
21 Mar
2015
21 Mar
'15
4 a.m.
On Sat, Mar 21, 2015 at 1:05 PM, David Feuer
On Mar 20, 2015 6:39 PM, "Chris Wong"
wrote: In this form we can see why your code works that way. This inner function only needs the Functor instances when it is *called*, not when it's constructed. So GHC defers resolving the constraints until the function is used.
Isn't this the same sort of situation that makes DatatypeContexts bad? In the GADT version with the constraints pulled outward, we can pattern match to get access to the dictionaries. Here, we pattern match to get something that demands, but does not use, a constraint. When is this useful?
Yeah on pondering the code, I agree with you that the constraints aren't very useful there. -- https://lambda.xyz