cur/stdlib/maybe.rkt
William J. Bowman 3be6730b1e Merge branch 'names' into actual-inductives
Conflicts:
	redex-curnel.rkt

With names finally fixed, many more tests can actually run.
* Changed uses of case to eliminators
* Fixed uses of new case* macro
* Fixed some assorted bugs in reduction of eliminators
2015-04-14 18:42:01 -04:00

20 lines
534 B
Racket

#lang s-exp "../redex-curnel.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))