;;;;; ;;;;; ;;;;; Maybe (Option) ;;;;; ;;;;; (define $Nothing {}) (define $Just (lambda [$x] {x})) (define $nothing (pattern-function [] )) (define $just (pattern-function [$pat] )) (define $maybe (lambda [$a] (list a))) ;(match-all (Just 1) (maybe integer) [(nothing) "error"]) ; {} ;(match-all (Just 1) (maybe integer) [(just $x) x]) ; {1}