Safe Haskell | Trustworthy |
---|---|
Language | Haskell2010 |
Distribution.Compat.Prelude
Contents
- Prelude
- Common type-classes
- Some types
- Data.Either
- Data.Maybe
- Data.List
- Data.List.NonEmpty
- Data.Foldable
- Data.Traversable
- Data.Function
- Data.Ord
- Control.Arrow
- Control.Monad
- Control.Exception
- Control.DeepSeq
- Data.Char
- Data.Void
- Data.Word & Data.Int
- Text.PrettyPrint
- System.Exit
- Text.Read
- Debug.Trace (as deprecated functions)
Description
This module does two things:
- Acts as a compatibility layer, like
base-compat
. - Provides commonly used imports.
Synopsis
- ($) :: (a -> b) -> a -> b
- ($!) :: (a -> b) -> a -> b
- (++) :: [a] -> [a] -> [a]
- (.) :: (b -> c) -> (a -> b) -> a -> c
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- asTypeOf :: a -> a -> a
- const :: a -> b -> a
- flip :: (a -> b -> c) -> b -> a -> c
- id :: a -> a
- map :: (a -> b) -> [a] -> [b]
- otherwise :: Bool
- until :: (a -> Bool) -> (a -> a) -> a -> a
- (&&) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- and :: Foldable t => t Bool -> Bool
- concat :: Foldable t => t [a] -> [a]
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- or :: Foldable t => t Bool -> Bool
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- maybe :: b -> (a -> b) -> Maybe a -> b
- lines :: String -> [String]
- unlines :: [String] -> String
- unwords :: [String] -> String
- words :: String -> [String]
- curry :: ((a, b) -> c) -> a -> b -> c
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- uncurry :: (a -> b -> c) -> (a, b) -> c
- error :: HasCallStack => [Char] -> a
- errorWithoutStackTrace :: [Char] -> a
- undefined :: HasCallStack => a
- ioError :: HasCallStack => IOError -> IO a
- userError :: String -> IOError
- (!!) :: HasCallStack => [a] -> Int -> a
- break :: (a -> Bool) -> [a] -> ([a], [a])
- cycle :: HasCallStack => [a] -> [a]
- drop :: Int -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- filter :: (a -> Bool) -> [a] -> [a]
- iterate :: (a -> a) -> a -> [a]
- lookup :: Eq a => a -> [(a, b)] -> Maybe 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]
- span :: (a -> Bool) -> [a] -> ([a], [a])
- splitAt :: Int -> [a] -> ([a], [a])
- take :: Int -> [a] -> [a]
- takeWhile :: (a -> Bool) -> [a] -> [a]
- unzip :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- 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]
- subtract :: Num a => a -> a -> a
- lex :: ReadS String
- readParen :: Bool -> ReadS a -> ReadS a
- (^) :: (Num a, Integral b) => a -> b -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- even :: Integral a => a -> Bool
- fromIntegral :: (Integral a, Num b) => a -> b
- gcd :: Integral a => a -> a -> a
- lcm :: Integral a => a -> a -> a
- odd :: Integral a => a -> Bool
- realToFrac :: (Real a, Fractional b) => a -> b
- showChar :: Char -> ShowS
- showParen :: Bool -> ShowS -> ShowS
- showString :: String -> ShowS
- shows :: Show a => a -> ShowS
- appendFile :: FilePath -> String -> IO ()
- getChar :: IO Char
- getContents :: IO String
- getLine :: IO String
- interact :: (String -> String) -> IO ()
- print :: Show a => a -> IO ()
- putChar :: Char -> IO ()
- putStr :: String -> IO ()
- putStrLn :: String -> IO ()
- readFile :: FilePath -> IO String
- readIO :: Read a => String -> IO a
- readLn :: Read a => IO a
- writeFile :: FilePath -> String -> IO ()
- reads :: Read a => ReadS a
- seq :: a -> b -> b
- class Functor f => Applicative (f :: Type -> Type) where
- class Functor (f :: Type -> Type) where
- class Applicative m => Monad (m :: Type -> Type) where
- class Semigroup a => Monoid a where
- class Eq a where
- class Eq a => Ord a where
- class Monad m => MonadFail (m :: Type -> Type) where
- data Either a b
- elem :: (Foldable t, Eq a) => a -> t a -> Bool
- foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b
- maximum :: (Foldable t, Ord a) => t a -> a
- minimum :: (Foldable t, Ord a) => t a -> a
- product :: (Foldable t, Num a) => t a -> a
- sum :: (Foldable t, Num a) => t a -> a
- class Bounded a where
- 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]
- class Fractional a => Floating a where
- 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
- type FilePath = String
- type IOError = IOException
- class Num a where
- class Read a where
- class Num a => Fractional a where
- (/) :: a -> a -> a
- recip :: a -> a
- fromRational :: Rational -> a
- class (Real a, Enum a) => Integral a where
- type Rational = Ratio Integer
- class (Num a, Ord a) => Real a where
- toRational :: a -> Rational
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- type ShowS = String -> String
- type ReadS a = String -> [(a, String)]
- data IO a
- data Ordering
- type String = [Char]
- data Integer
- data Maybe a
- data Bool
- data Char
- data Double
- data Float
- data Int
- class a ~# b => (a :: k) ~ (b :: k)
- class Semigroup a where
- (<>) :: a -> a -> a
- gmappend :: (Generic a, GSemigroup (Rep a)) => a -> a -> a
- gmempty :: (Generic a, GMonoid (Rep a)) => a
- class Typeable (a :: k)
- type TypeRep = SomeTypeRep
- typeRep :: forall {k} proxy (a :: k). Typeable a => proxy a -> TypeRep
- class Typeable a => Data a
- class Generic a
- class NFData a where
- rnf :: a -> ()
- genericRnf :: (Generic a, GNFData (Rep a)) => a -> ()
- class Binary t where
- class Typeable a => Structured a
- class Applicative f => Alternative (f :: Type -> Type) where
- class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
- class IsString a where
- fromString :: String -> a
- data Map k a
- data Set a
- data NonEmptySet a
- newtype Identity a = Identity {
- runIdentity :: a
- data Proxy (t :: k) = Proxy
- newtype Const a (b :: k) = Const {
- getConst :: a
- data Void
- partitionEithers :: [Either a b] -> ([a], [b])
- catMaybes :: [Maybe a] -> [a]
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- fromMaybe :: a -> Maybe a -> a
- maybeToList :: Maybe a -> [a]
- listToMaybe :: [a] -> Maybe a
- isNothing :: Maybe a -> Bool
- isJust :: Maybe a -> Bool
- unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- isPrefixOf :: Eq a => [a] -> [a] -> Bool
- isSuffixOf :: Eq a => [a] -> [a] -> Bool
- intercalate :: [a] -> [[a]] -> [a]
- intersperse :: a -> [a] -> [a]
- sort :: Ord a => [a] -> [a]
- sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- nub :: Eq a => [a] -> [a]
- nubBy :: (a -> a -> Bool) -> [a] -> [a]
- partition :: (a -> Bool) -> [a] -> ([a], [a])
- dropWhileEnd :: (a -> Bool) -> [a] -> [a]
- data NonEmpty a = a :| [a]
- nonEmpty :: [a] -> Maybe (NonEmpty a)
- foldl1 :: (a -> a -> a) -> NonEmpty a -> a
- foldr1 :: (a -> a -> a) -> NonEmpty a -> a
- head :: NonEmpty a -> a
- tail :: NonEmpty a -> [a]
- last :: NonEmpty a -> a
- init :: NonEmpty a -> [a]
- class Foldable (t :: Type -> Type)
- foldMap :: (Foldable t, Monoid m) => (a -> m) -> t a -> m
- foldr :: Foldable t => (a -> b -> b) -> b -> t a -> b
- null :: Foldable t => t a -> Bool
- length :: Foldable t => t a -> Int
- find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- foldl' :: Foldable t => (b -> a -> b) -> b -> t a -> b
- traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- toList :: Foldable t => t a -> [a]
- class (Functor t, Foldable t) => Traversable (t :: Type -> Type)
- traverse :: (Traversable t, Applicative f) => (a -> f b) -> t a -> f (t b)
- sequenceA :: (Traversable t, Applicative f) => t (f a) -> f (t a)
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- first :: Arrow a => a b c -> a (b, d) (c, d)
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- unless :: Applicative f => Bool -> f () -> f ()
- when :: Applicative f => Bool -> f () -> f ()
- ap :: Monad m => m (a -> b) -> m a -> m b
- void :: Functor f => f a -> f ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- join :: Monad m => m (m a) -> m a
- guard :: Alternative f => Bool -> f ()
- catch :: Exception e => IO a -> (e -> IO a) -> IO a
- throwIO :: (HasCallStack, Exception e) => e -> IO a
- evaluate :: a -> IO a
- class (Typeable e, Show e) => Exception e where
- toException :: e -> SomeException
- fromException :: SomeException -> Maybe e
- displayException :: e -> String
- backtraceDesired :: e -> Bool
- data IOException
- data SomeException = (Exception e, HasExceptionContext) => SomeException e
- tryIO :: IO a -> IO (Either IOException a)
- catchIO :: IO a -> (IOException -> IO a) -> IO a
- catchExit :: IO a -> (ExitCode -> IO a) -> IO a
- deepseq :: NFData a => a -> b -> b
- force :: NFData a => a -> a
- isSpace :: Char -> Bool
- isDigit :: Char -> Bool
- isUpper :: Char -> Bool
- isAlpha :: Char -> Bool
- isAlphaNum :: Char -> Bool
- chr :: Int -> Char
- ord :: Char -> Int
- toLower :: Char -> Char
- toUpper :: Char -> Char
- absurd :: Void -> a
- vacuous :: Functor f => f Void -> f a
- data Word
- data Word8
- data Word16
- data Word32
- data Word64
- data Int8
- data Int16
- data Int32
- data Int64
- (<<>>) :: Doc -> Doc -> Doc
- (<+>) :: Doc -> Doc -> Doc
- data ExitCode
- exitWith :: ExitCode -> IO a
- exitSuccess :: IO a
- exitFailure :: IO a
- readMaybe :: Read a => String -> Maybe a
- trace :: String -> a -> a
- traceShow :: Show a => a -> b -> b
- traceShowId :: Show a => a -> a
- traceM :: Applicative f => String -> f ()
- traceShowM :: (Show a, Applicative f) => a -> f ()
Prelude
error :: HasCallStack => [Char] -> a #
errorWithoutStackTrace :: [Char] -> a #
undefined :: HasCallStack => a #
ioError :: HasCallStack => IOError -> IO a #
(!!) :: HasCallStack => [a] -> Int -> a #
cycle :: HasCallStack => [a] -> [a] #
(^^) :: (Fractional a, Integral b) => a -> b -> a #
fromIntegral :: (Integral a, Num b) => a -> b #
realToFrac :: (Real a, Fractional b) => a -> b #
showString :: String -> ShowS #
appendFile :: FilePath -> String -> IO () #
getContents :: IO String #
class Functor f => Applicative (f :: Type -> Type) where #
Instances
class Functor (f :: Type -> Type) where #
Minimal complete definition
Instances
class Applicative m => Monad (m :: Type -> Type) where #
Minimal complete definition
Instances
class Semigroup a => Monoid a where #