Idris2/tests/idris2/reflection007/expected
Edwin Brady 08b56e9e75 Add quote operation to Elab
Allows quoting a term back to a TTImp. Test reflection007 shows one
possible use for this, building a reflected, type safe, representation
of an expression.
2020-06-02 23:36:20 +01:00

9 lines
403 B
Plaintext

1/1: Building NatExpr (NatExpr.idr)
Main> Main.test1 : (x : Nat) -> (y : Nat) -> NatExpr (plus x (plus y x))
test1 x y = Plus (Val x) (Plus (Val y) (Val x))
Main> Main.test2 : (x : Nat) -> (y : Nat) -> NatExpr (plus x (mult y x))
test2 x y = Plus (Val x) (Mult (Val y) (Val x))
Main> Main.test3 : (x : Nat) -> Nat -> NatExpr (plus x (mult 2 x))
test3 x y = Plus (Val x) (Dbl (Val x))
Main> Bye for now!