
elim was not checking that the arguments to be used for the parameters of the inductive matched the actual parameters expected, resulting in incorrect and non-deterministic unification, and thus incorrect reduction when the parameters were unified incorrectly.
20 lines
552 B
Racket
20 lines
552 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 Type (some bool btrue) (bool)
|
|
(lambda* (A : Type) (x : (maybe A)) A)
|
|
[(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))
|