diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2015-04-07 19:34:18 +0200 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2015-04-07 19:34:18 +0200 |
commit | 42c0849549032ca665c165ca7ffb19bb59692431 (patch) | |
tree | b1b7b4eff185a4d693a19787d132f73694f449a9 /posts | |
parent | 7646eb44b045ea9d955bbcdbcb20acb9ab35634b (diff) | |
download | dirty-haskell.org-42c0849549032ca665c165ca7ffb19bb59692431.tar dirty-haskell.org-42c0849549032ca665c165ca7ffb19bb59692431.tar.gz dirty-haskell.org-42c0849549032ca665c165ca7ffb19bb59692431.tar.bz2 dirty-haskell.org-42c0849549032ca665c165ca7ffb19bb59692431.tar.xz dirty-haskell.org-42c0849549032ca665c165ca7ffb19bb59692431.zip |
Syntax highlighting in source listings
Diffstat (limited to 'posts')
-rw-r--r-- | posts/blog-rss.md | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/posts/blog-rss.md b/posts/blog-rss.md index f7dbe37..4e8cb24 100644 --- a/posts/blog-rss.md +++ b/posts/blog-rss.md | |||
@@ -16,20 +16,24 @@ Each item carries a title, an url, a date, and contents as follows: | |||
16 | 16 | ||
17 | Along the way two helper functions were introduced — if an implementation of those already exists in Prelude or somewhere else common please mail in a comment: | 17 | Along the way two helper functions were introduced — if an implementation of those already exists in Prelude or somewhere else common please mail in a comment: |
18 | 18 | ||
19 | (<->) :: [(a -> b)] -> a -> [b] | 19 | ~~~ {.haskell} |
20 | [] <-> _ = [] | 20 | (<->) :: [(a -> b)] -> a -> [b] |
21 | (f:fs) <-> x = (f x:fs <-> x) | 21 | [] <-> _ = [] |
22 | (f:fs) <-> x = (f x:fs <-> x) | ||
22 | 23 | ||
23 | (<-->) :: [(a -> a)] -> a -> a | 24 | (<-->) :: [(a -> a)] -> a -> a |
24 | [] <--> x = x | 25 | [] <--> x = x |
25 | (f:fs) <--> x = fs <--> (f x) | 26 | (f:fs) <--> x = fs <--> (f x) |
27 | ~~~ | ||
26 | 28 | ||
27 | ## Update ## | 29 | ## Update ## |
28 | 30 | ||
29 | import Control.Applicative ((<*>), pure) | 31 | ~~~ {.haskell} |
32 | import Control.Applicative ((<*>), pure) | ||
30 | 33 | ||
31 | (<->) fs = (<*>) fs . pure | 34 | (<->) fs = (<*>) fs . pure |
32 | 35 | ||
33 | (<-->) = flip $ foldl (.) id | 36 | (<-->) = flip $ foldl (.) id |
37 | ~~~ | ||
34 | 38 | ||
35 | Thanks, viktor. \ No newline at end of file | 39 | Thanks, viktor. |