[ { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--fromRational", "poly_type": "Ad-hoc", "signature": "fromRational :: Fractional a => Rational -> a", "code": "fromRational (x:%y) = fromInteger x % fromInteger y", "dependencies": [ "fromInteger :: Num a => Integer -> a", "(%) :: (Integral a) => a -> a -> Ratio a", "data Ratio a = !a :% !a", "type Rational = Ratio Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2-Maybe", "poly_type": "Parametric", "signature": "liftA2 :: (a1 -> a2 -> a3) -> Maybe a1 -> Maybe a2 -> Maybe a3", "code": "liftA2 f (Just x) (Just y) = Just (f x y)\nliftA2 _ _ _ = Nothing", "dependencies": [ "data Maybe a = Nothing | Just a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--interact", "poly_type": "Monomorphic", "signature": "interact :: (String -> String) -> IO ()", "code": "interact f = getContents >>= \\s -> putStr (f s)", "dependencies": [ "putStr :: String -> IO ()", "getContents :: IO String", "(>>=) :: IO a -> (a -> IO b) -> IO b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(++)", "poly_type": "Parametric", "signature": "(++) :: [a] -> [a] -> [a]", "code": "(++) (x:xs) ys = x : xs ++ ys\n(++) [] ys = ys", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Ordering", "poly_type": "Monomorphic", "signature": "succ :: Ordering -> Ordering", "code": "succ LT = EQ\nsucc EQ = GT\nsucc GT = error \"bad argument\"", "dependencies": [ "data Ordering = LT | EQ | GT" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--(-)", "poly_type": "Ad-hoc", "signature": "(-) :: Num a => a -> a -> a", "code": "x - y = x + negate y", "dependencies": [ "(+) :: Num a => a -> a -> a", "negate :: Num a => a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--fromIntegral", "poly_type": "Ad-hoc", "signature": "fromIntegral :: (Integral a, Num b) => a -> b", "code": "fromIntegral = fromInteger . toInteger", "dependencies": [ "fromInteger :: Num a => Integer -> a", "toInteger :: Integral a => a -> Integer", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--mapM_", "poly_type": "Ad-hoc", "signature": "mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()", "code": "mapM_ f = foldr c (return ())\n where c x k = f x >> k", "dependencies": [ "(>>) :: Monad m => m a -> m b -> m b", "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "return :: Monad m => a -> m a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--product", "poly_type": "Ad-hoc", "signature": "product :: (Foldable t, Num a) => t a -> a", "code": "product = getProduct #. foldMap' Product", "dependencies": [ "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}" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/OldList.hs--lines", "poly_type": "Monomorphic", "signature": "lines :: String -> [String]", "code": "lines emptyStr = []\nlines s = cons (case break (== newLine) s of\n (l, s') -> (l, case s' of\n [] -> []\n _:s'' -> lines s''))\n where\n cons ~(h, t) = h : t", "dependencies": [ "break :: (a -> Bool) -> [a] -> ([a],[a])", "emptyStr :: String", "newLine :: Char", "(==) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--putChar", "poly_type": "Monomorphic", "signature": "putChar :: Char -> IO ()", "code": "putChar c = hPutChar stdout c", "dependencies": [ "hPutChar :: Handle -> Char -> IO ()", "stdout :: Handle" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--enumFromThen", "poly_type": "Ad-hoc", "signature": "enumFromThen :: Enum a => a -> a -> [a]", "code": "enumFromThen x y = map toEnum [fromEnum x, fromEnum y ..]", "dependencies": [ "map :: (a -> b) -> [a] -> [b]", "toEnum :: Enum a => Int -> a", "fromEnum :: Enum a => a -> Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Bool", "poly_type": "Monomorphic", "signature": "pred :: Bool -> Bool", "code": "pred True = False\npred False = error \"bad argument\"", "dependencies": [ "data Bool = False | True" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-[]", "poly_type": "Parametric", "signature": "pure :: a -> [a]", "code": "pure x = [x]", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--snd", "poly_type": "Parametric", "signature": "snd :: (a,b) -> b", "code": "snd (_,y) = y", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--span", "poly_type": "Parametric", "signature": "span :: (a -> Bool) -> [a] -> ([a],[a])", "code": "span _ xs@[] = (xs, xs)\nspan p xs@(x:xs')\n | p x = let (ys,zs) = span p xs' in (x:ys,zs)\n | otherwise = ([],xs)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanr", "poly_type": "Parametric", "signature": "scanr :: (a -> b -> b) -> b -> [a] -> [b]", "code": "scanr _ q0 [] = [q0]\nscanr f q0 (x:xs) = f x q : qs\n where qs@(q:_) = scanr f q0 xs", "dependencies": [] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(>=)", "poly_type": "Ad-hoc", "signature": "(>=) :: Ord a => a -> a -> Bool", "code": "x >= y = y <= x", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--enumFrom", "poly_type": "Ad-hoc", "signature": "enumFrom :: Enum a => a -> [a]", "code": "enumFrom x = map toEnum [fromEnum x ..]", "dependencies": [ "map :: (a -> b) -> [a] -> [b]", "toEnum :: Enum a => Int -> a", "fromEnum :: Enum a => a -> Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Text/Read.hs--read", "poly_type": "Ad-hoc", "signature": "read :: Read a => String -> a", "code": "read s = either errorWithoutStackTrace id (readEither s)", "dependencies": [ "either :: (a -> c) -> (b -> c) -> Either a b -> c", "readEither :: Read a => String -> Either String a", "id :: a -> a", "errorWithoutStackTrace :: String -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--unzip", "poly_type": "Parametric", "signature": "unzip :: [(a,b)] -> ([a],[b])", "code": "unzip = foldr (\\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[])", "dependencies": [ "foldr :: (a -> b -> b) -> b -> [a] -> b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isNaN-Float", "poly_type": "Monomorphic", "signature": "isNaN :: Float -> Bool", "code": "isNaN x = zero /= isFloatNaN x", "dependencies": [ "isFloatNaN :: Float -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Show.hs--showList--Char", "poly_type": "Monomorphic", "signature": "showList :: [Char] -> ShowS", "code": "showList cs = showChar quotationMark . showLitString cs . showChar quotationMark", "dependencies": [ "showChar :: Char -> ShowS", "showLitString :: String -> ShowS", "type ShowS = String -> String", "(.) :: (b -> c) -> (a -> b) -> a -> c", "quotationMark :: Char" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--encodeFloat-Double", "poly_type": "Monomorphic", "signature": "encodeFloat :: Integer -> Int -> Double", "code": "encodeFloat i (I_ j) = D_ (integerEncodeDouble_ i j)", "dependencies": [ "data Double = D_ Double_", "integerEncodeDouble_ :: Integer -> Int_ -> Double_", "data Int = I_ Int_" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-Either", "poly_type": "Parametric", "signature": "pure :: a -> Either e a", "code": "pure = Right", "dependencies": [ "data Either a b = Left a | Right b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanl1", "poly_type": "Parametric", "signature": "scanl1 :: (a -> a -> a) -> [a] -> [a]", "code": "scanl1 _ [] = []\nscanl1 f (x:xs) = scanl f x xs", "dependencies": [ "scanl :: (b -> a -> b) -> b -> [a] -> [b]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--dropWhile", "poly_type": "Parametric", "signature": "dropWhile :: (a -> Bool) -> [a] -> [a]", "code": "dropWhile _ [] = []\ndropWhile p xs@(x:xs')\n | p x = dropWhile p xs'\n | otherwise = xs", "dependencies": [] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(<)", "poly_type": "Ad-hoc", "signature": "(<) :: Ord a => a -> a -> Bool", "code": "x < y = not (y <= x>)", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--fst", "poly_type": "Parametric", "signature": "fst :: (a,b) -> a", "code": "fst (x,_) = x", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--quot", "poly_type": "Ad-hoc", "signature": "quot :: Integral => a -> a -> a", "code": "n `quot` d = fst (quotRem n d)", "dependencies": [ "fst :: (a, b) -> a", "quotRem :: Integral => a -> a -> (a, a)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Control/Monad/Fail.hs--fail-[]", "poly_type": "Parametric", "signature": "fail :: String -> [a]", "code": "fail x = []", "dependencies": [ "x :: String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--decodeFloat-Float", "poly_type": "Monomorphic", "signature": "decodeFloat :: Float -> (Integer, Int)", "code": "decodeFloat (F f) = case decodeFloat_Int_ f_ of\n (i, e) -> (IS i, I e)", "dependencies": [ "data Float = F_ Float_", "decodeFloat_Int_ :: Float_ -> (Int_, Int_)", "data Integer = IS Int_", "data Int = I_ Int_" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--concatMap", "poly_type": "Parametric", "signature": "concatMap :: (a -> [b]) -> [a] -> [b]", "code": "concatMap f = foldr ((++) . f) []", "dependencies": [ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "(++) :: [a] -> [a] -> [a]", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--fromInteger-Int", "poly_type": "Monomorphic", "signature": "fromInteger :: Integer -> Int", "code": "fromInteger i = I_ (integerToInt_ i)", "dependencies": [ "integerToInt_ :: Integer -> Int_", "data Int = I_ Int_" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Char", "poly_type": "Monomorphic", "signature": "succ :: Char -> Char", "code": "succ c = chr (ord c + one)", "dependencies": [ "chr :: Int -> Char", "ord :: Char -> Int", "(+) :: Num a => a -> a -> a", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--($)", "poly_type": "Parametric", "signature": "($) :: (a -> b) -> a -> b", "code": "($) f = f", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--print", "poly_type": "Ad-hoc", "signature": "print :: Show a => a -> IO ()", "code": "print x = putStrLn (show x)", "dependencies": [ "putStrLn :: String -> IO ()", "show :: Show a => a -> String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--recip", "poly_type": "Ad-hoc", "signature": "recip :: Fractional a => a -> a", "code": "recip x = one / x", "dependencies": [ "(/) :: Fractional a => a -> a -> a", "one :: Fractional a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Int", "poly_type": "Monomorphic", "signature": "fromEnum :: Int -> Int", "code": "fromEnum x = x", "dependencies": [ "x :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--(^^)", "poly_type": "Ad-hoc", "signature": "(^^) :: (Fractional a, Integral b) => a -> b -> a", "code": "x ^^ n = if n >= 0 then x^n else recip (x^(negate n))", "dependencies": [ "(>=) :: Ord a => a -> a -> Bool", "(^) :: (Num a, Integral b) => a -> b -> a", "recip :: Fractional a => a -> a", "negate :: Num a => a -> a" ] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--min", "poly_type": "Ad-hoc", "signature": "min :: Ord a => a -> a -> a", "code": "min x y = if x <= y then x else y", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(<*>)-(,)", "poly_type": "Parametric ", "signature": "(<*>) :: (a, (a -> b)) -> (a0, a) -> (a0, b) ", "code": "(u, f) <*> (v, x) = (u <> v, f x)", "dependencies": [ "(<>) :: Semigroup a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--enumFromTo", "poly_type": "Ad-hoc", "signature": "enumFromTo :: Enum a => a -> a -> [a]", "code": "enumFromTo x y = map toEnum [fromEnum x .. fromEnum y]", "dependencies": [ "map :: (a -> b) -> [a] -> [b]", "toEnum :: Enum a => Int -> a", "fromEnum :: Enum a => a -> Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--zipWith", "poly_type": "Parametric", "signature": "zipWith :: (a->b->c) -> [a]->[b]->[c]", "code": "zipWith f = go\n where\n go [] _ = []\n go _ [] = []\n go (x:xs) (y:ys) = f x y : go xs ys", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Read.hs--readsPrec", "poly_type": "Ad-hoc", "signature": "readsPrec :: Read a => Int -> ReadS a", "code": "readsPrec = readPrec_to_S readPrec", "dependencies": [ "readPrec_to_S :: ReadPrec a -> (Int -> ReadS a)", "readPrec :: ReadPrec a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--flip", "poly_type": "Parametric", "signature": "flip :: (a -> b -> c) -> b -> a -> c", "code": "flip f x y = f y x", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--drop", "poly_type": "Parametric", "signature": "drop :: Int -> [a] -> [a]", "code": "drop _ [] = []\ndrop n (_:xs) = drop (n-one) xs\ndrop n xs | n <= zero = xs", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool", "(-) :: Num a => a -> a -> a", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--concat", "poly_type": "Ad-hoc", "signature": "concat :: Foldable t => t [a] -> [a]", "code": "concat xs = build (\\c n -> foldr (\\x y -> foldr c y x) n xs)", "dependencies": [ "build :: ((a -> b -> b) -> b -> b) -> [a]", "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Maybe.hs--maybe", "poly_type": "Parametric", "signature": "maybe :: b -> (a -> b) -> Maybe a -> b", "code": "maybe _ f (Just x) = f x\nmaybe n _ Nothing = n", "dependencies": [ "data Maybe a = Nothing | Just a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-Maybe", "poly_type": "Parametric", "signature": "pure :: a -> Maybe a", "code": "pure = Just", "dependencies": [ "data Maybe a = Nothing | Just a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(<*>)", "poly_type": "Ad-hoc ", "signature": "(<*>) :: Applicative f => f (a -> b) -> f a -> f b ", "code": "(<*>) = liftA2 id", "dependencies": [ "id :: a -> a", "liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--even", "poly_type": "Ad-hoc", "signature": "even :: Integral a => a -> Bool", "code": "even n = n `rem` two == zero", "dependencies": [ "rem :: Integral a => a -> a -> a", "(==) :: Eq a => a -> a -> Bool", "two :: Integral a => a", "zero :: Integral a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Ordering", "poly_type": "Monomorphic", "signature": "pred :: Ordering -> Ordering", "code": "pred GT = EQ\npred EQ = LT\npred LT = error \"bad argument\"", "dependencies": [ "data Ordering = LT | EQ | GT" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--const", "poly_type": "Parametric", "signature": "const :: a -> b -> a", "code": "const x _ = x", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--init", "poly_type": "Parametric", "signature": "init :: [a] -> [a]", "code": "init (x:xs) = x : init xs\ninit [] = error\ninit [x] = []", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--elem", "poly_type": "Ad-hoc", "signature": "elem :: (Foldable t, Eq a) => a -> t a -> Bool", "code": "elem = any . (==)", "dependencies": [ "any :: Foldable t => (a -> Bool) -> t a -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c", "(==) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--atan2", "poly_type": "Ad-hoc", "signature": "atan2 :: RealFloat a => a -> a -> a", "code": "atan2 y x\n | x > zero = atan (y/x)\n | x == zero && y > zero = pi/two\n | x < zero && y > zero = pi + atan (y/x)\n |(x <= zero && y < zero) ||\n (x < zero && isNegativeZero y) ||\n (isNegativeZero x && isNegativeZero y)\n = -atan2 (-y) x\n | y == zero && (x < zero || isNegativeZero x)\n = pi \n | x==zero && y==zero = y \n | otherwise = x + y", "dependencies": [ "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" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(*>)-[]", "poly_type": "Parametric", "signature": "(*>) :: [a] -> [b] -> [b]", "code": "xs *> ys = [y | _ <- xs, y <- ys]", "dependencies": [] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(>)", "poly_type": "Ad-hoc", "signature": "(>) :: Ord a => a -> a -> Bool", "code": "x > y = not (x <= y)", "dependencies": [ "(>) :: Ord a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--odd", "poly_type": "Ad-hoc", "signature": "odd :: Integral a => a -> Bool", "code": "odd = not . even", "dependencies": [ "not :: Bool -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c", "even :: Integral a => a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--readFile", "poly_type": "Monomorphic", "signature": "readFile :: FilePath -> IO String", "code": "readFile name = openFile name ReadMode >>= hGetContents", "dependencies": [ "openFile :: FilePath -> IOMode -> IO Handle", "(>>=) :: IO a -> (a -> IO b) -> IO b", "hGetContents :: Handle -> IO String", "data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(.)", "poly_type": "Parametric", "signature": "(.) :: (b -> c) -> (a -> b) -> a -> c", "code": "(.) f g = \\x -> f (g x)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Bool", "poly_type": "Monomorphic", "signature": "succ :: Bool -> Bool", "code": "succ False = True\nsucc True = error \"bad argument\"", "dependencies": [ "data Bool = False | True" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2--[]", "poly_type": "Parametric", "signature": "liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c]", "code": "liftA2 f xs ys = [f x y | x <- xs, y <- ys]", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--toInteger--Natural", "poly_type": "Monomorphic", "signature": "toInteger :: Natural -> Integer", "code": "toInteger x = integerFromNatural x", "dependencies": [ "integerFromNatural :: Natural -> Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--floatDigits-Float", "poly_type": "Monomorphic", "signature": "floatDigits :: Float -> Int", "code": "floatDigits x = dbl_mant_dig", "dependencies": [ "dbl_mant_dig :: Int", "x :: Float" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--divMod", "poly_type": "Ad-hoc", "signature": "divMod :: Integral a => a -> a -> (a,a)", "code": "divMod n d = if signum r == negate (signum d) then (q-1, r+d) else qr\n where qr@(q,r) = quotRem n d", "dependencies": [ "quotRem :: Integral a => a -> a -> (a, a)", "negate :: Num a => a -> a", "(+) :: Num a => a -> a -> a", "(-) :: Num a => a -> a -> a", "signum :: Num a => a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--tail", "poly_type": "Parametric", "signature": "tail :: [a] -> [a]", "code": "tail (_:xs) = xs\ntail [] = error", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--decodeFloat-Double", "poly_type": "Monomorphic", "signature": "decodeFloat :: Double -> (Integer, Int)", "code": "decodeFloat (D_ x_) = case integerDecodeDouble_ x_ of\n (i, j) -> (i, I_ j)", "dependencies": [ "data Double = D_ Double_", "integerDecodeDouble_ :: Double_ -> (Integer, Int_)", "data Int = I_ Int_" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Control/Monad/Fail.hs--fail-Maybe", "poly_type": "Parametric", "signature": "fail :: String -> Maybe a", "code": "fail x = Nothing", "dependencies": [ "data Maybe a = Nothing | Just a", "x :: String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--(^)", "poly_type": "Ad-hoc", "signature": "(^) :: (Num a, Integral b) => a -> b -> a", "code": "x ^ y | y < zero = error \"negative\"\n | y == zero = one\n | otherwise = powImpl x y", "dependencies": [ "(<) :: Ord a => a -> a -> Bool", "(==) :: Eq a => a -> a -> Bool", "powImpl :: (Num a, Integral b) => a -> b -> a", "zero :: Num a => a", "one :: Num a => a" ] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--max", "poly_type": "Ad-hoc", "signature": "max :: Ord a => a -> a -> a", "code": "max x y = if x <= y then y else x", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--subtract", "poly_type": "Ad-hoc", "signature": "subtract :: Num a => a -> a -> a", "code": "subtract x y = y - x", "dependencies": [ "(-) :: Num a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap", "poly_type": "Ad-hoc", "signature": "foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m", "code": "foldMap f = foldr (mappend . f) mempty", "dependencies": [ "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" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--floatRange-Float", "poly_type": "Monomorphic", "signature": "floatRange :: Float -> (Int,Int)", "code": "floatRange x = (dbl_min_exp, dbl_max_exp)", "dependencies": [ "dbl_min_exp :: Int", "dbl_min_exp :: Int", "x :: Float" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(&&)", "poly_type": "Monomorphic", "signature": "(&&) :: Bool -> Bool -> Bool", "code": "(&&) True True = True\n(&&) _ _ = False", "dependencies": [ "data Bool = True | False" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--writeFile", "poly_type": "Monomorphic", "signature": "writeFile :: FilePath -> String -> IO ()", "code": "writeFile f txt = withFile f WriteMode (\\ hdl -> hPutStr hdl txt)", "dependencies": [ "hPutStr :: Handle -> String -> IO ()", "withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r", "data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2--(,)", "poly_type": "Parametric", "signature": "liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c)", "code": "liftA2 f (u, x) (v, y) = (u <> v, f x y)", "dependencies": [ "(<>) :: a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isNaN-Double", "poly_type": "Monomorphic", "signature": "isNaN :: Double -> Bool", "code": "isNaN x = zero /= isDoubleNaN x", "dependencies": [ "isDoubleNaN :: Double -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--encodeFloat-Float", "poly_type": "Monomorphic", "signature": "encodeFloat :: Integer -> Int -> Float", "code": "encodeFloat i (I_ e) = F_ (integerEncodeFloat_ i e)", "dependencies": [ "data Int = I_ Int_", "data Float = F_ Float_", "integerEncodeFloat_ :: Integer -> Int_ -> Float_" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Read.hs--readParen", "poly_type": "Parametric", "signature": "readParen :: Bool -> ReadS a -> ReadS a", "code": "readParen b g = if b then mandatory else optional\n where optional r = g r ++ mandatory r\n mandatory r =\n lex r >>= \\([leftParenthesis], s) ->\n optional s >>= \\(x, t) ->\n lex t >>= \\([rightParenthesis], u) ->\n return (x, u)\n", "dependencies": [ "(++) :: [a] -> [a] -> [a]", "return :: Monad m => a -> m a", "lex :: String -> [(String, String)]", "(>>=) :: Monad m => m a -> (a -> m b) -> m b", "type ReadS a = String -> [(a, String)]", "leftParenthesis :: Char", "rightParenthesis :: Char" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--zipWith3", "poly_type": "Parametric", "signature": "zipWith3 :: (a->b->c->d) -> [a]->[b]->[c]->[d]", "code": "zipWith3 z = go\n where\n go (a:as) (b:bs) (c:cs) = z a b c : go as bs cs\n go _ _ _ = []", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--concat", "poly_type": "Parametric", "signature": "concat :: [[a]] -> [a]", "code": "concat = foldr (++) []", "dependencies": [ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "(++) :: [a] -> [a] -> [a]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--enumFromThenTo", "poly_type": "Ad-hoc", "signature": "enumFromThenTo :: Enum a => a -> a -> a -> [a]", "code": "enumFromThenTo x1 x2 y = map toEnum [fromEnum x1, fromEnum x2 .. fromEnum y]", "dependencies": [ "map :: (a -> b) -> [a] -> [b]", "toEnum :: Enum a => Int -> a", "fromEnum :: Enum a => a -> Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--until", "poly_type": "Parametric", "signature": "until :: (a -> Bool) -> (a -> a) -> a -> a", "code": "until p f = go\n where\n go x | p x = x\n | otherwise = go (f x)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--quotRem-Int", "poly_type": "Monomorphic", "signature": "quotRem :: Int -> Int -> (Int, Int)", "code": "quotRem a b = quotRemInt a b", "dependencies": [ "quotRemInt :: Int -> Int -> (Int, Int)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Int", "poly_type": "Monomorphic", "signature": "toEnum :: Int -> Int", "code": "toEnum x = x", "dependencies": [ "x :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Either.hs--either", "poly_type": "Parametric", "signature": "either :: (a -> c) -> (b -> c) -> Either a b -> c", "code": "either _ g (Right y) = g y\neither f _ (Left x) = f x", "dependencies": [ "data Either a b = Left a | Right b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-(,)", "poly_type": "Parametric", "signature": "fmap :: (a0 -> b) -> (a, a0) -> (a, b)", "code": "fmap f (x, y) = (x, f y)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--concatMap", "poly_type": "Ad-hoc", "signature": "concatMap :: Foldable t => (a -> [b]) -> t a -> [b]", "code": "concatMap f xs = build (\\c n -> foldr (\\x b -> foldr c b (f x)) n xs)", "dependencies": [ "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "build :: ((a -> b -> b) -> b -> b) -> [a]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--takeWhile", "poly_type": "Parametric", "signature": "takeWhile :: (a -> Bool) -> [a] -> [a]", "code": "takeWhile _ [] = []\ntakeWhile p (x:xs)\n | p x = x : takeWhile p xs\n | otherwise = []", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--signum-Int", "poly_type": "Monomorphic", "signature": "signum :: Int -> Int", "code": "signum n | n `ltInt` zero = negate one\n | n `eqInt` zero = zero\n | otherwise = one", "dependencies": [ "negate :: Num a => a -> a", "ltInt :: Int -> Int -> Bool", "eqInt :: Int -> Int -> Bool", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Char", "poly_type": "Monomorphic", "signature": "pred :: Char -> Char", "code": "pred c = chr (ord c - one)", "dependencies": [ "chr :: Int -> Char", "ord :: Char -> Int", "(-) :: Num a => a -> a -> a", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--tanh", "poly_type": "Ad-hoc", "signature": "tanh :: Floating a => a -> a", "code": "tanh x = sinh x / cosh x", "dependencies": [ "sinh :: Floating a => a -> a", "cosh :: Floating a => a -> a", "(/) :: Fractional a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Bool", "poly_type": "Monomorphic", "signature": "toEnum :: Int -> Bool", "code": "toEnum n | n == zero = False\n | n == one = True\n | otherwise = error \"bad argument\"", "dependencies": [ "data Bool = False | True", "(==) :: Eq a => a -> a -> Bool", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--curry", "poly_type": "Parametric", "signature": "curry :: ((a, b) -> c) -> a -> b -> c", "code": "curry f x y = f (x, y)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--truncate", "poly_type": "Ad-hoc", "signature": "truncate :: (RealFrac a, Integral b) => a -> b", "code": "truncate x = fst (properFraction x)", "dependencies": [ "fst :: (a, b) -> a", "properFraction :: (RealFrac a, Integral b) => a -> (b, a)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--significand", "poly_type": "Ad-hoc", "signature": "significand :: RealFloat a => a -> a", "code": "significand x = encodeFloat m (negate (floatDigits x))\n where (m,_) = decodeFloat x", "dependencies": [ "encodeFloat :: RealFloat a => Integer -> Int -> a", "decodeFloat :: RealFloat a => a -> (Integer, Int)", "floatDigits :: RealFloat a => a -> Int", "negate :: Num a => a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--repeat", "poly_type": "Parametric", "signature": "repeat :: a -> [a]", "code": "repeat x = xs where xs = x : xs", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--null", "poly_type": "Parametric", "signature": "null :: [a] -> Bool", "code": "null [] = True\nnull (_:_) = False", "dependencies": [ "data Bool = False | True" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-Maybe", "poly_type": "Parametric", "signature": "fmap :: (a -> b) -> Maybe a -> Maybe b", "code": "fmap _ Nothing = Nothing\nfmap f (Just a) = Just (f a)", "dependencies": [ "data Maybe a = Nothing | Just a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--notElem", "poly_type": "Ad-hoc", "signature": "notElem :: (Foldable t, Eq a) => a -> t a -> Bool", "code": "notElem x = not . elem x", "dependencies": [ "elem :: (Foldable t, Eq a) => a -> t a -> Bool", "not :: Bool -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Show.hs--showsPrec", "poly_type": "Ad-hoc", "signature": "showsPrec :: Show a => Int -> a -> ShowS", "code": "showsPrec _ x s = show x ++ s", "dependencies": [ "show ::Show a => a -> String", "(++) :: [a] -> [a] -> [a]", "type ShowS = String -> String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--map", "poly_type": "Parametric", "signature": "map :: (a -> b) -> [a] -> [b]", "code": "map _ [] = []\nmap f (x:xs) = f x : map f xs", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--sum", "poly_type": "Ad-hoc", "signature": "sum :: (Foldable t, Num a) => t a -> a", "code": "sum = getSum #. foldMap' Sum", "dependencies": [ "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}" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--reverse", "poly_type": "Parametric", "signature": "reverse :: [a] -> [a]", "code": "reverse = foldl (flip (:)) []", "dependencies": [ "foldl :: (b -> a -> b) -> b -> [a] -> b", "flip :: (a -> b -> c) -> b -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--sqrt", "poly_type": "Ad-hoc", "signature": "sqrt :: Floating a => a -> a", "code": "sqrt x = x ** oneHalf", "dependencies": [ "(**) :: Floating a => a -> a -> a", "oneHalf :: Floating a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--realToFrac", "poly_type": "Ad-hoc", "signature": "realToFrac :: (Real a, Fractional b) => a -> b", "code": "realToFrac = fromRational . toRational", "dependencies": [ "fromRational :: Fractional a => Rational -> a", "toRational :: Real a => a -> Rational", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Ordering", "poly_type": "Monomorphic", "signature": "fromEnum :: Ordering -> Int", "code": "fromEnum LT = zero\nfromEnum EQ = one\nfromEnum GT = two", "dependencies": [ "data Ordering = LT | EQ | GT", "zero :: Int", "one :: Int", "two :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--round", "poly_type": "Ad-hoc", "signature": "round :: (RealFrac a, Integral b) => a -> b", "code": "round x =\n let (n, r) = properFraction x\n m = if r < zero then n - one else n + one\n in case signum (abs r - oneHalf) of\n negOne -> n\n zero -> if even n then n else m\n one -> m\n _ -> error \"Bad value\"", "dependencies": [ "properFraction :: (RealFrac a, Integral b) => a -> (b, a)", "abs :: Num a => a -> a", "(+) :: Num a => a -> a -> a", "(-) :: Num a => a -> a -> a", "signum :: Num a => a -> a", "even :: Integral a => a -> Bool", "(<) :: Ord a => a -> a -> Bool", "oneHalf :: Fractional a => a", "zero :: Num a => a", "one :: Num a => a", "negOne :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--rem", "poly_type": "Ad-hoc", "signature": "rem :: Integral a => a -> a -> a", "code": "n `rem` d = snd (quotRem n d)", "dependencies": [ "snd :: (a, b) -> b", "quotRem :: Integral a => a -> a -> (a, a)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--iterate", "poly_type": "Parametric", "signature": "iterate :: (a -> a) -> a -> [a]", "code": "iterate f x = x : iterate f (f x)", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--splitAt", "poly_type": "Parametric", "signature": "splitAt :: Int -> [a] -> ([a],[a])", "code": "splitAt n xs = (take n xs, drop n xs)", "dependencies": [ "take :: Int -> [a] -> [a]", "drop :: Int -> [a] -> [a]" ] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(/=)", "poly_type": "Ad-hoc", "signature": "(/=) :: Eq a => a -> a -> Bool", "code": "x /= y = not (x == y)", "dependencies": [ "not :: Bool -> Bool", "(==) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--putStrLn", "poly_type": "Monomorphic", "signature": "putStrLn :: String -> IO ()", "code": "putStrLn s = hPutStrLn stdout s", "dependencies": [ "hPutStrLn :: Handle -> String -> IO ()", "stdout :: Handle" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/OldList.hs--unwords", "poly_type": "Monomorphic", "signature": "unwords :: [String] -> String", "code": "unwords [] = emptyStr\nunwords ws = foldr1 (\\w s -> w ++ space:s) ws", "dependencies": [ "(++) :: [a] -> [a] -> [a]", "foldr1 :: Foldable t => (a -> a -> a) -> t a -> a", "space :: Char", "emptyStr :: String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--liftA2", "poly_type": "Ad-hoc", "signature": "liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c", "code": "liftA2 f x = (<*>) (fmap f x)", "dependencies": [ "(<*>) :: f (a -> b) -> f a -> f b", "fmap :: (a -> b) -> f a -> f b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--toRational-Int", "poly_type": "Monomorphic", "signature": "toRational :: Int -> Rational", "code": "toRational x = toInteger x :% one", "dependencies": [ "toInteger :: Int -> Integer", "one :: Integer", "data Ratio a = !a :% !a", "type Rational = Ratio Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Char", "poly_type": "Monomorphic", "signature": "fromEnum :: Char -> Int", "code": "fromEnum = ord", "dependencies": [ "ord :: Char -> Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--mempty", "poly_type": "Ad-hoc", "signature": "mempty :: Monoid a => a", "code": "mempty = mconcat []", "dependencies": [ "mconcat :: Monoid a => [a] -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--(**)", "poly_type": "Ad-hoc", "signature": "(**) :: Floating a => a -> a -> a", "code": "x ** y = exp (log x * y)", "dependencies": [ "exp :: Floating a => a -> a", "log :: Floating a => a -> a", "(*) :: Num a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--break", "poly_type": "Parametric", "signature": "break :: (a -> Bool) -> [a] -> ([a],[a])", "code": "break p = span (not . p)", "dependencies": [ "span :: (a -> Bool) -> [a] -> ([a],[a])", "not :: Bool -> Bool", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--scanr1", "poly_type": "Parametric", "signature": "scanr1 :: (a -> a -> a) -> [a] -> [a]", "code": "scanr1 _ [] = []\nscanr1 _ [x] = [x]\nscanr1 f (x:xs) = f x q : qs\n where qs@(q:_) = scanr1 f xs", "dependencies": [] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(<=)", "poly_type": "Ad-hoc", "signature": "(<=) :: Ord a => a -> a -> Bool", "code": "x <= y = case compare x y of { GT -> False; _ -> True }", "dependencies": [ "compare :: Ord a => a -> a -> Ordering", "data Ordering = LT | EQ | GT" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ-Int", "poly_type": "Monomorphic", "signature": "succ :: Int -> Int", "code": "succ x = x + one", "dependencies": [ "(+) :: Ord a => a -> a -> a", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--div", "poly_type": "Ad-hoc", "signature": "div :: Integral a => a -> a -> a", "code": "n `div` d = fst (divMod n d)", "dependencies": [ "fst :: (a, b) -> a", "divMod :: Integral a => a -> a -> (a, a)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--ceiling", "poly_type": "Ad-hoc", "signature": "ceiling :: (RealFrac a, Integral b) => a -> b", "code": "ceiling x = if r > zero then n + one else n\n where (n,r) = properFraction x", "dependencies": [ "properFraction :: (RealFrac a, Integral b) => a -> (b, a)", "(+) :: Num a => a -> a -> a", "(>) :: Ord a => a -> a -> Bool", "zero :: Num a => a", "one :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-Maybe", "poly_type": "Ad-hoc", "signature": "foldMap :: Monoid m => (a -> m) -> Maybe a -> m", "code": "foldMap = maybe mempty", "dependencies": [ "maybe :: b -> (a -> b) -> Maybe a -> b", "mempty :: Monoid m => m" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/OldList.hs--words", "poly_type": "Monomorphic", "signature": "words :: String -> [String]", "code": "words s = case dropWhile isSpace s of\n emptyStr -> []\n s' -> w : words s''\n where (w, s'') = break isSpace s'", "dependencies": [ "break :: (a -> Bool) -> [a] -> ([a],[a])", "dropWhile :: (a -> Bool) -> [a] -> [a]", "isSpace :: Char -> Bool", "emptyStr :: String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--putStr", "poly_type": "Monomorphic", "signature": "putStr :: String -> IO ()", "code": "putStr s = hPutStr stdout s", "dependencies": [ "hPutStr :: Handle -> String -> IO ()", "stdout :: Handle" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--length", "poly_type": "Parametric", "signature": "length :: [a] -> Int", "code": "length xs = lenAcc xs zero", "dependencies": [ "lenAcc :: [a] -> Int -> Int", "zero :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--replicate", "poly_type": "Parametric", "signature": "replicate :: Int -> a -> [a]", "code": "replicate n x = take n (repeat x)", "dependencies": [ "take :: Int -> [a] -> [a]", "repeat :: a -> [a]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--abs-Int", "poly_type": "Monomorphic", "signature": "abs :: Int -> Int", "code": "abs n = if n > zero then n else negate n", "dependencies": [ "(>) :: Ord a => a -> a -> Bool", "negate :: Num a => a -> a", "zero :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Tuple.hs--uncurry", "poly_type": "Parametric", "signature": "uncurry :: (a -> b -> c) -> ((a, b) -> c)", "code": "uncurry f p = f (fst p) (snd p)", "dependencies": [ "snd :: (a,b) -> b", "fst :: (a,b) -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--exponent", "poly_type": "Ad-hoc", "signature": "exponent :: RealFloat a => a -> Int", "code": "exponent x = if m == zero then zero else n + floatDigit \n where (m,n) = decodeFloat x", "dependencies": [ "decodeFloat :: RealFloat a => a -> (Integer, Int)", "floatDigits :: RealFloat a => a -> Int", "(+) :: Num a => a -> a -> a", "(==) :: Eq a => a -> a -> Bool", "zero :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--properFraction", "poly_type": "Ad-hoc", "signature": "properFraction :: (RealFrac a, Integral b) => a -> (b,a)", "code": "properFraction (x:%y) = (fromInteger (toInteger q), r:%y)\n where (q,r) = quotRem x y", "dependencies": [ "quotRem :: Integral a => a -> a -> (a,a)", "toInteger :: Integral => a -> Integer", "fromInteger :: Integral => Integer -> a", "data Ratio a = !a :% !a", "type Rational = Ratio Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--pure-(,)", "poly_type": "Parametric", "signature": "pure :: a0 -> (a, a0)", "code": "pure x = (mempty, x)", "dependencies": [ "mempty :: a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Show.hs--showList", "poly_type": "Ad-hoc", "signature": "showList :: Show a => [a] -> ShowS", "code": "showList ls s = showList__ shows ls s", "dependencies": [ "showList__ :: (a -> ShowS) -> [a] -> ShowS", "shows :: Show a => a -> ShowS", "type ShowS = String -> String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--lookup", "poly_type": "Ad-hoc", "signature": "lookup :: (Eq a) => a -> [(a,b)] -> Maybe b", "code": "lookup _key [] = Nothing\nlookup key ((x,y):xys)\n | key == x = Just y\n | otherwise = lookup key xys", "dependencies": [ "data Maybe a = Nothing | Just a", "(==) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isInfinite-Double", "poly_type": "Monomorphic", "signature": "isInfinite :: Double -> Bool", "code": "isInfinite x = 0 /= isDoubleInfinite x", "dependencies": [ "isDoubleInfinite :: Double -> Int", "(/=) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--(!!)", "poly_type": "Parametric", "signature": "(!!) :: [a] -> Int -> a", "code": "xs !! n | n < zero = error \"negative index\"\n[] !! _ = error \"too large\"\n(x:_) !! zero = x\n(_:xs) !! n = xs !! (n-one)", "dependencies": [ "(<) :: Ord a => a -> a -> Bool", "(-) :: Num a => a -> a -> a", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Traversable.hs--traverse", "poly_type": "Ad-hoc", "signature": "traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)", "code": "traverse f = sequenceA . fmap f", "dependencies": [ "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" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--filter", "poly_type": "Parametric", "signature": "filter :: (a -> Bool) -> [a] -> [a]", "code": "filter f [] = []\nfilter f (x:xs)\n | f x = x : filter f xs\n | otherwise = filter f xs", "dependencies": [] }, { "task_id": "data/repos/ghc/libraries/ghc-prim/GHC/Classes.hs--(==)", "poly_type": "Ad-hoc", "signature": "(==) :: Eq a => a -> a -> Bool", "code": "x == y = not (x /= y)", "dependencies": [ "not :: Bool -> Bool", "(/=) :: Eq a => a -> a -> Bool" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--fromEnum-Bool", "poly_type": "Monomorphic", "signature": "fromEnum :: Bool -> Int", "code": "fromEnum False = zero\nfromEnum True = one", "dependencies": [ "data Bool = False | True", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--toRational-Natural", "poly_type": "Monomorphic", "signature": "toRational :: Natural -> Rational", "code": "toRational n = integerFromNatural n :% one", "dependencies": [ "integerFromNatural :: Natural -> Integer", "one :: Integer", "data Ratio a = !a :% !a", "type Rational = Ratio Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--tan", "poly_type": "Ad-hoc", "signature": "tan :: Floating a => a -> a", "code": "tan x = sin x / cos x", "dependencies": [ "sin :: Floating a => a -> a", "cos :: Floating a => a -> a", "(/) :: Fractional a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(<$)", "poly_type": "Ad-hoc", "signature": "(<$) :: Functor f => a -> f b -> f a", "code": "(<$) = fmap . const", "dependencies": [ "fmap :: Functor f => (a -> b) -> f a -> f b", "const :: a -> b -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--mconcat-[]", "poly_type": "Parametric", "signature": "mconcat :: [[a]] -> a", "code": "mconcat xss = [x | xs <- xss, x <- xs]", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-(,)", "poly_type": "Ad-hoc", "signature": "foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m", "code": "foldMap f (_, y) = f y", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--gcd", "poly_type": "Ad-hoc", "signature": "gcd :: Integral a => a -> a -> a", "code": "gcd x y = gcd' (abs x) (abs y)\n where \n gcd' a zero = a\n gcd' a b = gcd' b (a `rem` b)", "dependencies": [ "abs :: Num a => a -> a", "rem :: Integral a => a -> a -> a", "zero :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldr", "poly_type": "Ad-hoc", "signature": "foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b", "code": "foldr f z t = appEndo (foldMap (Endo #. f) t) z", "dependencies": [ "appEndo :: Endo a -> a -> a", "foldMap :: Monoid m => (a -> m) -> t a -> m", "(#.) :: Coercible b c => (b -> c) -> (a -> b) -> (a -> c)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--floatRadix-Float", "poly_type": "Monomorphic", "signature": "floatRadix :: Float -> Integer", "code": "floatRadix x = flt_radix", "dependencies": [ "flt_radix :: Integer", "x :: Float" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-[]", "poly_type": "Parametric", "signature": "fmap :: (a -> b) -> [a] -> [b]", "code": "fmap = map", "dependencies": [ "map :: (a -> b) -> [a] -> [b]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--take", "poly_type": "Parametric", "signature": "take :: Int -> [a] -> [a]", "code": "take _ [] = []\ntake n (x:xs) = x : take (n-one) xs\ntake n _ | n <= zero = []", "dependencies": [ "(<=) :: Ord a => a -> a -> Bool", "(-) :: Num a => a -> a -> a", "zero :: Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--all", "poly_type": "Ad-hoc", "signature": "all :: Foldable t => (a -> Bool) -> t a -> Bool", "code": "all p = getAll #. foldMap (All #. p)", "dependencies": [ "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 }" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Ordering", "poly_type": "Monomorphic", "signature": "toEnum :: Int -> Ordering", "code": "toEnum n | n == zero = LT\n | n == one = EQ\n | n == two = GT\n | otherwise = error \"bad argument\"", "dependencies": [ "data Ordering = LT | EQ | GT", "(==) :: Eq a => a -> a -> Bool", "zero :: Int", "one :: Int", "two :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred", "poly_type": "Ad-hoc", "signature": "pred :: Enum a => a -> a", "code": "pred = toEnum . (subtract one) . fromEnum", "dependencies": [ "toEnum :: Enum a => Int -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "subtract :: Num a => a -> a -> a", "fromEnum :: Enum a => a -> Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(*>)", "poly_type": "Ad-hoc ", "signature": "(*>) :: Applicative f => f a -> f b -> f b", "code": "a1 *> a2 = (id <$ a1) <*> a2", "dependencies": [ "id :: a -> a", "(<$) :: Functor f => a -> f b -> f a", "(<*>) :: Applicative f => f (a -> b) -> f a -> f b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--last", "poly_type": "Parametric", "signature": "last :: [a] -> a", "code": "last (_:xs) = last xs\nlast [] = error\nlast [x] = x", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--zip3", "poly_type": "Parametric", "signature": "zip3 :: [a] -> [b] -> [c] -> [(a,b,c)]", "code": "zip3 (a:as) (b:bs) (c:cs) = (a,b,c) : zip3 as bs cs\nzip3 _ _ _ = []", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Show.hs--showParen", "poly_type": "Monomorphic", "signature": "showParen :: Bool -> ShowS -> ShowS", "code": "showParen b p = if b then showChar leftParenthesis . p . showChar rightParenthesis else p", "dependencies": [ "showChar :: Char -> ShowS", "(.) :: (b -> c) -> (a -> b) -> a -> c", "leftParenthesis :: Char", "rightParenthesis :: Char", "type ShowS = String -> String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--pred-Int", "poly_type": "Monomorphic", "signature": "pred :: Int -> Int", "code": "pred x = x - one", "dependencies": [ "(-) :: Num a => a -> a -> a", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldl", "poly_type": "Parametric", "signature": "foldl :: (b -> a -> b) -> b -> t a -> b", "code": "foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z", "dependencies": [ "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)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--lcm", "poly_type": "Ad-hoc", "signature": "lcm :: Integral a => a -> a -> a", "code": "lcm zero _ = zero\nlcm _ zero = zero\nlcm x y = abs ((x `quot` (gcd x y)) * y)", "dependencies": [ "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" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--succ", "poly_type": "Ad-hoc", "signature": "succ :: Enum a => a -> a", "code": "succ = toEnum . (+ one) . fromEnum", "dependencies": [ "toEnum :: Enum a => Int -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "(+) :: Num a => a -> a -> a", "fromEnum :: Enum a => a -> Int", "one :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Enum.hs--toEnum-Char", "poly_type": "Monomorphic", "signature": "toEnum :: Int -> Char", "code": "toEnum = chr", "dependencies": [ "chr :: Int -> Char" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--abs-Natural", "poly_type": "Monomorphic", "signature": "abs :: Natural -> Natural", "code": "abs x = id x", "dependencies": [ "id :: a -> a", "x :: Natural" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Generics.hs--fmap-Either", "poly_type": "Parametric", "signature": "fmap :: (a0 -> b) -> Either a a0 -> Either a b", "code": "fmap _ (Left x) = Left x\nfmap f (Right y) = Right (f y)", "dependencies": [ "data Either a b = Left a | Right b" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--any", "poly_type": "Ad-hoc", "signature": "any :: Foldable t => (a -> Bool) -> t a -> Bool", "code": "any p = getAny #. foldMap (Any #. p)", "dependencies": [ "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}" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--cycle", "poly_type": "Parametric", "signature": "cycle :: [a] -> [a]", "code": "cycle [] = error\ncycle xs = xs' where xs' = xs ++ xs'", "dependencies": [ "(++) :: [a] -> [a] -> [a]" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Traversable.hs--sequenceA", "poly_type": "Ad-hoc", "signature": "sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)", "code": "sequenceA = traverse id", "dependencies": [ "traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)", "id :: a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--head", "poly_type": "Parametric", "signature": "head :: [a] -> a", "code": "head (x:_) = x\nhead [] = error \"empty\"", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--isInfinite-Float", "poly_type": "Monomorphic", "signature": "isInfinite :: Float -> Bool", "code": "isInfinite x = zero /= isFloatInfinite x", "dependencies": [ "isFloatInfinite :: Float -> Int", "(/=) :: Eq a => a -> a -> Bool", "zero :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--(<*)", "poly_type": "Ad-hoc ", "signature": "(<*) :: Applicative f => f a -> f b -> f a", "code": "(<*) = liftA2 const", "dependencies": [ "liftA2 :: Applicative f => (a -> b -> c) -> f a -> f b -> f c", "const :: a -> b -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Show.hs--show", "poly_type": "Ad-hoc", "signature": "show :: Show a => a -> String", "code": "show x = shows x emptyStr", "dependencies": [ "shows :: (Show a) => a -> ShowS", "type ShowS = String -> String", "emptyStr :: String" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/List.hs--zip", "poly_type": "Parametric", "signature": "zip :: [a] -> [b] -> [(a,b)]", "code": "zip (a:as) (b:bs) = (a,b) : zip as bs\nzip [] _bs = []\nzip _as [] = []", "dependencies": [] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--negate", "poly_type": "Ad-hoc", "signature": "negate :: Num a => a -> a", "code": "negate x = zero - x", "dependencies": [ "(-) :: Num a => a -> a -> a", "zero :: Num a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--mod", "poly_type": "Ad-hoc", "signature": "mod :: Integral a => a -> a -> a", "code": "n `mod` d = snd (divMod n d)", "dependencies": [ "snd :: (a, b) -> b", "divMod :: Integral a => a -> a -> (a, a)" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--floor", "poly_type": "Ad-hoc", "signature": "floor :: (RealFrac a, Integral b) => a -> b", "code": "floor x = if r < zero then n - one else n\n where (n,r) = properFraction x", "dependencies": [ "properFraction :: (RealFrac a, Integral b) => a -> (b, a)", "(-) :: Num a => a -> a -> a", "(<) :: Ord a => a -> a -> Bool", "zero :: Num a => a", "one :: Num a => a" ] }, { "task_id": "data/repos/libraries/ghc-prim/GHC/Classes.hs--compare", "poly_type": "Ad-hoc", "signature": "compare :: Ord a => a -> a -> Ordering", "code": "compare x y = if x == y then EQ\n else if x <= y then LT\n else GT", "dependencies": [ "(==) :: Eq a => a -> a -> Bool", "(<=) :: Ord a => a -> a -> Bool", "data Ordering = LT | EQ | GT" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/System/IO.hs--appendFile", "poly_type": "Monomorphic", "signature": "appendFile :: FilePath -> String -> IO ()", "code": "appendFile f txt = withFile f AppendMode (\\ hdl -> hPutStr hdl txt)", "dependencies": [ "hPutStr :: Handle -> String -> IO ()", "withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r", "data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Num.hs--negate-Int", "poly_type": "Monomorphic", "signature": "negate :: Int -> Int", "code": "negate x = zero - x", "dependencies": [ "(-) :: Num a => a -> a -> a", "zero :: Int" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--logBase", "poly_type": "Ad-hoc", "signature": "logBase :: Floating a => a -> a -> a", "code": "logBase x y = log y / log x", "dependencies": [ "log :: Floating a => a -> a", "(/) :: Fractional a => a -> a -> a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Float.hs--scaleFloat", "poly_type": "Ad-hoc", "signature": "scaleFloat :: RealFloat a => Int -> a -> a", "code": "scaleFloat zero x = x\nscaleFloat zero x = x\nscaleFloat zero x = x\nscaleFloat k x\n | isFix = x\n | otherwise = encodeFloat m (n + clamp b k)\n where (m,n) = decodeFloat x\n (l,h) = floatRange x\n d = floatDigits x\n b = h - l + four*d\n isFix = x == zero || isNaN x || isInfinite x", "dependencies": [ "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" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Real.hs--toRational-Integer", "poly_type": "Monomorphic", "signature": "toRational :: Integer -> Rational", "code": "toRational x = x :% one", "dependencies": [ "one :: Integer", "data Ratio a = !a :% !a", "type Rational = Ratio Integer" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Base.hs--mconcat", "poly_type": "Ad-hoc", "signature": "mconcat :: Monoid a => [a] -> a", "code": "mconcat = foldr mappend mempty", "dependencies": [ "foldr :: (a -> b -> b) -> b -> [a] -> b", "mappend :: Monoid a => a -> a -> a", "mempty :: Monoid a => a" ] }, { "task_id": "data/repos/ghc-internal-9.1001.0/src/GHC/Internal/Data/Foldable.hs--foldMap-List", "poly_type": "Ad-hoc", "signature": "foldMap :: Monoid m => (a -> m) -> [a] -> m", "code": "foldMap = (mconcat .) . map", "dependencies": [ "mconcat :: Monoid a => [a] -> a", "(.) :: (b -> c) -> (a -> b) -> a -> c", "map :: (a -> b) -> [a] -> [b]" ] } ]