Created
April 24, 2012 03:12
-
-
Save dleslie/2475945 to your computer and use it in GitHub Desktop.
Maybe example
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
(do <maybe> | |
(if #t | |
'Nothing | |
'(Just First)) | |
'(Just Second)) | |
; Returns: Nothing | |
((do <state> | |
(x <- (/m! gets (lambda (s) (+ s 1)))) | |
(return x)) | |
1) | |
; Returns: (2 . 1) | |
((do <reader> | |
(/m! local | |
(lambda (v) (+ v 1)) | |
(do <reader> | |
(x <- (/m ask)) | |
(return x)))) | |
1) | |
; Returns: 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment