On Thu, Mar 3, 2011 at 8:00 PM, Paul Sujkov <psuj...@gmail.com> wrote: > Hi, > you can always check the types using GHCi prompt: > *Prelude> :i (,) > data (,) a b = (,) a b -- Defined in GHC.Tuple > instance (Bounded a, Bounded b) => Bounded (a, b) > -- Defined in GHC.Enum > instance (Eq a, Eq b) => Eq (a, b) -- Defined in Data.Tuple > instance Functor ((,) a) -- Defined in Control.Monad.Instances > instance (Ord a, Ord b) => Ord (a, b) -- Defined in Data.Tuple > instance (Read a, Read b) => Read (a, b) -- Defined in GHC.Read > instance (Show a, Show b) => Show (a, b) -- Defined in GHC.Show > that's for a tuple. You can see that tuple has an instance for the Ord > class. > *Prelude> :i () > data () = () -- Defined in GHC.Unit > instance Bounded () -- Defined in GHC.Enum > instance Enum () -- Defined in GHC.Enum > instance Eq () -- Defined in Data.Tuple > instance Ord () -- Defined in Data.Tuple > instance Read () -- Defined in GHC.Read > instance Show () -- Defined in GHC.Show > and that's for a unit type. > [snip] Ah, thanks! I didn't know about :i, tried only :t () which didn't give very interesting information.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe