According to the Idris crash course:
The Idris type checker knows about the
Lazytype, and inserts conversions where necessary betweenLazy aanda, and vice versa.
For example, b1 && b2 is converted into b1 && Delay b2. What are the specific rules that Idris uses when deciding where to place these implicit conversions?
IIRC it's simply based on the unification of the provided type and the expected type. (&&) has type Bool -> Lazy Bool -> Bool. Unifying the second argument with y: Bool converts it to (delay y) value. On the other hand, if you'd pass x : Lazy Bool as the first argument, it converts to (force x). And this will be done with any values/function with Lazy a types.
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