If a newbie considers this as something natural, this is another reason for syntactic sugaring of HList:
--I tried to write such polymorphic function:
expand (x,y,z) = (x,y,z)
expand (x,y) = (x,y,1)
--And it didn't compile. Then I added a type signature:
expand::a->b
expand (x,y,z) = (x,y,z)
expand (x,y) = (x,y,1)
--It still didn't compile. I think the reason is that the following is disallowed:
f::a->b
f x = x
--Is it possible to get around this and write the "expand" function? Of course, x and y may be of different types
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe