如何在Haskell中知道builtins函数? [英] how to know in Haskell the builtins functions?

查看:83
本文介绍了如何在Haskell中知道builtins函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



相当于我们在Python中执行此操作所能达到的效果::

 >>> print([func for func in dir(__ builtins__)if func [0] .islower()])
['abs','all','any','ascii','bin','bool' ,'bytearray','bytes','callable','chr','classmethod','compile','complex','copyright','credits','delattr',
'dict' dir','divmod','enumerate','eval','exec','exit','filter','float','format','frozenset','getattr','globals','hasattr' ,'hash','help','hex','id','input','int','isinstance','issubclass','iter','len',
'license',' 'max','memoryview','min','next','object','oct','open','ord','pow','print' ,'范围','repr','reverse','round','set','setattr','slice','sorted','staticmethod',
' str','sum','super',' tuple','type','vars','zip']
>>>打印(len .__ doc__)
返回容器中的物品数量。
>>>

这不是一个关于如何从图书馆内容中获取信息的问题, 有没有在GHCI中查看模块中函数列表的方法?



关于内建函数,关于没有导入任何libray的语言。



我需要获取pro program.hs 中的函数列表,而不是Prelude帮助系统或Prelude完成系统。

解决方案

在GHCi中,您可以输入:browse Prelude 列出由 Prelude 模块导出的所有内容。



我的本​​地安装输出:

  Prelude> :浏览Prelude 
