Hello,
Is there a way to get this to work?
data A = Aconstructor Intdata B = Bconstructor Intdata AorB = A | Bf :: Int -> AorBf x| even x = Aconstructor x| otherwise = Bconstructor xI get this diagnostic.Couldn't match expected type `AorB' against inferred type `A'Since AorB is A or B, why is this not permitted?If instead I writedata AorB = Aconstructor Int | Bconstructor Inteverything works out ok. But what if I want separate types for A and B?Thanks,
-- Russ
_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners