1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | {-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances #-} class X a b where sth :: a b data A b = A b -- this works: -- type A_1 = A -- this doesn't: type A_1 b = A b instance X A_1 Int where sth = A 42 main :: IO () main = return () |
ey0jIExBTkdVQUdFIE11bHRpUGFyYW1UeXBlQ2xhc3NlcywgVHlwZVN5bm9ueW1JbnN0YW5jZXMgIy19CgpjbGFzcyBYIGEgYiB3aGVyZQogICAgc3RoIDo6IGEgYgoKZGF0YSBBIGIgPSBBIGIKCi0tIHRoaXMgd29ya3M6Ci0tIHR5cGUgQV8xID0gQQotLSB0aGlzIGRvZXNuJ3Q6CnR5cGUgQV8xIGIgPSBBIGIKCmluc3RhbmNlIFggQV8xIEludCB3aGVyZQogICAgc3RoID0gQSA0MgoKbWFpbiA6OiBJTyAoKQptYWluID0gcmV0dXJuICgp
[1 of 1] Compiling Main ( prog.hs, prog.o )
prog.hs:13:0:
Type synonym `A_1' should have 1 argument, but has been given 0
In the instance declaration for `X A_1 Int'
-
result: Compilation error (maybe you wish to see an example for Haskell)


