{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE Trustworthy #-}
module Prelude (
Bool(False, True),
(&&), (||), not, otherwise,
Maybe(Nothing, Just),
maybe,
Either(Left, Right),
either,
Ordering(LT, EQ, GT),
Char, String,
fst, snd, curry, uncurry,
Eq((==), (/=)),
Ord(compare, (<), (<=), (>=), (>), max, min),
Enum(succ, pred, toEnum, fromEnum, enumFrom, enumFromThen,
enumFromTo, enumFromThenTo),
Bounded(minBound, maxBound),
Int, Integer, Float, Double,
Rational, Word,
Num((+), (-), (*), negate, abs, signum, fromInteger),
Real(toRational),
Integral(quot, rem, div, mod, quotRem, divMod, toInteger),
Fractional((/), recip, fromRational),
Floating(pi, exp, log, sqrt, (**), logBase, sin, cos, tan,
asin, acos, atan, sinh, cosh, tanh, asinh, acosh, atanh),
RealFrac(properFraction, truncate, round, ceiling, floor),
RealFloat(floatRadix, floatDigits, floatRange, decodeFloat,
encodeFloat, exponent, significand, scaleFloat, isNaN,
isInfinite, isDenormalized, isIEEE, isNegativeZero, atan2),
subtract, even, odd, gcd, lcm, (^), (^^),
fromIntegral, realToFrac,
Functor(fmap),
Applicative(pure, liftA2, (<*>), (<*), (*>)),
Monad((>>=)),
MonadFail(fail),
(>>), return, mapM, mapM_, sequence, sequence_, (=<<),
id, const, (.), flip, ($), until,
asTypeOf, error, undefined,
seq, ($!),
map, (++), filter,
head, last, tail, init, null, length, (!!),
reverse,
foldl, foldl1, foldr, foldr1,
and, or, any, all,
sum, product,
concat, concatMap,
maximum, minimum,
scanl, scanl1, scanr, scanr1,
iterate, repeat, replicate, cycle,
take, drop, splitAt, takeWhile, dropWhile, span, break,
elem, notElem, lookup,
zip, zip3, zipWith, zipWith3, unzip, unzip3,
lines, words, unlines, unwords,
ShowS,
Show(showsPrec, showList, show),
shows,
showChar, showString, showParen,
ReadS,
Read(readsPrec, readList),
reads, readParen, read, lex,
IO,
putChar,
putStr, putStrLn, print,
getChar,
getLine, getContents, interact,
FilePath,
readFile, writeFile, appendFile, readIO, readLn,
IOError, ioError, userError, catch
) where
import "base" Control.Applicative
import qualified "base" Control.Exception.Base as New (catch)
import "this" Control.Monad
import "base" Data.Either
import "this" Data.List
import "base" Data.Maybe
import "base" Data.Tuple
import "base" System.IO
import "base" System.IO.Error (IOError, ioError, userError)
import GHC.Base (Bool (..), Char, Eq (..), Int,
Ord (..), Ordering (..), String,
Word, asTypeOf, const, error,
flip, id, not, otherwise, seq,
undefined, until, ($), ($!),
(&&), (.), (||))
import GHC.Enum
import GHC.Float
import GHC.List (all, and, any, break, concat,
concatMap, cycle, drop,
dropWhile, elem, filter, foldl,
foldl1, foldr, foldr1, head,
init, iterate, last, length,
lookup, map, maximum, minimum,
notElem, null, or, product,
repeat, replicate, reverse,
scanl, scanl1, scanr, scanr1,
span, sum, tail, take,
takeWhile, unzip, unzip3, zip,
zip3, zipWith, zipWith3, (!!),
(++))
import GHC.Num
import GHC.Real hiding (gcd)
import qualified GHC.Real (gcd)
import GHC.Show
import Text.Read
catch :: IO a -> (IOError -> IO a) -> IO a
catch = New.catch
gcd :: (Integral a) => a -> a -> a
gcd 0 0 = error "Prelude.gcd: gcd 0 0 is undefined"
gcd x y = GHC.Real.gcd x y