(!!):: [a] - > Int - > a
($)::
forall(r :: GHC.Types.RuntimeRep)a(b :: TYPE r)。
(a - > b) - > a - > b
($!)::(a - > b) - > a - > b
(&& amp;):: Bool - >布尔 - > Bool
(++):: [a] - > [a] - > [a]
(。)::(b - > c) - > (a - > b) - > a - > c
(< $>):: Functor f => (a - > b) - > f a - > f b
(=<<):: Monad m => (a - > m b) - > m a - > m b
class Functor f => Applicative(f :: * - > *)其中
pure :: a - > f a
(*):: f(a - > b) - > f a - > f b
(*>):: f a - > f b - > f b
(< *):: f a - > f b - > f a
{ - #MINIMAL pure,(*)# - }
data Bool = False |真
类有界a
minBound :: a
maxBound :: a
{ - #MINIMAL minBound,maxBound# - }
数据Char = GHC.Types。 C#GHC.Prim.Char#
data Double = GHC.Types.D#GHC.Prim.Double#
data ab = Left a |右b
类枚举a where
succ :: 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]
{ - #MINIMAL toEnum,fromEnum# - }
class Eq a其中
(==):: a - > a - > Bool
(/ =):: a - > a - > Bool
{ - #MINIMAL(==)| (/ =)# - }
type FilePath = String
data Float = GHC.Types.F#GHC.Prim.Float#
class Fractional a =>浮动一个位置
pi :: a
exp :: a - > a
log :: a - > a
sqrt :: a - > a
(**):: a - > a - > a
logBase :: a - > a - > a
sin :: a - > a
cos :: a - > a
tan :: a - > a
asin :: a - > a
acos :: a - >
atan :: a - > a
sinh :: a - > a
cosh :: a - >
tanh :: a - > a
asinh :: a - > a
acosh :: a - > a
atanh :: a - > a
GHC.Float.log1p :: a - > a
GHC.Float.expm1 :: a - > a
GHC.Float.log1pexp :: a - > a
GHC.Float.log1mexp :: a - > a
{ - #MINIMAL pi,exp,log,sin,cos,asin,acos,atan,sinh,cosh,
asinh,acosh,atanh# - }
class Foldable(t: :* - > *)其中
Data.Foldable.fold :: Monoid m => t m - > m
foldMap :: Monoid m => (a - > m) - > t a - > m
foldr ::(a - > b - > b) - > b - > t a - > b
Data.Foldable.foldr'::(a - > b - > b) - > b - > t a - > b
foldl ::(b - > a - > b) - > b - > t a - > b
Data.Foldable.foldl'::(b - > a - > b) - > b - > t a - > b
foldr1 ::(a - > a - > a) - > t a - > a
foldl1 ::(a - > a - > a) - > t a - > a
Data.Foldable.toList :: t a - > [a]
null :: t a - > Bool
长度:: t a - > Int
elem :: Eq a => a - > t a - > Bool
maximum :: Ord a => t a - > a
minimum :: Ord a => t a - >
sum :: Num a => t a - > a
product :: Num a => t a - >
{ - #MINIMAL foldMap | foldr# - }
class Num a =>小数a其中
(/):: a - > a - > a
recip :: a - > a
fromRational :: Rational - >
{ - #MINIMAL fromRational,(recip |(/))# - }
类Functor(f :: * - > *)其中
fmap ::(a - > b) - > f a - > f b
(< $):: a - > f b - > fa
{ - #MINIMAL fmap# - }
newtype IO a
= GHC.Types.IO(GHC.Prim.State#GHC.Prim.RealWorld
- >( #GHC.Prim.State#GHC.Prim.RealWorld,a#))
type IOError = GHC.IO.Exception.IOException
data Int = GHC.Types.I#GHC.Prim.Int#
data整数
=整数-gmp-1.0.0.1:GHC.Integer.Type.S#!GHC.Prim.Int#
| integer-gmp-1.0.0.1:GHC.Integer.Type.Jp#{ - #UNPACK# - } integer-gmp-1.0.0.1:GHC.Integer.Type.BigNat
| integer-gmp-1.0.0.1:GHC.Integer.Type.Jn#{ - #UNPACK# - } integer-gmp-1.0.0.1:GHC.Integer.Type.BigNat
class(Real a,Enum a) => Integral a where
quot :: a - > a - > a
rem :: a - > a - >
div :: a - > a - > a
mod :: a - > a - > a
quotRem :: a - > a - > (a,a)
divMod :: a - > a - > (a,a)
toInteger :: a - >整数
{ - #MINIMAL quotRem,toInteger# - }
data Maybe a = Nothing |只需
类Applicative m => Monad(m :: * - > *)其中
(>> =):: m a - > (a - > m b) - > m b
(>>):: m a - > m b - > m b
return :: a - > m a
fail :: String - > m a
{ - #MINIMAL(>> =)# - }
class Monoid a where
mempty :: a
mappend :: a - > a - >
mconcat :: [a] - > a
{ - #MINIMAL mempty,mappend# - }
class Num a where
(+):: a - > a - > a
( - ):: a - > a - > a
(*):: a - > a - > a
negate :: a - >
abs :: a - >
signum :: a - > a
fromInteger :: Integer - > a
{ - #MINIMAL(+),(*),abs,signum,fromInteger,(negate |( - ))# - }
class Eq a => Ord a where
compare :: a - > a - >订购
(<):: a - > a - > Bool
(< =):: a - > a - > Bool
(>):: a - > a - > Bool
(> =):: a - > a - > Bool
max :: a - > a - > a
min :: a - > a - >
{ - #MINIMAL compare | (<=)# - }
数据排序= LT | EQ | GT
类型Rational = GHC.Real.Ratio整数
类读取其中
readsPrec :: Int - > ReadS a
readList :: ReadS [a]
GHC.Read.readPrec :: Text.ParserCombinators.ReadPrec.ReadPrec a
GHC.Read.readListPrec :: Text.ParserCombinators.ReadPrec.ReadPrec
[a]
{ - #MINIMAL readsPrec | readPrec# - }
类型ReadS a = String - > [(a,String)]
class(Num a,Ord a)=> Real a where
toRational :: a - > Rational
{ - #MINIMAL toRational# - }
class(RealFrac a,Floating a)=> RealFloat a where
floatRadix :: a - >整数
floatDigits :: a - > Int
floatRange :: a - > (Int,Int)
decodeFloat :: a - > (Integer,Int)
encodeFloat :: Integer - > Int - > a
exponent :: a - > Int
significand :: a - > a
scaleFloat :: Int - > a - >
isNaN :: a - > Bool
isInfinite :: a - > Bool
isDenormalized :: a - > Bool
isNegativeZero :: a - > Bool
isIEEE :: a - > Bool
atan2 :: a - > a - > a
{ - #MINIMAL floatRadix,floatDigits,floatRange,decodeFloat,
encodeFloat,isNaN,isInfinite,isDenormalized,isNegativeZero,
isIEEE# - }
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
{ - #MINIMAL properFraction# - }
class显示其中
showsPrec :: Int - > a - > ShowS
show :: a - >字符串
showList :: [a] - > ShowS
{ - #MINIMAL showsPrec | show# - }
type ShowS = String - > String
type String = [Char]
class(Functor t,Foldable t)=> Traversable(t :: * - > *)其中
遍历:: Applicative f => (a - > f b) - > t a - > f(t b)
sequenceA :: Applicative f => t(f a) - > f(t a)
mapM :: Monad m => (a - > m b) - > t a - > m(t b)
sequence:Monad m => t(m a) - > m(t a)
{ - #MINIMAL遍历| sequenceA# - }
data Word = GHC.Types.W#GHC.Prim.Word#
(^)::(Num a,Integral b)=> a - > b - > a
(^^)::(分数a,积分b)=> a - > b - > a
all ::可折叠t => (a - > Bool) - > t a - > Bool
和:: Foldable t => t Bool - > Bool
any ::可折叠t => (a - > Bool) - > t a - > Bool
appendFile :: FilePath - >字符串 - > IO()
asTypeOf :: a - > a - >
break ::(a - > Bool) - > [a] - > ([a],[a])
concat :: Foldable t => t [a] - > [a]
concatMap :: Foldable t => (a - > [b]) - > t a - > [b]
const :: a - > b - > a
curry ::((a,b) - > c) - > a - > b - > c
cycle :: [a] - > [a]
drop :: Int - > [a] - > [a]
dropWhile ::(a - > Bool) - > [a] - > [a]
或者::(a - > c) - > (b→c)→>无论是b - > c
错误::
forall(r :: GHC.Types.RuntimeRep)(a :: TYPE r)。
GHC.Stack.Types.HasCallStack =>
[Char] - > a
errorWithoutStackTrace ::
forall(r :: GHC.Types.RuntimeRep)(a :: TYPE r)。 [Char] - > a
even :: Integral a => a - > Bool
filter ::(a - > Bool) - > [a] - > [a]
flip ::(a - > b - > c) - > b - > a - > c
fromIntegral ::(Integral a,Num b)=> a - > b
fst ::(a,b) - > a
gcd :: Integral a => a - > a - > a
getChar :: IO Char
getContents :: IO String
getLine :: IO String
head :: [a] - > a
id :: a - > a
init :: [a] - > [a]
interact ::(String - > String) - > IO()
ioError :: IOError - > IO a
iterate ::(a - > a) - > a - > [a]
last :: [a] - > a
lcm :: Integral a => a - > a - > a
lex :: ReadS String
lines :: String - > [String]
lookup :: Eq a => a - > [(a,b)] - >也许b
map ::(a - > b) - > [a] - > [b]
mapM_ ::(可折叠t,Monad m)=> (a - > m b) - > t a - > m()
maybe :: b - > (a - > b) - >也许是 - > b
not :: Bool - > Bool
notElem ::(可折叠t,等式a)=> a - > t a - > Bool
odd :: Integral a => a - > Bool
或:: Foldable t => t Bool - > Bool
otherwise :: Bool
print :: Show a => a - > IO()
putChar :: Char - > IO()
putStr :: String - > IO()
putStrLn :: String - > IO()
read :: Read a =>字符串 - >
readFile :: FilePath - > IO字符串
readIO ::读取a =>字符串 - > IO a
readLn :: Read a => IO a
readParen :: Bool - >读取a - >读取
读取::读取a =>阅读
realToFrac ::(Real a,Fractional b)=> a - > b
repeat :: a - > [a]
replicate :: Int - > a - > [a]
reverse :: [a] - > [a]
scanl ::(b - > a - > b) - > b - > [a] - > [b]
scanl1 ::(a - > a - > a) - > [a] - > [a]
扫描仪::(a - > b - > b) - > b - > [a] - > [b]
scanr1 ::(a - > a - > a) - > [a] - > [a]
seq :: a - > b - > b
sequence_ ::(可折叠t,Monad m)=> t(m a) - > m()
showChar :: Char - > ShowS
showParen :: Bool - > ShowS - > ShowS
showString :: String - > ShowS
shows :: Show a => a - > ShowS
snd ::(a,b) - > b
span ::(a - > Bool) - > [a] - > ([a],[a])
splitAt :: Int - > [a] - > ([a],[a])
减法:: Num a => a - > a - > a
tail :: [a] - > [a]
取::: Int - > [a] - > [a]
takeWhile ::(a - > Bool) - > [a] - > [a]
uncurry ::(a - > b - > c) - > (a,b)→> c
undefined ::
forall(r :: GHC.Types.RuntimeRep)(a :: TYPE r)。
GHC.Stack.Types.HasCallStack =>
a
unlines :: [String] - >字符串
直到::(a - > Bool) - > (a - > a) - > a - > a
unwords :: [String] - >字符串
unzip :: [(a,b)] - > ([a],[b])
unzip3 :: [(a,b,c)] - > ([a],[b],[c])
userError :: String - > IOError
words :: String - > [String]
writeFile :: FilePath - >字符串 - > IO()
zip :: [a] - > [b] - > [(a,b)]
zip3 :: [a] - > [b] - > [c] - > [(a,b,c)]
zipWith ::(a - > b - > c) - > [a] - > [b] - > [c]
zipWith3 ::(a - > b - > c - > d) - > [a] - > [b] - > [c] - > [d]
(||):: Bool - >布尔 - > Bool


I look for a way to get all the builtins namespace of prelude Haskell.

something equivalent to what we can have in Python doing this::

>>> print([func for func in dir(__builtins__) if func[0].islower()])
['abs', 'all', 'any', 'ascii', 'bin', 'bool', 'bytearray', 'bytes', 'callable', 'chr', 'classmethod', 'compile', 'complex', 'copyright', 'credits', 'delattr',
 'dict', 'dir', 'divmod', 'enumerate', 'eval', 'exec', 'exit', 'filter', 'float', 'format', 'frozenset', 'getattr', 'globals', 'hasattr', 'hash', 'help', 'hex', 'id', 'input', 'int', 'isinstance', 'issubclass', 'iter', 'len',
 'license', 'list', 'locals', 'map', 'max', 'memoryview', 'min', 'next', 'object', 'oct', 'open', 'ord', 'pow', 'print', 'property', 'quit', 'range', 'repr', 'reversed', 'round', 'set', 'setattr', 'slice', 'sorted', 'staticmethod',
'str', 'sum', 'super', 'tuple', 'type', 'vars', 'zip']
>>> print(len.__doc__)
Return the number of items in a container.
>>> 

This is not a question about "how to get info from a library's contents" like they talk here: Is there a way to see the list of functions in a module, in GHCI?

It's about builtins, so about the language when you did not import any libray.

I need to get the list of functions in a pro program.hs not in Prelude help system or in Prelude completion system.

解决方案

In GHCi, you can type :browse Prelude to list everything exported by the Prelude module.

Output from my local installation:

Prelude> :browse Prelude
(!!) :: [a] -> Int -> a
($) ::
  forall (r :: GHC.Types.RuntimeRep) a (b :: TYPE r).
  (a -> b) -> a -> b
($!) :: (a -> b) -> a -> b
(&&) :: Bool -> Bool -> Bool
(++) :: [a] -> [a] -> [a]
(.) :: (b -> c) -> (a -> b) -> a -> c
(<$>) :: Functor f => (a -> b) -> f a -> f b
(=<<) :: Monad m => (a -> m b) -> m a -> m b
class Functor f => Applicative (f :: * -> *) where
  pure :: a -> f a
  (<*>) :: f (a -> b) -> f a -> f b
  (*>) :: f a -> f b -> f b
  (<*) :: f a -> f b -> f a
  {-# MINIMAL pure, (<*>) #-}
data Bool = False | True
class Bounded a where
  minBound :: a
  maxBound :: a
  {-# MINIMAL minBound, maxBound #-}
data Char = GHC.Types.C# GHC.Prim.Char#
data Double = GHC.Types.D# GHC.Prim.Double#
data Either a b = Left a | Right b
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]
  {-# MINIMAL toEnum, fromEnum #-}
class Eq a where
  (==) :: a -> a -> Bool
  (/=) :: a -> a -> Bool
  {-# MINIMAL (==) | (/=) #-}
type FilePath = String
data Float = GHC.Types.F# GHC.Prim.Float#
class Fractional a => Floating a where
  pi :: a
  exp :: a -> a
  log :: a -> a
  sqrt :: a -> a
  (**) :: a -> a -> a
  logBase :: a -> a -> a
  sin :: a -> a
  cos :: a -> a
  tan :: a -> a
  asin :: a -> a
  acos :: a -> a
  atan :: a -> a
  sinh :: a -> a
  cosh :: a -> a
  tanh :: a -> a
  asinh :: a -> a
  acosh :: a -> a
  atanh :: a -> a
  GHC.Float.log1p :: a -> a
  GHC.Float.expm1 :: a -> a
  GHC.Float.log1pexp :: a -> a
  GHC.Float.log1mexp :: a -> a
  {-# MINIMAL pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh,
              asinh, acosh, atanh #-}
class Foldable (t :: * -> *) where
  Data.Foldable.fold :: Monoid m => t m -> m
  foldMap :: Monoid m => (a -> m) -> t a -> m
  foldr :: (a -> b -> b) -> b -> t a -> b
  Data.Foldable.foldr' :: (a -> b -> b) -> b -> t a -> b
  foldl :: (b -> a -> b) -> b -> t a -> b
  Data.Foldable.foldl' :: (b -> a -> b) -> b -> t a -> b
  foldr1 :: (a -> a -> a) -> t a -> a
  foldl1 :: (a -> a -> a) -> t a -> a
  Data.Foldable.toList :: t a -> [a]
  null :: t a -> Bool
  length :: t a -> Int
  elem :: Eq a => a -> t a -> Bool
  maximum :: Ord a => t a -> a
  minimum :: Ord a => t a -> a
  sum :: Num a => t a -> a
  product :: Num a => t a -> a
  {-# MINIMAL foldMap | foldr #-}
class Num a => Fractional a where
  (/) :: a -> a -> a
  recip :: a -> a
  fromRational :: Rational -> a
  {-# MINIMAL fromRational, (recip | (/)) #-}
class Functor (f :: * -> *) where
  fmap :: (a -> b) -> f a -> f b
  (<$) :: a -> f b -> f a
  {-# MINIMAL fmap #-}
newtype IO a
  = GHC.Types.IO (GHC.Prim.State# GHC.Prim.RealWorld
                  -> (# GHC.Prim.State# GHC.Prim.RealWorld, a #))
type IOError = GHC.IO.Exception.IOException
data Int = GHC.Types.I# GHC.Prim.Int#
data Integer
  = integer-gmp-1.0.0.1:GHC.Integer.Type.S# !GHC.Prim.Int#
  | integer-gmp-1.0.0.1:GHC.Integer.Type.Jp# {-# UNPACK #-}integer-gmp-1.0.0.1:GHC.Integer.Type.BigNat
  | integer-gmp-1.0.0.1:GHC.Integer.Type.Jn# {-# UNPACK #-}integer-gmp-1.0.0.1:GHC.Integer.Type.BigNat
class (Real a, Enum a) => Integral a where
  quot :: a -> a -> a
  rem :: a -> a -> a
  div :: a -> a -> a
  mod :: a -> a -> a
  quotRem :: a -> a -> (a, a)
  divMod :: a -> a -> (a, a)
  toInteger :: a -> Integer
  {-# MINIMAL quotRem, toInteger #-}
data Maybe a = Nothing | Just a
class Applicative m => Monad (m :: * -> *) where
  (>>=) :: m a -> (a -> m b) -> m b
  (>>) :: m a -> m b -> m b
  return :: a -> m a
  fail :: String -> m a
  {-# MINIMAL (>>=) #-}
class Monoid a where
  mempty :: a
  mappend :: a -> a -> a
  mconcat :: [a] -> a
  {-# MINIMAL mempty, mappend #-}
class Num a where
  (+) :: a -> a -> a
  (-) :: a -> a -> a
  (*) :: a -> a -> a
  negate :: a -> a
  abs :: a -> a
  signum :: a -> a
  fromInteger :: Integer -> a
  {-# MINIMAL (+), (*), abs, signum, fromInteger, (negate | (-)) #-}
class Eq a => Ord a where
  compare :: a -> a -> Ordering
  (<) :: a -> a -> Bool
  (<=) :: a -> a -> Bool
  (>) :: a -> a -> Bool
  (>=) :: a -> a -> Bool
  max :: a -> a -> a
  min :: a -> a -> a
  {-# MINIMAL compare | (<=) #-}
data Ordering = LT | EQ | GT
type Rational = GHC.Real.Ratio Integer
class Read a where
  readsPrec :: Int -> ReadS a
  readList :: ReadS [a]
  GHC.Read.readPrec :: Text.ParserCombinators.ReadPrec.ReadPrec a
  GHC.Read.readListPrec :: Text.ParserCombinators.ReadPrec.ReadPrec
                             [a]
  {-# MINIMAL readsPrec | readPrec #-}
type ReadS a = String -> [(a, String)]
class (Num a, Ord a) => Real a where
  toRational :: a -> Rational
  {-# MINIMAL toRational #-}
class (RealFrac a, Floating a) => RealFloat a where
  floatRadix :: a -> Integer
  floatDigits :: a -> Int
  floatRange :: a -> (Int, Int)
  decodeFloat :: a -> (Integer, Int)
  encodeFloat :: Integer -> Int -> a
  exponent :: a -> Int
  significand :: a -> a
  scaleFloat :: Int -> a -> a
  isNaN :: a -> Bool
  isInfinite :: a -> Bool
  isDenormalized :: a -> Bool
  isNegativeZero :: a -> Bool
  isIEEE :: a -> Bool
  atan2 :: a -> a -> a
  {-# MINIMAL floatRadix, floatDigits, floatRange, decodeFloat,
              encodeFloat, isNaN, isInfinite, isDenormalized, isNegativeZero,
              isIEEE #-}
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
  {-# MINIMAL properFraction #-}
class Show a where
  showsPrec :: Int -> a -> ShowS
  show :: a -> String
  showList :: [a] -> ShowS
  {-# MINIMAL showsPrec | show #-}
type ShowS = String -> String
type String = [Char]
class (Functor t, Foldable t) => Traversable (t :: * -> *) where
  traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
  sequenceA :: Applicative f => t (f a) -> f (t a)
  mapM :: Monad m => (a -> m b) -> t a -> m (t b)
  sequence :: Monad m => t (m a) -> m (t a)
  {-# MINIMAL traverse | sequenceA #-}
data Word = GHC.Types.W# GHC.Prim.Word#
(^) :: (Num a, Integral b) => a -> b -> a
(^^) :: (Fractional a, Integral b) => a -> b -> a
all :: Foldable t => (a -> Bool) -> t a -> Bool
and :: Foldable t => t Bool -> Bool
any :: Foldable t => (a -> Bool) -> t a -> Bool
appendFile :: FilePath -> String -> IO ()
asTypeOf :: a -> a -> a
break :: (a -> Bool) -> [a] -> ([a], [a])
concat :: Foldable t => t [a] -> [a]
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
const :: a -> b -> a
curry :: ((a, b) -> c) -> a -> b -> c
cycle :: [a] -> [a]
drop :: Int -> [a] -> [a]
dropWhile :: (a -> Bool) -> [a] -> [a]
either :: (a -> c) -> (b -> c) -> Either a b -> c
error ::
  forall (r :: GHC.Types.RuntimeRep) (a :: TYPE r).
  GHC.Stack.Types.HasCallStack =>
  [Char] -> a
errorWithoutStackTrace ::
  forall (r :: GHC.Types.RuntimeRep) (a :: TYPE r). [Char] -> a
even :: Integral a => a -> Bool
filter :: (a -> Bool) -> [a] -> [a]
flip :: (a -> b -> c) -> b -> a -> c
fromIntegral :: (Integral a, Num b) => a -> b
fst :: (a, b) -> a
gcd :: Integral a => a -> a -> a
getChar :: IO Char
getContents :: IO String
getLine :: IO String
head :: [a] -> a
id :: a -> a
init :: [a] -> [a]
interact :: (String -> String) -> IO ()
ioError :: IOError -> IO a
iterate :: (a -> a) -> a -> [a]
last :: [a] -> a
lcm :: Integral a => a -> a -> a
lex :: ReadS String
lines :: String -> [String]
lookup :: Eq a => a -> [(a, b)] -> Maybe b
map :: (a -> b) -> [a] -> [b]
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
maybe :: b -> (a -> b) -> Maybe a -> b
not :: Bool -> Bool
notElem :: (Foldable t, Eq a) => a -> t a -> Bool
odd :: Integral a => a -> Bool
or :: Foldable t => t Bool -> Bool
otherwise :: Bool
print :: Show a => a -> IO ()
putChar :: Char -> IO ()
putStr :: String -> IO ()
putStrLn :: String -> IO ()
read :: Read a => String -> a
readFile :: FilePath -> IO String
readIO :: Read a => String -> IO a
readLn :: Read a => IO a
readParen :: Bool -> ReadS a -> ReadS a
reads :: Read a => ReadS a
realToFrac :: (Real a, Fractional b) => a -> b
repeat :: a -> [a]
replicate :: Int -> a -> [a]
reverse :: [a] -> [a]
scanl :: (b -> a -> b) -> b -> [a] -> [b]
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr1 :: (a -> a -> a) -> [a] -> [a]
seq :: a -> b -> b
sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
showChar :: Char -> ShowS
showParen :: Bool -> ShowS -> ShowS
showString :: String -> ShowS
shows :: Show a => a -> ShowS
snd :: (a, b) -> b
span :: (a -> Bool) -> [a] -> ([a], [a])
splitAt :: Int -> [a] -> ([a], [a])
subtract :: Num a => a -> a -> a
tail :: [a] -> [a]
take :: Int -> [a] -> [a]
takeWhile :: (a -> Bool) -> [a] -> [a]
uncurry :: (a -> b -> c) -> (a, b) -> c
undefined ::
  forall (r :: GHC.Types.RuntimeRep) (a :: TYPE r).
  GHC.Stack.Types.HasCallStack =>
  a
unlines :: [String] -> String
until :: (a -> Bool) -> (a -> a) -> a -> a
unwords :: [String] -> String
unzip :: [(a, b)] -> ([a], [b])
unzip3 :: [(a, b, c)] -> ([a], [b], [c])
userError :: String -> IOError
words :: String -> [String]
writeFile :: FilePath -> String -> IO ()
zip :: [a] -> [b] -> [(a, b)]
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
(||) :: Bool -> Bool -> Bool

这篇关于如何在Haskell中知道builtins函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