
17 Dec
2007
17 Dec
'07
5:12 a.m.
Adam Smyczek
But when I extract a and b to constants:
c_a = "a" :: String c_b = "b" :: String
case name of c_a -> ... c_b -> ... I get Patterns match(es) are overlapped.
Do you require 'name' and the constants to be of type String? If not, you could get around the issue Brandon described by declaring a data type for them: data Name = A | B ... case name of A -> ... B -> ... The type system would then prevent A and B from being used in places where a String is expected. This may be an advantage, depending on the style of the rest of the program. Regards, Tom