Safe Haskell | None |
---|---|
Language | Haskell2010 |
Development.Shakers
Description
Shake helpers.
Synopsis
- seq :: a -> b -> b
- filter :: (a -> Bool) -> [a] -> [a]
- zip :: [a] -> [b] -> [(a, b)]
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- otherwise :: Bool
- ($) :: (a -> b) -> a -> b
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- guard :: Alternative f => Bool -> f ()
- join :: Monad m => m (m a) -> m a
- class Bounded a where
- class Enum a where
- class Eq a where
- class Fractional a => Floating a where
- class Num a => Fractional a where
- class (Real a, Enum a) => Integral a where
- class Applicative m => Monad (m :: * -> *) where
- class Functor (f :: * -> *) where
- class Num a where
- class Eq a => Ord a where
- class Read a where
- class (Num a, Ord a) => Real a where
- class (RealFrac a, Floating a) => RealFloat a where
- class (Real a, Fractional a) => RealFrac a where
- class Show a where
- class Typeable (a :: k)
- class IsString a where
- class Functor f => Applicative (f :: * -> *) where
- class Foldable (t :: * -> *) where
- class (Functor t, Foldable t) => Traversable (t :: * -> *) where
- (<>) :: Semigroup a => a -> a -> a
- class Semigroup a => Monoid a where
- data Bool
- data Char
- data Double
- data Float
- data Int
- data Int32
- data Int64
- data Integer
- data Maybe a
- data Ordering
- type Rational = Ratio Integer
- data IO a
- data Word
- data Word8
- data Word32
- data Word64
- data Either a b
- class Monad m => MonadIO (m :: * -> *) where
- mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a
- (<$!>) :: Monad m => (a -> b) -> m a -> m b
- unless :: Applicative f => Bool -> f () -> f ()
- replicateM_ :: Applicative m => Int -> m a -> m ()
- replicateM :: Applicative m => Int -> m a -> m [a]
- foldM_ :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m ()
- foldM :: (Foldable t, Monad m) => (b -> a -> m b) -> b -> t a -> m b
- zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m ()
- zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c]
- mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c])
- forever :: Applicative f => f a -> f b
- (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c
- (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c
- filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a]
- isSubsequenceOf :: Eq a => [a] -> [a] -> Bool
- mapAccumR :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- mapAccumL :: Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
- forM :: (Traversable t, Monad m) => t a -> (a -> m b) -> m (t b)
- for :: (Traversable t, Applicative f) => t a -> (a -> f b) -> f (t b)
- first :: Arrow a => a b c -> a (b, d) (c, d)
- second :: Arrow a => a b c -> a (d, b) (d, c)
- (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c')
- (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c')
- catchIOError :: IO a -> (IOError -> IO a) -> IO a
- annotateIOError :: IOError -> String -> Maybe Handle -> Maybe FilePath -> IOError
- modifyIOError :: (IOError -> IOError) -> IO a -> IO a
- ioeSetFileName :: IOError -> FilePath -> IOError
- ioeSetHandle :: IOError -> Handle -> IOError
- ioeSetLocation :: IOError -> String -> IOError
- ioeSetErrorString :: IOError -> String -> IOError
- ioeSetErrorType :: IOError -> IOErrorType -> IOError
- ioeGetFileName :: IOError -> Maybe FilePath
- ioeGetHandle :: IOError -> Maybe Handle
- ioeGetLocation :: IOError -> String
- ioeGetErrorString :: IOError -> String
- ioeGetErrorType :: IOError -> IOErrorType
- isUserErrorType :: IOErrorType -> Bool
- isPermissionErrorType :: IOErrorType -> Bool
- isIllegalOperationErrorType :: IOErrorType -> Bool
- isEOFErrorType :: IOErrorType -> Bool
- isFullErrorType :: IOErrorType -> Bool
- isAlreadyInUseErrorType :: IOErrorType -> Bool
- isDoesNotExistErrorType :: IOErrorType -> Bool
- isAlreadyExistsErrorType :: IOErrorType -> Bool
- userErrorType :: IOErrorType
- permissionErrorType :: IOErrorType
- illegalOperationErrorType :: IOErrorType
- eofErrorType :: IOErrorType
- fullErrorType :: IOErrorType
- alreadyInUseErrorType :: IOErrorType
- doesNotExistErrorType :: IOErrorType
- alreadyExistsErrorType :: IOErrorType
- isUserError :: IOError -> Bool
- isPermissionError :: IOError -> Bool
- isIllegalOperation :: IOError -> Bool
- isEOFError :: IOError -> Bool
- isFullError :: IOError -> Bool
- isAlreadyInUseError :: IOError -> Bool
- isDoesNotExistError :: IOError -> Bool
- isAlreadyExistsError :: IOError -> Bool
- mkIOError :: IOErrorType -> String -> Maybe Handle -> Maybe FilePath -> IOError
- tryIOError :: IO a -> IO (Either IOError a)
- ioError :: IOError -> IO a
- data IOErrorType
- type FilePath = String
- userError :: String -> IOError
- data IOException
- type IOError = IOException
- class (Typeable e, Show e) => Exception e where
- find :: Foldable t => (a -> Bool) -> t a -> Maybe a
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- minimumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- maximumBy :: Foldable t => (a -> a -> Ordering) -> t a -> a
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- or :: Foldable t => t Bool -> Bool
- and :: Foldable t => t Bool -> Bool
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- msum :: (Foldable t, MonadPlus m) => t (m a) -> m a
- asum :: (Foldable t, Alternative f) => t (f a) -> f a
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- sequenceA_ :: (Foldable t, Applicative f) => t (f a) -> f ()
- forM_ :: (Foldable t, Monad m) => t a -> (a -> m b) -> m ()
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- for_ :: (Foldable t, Applicative f) => t a -> (a -> f b) -> f ()
- traverse_ :: (Foldable t, Applicative f) => (a -> f b) -> t a -> f ()
- unfoldr :: (b -> Maybe (a, b)) -> b -> [a]
- sortOn :: Ord b => (a -> b) -> [a] -> [a]
- sortBy :: (a -> a -> Ordering) -> [a] -> [a]
- sort :: Ord a => [a] -> [a]
- permutations :: [a] -> [[a]]
- subsequences :: [a] -> [[a]]
- tails :: [a] -> [[a]]
- inits :: [a] -> [[a]]
- groupBy :: (a -> a -> Bool) -> [a] -> [[a]]
- group :: Eq a => [a] -> [[a]]
- deleteFirstsBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
- unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
- unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
- unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
- zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
- zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
- zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
- zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
- zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
- zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
- zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
- zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
- genericReplicate :: Integral i => i -> a -> [a]
- genericIndex :: Integral i => [a] -> i -> a
- genericSplitAt :: Integral i => i -> [a] -> ([a], [a])
- genericDrop :: Integral i => i -> [a] -> [a]
- genericTake :: Integral i => i -> [a] -> [a]
- genericLength :: Num i => [a] -> i
- insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
- insert :: Ord a => a -> [a] -> [a]
- partition :: (a -> Bool) -> [a] -> ([a], [a])
- transpose :: [[a]] -> [[a]]
- intersperse :: a -> [a] -> [a]
- intersectBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- intersect :: Eq a => [a] -> [a] -> [a]
- unionBy :: (a -> a -> Bool) -> [a] -> [a] -> [a]
- union :: Eq a => [a] -> [a] -> [a]
- (\\) :: Eq a => [a] -> [a] -> [a]
- deleteBy :: (a -> a -> Bool) -> a -> [a] -> [a]
- delete :: Eq a => a -> [a] -> [a]
- nubBy :: (a -> a -> Bool) -> [a] -> [a]
- nub :: Eq a => [a] -> [a]
- isInfixOf :: Eq a => [a] -> [a] -> Bool
- isSuffixOf :: Eq a => [a] -> [a] -> Bool
- isPrefixOf :: Eq a => [a] -> [a] -> Bool
- findIndices :: (a -> Bool) -> [a] -> [Int]
- findIndex :: (a -> Bool) -> [a] -> Maybe Int
- elemIndices :: Eq a => a -> [a] -> [Int]
- elemIndex :: Eq a => a -> [a] -> Maybe Int
- stripPrefix :: Eq a => [a] -> [a] -> Maybe [a]
- dropWhileEnd :: (a -> Bool) -> [a] -> [a]
- reads :: Read a => ReadS a
- partitionEithers :: [Either a b] -> ([a], [b])
- rights :: [Either a b] -> [b]
- lefts :: [Either a b] -> [a]
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- newtype Down a = Down a
- id :: Category cat => cat a a
- (.) :: Category cat => cat b c -> cat a b -> cat a c
- class Storable a
- lex :: ReadS String
- readParen :: Bool -> ReadS a -> ReadS a
- type ReadS a = String -> [(a, String)]
- bool :: a -> a -> Bool -> a
- on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
- void :: Functor f => f a -> f ()
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- lcm :: Integral a => a -> a -> a
- gcd :: Integral a => a -> a -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- (^) :: (Num a, Integral b) => a -> b -> a
- odd :: Integral a => a -> Bool
- even :: Integral a => a -> Bool
- showParen :: Bool -> ShowS -> ShowS
- showString :: String -> ShowS
- showChar :: Char -> ShowS
- shows :: Show a => a -> ShowS
- type ShowS = String -> String
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- unzip :: [(a, b)] -> ([a], [b])
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- (!!) :: [a] -> Int -> a
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- reverse :: [a] -> [a]
- break :: (a -> Bool) -> [a] -> ([a], [a])
- span :: (a -> Bool) -> [a] -> ([a], [a])
- splitAt :: Int -> [a] -> ([a], [a])
- drop :: Int -> [a] -> [a]
- take :: Int -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- takeWhile :: (a -> Bool) -> [a] -> [a]
- cycle :: [a] -> [a]
- replicate :: Int -> a -> [a]
- repeat :: a -> [a]
- iterate' :: (a -> a) -> a -> [a]
- iterate :: (a -> a) -> a -> [a]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanl' :: (b -> a -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- foldl1' :: (a -> a -> a) -> [a] -> a
- init :: [a] -> [a]
- last :: [a] -> a
- tail :: [a] -> [a]
- uncons :: [a] -> Maybe (a, [a])
- head :: [a] -> a
- mapMaybe :: (a -> Maybe b) -> [a] -> [b]
- catMaybes :: [Maybe a] -> [a]
- listToMaybe :: [a] -> Maybe a
- maybeToList :: Maybe a -> [a]
- fromMaybe :: a -> Maybe a -> a
- isNothing :: Maybe a -> Bool
- isJust :: Maybe a -> Bool
- maybe :: b -> (a -> b) -> Maybe a -> b
- swap :: (a, b) -> (b, a)
- uncurry :: (a -> b -> c) -> (a, b) -> c
- curry :: ((a, b) -> c) -> a -> b -> c
- subtract :: Num a => a -> a -> a
- asTypeOf :: a -> a -> a
- until :: (a -> Bool) -> (a -> a) -> a -> a
- ($!) :: (a -> b) -> a -> b
- flip :: (a -> b -> c) -> b -> a -> c
- const :: a -> b -> a
- ap :: Monad m => m (a -> b) -> m a -> m b
- liftM5 :: Monad m => (a1 -> a2 -> a3 -> a4 -> a5 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m a5 -> m r
- liftM4 :: Monad m => (a1 -> a2 -> a3 -> a4 -> r) -> m a1 -> m a2 -> m a3 -> m a4 -> m r
- liftM3 :: Monad m => (a1 -> a2 -> a3 -> r) -> m a1 -> m a2 -> m a3 -> m r
- liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
- liftM :: Monad m => (a1 -> r) -> m a1 -> m r
- when :: Applicative f => Bool -> f () -> f ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- (<|>) :: Alternative f => f a -> f a -> f a
- class (Alternative m, Monad m) => MonadPlus (m :: * -> *) where
- type String = [Char]
- undefined :: HasCallStack => a
- error :: HasCallStack => [Char] -> a
- data SomeException
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- readLn :: (MonadIO m, Read a) => m a
- putChar :: MonadIO m => Char -> m ()
- getChar :: MonadIO m => m Char
- readMay :: Read a => Text -> Maybe a
- interact :: MonadIO m => (LText -> LText) -> m ()
- getContents :: MonadIO m => m LText
- getLine :: MonadIO m => m Text
- decodeUtf8 :: ByteString -> Text
- fpToString :: FilePath -> String
- fpFromText :: Text -> FilePath
- fpToText :: FilePath -> Text
- ltextToString :: LText -> String
- textToString :: Text -> String
- appendFile :: MonadIO m => FilePath -> Text -> m ()
- writeFile :: MonadIO m => FilePath -> Text -> m ()
- readFile :: MonadIO m => FilePath -> m Text
- readIO :: (MonadIO m, Read a) => Text -> m a
- read :: Read a => Text -> a
- fromShow :: (Show a, IsString b) => a -> b
- tshow :: Show a => a -> Text
- product :: (Foldable f, Num a) => f a -> a
- sum :: (Foldable f, Num a) => f a -> a
- intercalate :: Monoid w => w -> [w] -> w
- concat :: Monoid w => [w] -> w
- (++) :: Monoid w => w -> w -> w
- empty :: Monoid w => w
- map :: Functor f => (a -> b) -> f a -> f b
- terror :: HasCallStack => Text -> a
- print :: (MonadIO m, Show a) => a -> m ()
- putStrLn :: MonadIO m => Text -> m ()
- putStr :: MonadIO m => Text -> m ()
- getArgs :: MonadIO m => m [Text]
- equating :: Eq a => (b -> a) -> b -> b -> Bool
- type LText = Text
- type LByteString = ByteString
- type UVector = Vector
- type SVector = Vector
- data Vector a
- class (Vector Vector a, MVector MVector a) => Unbox a
- data HashMap k v
- data HashSet a
- data Text
- encodeUtf8 :: Text -> ByteString
- words :: Text -> [Text]
- lines :: Text -> [Text]
- unlines :: [Text] -> Text
- unwords :: [Text] -> Text
- class Hashable a where
- (<.>) :: FilePath -> String -> FilePath
- (</>) :: FilePath -> FilePath -> FilePath
- data Set a
- data Seq a
- data Map k a
- data IntSet
- data IntMap a
- data ByteString
- unit :: m () -> m ()
- lift :: (MonadTrans t, Monad m) => m a -> t m a
- askOracleWith :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> a -> Action a
- (&*>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
- (|*>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
- (*>) :: FilePattern -> (FilePath -> Action ()) -> Rules ()
- (*>>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
- (?>>) :: (FilePath -> Maybe [FilePath]) -> ([FilePath] -> Action ()) -> Rules ()
- (**>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
- shakeOptDescrs :: [OptDescr (Either String (ShakeOptions -> ShakeOptions))]
- shakeArgsOptionsWith :: ShakeOptions -> [OptDescr (Either String a)] -> (ShakeOptions -> [a] -> [String] -> IO (Maybe (ShakeOptions, Rules ()))) -> IO ()
- shakeArgsWith :: ShakeOptions -> [OptDescr (Either String a)] -> ([a] -> [String] -> IO (Maybe (Rules ()))) -> IO ()
- shakeArgs :: ShakeOptions -> Rules () -> IO ()
- cmd_ :: (CmdArguments args, Unit args) => args :-> Action ()
- cmd :: CmdArguments args => args :-> Action r
- command_ :: [CmdOption] -> String -> [String] -> Action ()
- command :: CmdResult r => [CmdOption] -> String -> [String] -> Action r
- addEnv :: MonadIO m => [(String, String)] -> m CmdOption
- addPath :: MonadIO m => [String] -> [String] -> m CmdOption
- newtype Stdout a = Stdout {
- fromStdout :: a
- newtype Stderr a = Stderr {
- fromStderr :: a
- newtype Stdouterr a = Stdouterr {
- fromStdouterr :: a
- newtype Exit = Exit {}
- newtype Process = Process {}
- newtype CmdTime = CmdTime {}
- newtype CmdLine = CmdLine {}
- class CmdString a
- class CmdResult a
- newCache :: (Eq k, Hashable k) => (k -> Action v) -> Rules (k -> Action v)
- withResources :: [(Resource, Int)] -> Action a -> Action a
- newThrottle :: String -> Int -> Double -> Rules Resource
- newResource :: String -> Int -> Rules Resource
- par :: Action a -> Action b -> Action (a, b)
- forP :: [a] -> (a -> Action b) -> Action [b]
- withTempDirWithin :: FilePath -> (FilePath -> Action a) -> Action a
- withTempDir :: (FilePath -> Action a) -> Action a
- withTempFileWithin :: FilePath -> (FilePath -> Action a) -> Action a
- withTempFile :: (FilePath -> Action a) -> Action a
- writeFileChanged :: MonadIO m => FilePath -> String -> m ()
- writeFileLines :: MonadIO m => FilePath -> [String] -> m ()
- readFileLines :: FilePath -> Action [String]
- writeFile' :: MonadIO m => FilePath -> String -> m ()
- readFile' :: FilePath -> Action String
- copyFileChanged :: FilePath -> FilePath -> Action ()
- copyFile' :: FilePath -> FilePath -> Action ()
- addShakeExtra :: Typeable a => a -> HashMap TypeRep Dynamic -> HashMap TypeRep Dynamic
- getShakeExtraRules :: Typeable a => Rules (Maybe a)
- getShakeExtra :: Typeable a => Action (Maybe a)
- getHashedShakeVersion :: [FilePath] -> IO String
- shake :: ShakeOptions -> Rules () -> IO ()
- removeFilesAfter :: FilePath -> [FilePattern] -> Action ()
- removeFiles :: FilePath -> [FilePattern] -> IO ()
- getDirectoryFilesIO :: FilePath -> [FilePattern] -> IO [FilePath]
- getDirectoryDirs :: FilePath -> Action [FilePath]
- getDirectoryFiles :: FilePath -> [FilePattern] -> Action [FilePath]
- getDirectoryContents :: FilePath -> Action [FilePath]
- getEnvWithDefault :: String -> String -> Action String
- getEnv :: String -> Action (Maybe String)
- doesDirectoryExist :: FilePath -> Action Bool
- doesFileExist :: FilePath -> Action Bool
- (&?>) :: (FilePath -> Maybe [FilePath]) -> ([FilePath] -> Action ()) -> Rules ()
- (&%>) :: [FilePattern] -> ([FilePath] -> Action ()) -> Rules ()
- orderOnly :: [FilePath] -> Action ()
- (%>) :: FilePattern -> (FilePath -> Action ()) -> Rules ()
- (|%>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
- (?>) :: (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
- (~>) :: String -> Action () -> Rules ()
- phonys :: (String -> Maybe (Action ())) -> Rules ()
- phony :: String -> Action () -> Rules ()
- want :: [FilePath] -> Rules ()
- trackAllow :: [FilePattern] -> Action ()
- trackWrite :: [FilePath] -> Action ()
- trackRead :: [FilePath] -> Action ()
- needed :: [FilePath] -> Action ()
- needHasChanged :: [FilePath] -> Action [FilePath]
- need :: [FilePath] -> Action ()
- resultHasChanged :: FilePath -> Action Bool
- askOracle :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> Action a
- addOracleCache :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => (q -> Action a) -> Rules (q -> Action a)
- addOracle :: (RuleResult q ~ a, ShakeValue q, ShakeValue a) => (q -> Action a) -> Rules (q -> Action a)
- alwaysRerun :: Action ()
- batch :: Int -> ((a -> Action ()) -> Rules ()) -> (a -> Action b) -> ([b] -> Action ()) -> Rules ()
- orderOnlyAction :: Action a -> Action a
- parallel :: [Action a] -> Action [a]
- unsafeExtraThread :: Action a -> Action a
- newCacheIO :: (Eq k, Hashable k) => (k -> Action v) -> IO (k -> Action v)
- withResource :: Resource -> Int -> Action a -> Action a
- traced :: String -> IO a -> Action a
- quietly :: Action a -> Action a
- withVerbosity :: Verbosity -> Action a -> Action a
- getVerbosity :: Action Verbosity
- putQuiet :: String -> Action ()
- putNormal :: String -> Action ()
- putLoud :: String -> Action ()
- runAfter :: IO () -> Action ()
- getProgress :: Action Progress
- getShakeOptions :: Action ShakeOptions
- actionFinally :: Action a -> IO b -> Action a
- actionOnException :: Action a -> IO b -> Action a
- withoutActions :: Rules () -> Rules ()
- action :: Action a -> Rules ()
- alternatives :: Rules () -> Rules ()
- priority :: Double -> Rules () -> Rules ()
- getShakeOptionsRules :: Rules ShakeOptions
- data Rules a
- type family RuleResult key :: *
- data Action a
- shakeOptions :: ShakeOptions
- data Rebuild
- data Lint
- data Change
- data ShakeOptions = ShakeOptions {
- shakeFiles :: FilePath
- shakeThreads :: Int
- shakeVersion :: String
- shakeVerbosity :: Verbosity
- shakeStaunch :: Bool
- shakeReport :: [FilePath]
- shakeLint :: Maybe Lint
- shakeLintInside :: [FilePath]
- shakeLintIgnore :: [FilePattern]
- shakeCommandOptions :: [CmdOption]
- shakeFlush :: Maybe Double
- shakeRebuild :: [(Rebuild, FilePattern)]
- shakeAbbreviations :: [(String, String)]
- shakeStorageLog :: Bool
- shakeLineBuffering :: Bool
- shakeTimings :: Bool
- shakeRunCommands :: Bool
- shakeChange :: Change
- shakeCreationCheck :: Bool
- shakeLiveFiles :: [FilePath]
- shakeVersionIgnore :: Bool
- shakeColor :: Bool
- shakeProgress :: IO Progress -> IO ()
- shakeOutput :: Verbosity -> String -> IO ()
- shakeExtra :: HashMap TypeRep Dynamic
- data Verbosity
- progressSimple :: IO Progress -> IO ()
- progressProgram :: IO (String -> IO ())
- progressTitlebar :: String -> IO ()
- progressDisplay :: Double -> (String -> IO ()) -> IO Progress -> IO ()
- data Progress = Progress {
- isFailure :: !(Maybe String)
- countSkipped :: !Int
- countBuilt :: !Int
- countUnknown :: !Int
- countTodo :: !Int
- timeSkipped :: !Double
- timeBuilt :: !Double
- timeUnknown :: !Double
- timeTodo :: !(Double, Int)
- newThrottleIO :: String -> Int -> Double -> IO Resource
- newResourceIO :: String -> Int -> IO Resource
- data Resource
- type ShakeValue a = (Show a, Typeable a, Eq a, Hashable a, Binary a, NFData a)
- filePattern :: FilePattern -> FilePath -> Maybe [String]
- (?==) :: FilePattern -> FilePath -> Bool
- (<//>) :: FilePattern -> FilePattern -> FilePattern
- type FilePattern = String
- data ShakeException = ShakeException {}
- data CmdOption
- = Cwd FilePath
- | Env [(String, String)]
- | AddEnv String String
- | RemEnv String
- | AddPath [String] [String]
- | Stdin String
- | StdinBS ByteString
- | FileStdin FilePath
- | Shell
- | BinaryPipes
- | Traced String
- | Timeout Double
- | WithStdout Bool
- | WithStderr Bool
- | EchoStdout Bool
- | EchoStderr Bool
- | FileStdout FilePath
- | FileStderr FilePath
- | AutoDeps
- (<:>) :: (IsString m, Monoid m) => m -> m -> m
- (<->) :: (IsString m, Monoid m) => m -> m -> m
- (<=>) :: (IsString m, Monoid m) => m -> m -> m
- timestamp :: Action String
- buildFile :: FilePath -> FilePath
- fakeFile :: FilePath -> FilePath
- metaFile :: FilePath -> FilePath
- mirrorDir :: Action FilePath
- parentDir :: Action FilePath
- getVar :: String -> Action String
- getFlag :: String -> Action Bool
- cmdArgs :: String -> [String] -> Action String
- cmdArgs_ :: String -> [String] -> Action ()
- cmdArgsDir :: FilePath -> String -> [String] -> Action String
- cmdArgsDir_ :: FilePath -> String -> [String] -> Action ()
- stack :: FilePath -> [String] -> Action String
- stack_ :: FilePath -> [String] -> Action ()
- stackExec :: FilePath -> String -> [String] -> Action String
- stackExec_ :: FilePath -> String -> [String] -> Action ()
- sed_ :: FilePath -> [String] -> Action ()
- replace :: FilePath -> FilePath -> String -> String -> Action ()
- git :: FilePath -> [String] -> Action String
- git_ :: FilePath -> [String] -> Action ()
- schemaApply_ :: FilePath -> [String] -> Action ()
- m4 :: [String] -> Action String
- aws :: [String] -> Action String
- rsync_ :: [String] -> Action ()
- ssh :: String -> [String] -> Action String
- ssh_ :: String -> [String] -> Action ()
- sshDir :: FilePath -> String -> [String] -> Action String
- sshDir_ :: FilePath -> String -> [String] -> Action ()
- rssh :: [String] -> Action String
- rssh_ :: [String] -> Action ()
- rdocker_ :: [String] -> Action ()
- docker_ :: [String] -> Action ()
- xdocker_ :: [String] -> Action ()
- convox_ :: [String] -> Action ()
- fake :: FilePath -> [FilePattern] -> String -> ([FilePath] -> Action ()) -> Rules ()
- meta :: FilePath -> Action String -> Rules ()
- preprocess :: FilePattern -> FilePath -> Action [(String, String)] -> Rules ()
- getHashedVersion :: FilePath -> [FilePattern] -> Action String
- hsRules :: FilePath -> [FilePattern] -> Rules ()
- stackRules :: FilePath -> [FilePattern] -> Rules ()
- stackTargetRules :: FilePath -> String -> [FilePattern] -> Rules ()
- cabalRules :: FilePath -> FilePath -> Rules ()
- dbRules :: FilePath -> Rules ()
- dockerRules :: FilePath -> [FilePattern] -> Rules ()
- shakeMain :: Rules () -> IO ()
Documentation
The value of seq a b
is bottom if a
is bottom, and
otherwise equal to b
. In other words, it evaluates the first
argument a
to weak head normal form (WHNF). seq
is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression seq a b
does
not guarantee that a
will be evaluated before b
.
The only guarantee given by seq
is that the both a
and b
will be evaluated before seq
returns a value.
In particular, this means that b
may be evaluated before
a
. If you need to guarantee a specific order of evaluation,
you must use the function pseq
from the "parallel" package.
filter :: (a -> Bool) -> [a] -> [a] #
filter
, applied to a predicate and a list, returns the list of
those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]
($) :: (a -> b) -> a -> b infixr 0 #
Application operator. This operator is redundant, since ordinary
application (f x)
means the same as (f
. However, $
x)$
has
low, right-associative binding precedence, so it sometimes allows
parentheses to be omitted; for example:
f $ g $ h x = f (g (h x))
It is also useful in higher-order situations, such as
,
or map
($
0) xs
.zipWith
($
) fs xs
fromIntegral :: (Integral a, Num b) => a -> b #
general coercion from integral types
realToFrac :: (Real a, Fractional b) => a -> b #
general coercion to fractional types
guard :: Alternative f => Bool -> f () #
Conditional failure of Alternative
computations. Defined by
guard True =pure
() guard False =empty
Examples
Common uses of guard
include conditionally signaling an error in
an error monad and conditionally rejecting the current choice in an
Alternative
-based parser.
As an example of signaling an error in the error monad Maybe
,
consider a safe division function safeDiv x y
that returns
Nothing
when the denominator y
is zero and
otherwise. For example:Just
(x `div`
y)
>>> safeDiv 4 0 Nothing >>> safeDiv 4 2 Just 2
A definition of safeDiv
using guards, but not guard
:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y | y /= 0 = Just (x `div` y) | otherwise = Nothing
A definition of safeDiv
using guard
and Monad
do
-notation:
safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x `div` y)
join :: Monad m => m (m a) -> m a #
The join
function is the conventional monad join operator. It
is used to remove one level of monadic structure, projecting its
bound argument into the outer level.
The Bounded
class is used to name the upper and lower limits of a
type. Ord
is not a superclass of Bounded
since types that are not
totally ordered may also have upper and lower bounds.
The Bounded
class may be derived for any enumeration type;
minBound
is the first constructor listed in the data
declaration
and maxBound
is the last.
Bounded
may also be derived for single-constructor datatypes whose
constituent types are in Bounded
.
Instances
Class Enum
defines operations on sequentially ordered types.
The enumFrom
... methods are used in Haskell's translation of
arithmetic sequences.
Instances of Enum
may be derived for any enumeration type (types
whose constructors have no fields). The nullary constructors are
assumed to be numbered left-to-right by fromEnum
from 0
through n-1
.
See Chapter 10 of the Haskell Report for more details.
For any type that is an instance of class Bounded
as well as Enum
,
the following should hold:
- The calls
andsucc
maxBound
should result in a runtime error.pred
minBound
fromEnum
andtoEnum
should give a runtime error if the result value is not representable in the result type. For example,
is an error.toEnum
7 ::Bool
enumFrom
andenumFromThen
should be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBound
Methods
the successor of a value. For numeric types, succ
adds 1.
the predecessor of a value. For numeric types, pred
subtracts 1.
Convert from an Int
.
Convert to an Int
.
It is implementation-dependent what fromEnum
returns when
applied to a value that is too large to fit in an Int
.
Used in Haskell's translation of [n..]
.
enumFromThen :: a -> a -> [a] #
Used in Haskell's translation of [n,n'..]
.
enumFromTo :: a -> a -> [a] #
Used in Haskell's translation of [n..m]
.
enumFromThenTo :: a -> a -> a -> [a] #
Used in Haskell's translation of [n,n'..m]
.
Instances
The Eq
class defines equality (==
) and inequality (/=
).
All the basic datatypes exported by the Prelude are instances of Eq
,
and Eq
may be derived for any datatype whose constituents are also
instances of Eq
.
Instances
Eq Bool | |
Eq Char | |
Eq Double | |
Eq Float | |
Eq Int | |
Eq Int8 | Since: base-2.1 |
Eq Int16 | Since: base-2.1 |
Eq Int32 | Since: base-2.1 |
Eq Int64 | Since: base-2.1 |
Eq Integer | |
Eq Ordering | |
Eq Word | |
Eq Word8 | Since: base-2.1 |
Eq Word16 | Since: base-2.1 |
Eq Word32 | Since: base-2.1 |
Eq Word64 | Since: base-2.1 |
Eq SomeTypeRep | |
Defined in Data.Typeable.Internal | |
Eq () | |
Eq TyCon | |
Eq Module | |
Eq TrName | |
Eq Handle | Since: base-4.1.0.0 |
Eq BigNat | |
Eq Void | Since: base-4.8.0.0 |
Eq SpecConstrAnnotation | |
Defined in GHC.Exts Methods (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # | |
Eq AsyncException | |
Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool # | |
Eq ArrayException | |
Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool # | |
Eq ExitCode | |
Eq IOErrorType | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Eq BufferMode | |
Defined in GHC.IO.Handle.Types | |
Eq Newline | |
Eq NewlineMode | |
Defined in GHC.IO.Handle.Types | |
Eq MaskingState | |
Defined in GHC.IO | |
Eq IOException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Eq ErrorCall | |
Eq ArithException | |
Defined in GHC.Exception Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool # | |
Eq Fixity | |
Eq Associativity | |
Defined in GHC.Generics Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
Eq SourceUnpackedness | |
Defined in GHC.Generics Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
Eq SourceStrictness | |
Defined in GHC.Generics Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
Eq DecidedStrictness | |
Defined in GHC.Generics Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
Eq CChar | |
Eq CSChar | |
Eq CUChar | |
Eq CShort | |
Eq CUShort | |
Eq CInt | |
Eq CUInt | |
Eq CLong | |
Eq CULong | |
Eq CLLong | |
Eq CULLong | |
Eq CBool | |
Eq CFloat | |
Eq CDouble | |
Eq CPtrdiff | |
Eq CSize | |
Eq CWchar | |
Eq CSigAtomic | |
Defined in Foreign.C.Types | |
Eq CClock | |
Eq CTime | |
Eq CUSeconds | |
Eq CSUSeconds | |
Defined in Foreign.C.Types | |
Eq CIntPtr | |
Eq CUIntPtr | |
Eq CIntMax | |
Eq CUIntMax | |
Eq GeneralCategory | |
Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool # (/=) :: GeneralCategory -> GeneralCategory -> Bool # | |
Eq SrcLoc | |
Eq IntSet | |
Eq ByteString | |
Defined in Data.ByteString.Internal | |
Eq Clock | |
Eq TimeSpec | |
Eq XdgDirectory | |
Defined in System.Directory | |
Eq FileType | |
Eq Permissions | |
Defined in System.Directory.Internal.Common | |
Eq StdStream | |
Eq CmdSpec | |
Eq CreateProcess | |
Defined in System.Process.Common Methods (==) :: CreateProcess -> CreateProcess -> Bool # (/=) :: CreateProcess -> CreateProcess -> Bool # | |
Eq ByteArray | Since: primitive-0.6.3.0 |
Eq Addr | |
Eq FileQ | |
Eq EqualCost | |
Eq Key | |
Eq QTypeRep | |
Eq CmdArgument | |
Defined in Development.Shake.Command | |
Eq RunChanged | |
Defined in Development.Shake.Internal.Core.Types | |
Eq Rebuild | |
Eq Lint | |
Eq Change | |
Eq Verbosity | |
Eq Progress | |
Eq Resource | |
Eq CmdOption | |
Eq LocalTime | |
Eq DoesDirectoryExistQ | |
Eq DoesFileExistQ | |
Eq DoesDirectoryExistA | |
Eq DoesFileExistA | |
Eq GetDirectoryA | |
Eq GetDirectoryContentsQ | |
Eq GetDirectoryDirsQ | |
Eq GetDirectoryFilesQ | |
Eq GetEnvA | |
Eq GetEnvQ | |
Eq FilesQ | |
Eq AlwaysRerunQ | |
Eq Pat | |
Eq PID | |
Eq Result | |
Eq Str | |
Eq Extra | |
Eq CodePoint | |
Eq DecoderState | |
Eq a => Eq [a] | |
Eq a => Eq (Maybe a) | |
Eq a => Eq (Ratio a) | |
Eq p => Eq (Par1 p) | |
Eq a => Eq (Complex a) | |
Eq a => Eq (Min a) | |
Eq a => Eq (Max a) | |
Eq a => Eq (First a) | |
Eq a => Eq (Last a) | |
Eq m => Eq (WrappedMonoid m) | |
Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # | |
Eq a => Eq (Option a) | |
Eq a => Eq (Identity a) | |
Eq a => Eq (Down a) | |
Eq a => Eq (NonEmpty a) | |
Eq a => Eq (Vector a) | |
Eq a => Eq (HashSet a) | |
Eq a => Eq (Set a) | |
Eq a => Eq (Seq a) | |
Eq a => Eq (IntMap a) | |
Eq a => Eq (Tree a) | |
Eq a => Eq (ViewL a) | |
Eq a => Eq (ViewR a) | |
Eq a => Eq (Hashed a) | Uses precomputed hash to detect inequality faster |
(Eq a, PrimUnlifted a) => Eq (UnliftedArray a) | |
Defined in Data.Primitive.UnliftedArray Methods (==) :: UnliftedArray a -> UnliftedArray a -> Bool # (/=) :: UnliftedArray a -> UnliftedArray a -> Bool # | |
(Eq a, Prim a) => Eq (PrimArray a) | Since: primitive-0.6.4.0 |
Eq a => Eq (SmallArray a) | |
Defined in Data.Primitive.SmallArray | |
Eq a => Eq (Array a) | |
Eq a => Eq (UserRule a) | |
(Storable a, Eq a) => Eq (Vector a) | |
(Prim a, Eq a) => Eq (Vector a) | |
Eq answer => Eq (OracleA answer) | |
Eq question => Eq (OracleQ question) | |
(Eq a, Eq b) => Eq (Either a b) | |
Eq (V1 p) | Since: base-4.9.0.0 |
Eq (U1 p) | Since: base-4.9.0.0 |
Eq (TypeRep a) | Since: base-2.1 |
(Eq a, Eq b) => Eq (a, b) | |
Eq a => Eq (Arg a b) | Since: base-4.9.0.0 |
(Eq k, Eq v) => Eq (HashMap k v) | |
(Eq k, Eq a) => Eq (Map k a) | |
Eq (MutableUnliftedArray s a) | |
Defined in Data.Primitive.UnliftedArray Methods (==) :: MutableUnliftedArray s a -> MutableUnliftedArray s a -> Bool # (/=) :: MutableUnliftedArray s a -> MutableUnliftedArray s a -> Bool # | |
Eq (SmallMutableArray s a) | |
Defined in Data.Primitive.SmallArray Methods (==) :: SmallMutableArray s a -> SmallMutableArray s a -> Bool # (/=) :: SmallMutableArray s a -> SmallMutableArray s a -> Bool # | |
Eq (MutableArray s a) | |
Defined in Data.Primitive.Array Methods (==) :: MutableArray s a -> MutableArray s a -> Bool # (/=) :: MutableArray s a -> MutableArray s a -> Bool # | |
(Eq k, Eq v) => Eq (Leaf k v) | |
Eq (f p) => Eq (Rec1 f p) | |
Eq (URec (Ptr ()) p) | |
Eq (URec Char p) | |
Eq (URec Double p) | |
Eq (URec Float p) | |
Eq (URec Int p) | |
Eq (URec Word p) | |
(Eq a, Eq b, Eq c) => Eq (a, b, c) | |
Eq a => Eq (Const a b) | |
Eq (a :~: b) | |
(Eq e, Eq1 m, Eq a) => Eq (ErrorT e m a) | |
Eq c => Eq (K1 i c p) | |
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | |
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | |
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) | Since: base-4.9.0.0 |
(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) | Since: base-4.9.0.0 |
Eq (a :~~: b) | Since: base-4.10.0.0 |
Eq (f p) => Eq (M1 i c f p) | |
Eq (f (g p)) => Eq ((f :.: g) p) | |
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) | |
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) | Since: base-4.9.0.0 |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
class Fractional a => Floating a where #
Trigonometric and hyperbolic functions and related functions.
Minimal complete definition
pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh
Instances
class Num a => Fractional a where #
Fractional numbers, supporting real division.
Minimal complete definition
fromRational, (recip | (/))
Methods
fractional division
reciprocal fraction
fromRational :: Rational -> a #
Conversion from a Rational
(that is
).
A floating literal stands for an application of Ratio
Integer
fromRational
to a value of type Rational
, so such literals have type
(
.Fractional
a) => a
Instances
Fractional CFloat | |
Fractional CDouble | |
Integral a => Fractional (Ratio a) | Since: base-2.0.1 |
RealFloat a => Fractional (Complex a) | Since: base-2.1 |
Fractional a => Fractional (Identity a) | |
Fractional a => Fractional (Const a b) | |
class (Real a, Enum a) => Integral a where #
Integral numbers, supporting integer division.
Methods
quot :: a -> a -> a infixl 7 #
integer division truncated toward zero
integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == x
integer division truncated toward negative infinity
integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == x
conversion to Integer
Instances
class Applicative m => Monad (m :: * -> *) where #
The Monad
class defines the basic operations over a monad,
a concept from a branch of mathematics known as category theory.
From the perspective of a Haskell programmer, however, it is best to
think of a monad as an abstract datatype of actions.
Haskell's do
expressions provide a convenient syntax for writing
monadic expressions.
Instances of Monad
should satisfy the following laws:
Furthermore, the Monad
and Applicative
operations should relate as follows:
The above laws imply:
and that pure
and (<*>
) satisfy the applicative functor laws.
The instances of Monad
for lists, Maybe
and IO
defined in the Prelude satisfy these laws.
Minimal complete definition
Methods
(>>=) :: m a -> (a -> m b) -> m b infixl 1 #
Sequentially compose two actions, passing any value produced by the first as an argument to the second.
(>>) :: m a -> m b -> m b infixl 1 #
Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
Inject a value into the monadic type.
Fail with a message. This operation is not part of the
mathematical definition of a monad, but is invoked on pattern-match
failure in a do
expression.
As part of the MonadFail proposal (MFP), this function is moved
to its own class MonadFail
(see Control.Monad.Fail for more
details). The definition here will be removed in a future
release.
Instances
Monad [] | Since: base-2.1 |
Monad Maybe | Since: base-2.1 |
Monad IO | Since: base-2.1 |
Monad Par1 | Since: base-4.9.0.0 |
Monad Complex | Since: base-4.9.0.0 |
Monad Min | Since: base-4.9.0.0 |
Monad Max | Since: base-4.9.0.0 |
Monad First | Since: base-4.9.0.0 |
Monad Last | Since: base-4.9.0.0 |
Monad Option | Since: base-4.9.0.0 |
Monad Identity | Since: base-4.8.0.0 |
Monad Down | Since: base-4.11.0.0 |
Monad ReadP | Since: base-2.1 |
Monad NonEmpty | Since: base-4.9.0.0 |
Monad Vector | |
Monad Seq | |
Monad Put | |
Monad Tree | |
Monad SmallArray | |
Defined in Data.Primitive.SmallArray Methods (>>=) :: SmallArray a -> (a -> SmallArray b) -> SmallArray b # (>>) :: SmallArray a -> SmallArray b -> SmallArray b # return :: a -> SmallArray a # fail :: String -> SmallArray a # | |
Monad Array | |
Monad Rules | |
Monad Action | |
Monad P | Since: base-2.1 |
Monad (Either e) | Since: base-4.4.0.0 |
Monad (U1 :: * -> *) | Since: base-4.9.0.0 |
Monoid a => Monad ((,) a) | Since: base-4.9.0.0 |
ArrowApply a => Monad (ArrowMonad a) | Since: base-2.1 |
Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # fail :: String -> ArrowMonad a a0 # | |
Monad f => Monad (Rec1 f) | Since: base-4.9.0.0 |
(Applicative f, Monad f) => Monad (WhenMissing f x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods (>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b # (>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b # return :: a -> WhenMissing f x a # fail :: String -> WhenMissing f x a # | |
(Monad m, Error e) => Monad (ErrorT e m) | |
Monad (RAW ro rw) | |
Monad ((->) r :: * -> *) | Since: base-2.1 |
(Monad f, Monad g) => Monad (f :*: g) | Since: base-4.9.0.0 |
(Monad f, Monad g) => Monad (Product f g) | Since: base-4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.IntMap.Internal Methods (>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b # (>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b # return :: a -> WhenMatched f x y a # fail :: String -> WhenMatched f x y a # | |
(Applicative f, Monad f) => Monad (WhenMissing f k x) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods (>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b # (>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b # return :: a -> WhenMissing f k x a # fail :: String -> WhenMissing f k x a # | |
Monad f => Monad (M1 i c f) | Since: base-4.9.0.0 |
(Monad f, Applicative f) => Monad (WhenMatched f k x y) | Equivalent to Since: containers-0.5.9 |
Defined in Data.Map.Internal Methods (>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b # (>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b # return :: a -> WhenMatched f k x y a # fail :: String -> WhenMatched f k x y a # |
class Functor (f :: * -> *) where #
The Functor
class is used for types that can be mapped over.
Instances of Functor
should satisfy the following laws:
fmap id == id fmap (f . g) == fmap f . fmap g
The instances of Functor
for lists, Maybe
and IO
satisfy these laws.
Minimal complete definition
Instances
Functor [] | Since: base-2.1 |
Functor Maybe | Since: base-2.1 |
Functor IO | Since: base-2.1 |
Functor Par1 | |
Functor Complex | |
Functor Min | Since: base-4.9.0.0 |
Functor Max | Since: base-4.9.0.0 |
Functor First | Since: base-4.9.0.0 |
Functor Last | Since: base-4.9.0.0 |
Functor Option | Since: base-4.9.0.0 |
Functor ArgOrder | Since: base-4.6.0.0 |
Functor OptDescr | Since: base-4.6.0.0 |
Functor ArgDescr | Since: base-4.6.0.0 |
Functor Identity | Since: base-4.8.0.0 |