
24 Nov
2013
24 Nov
'13
10:02 p.m.
Emanuel Koczwara
writes:
He Emanuel, you're doing well. Hardly anyone these days sticks to Haskell 98; and really there's no need to. (What you're trying to do can be achieved with H98, but would need some not-so-user-friendly coding.)
I want to enable "instance [Char] where..." but disable "instance [a]
where...". Is it possible?
Yes, you're almost there. You do need FlexibleInstances to be able to put [Char]. To ban [a], you need to ban overlapping instances. {-# LANGUAGE NoOverlappingInstances #-} (Usually overlapping instances is on by default.) You're next error meesage is probably going to be, Illegal overlapping instance declaration for ... Avoiding them is subtle, but a valuable discipline ;-) HTH