Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to view a list of Prelude functions from the Haskell console?

Is there a way to view a list of Prelude functions (such as Data.Char) from the Haskell console, instead of visiting Hoogle?

like image 627
Abel Jimenez Avatar asked Jan 02 '13 18:01

Abel Jimenez


1 Answers

From GHCi you can use

:browse Data.Char

to see the types and values exported by a given module.

E.g.

Prelude> :browse Data.Char
digitToInt :: Char -> Int
generalCategory :: Char -> GeneralCategory
isLetter :: Char -> Bool
isMark :: Char -> Bool
isNumber :: Char -> Bool
isPunctuation :: Char -> Bool
isSeparator :: Char -> Bool
isSymbol :: Char -> Bool
data Char = GHC.Types.C# GHC.Prim.Char#
chr :: Int -> Char
...
like image 195
Don Stewart Avatar answered Sep 23 '22 23:09

Don Stewart