Answer by chi for How to fix "Illegal datatype context" (use...
Typeclass contexts in datatypes are now regarded as a not so useful feature. The problem is that the following does not compile:foo :: Units a -> afoo (Units x _) = x+xThis intuitively should...
View ArticleHow to fix "Illegal datatype context" (use -XDatatypeContexts)?
I am a new learner of Haskell, my code is as follows:data Num a=>Units a = Units a (SymbolicManip a ) deriving (Eq)I am not sure how to fix it?Anyone can help me?
View Article
More Pages to Explore .....