cur/stdlib/maybe.rkt
William J. Bowman 3ce14c3871
Refactored core
Moved all curnel code into curnel/, and split the two kernel modules
into separate files. Now the trusted core and the module/#lang stuff are
in separate files. The #lang is now reprovided by "cur.rkt", which
should also provide core agnostic sugar.
2015-09-15 18:02:36 -04:00

20 lines
525 B
Racket

#lang s-exp "../cur.rkt"
(require "sugar.rkt")
(provide maybe none some)
(data maybe : (forall (A : Type) Type)
(none : (forall (A : Type) (maybe A)))
(some : (forall* (A : Type) (a : A) (maybe A))))
(module+ test
(require rackunit "bool.rkt")
#;(check-equal?
(case* maybe (some bool btrue)
(lambda (x : (maybe bool)) bool)
[(none (A : Type)) IH: ()
bfalse]
[(some (A : Type) (x : A)) IH: ()
;; TODO: Don't know how to use dependency yet
(if x btrue bfalse)])
btrue))