Cookbook/Compilers and interpreters

From HaskellWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

GHC

TODO

GHCi

Problem Solution Examples
checking definitions :i
Prelude> :i Maybe
data Maybe a = Nothing | Just a         -- Defined in Data.Maybe
instance (Eq a) => Eq (Maybe a) -- Defined in Data.Maybe
instance Monad Maybe -- Defined in Data.Maybe
instance Functor Maybe -- Defined in Data.Maybe
instance (Ord a) => Ord (Maybe a) -- Defined in Data.Maybe
instance (Read a) => Read (Maybe a) -- Defined in GHC.Read
instance (Show a) => Show (Maybe a) -- Defined in GHC.Show
checking types :t
Prelude> :t "Hello"
"Hello" :: [Char]

Hugs

TODO