Created
October 3, 2015 13:01
-
-
Save umairsd/a1fd12b091dbb5d09e69 to your computer and use it in GitHub Desktop.
General purpose Haskell functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- a function that's equivalent to the standard library's sequence function | |
| myseq ms = foldr k ([[]]) ms | |
| where k m m' = [x:xs | x <- m, xs <- m'] | |
| -- another variant of the sequence function, uses return [] instead of [[]] | |
| myseq1 ms = foldr k (return []) ms | |
| where k m m' = [x:xs | x <- m, xs <- m'] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment