task_id
stringlengths
53
83
poly_type
stringclasses
5 values
signature
stringlengths
16
74
code
stringlengths
9
481
dependencies
listlengths
0
14
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--curry
Parametric
curry :: ((a, b) -> c) -> a -> b -> c
curry f x y = f (x, y)
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--scaleFloat
Ad-hoc
scaleFloat :: RealFloat a => Int -> a -> a
scaleFloat zero x = x scaleFloat zero x = x scaleFloat zero x = x scaleFloat k x | isFix = x | otherwise = encodeFloat m (n + clamp b k) where (m,n) = decodeFloat x (l,h) = floatRange x d = floatDigits x b = h - l + four*d isFix = x == zero || isNaN x || isInfinite x
[ "floatDigits :: RealFloat a => a -> Int", "floatRange :: RealFloat a => a -> (Int,Int)", "(*) :: Num a => a -> a -> a", "(+) :: Num a => a -> a -> a", "isInfinite :: RealFloat a => a -> Bool", "encodeFloat :: RealFloat a => Integer -> Int -> a", "clamp :: (Ord a) => (a, a) -> a -> a", "decodeFloat :: RealFloat a => a -> (Integer,Int)", "isNaN :: RealFloat a => a -> Bool", "(==) :: Eq a => a -> a -> Bool", "zero :: Int", "four :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isNaN-Float
Monomorphic
isNaN :: Float -> Bool
isNaN x = zero /= isFloatNaN x
[ "isFloatNaN :: Float -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isNaN-Double
Monomorphic
isNaN :: Double -> Bool
isNaN x = zero /= isDoubleNaN x
[ "isDoubleNaN :: Double -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isInfinite-Float
Monomorphic
isInfinite :: Float -> Bool
isInfinite x = zero /= isFloatInfinite x
[ "isFloatInfinite :: Float -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isInfinite-Double
Monomorphic
isInfinite :: Double -> Bool
isInfinite x = 0 /= isDoubleInfinite x
[ "isDoubleInfinite :: Double -> Int", "(/=) :: Eq a => a -> a -> Bool" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--atan2
Ad-hoc
atan2 :: RealFloat a => a -> a -> a
atan2 y x | x > zero = atan (y/x) | x == zero && y > zero = pi/two | x < zero && y > zero = pi + atan (y/x) |(x <= zero && y < zero) || (x < zero && isNegativeZero y) || (isNegativeZero x && isNegativeZero y) = -atan2 (-y) x | y == zero && (x < zero || isNegativeZero x) = pi | x==zero && y==zero = y | otherwise = x + y
[ "atan :: Floating a => a -> a", "pi :: Floating a => a", "(/) :: Fractional a => a -> a -> a", "(+) :: Num a => a -> a -> a", "(-) :: Num a => a -> a -> a", "isNegativeZero :: RealFloat a => a -> Bool", "(==) :: Eq a => a -> a -> Bool", "(<) :: Ord a => a -> a -> Bool", "(<=) :: Ord a => a -> a -> Bool", "(>) :: Ord a => a -> a -> Bool", "(&&) :: Bool -> Bool -> Bool", "(||) :: Bool -> Bool -> Bool", "zero :: Num a => a", "two :: Num a => a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--subtract
Ad-hoc
subtract :: Num a => a -> a -> a
subtract x y = y - x
[ "(-) :: Num a => a -> a -> a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--gcd
Ad-hoc
gcd :: Integral a => a -> a -> a
gcd x y = gcd' (abs x) (abs y) where gcd' a zero = a gcd' a b = gcd' b (a `rem` b)
[ "abs :: Num a => a -> a", "rem :: Integral a => a -> a -> a", "zero :: Num a => a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--lcm
Ad-hoc
lcm :: Integral a => a -> a -> a
lcm zero _ = zero lcm _ zero = zero lcm x y = abs ((x `quot` (gcd x y)) * y)
[ "abs :: Num a => a -> a", "gcd :: Integral a => a -> a -> a", "(*) :: Num a => a -> a -> a", "quot :: Integral a => a -> a -> a", "zero :: Num a => a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--uncurry
Parametric
uncurry :: (a -> b -> c) -> ((a, b) -> c)
uncurry f p = f (fst p) (snd p)
[ "snd :: (a,b) -> b", "fst :: (a,b) -> a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--mconcat-[]
Parametric
mconcat :: [[a]] -> a
mconcat xss = [x | xs <- xss, x <- xs]
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--mconcat
Ad-hoc
mconcat :: Monoid a => [a] -> a
mconcat = foldr mappend mempty
[ "foldr :: (a -> b -> b) -> b -> [a] -> b", "mappend :: Monoid a => a -> a -> a", "mempty :: Monoid a => a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-Maybe
Parametric
fmap :: (a -> b) -> Maybe a -> Maybe b
fmap _ Nothing = Nothing fmap f (Just a) = Just (f a)
[ "data Maybe a = Nothing | Just a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-[]
Parametric
fmap :: (a -> b) -> [a] -> [b]
fmap = map
[ "map :: (a -> b) -> [a] -> [b]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-Either
Parametric
fmap :: (a0 -> b) -> Either a a0 -> Either a b
fmap _ (Left x) = Left x fmap f (Right y) = Right (f y)
[ "data Either a b = Left a | Right b" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-(,)
Parametric
fmap :: (a0 -> b) -> (a, a0) -> (a, b)
fmap f (x, y) = (x, f y)
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-Maybe
Parametric
pure :: a -> Maybe a
pure = Just
[ "data Maybe a = Nothing | Just a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-[]
Parametric
pure :: a -> [a]
pure x = [x]
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-Either
Parametric
pure :: a -> Either e a
pure = Right
[ "data Either a b = Left a | Right b" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-(,)
Parametric
pure :: a0 -> (a, a0)
pure x = (mempty, x)
[ "mempty :: a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2-Maybe
Parametric
liftA2 :: (a1 -> a2 -> a3) -> Maybe a1 -> Maybe a2 -> Maybe a3
liftA2 f (Just x) (Just y) = Just (f x y) liftA2 _ _ _ = Nothing
[ "data Maybe a = Nothing | Just a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2--[]
Parametric
liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c]
liftA2 f xs ys = [f x y | x <- xs, y <- ys]
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2--(,)
Parametric
liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c)
liftA2 f (u, x) (v, y) = (u <> v, f x y)
[ "(<>) :: a -> a -> a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2
Ad-hoc
liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c
liftA2 f x = (<*>) (fmap f x)
[ "(<*>) :: f (a -> b) -> f a -> f b", "fmap :: (a -> b) -> f a -> f b" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Control/Monad/Fail.hs--fail-Maybe
Parametric
fail :: String -> Maybe a
fail x = Nothing
[ "data Maybe a = Nothing | Just a", "x :: String" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Control/Monad/Fail.hs--fail-[]
Parametric
fail :: String -> [a]
fail x = []
[ "x :: String" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--mapM_
Ad-hoc
mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
mapM_ f = foldr c (return ()) where c x k = f x >> k
[ "(>>) :: Monad m => m a -> m b -> m b", "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "return :: Monad m => a -> m a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--elem
Ad-hoc
elem :: (Foldable t, Eq a) => a -> t a -> Bool
elem = any . (==)
[ "any :: Foldable t => (a -> Bool) -> t a -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c", "(==) :: Eq a => a -> a -> Bool" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-Maybe
Ad-hoc
foldMap :: Monoid m => (a -> m) -> Maybe a -> m
foldMap = maybe mempty
[ "maybe :: b -> (a -> b) -> Maybe a -> b", "mempty :: Monoid m => m" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-List
Ad-hoc
foldMap :: Monoid m => (a -> m) -> [a] -> m
foldMap = (mconcat .) . map
[ "mconcat :: Monoid a => [a] -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "map :: (a -> b) -> [a] -> [b]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-(,)
Ad-hoc
foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m
foldMap f (_, y) = f y
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap
Ad-hoc
foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
foldMap f = foldr (mappend . f) mempty
[ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "mappend :: Monoid m => m -> m -> m", "(.) :: (b -> c) -> (a -> b) -> a -> c", "mempty :: Monoid m => m" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldr
Ad-hoc
foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
foldr f z t = appEndo (foldMap (Endo #. f) t) z
[ "appEndo :: Endo a -> a -> a", "foldMap :: Monoid m => (a -> m) -> t a -> m", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldl
Parametric
foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
[ "appEndo :: Endo a -> a -> a", "getDual :: Dual a -> a", "foldMap :: Monoid m => (a -> m) -> t a -> m", "newtype Dual a = Dual { getDual :: a }", "newtype Endo a = Endo { appEndo :: a -> a }", "flip :: (a -> b -> c) -> b -> a -> c", "(.) :: (a -> a) -> (a -> a) -> (a -> a)" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Bool
Monomorphic
succ :: Bool -> Bool
succ False = True succ True = error "bad argument"
[ "data Bool = False | True" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Ordering
Monomorphic
succ :: Ordering -> Ordering
succ LT = EQ succ EQ = GT succ GT = error "bad argument"
[ "data Ordering = LT | EQ | GT" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Char
Monomorphic
succ :: Char -> Char
succ c = chr (ord c + one)
[ "chr :: Int -> Char", "ord :: Char -> Int", "(+) :: Num a => a -> a -> a", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Int
Monomorphic
succ :: Int -> Int
succ x = x + one
[ "(+) :: Ord a => a -> a -> a", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ
Ad-hoc
succ :: Enum a => a -> a
succ = toEnum . (+ one) . fromEnum
[ "toEnum :: Enum a => Int -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "(+) :: Num a => a -> a -> a", "fromEnum :: Enum a => a -> Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--product
Ad-hoc
product :: (Foldable t, Num a) => t a -> a
product = getProduct #. foldMap' Product
[ "getProduct :: Product a -> a", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)", "foldMap' :: Monoid m => (a -> m) -> t a -> m", "newtype Product a = Product {getProduct :: a}" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--sum
Ad-hoc
sum :: (Foldable t, Num a) => t a -> a
sum = getSum #. foldMap' Sum
[ "getSum :: Sum a -> a", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)", "foldMap' :: Monoid m => (a -> m) -> t a -> m", "newtype Sum a = Sum {getSum :: a}" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Traversable.hs--traverse
Ad-hoc
traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
traverse f = sequenceA . fmap f
[ "sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)", "(.) :: (b -> c) -> (a -> b) -> a -> c", "fmap :: Functor f => (a -> b) -> f a -> f b" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Traversable.hs--sequenceA
Ad-hoc
sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
sequenceA = traverse id
[ "traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)", "id :: a -> a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--const
Parametric
const :: a -> b -> a
const x _ = x
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Bool
Monomorphic
pred :: Bool -> Bool
pred True = False pred False = error "bad argument"
[ "data Bool = False | True" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Ordering
Monomorphic
pred :: Ordering -> Ordering
pred GT = EQ pred EQ = LT pred LT = error "bad argument"
[ "data Ordering = LT | EQ | GT" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Char
Monomorphic
pred :: Char -> Char
pred c = chr (ord c - one)
[ "chr :: Int -> Char", "ord :: Char -> Int", "(-) :: Num a => a -> a -> a", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Int
Monomorphic
pred :: Int -> Int
pred x = x - one
[ "(-) :: Num a => a -> a -> a", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred
Ad-hoc
pred :: Enum a => a -> a
pred = toEnum . (subtract one) . fromEnum
[ "toEnum :: Enum a => Int -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "subtract :: Num a => a -> a -> a", "fromEnum :: Enum a => a -> Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--flip
Parametric
flip :: (a -> b -> c) -> b -> a -> c
flip f x y = f y x
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--until
Parametric
until :: (a -> Bool) -> (a -> a) -> a -> a
until p f = go where go x | p x = x | otherwise = go (f x)
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--map
Parametric
map :: (a -> b) -> [a] -> [b]
map _ [] = [] map f (x:xs) = f x : map f xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--filter
Parametric
filter :: (a -> Bool) -> [a] -> [a]
filter f [] = [] filter f (x:xs) | f x = x : filter f xs | otherwise = filter f xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--head
Parametric
head :: [a] -> a
head (x:_) = x head [] = error "empty"
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--last
Parametric
last :: [a] -> a
last (_:xs) = last xs last [] = error last [x] = x
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--tail
Parametric
tail :: [a] -> [a]
tail (_:xs) = xs tail [] = error
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--init
Parametric
init :: [a] -> [a]
init (x:xs) = x : init xs init [] = error init [x] = []
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Bool
Monomorphic
toEnum :: Int -> Bool
toEnum n | n == zero = False | n == one = True | otherwise = error "bad argument"
[ "data Bool = False | True", "(==) :: Eq a => a -> a -> Bool", "zero :: Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Ordering
Monomorphic
toEnum :: Int -> Ordering
toEnum n | n == zero = LT | n == one = EQ | n == two = GT | otherwise = error "bad argument"
[ "data Ordering = LT | EQ | GT", "(==) :: Eq a => a -> a -> Bool", "zero :: Int", "one :: Int", "two :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Char
Monomorphic
toEnum :: Int -> Char
toEnum = chr
[ "chr :: Int -> Char" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Int
Monomorphic
toEnum :: Int -> Int
toEnum x = x
[ "x :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--null
Parametric
null :: [a] -> Bool
null [] = True null (_:_) = False
[ "data Bool = False | True" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--length
Parametric
length :: [a] -> Int
length xs = lenAcc xs zero
[ "lenAcc :: [a] -> Int -> Int", "zero :: Num a => a" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--any
Ad-hoc
any :: Foldable t => (a -> Bool) -> t a -> Bool
any p = getAny #. foldMap (Any #. p)
[ "foldMap :: Monoid m => (a -> m) -> t a -> m", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)", "getAny :: Any -> Bool", "newtype Any = Any {getAny :: Bool}" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--all
Ad-hoc
all :: Foldable t => (a -> Bool) -> t a -> Bool
all p = getAll #. foldMap (All #. p)
[ "foldMap :: Monoid m => (a -> m) -> t a -> m", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)", "getAll :: All -> Bool", "newtype All = All { getAll :: Bool }" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--concat
Parametric
concat :: [[a]] -> [a]
concat = foldr (++) []
[ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "(++) :: [a] -> [a] -> [a]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--concat
Ad-hoc
concat :: Foldable t => t [a] -> [a]
concat xs = build (\c n -> foldr (\x y -> foldr c y x) n xs)
[ "build :: ((a -> b -> b) -> b -> b) -> [a]", "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--concatMap
Parametric
concatMap :: (a -> [b]) -> [a] -> [b]
concatMap f = foldr ((++) . f) []
[ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "(++) :: [a] -> [a] -> [a]", "(.) :: (b -> c) -> (a -> b) -> a -> c" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--concatMap
Ad-hoc
concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
concatMap f xs = build (\c n -> foldr (\x b -> foldr c b (f x)) n xs)
[ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "build :: ((a -> b -> b) -> b -> b) -> [a]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanl1
Parametric
scanl1 :: (a -> a -> a) -> [a] -> [a]
scanl1 _ [] = [] scanl1 f (x:xs) = scanl f x xs
[ "scanl :: (b -> a -> b) -> b -> [a] -> [b]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanr
Parametric
scanr :: (a -> b -> b) -> b -> [a] -> [b]
scanr _ q0 [] = [q0] scanr f q0 (x:xs) = f x q : qs where qs@(q:_) = scanr f q0 xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanr1
Parametric
scanr1 :: (a -> a -> a) -> [a] -> [a]
scanr1 _ [] = [] scanr1 _ [x] = [x] scanr1 f (x:xs) = f x q : qs where qs@(q:_) = scanr1 f xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--iterate
Parametric
iterate :: (a -> a) -> a -> [a]
iterate f x = x : iterate f (f x)
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Bool
Monomorphic
fromEnum :: Bool -> Int
fromEnum False = zero fromEnum True = one
[ "data Bool = False | True", "zero :: Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Ordering
Monomorphic
fromEnum :: Ordering -> Int
fromEnum LT = zero fromEnum EQ = one fromEnum GT = two
[ "data Ordering = LT | EQ | GT", "zero :: Int", "one :: Int", "two :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Char
Monomorphic
fromEnum :: Char -> Int
fromEnum = ord
[ "ord :: Char -> Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Int
Monomorphic
fromEnum :: Int -> Int
fromEnum x = x
[ "x :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--repeat
Parametric
repeat :: a -> [a]
repeat x = xs where xs = x : xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--replicate
Parametric
replicate :: Int -> a -> [a]
replicate n x = take n (repeat x)
[ "take :: Int -> [a] -> [a]", "repeat :: a -> [a]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--cycle
Parametric
cycle :: [a] -> [a]
cycle [] = error cycle xs = xs' where xs' = xs ++ xs'
[ "(++) :: [a] -> [a] -> [a]" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--take
Parametric
take :: Int -> [a] -> [a]
take _ [] = [] take n (x:xs) = x : take (n-one) xs take n _ | n <= zero = []
[ "(<=) :: Ord a => a -> a -> Bool", "(-) :: Num a => a -> a -> a", "zero :: Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--drop
Parametric
drop :: Int -> [a] -> [a]
drop _ [] = [] drop n (_:xs) = drop (n-one) xs drop n xs | n <= zero = xs
[ "(<=) :: Ord a => a -> a -> Bool", "(-) :: Num a => a -> a -> a", "zero :: Int", "one :: Int" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--takeWhile
Parametric
takeWhile :: (a -> Bool) -> [a] -> [a]
takeWhile _ [] = [] takeWhile p (x:xs) | p x = x : takeWhile p xs | otherwise = []
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--dropWhile
Parametric
dropWhile :: (a -> Bool) -> [a] -> [a]
dropWhile _ [] = [] dropWhile p xs@(x:xs') | p x = dropWhile p xs' | otherwise = xs
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--span
Parametric
span :: (a -> Bool) -> [a] -> ([a],[a])
span _ xs@[] = (xs, xs) span p xs@(x:xs') | p x = let (ys,zs) = span p xs' in (x:ys,zs) | otherwise = ([],xs)
[]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--break
Parametric
break :: (a -> Bool) -> [a] -> ([a],[a])
break p = span (not . p)
[ "span :: (a -> Bool) -> [a] -> ([a],[a])", "not :: Bool -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c" ]
data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--splitAt
Parametric
splitAt :: Int -> [a] -> ([a],[a])
splitAt n xs = (take n xs, drop n xs)
[ "take :: Int -> [a] -> [a]", "drop :: Int -> [a] -> [a]" ]