Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.haskell > #288

Re: how to list all methods of a class or type in haskell

From Mark Carroll <mtbc@bcs.org>
Newsgroups comp.lang.haskell
Subject Re: how to list all methods of a class or type in haskell
Date 2014-04-25 15:38 +0100
Organization none
Message-ID <87vbtxqxs0.fsf@ixod.org> (permalink)
References <1f29f803-7267-483c-a7c3-9acac128e694@googlegroups.com>

Show all headers | View raw


jobmattcon@gmail.com writes:

> how to list all methods of a class or type in haskell

I don't know if this helps:

$ ghci
GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Prelude> :info Double
data Double = GHC.Types.D# GHC.Prim.Double#
     -- Defined in `GHC.Types'
instance Enum Double -- Defined in `GHC.Float'
instance Eq Double -- Defined in `GHC.Classes'
instance Floating Double -- Defined in `GHC.Float'
instance Fractional Double -- Defined in `GHC.Float'
instance Num Double -- Defined in `GHC.Float'
instance Ord Double -- Defined in `GHC.Classes'
instance Read Double -- Defined in `GHC.Read'
instance Real Double -- Defined in `GHC.Float'
instance RealFloat Double -- Defined in `GHC.Float'
instance RealFrac Double -- Defined in `GHC.Float'
instance Show Double -- Defined in `GHC.Float'
Prelude> :info RealFrac
class (Real a, Fractional a) => RealFrac a where
  properFraction :: Integral b => a -> (b, a)
  truncate :: Integral b => a -> b
  round :: Integral b => a -> b
  ceiling :: Integral b => a -> b
  floor :: Integral b => a -> b
        -- Defined in `GHC.Real'
instance RealFrac Float -- Defined in `GHC.Float'
instance RealFrac Double -- Defined in `GHC.Float'
Prelude> 

Remember that Haskell isn't object-orientated. (-:

-- Mark

Back to comp.lang.haskell | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

how to list all methods of a class or type in haskell jobmattcon@gmail.com - 2014-04-25 07:24 -0700
  Re: how to list all methods of a class or type in haskell Mark Carroll <mtbc@bcs.org> - 2014-04-25 15:38 +0100

csiph-web