Skip to content

Instantly share code, notes, and snippets.

@SteveGilham
Created April 26, 2015 14:04
Show Gist options
  • Save SteveGilham/eff2610b17077bafd38b to your computer and use it in GitHub Desktop.
Save SteveGilham/eff2610b17077bafd38b to your computer and use it in GitHub Desktop.
List of monads to monad of lists
let rec Sequence l
= match l with
| [] -> Return []
| h::t -> h >>= fun h1 -> (Sequence t) >>= fun t1 -> Return (h1::t1);;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment