Idris2/tests/idris2/interface021/LocalHint.idr
Edwin Brady 170af1e87a
Use Closures instead of NF in binders for normal forms (#1823)
* Skip forced arguments in conversion check

This isn't always safe - we have to have also checked the type of the
things we're converting - but in the place where it is safe it can be a
pretty significant saving.

* Use Closures, not NF, in Binders for normal forms

This means we don't need to reduce argument types during unification if
we don't need to. Also, we now try to avoid reducing closures during
unification if they are unified with a metavariable. Together, this
saves a huge amount of unnecessary evaluation in programs that do a lot
of compile time evaluation.

* Didn't mean to update idris2api.ipkg

* Fix dodgy merge
2021-08-08 17:05:29 +01:00

24 lines
380 B
Idris

Gnu : Type
Gnu = Int
Foo : Type
Foo = Bool
A : Foo
A = True
mkFoo : Gnu -> Foo
mkFoo gnu = A
gnat : {auto startHere : (a : Foo ** a = A)} -> Unit
gnat = ()
pathology : (gnu : Gnu) -> Unit
pathology gnu =
let %hint foo : Foo
foo = mkFoo gnu
%hint bar : Foo -> (ford : arg = A)
-> (a : Foo ** a = A)
bar _ Refl = (A ** Refl)
in gnat