mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-19 01:01:59 +03:00
e2aabd6602
`{{ n }} gives a value of type Name. No name resolution is attempted (so no namespaces added etc)
29 lines
561 B
Idris
29 lines
561 B
Idris
import Language.Reflection
|
|
|
|
add : TTImp -> TTImp -> TTImp
|
|
add x y = `(~(x) + ~(y))
|
|
|
|
test : TTImp
|
|
test = add `(3) `(4)
|
|
|
|
bigger : TTImp -> TTImp
|
|
bigger val
|
|
= `(let xfn : Int -> Int
|
|
xfn var = var * 2 in
|
|
xfn ~(val))
|
|
|
|
bigger' : Int -> TTImp
|
|
bigger' val
|
|
= `(let xfn : Int -> Int
|
|
xfn var = var * 2 in
|
|
xfn ~(IPrimVal EmptyFC (I val)))
|
|
|
|
bad : Int -> TTImp
|
|
bad val
|
|
= `(let xfn : Int -> Int
|
|
xfn var = var * 2 in
|
|
xfn ~(val))
|
|
|
|
names : List Name
|
|
names = [ `{{ names }}, `{{ Prelude.(+) }} ]
|