Hello! Assume I have a type MyType with the constructor GeneralConstructor:

data MyType = GeneralConstructor [Double]

but I also want to have a separate name for special case of this constructor:

SpecialConstructor Double

so SpecialConstructor a = GeneralConstructor (a:[]) that is

SpecialConstructor 5 was exactly the same as GeneralConstructor [5].

And for example instead of writing GeneralConstructor [0] I would like to use 
constructor Zero. It's all just for convenience.

How can I achieve this? Well, of course I always can use sed to replace 
SpecialConstructor 5 with  GeneralConstructor [5] in program sources, but it's 
not convenient.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to