mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-16 07:34:45 +03:00
106235c165
If available (sometimes, say a top level expression, it might need inferring so there'll be no goal available). Also add the ability to log the current goal, or indeed any term.
11 lines
202 B
Idris
11 lines
202 B
Idris
import Language.Reflection
|
|
|
|
%language ElabReflection
|
|
|
|
powerFn : Nat -> TTImp
|
|
powerFn Z = `(const 1)
|
|
powerFn (S k) = `(\x => mult x (~(powerFn k) x))
|
|
|
|
cube : Nat -> Nat
|
|
cube = %runElab check (powerFn 3)
|