
* Dmitry Vyal
On 10/18/2012 03:20 PM, MigMit wrote:
Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"?
Hmm, looks like a nice idea. I tried it, unfortunately I can't cope with compiler error messages:
tst.hs:32:15: Context reduction stack overflow; size = 201 Use -fcontext-stack=N to increase stack size to N Upcast a b In the first argument of `(.)', namely `(upcast :: b -> a)' In the expression: (upcast :: b -> a) . (upcast :: c -> b) In the expression: (upcast :: b -> a) . (upcast :: c -> b) $ x
instance (Upcast a b, Upcast b c) => Upcast a c where upcast = (upcast :: b -> a) . (upcast :: c -> b)
This is the offending instance. Remember, GHC only looks at the instance head ("Upcast a c" here) when it decides which instance to use. Roman