Created
April 26, 2015 13:59
-
-
Save SteveGilham/4900c10576204213f400 to your computer and use it in GitHub Desktop.
Monadic string reader
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
let GetS length = | |
let rec get chars count = | |
if count > 0 | |
then GetC >>= fun c -> get (chars@[c]) (count – 1) | |
else Return IO String(List.toArray chars) | |
get [] length;; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment