banana : Type
banana = forall x . x -> x
gives
While processing right hand side of banana. x is not accessible in this context.
However,
banana : Type
banana = {x : Type} -> x -> x
apple : forall x . x -> x
apple t = t
work.
How can I use universal quantification as the output of a function? If it's not possible, why not?
forall x . means {0 x : _} -> i.e. there are no xs at runtime. Since you use x in the definition, there can be no bananas at runtime
0 banana : Type
banana : forall x . x -> x
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With