[Haskell-beginners] Is there a way to hide an existing data type so that I can use my own version?
Costello, Roger L.
costello at mitre.org
Tue Jul 31 13:08:38 CEST 2012
For learning purposes, I created an "Either" data type:
data Either a b = Left a | Right b
However, when I try to use Left (or Right), I get an error message saying that it is ambiguous whether I am using Prelude.Left or Main.Left
So I tried hiding Prelude.Either like so:
import Prelude hiding Either
But that produced an error.
Is there a way to hide the existing Either data type so that I can use my own version?
More information about the Beginners