
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.
20 lines
525 B
Racket
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))
|