Haskell: list of elements with class restriction
Posted
by
user1760586
on Stack Overflow
See other posts from Stack Overflow
or by user1760586
Published on 2012-10-19T21:41:24Z
Indexed on
2012/10/20
5:03 UTC
Read the original article
Hit count: 137
haskell
here's my question:
this works perfectly:
type Asdf = [Integer]
type ListOfAsdf = [Asdf]
Now I want to do the same but with the Integral class restriction:
type Asdf2 a = (Integral a) => [a]
type ListOfAsdf2 = (Integral a) => [Asdf2 a]
I got this error:
Illegal polymorphic or qualified type: Asdf2 a
Perhaps you intended to use -XImpredicativeTypes
In the type synonym declaration for `ListOfAsdf2'
I have tried a lot of things but I am still not able to create a type with a class restriction as described above.
Thanks in advance!!! =)
Dak
© Stack Overflow or respective owner