ghci: catching up with hugs?-)
Serge D. Mechveliani
mechvel at botik.ru
Fri Jul 30 00:20:18 EDT 2004
I also would like to have the info on clases and instances in the
:info interactive command.
-----------------
Serge Mechveliani
mechvel at botik.ru
On Thu, Jul 29, 2004 at 05:48:26PM +0100, Claus Reinke wrote:
> [..]
>
> in hugs, a simple ":info <type>" gives me the answer:
>
> Prelude> :info Bool
> -- type constructor
> data Bool
>
> -- constructors:
> False :: Bool
> True :: Bool
>
> -- instances:
> instance Eq Bool
> instance Ord Bool
> instance Ix Bool
> instance Enum Bool
> instance Read Bool
> instance Show Bool
> instance Bounded Bool
>
> in fact, I can even ask by class, using ":info <class>":
>
> Prelude> :i Enum
> -- type class
> class Enum a where
> succ :: a -> a
> pred :: a -> a
> toEnum :: Int -> a
> fromEnum :: a -> Int
> enumFrom :: a -> [a]
> enumFromThen :: a -> a -> [a]
> enumFromTo :: a -> a -> [a]
> enumFromThenTo :: a -> a -> a -> [a]
>
> -- instances:
> instance Enum ()
> instance Enum Char
> instance Enum Int
> instance Enum Integer
> instance Enum Float
> instance Enum Double
> instance Integral a => Enum (Ratio a)
> instance Enum Bool
> instance Enum Ordering
>
> [..]
More information about the Glasgow-haskell-users
mailing list