Quantcast
Channel: How to fix "Illegal datatype context" (use -XDatatypeContexts)? - Stack Overflow
Browsing latest articles
Browse All 2 View Live

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 Article



How 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
Browsing latest articles
Browse All 2 View Live




Latest Images