-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | A build-system library and driver
--
-- Soon to appear.
@package cake
@version 0.4.2.0
-- | This module provides the Parsek library developed by Koen
-- Claessen in his functional pearl article Parallel Parsing
-- Processes, Journal of Functional Programming, 14(6), 741757,
-- Cambridge University Press, 2004:
--
-- http://www.cs.chalmers.se/~koen/pubs/entry-jfp04-parser.html
--
-- http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/
--
--
-- http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/code/week3/Parsek.hs
--
-- Copyright (C) 2003 Koen Claessen
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or (at
-- your option) any later version.
--
-- This program is distributed in the hope that it will be useful, but
-- WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-- General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program; if not, write to the Free Software
-- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-- 02110-1301 USA.
--
-- PureFP.Parsers.Stream
module Parsek
data Parser s a
type Expect = [String]
type Unexpect = [String]
satisfy :: Show s => (s -> Bool) -> Parser s s
look :: Parser s [s]
succeeds :: Parser s a -> Parser s (Maybe a)
string :: (Eq s, Show s) => [s] -> Parser s [s]
char :: (Eq t, Show t) => t -> Parser t t
noneOf :: (Eq a, Show a) => [a] -> Parser a a
oneOf :: (Eq a, Show a) => [a] -> Parser a a
spaces :: Parser Char ()
space :: Parser Char Char
newline :: Parser Char Char
tab :: Parser Char Char
upper :: Parser Char Char
lower :: Parser Char Char
alphaNum :: Parser Char Char
letter :: Parser Char Char
digit :: Parser Char Char
hexDigit :: Parser Char Char
octDigit :: Parser Char Char
anyChar :: Parser s s
anySymbol :: Parser s s
munch :: (s -> Bool) -> Parser s [s]
munch1 :: Show s => (s -> Bool) -> Parser s [s]
label :: Parser s a -> String -> Parser s a
(>) :: Parser s a -> String -> Parser s a
pzero :: Parser s a
(<|>) :: Parser s a -> Parser s a -> Parser s a
(<<|>) :: Parser s a -> Parser s a -> Parser s a
try :: Parser s a -> Parser s a
choice :: [Parser s a] -> Parser s a
option :: a -> Parser s a -> Parser s a
optional :: Parser s a -> Parser s ()
between :: Parser s open -> Parser s close -> Parser s a -> Parser s a
count :: Int -> Parser s a -> Parser s [a]
chainl1 :: Parser s a -> Parser s (a -> a -> a) -> Parser s a
chainl :: Parser s a -> Parser s (a -> a -> a) -> a -> Parser s a
chainr1 :: Parser s a -> Parser s (a -> a -> a) -> Parser s a
chainr :: Parser s a -> Parser s (a -> a -> a) -> a -> Parser s a
skipMany1 :: Parser s a -> Parser s ()
skipMany :: Parser s a -> Parser s ()
many1 :: Parser s a -> Parser s [a]
many :: Parser s a -> Parser s [a]
sepBy1 :: Parser s a -> Parser s sep -> Parser s [a]
sepBy :: Parser s a -> Parser s sep -> Parser s [a]
type ParseMethod s a e r = P s a -> [s] -> ParseResult e r
type ParseResult e r = Either (e, Expect, Unexpect) r
parseFromFile :: Parser Char a -> ParseMethod Char a e r -> FilePath -> IO (ParseResult e r)
parse :: Parser s a -> ParseMethod s a e r -> [s] -> ParseResult e r
shortestResult :: ParseMethod s a (Maybe s) a
longestResult :: ParseMethod s a (Maybe s) a
longestResults :: ParseMethod s a (Maybe s) [a]
allResults :: ParseMethod s a (Maybe s) [a]
allResultsStaged :: ParseMethod s a (Maybe s) [[a]]
completeResults :: ParseMethod s a (Maybe s) [a]
shortestResultWithLeftover :: ParseMethod s a (Maybe s) (a, [s])
longestResultWithLeftover :: ParseMethod s a (Maybe s) (a, [s])
longestResultsWithLeftover :: ParseMethod s a (Maybe s) ([a], Maybe [s])
allResultsWithLeftover :: ParseMethod s a (Maybe s) [(a, [s])]
completeResultsWithLine :: ParseMethod Char a Int [a]
instance MonadPlus (Parser s)
instance Monad (Parser s)
instance Functor (Parser s)
module Cake.Core
-- | Rules map names of files to actions building them.
type Rule = P (Act ())
type P = Parser Char
(==>) :: P x -> (x -> Act a) -> Rule
data Act a
-- | Run an action in the context of a set of rules.
cake :: Rule -> Act () -> IO ()
-- | Try to build a file using known rules; then mark it as used.
need :: FilePath -> Act ()
-- | List directory contents by extension
list :: FilePath -> [Char] -> Act [String]
-- | Produce a file, using the given action. The action should be
-- independent of the context.
produce :: FilePath -> Act () -> Act ()
-- | Produce a file, using with the given action. The action should be
-- independent of the context. BUT: no problem to produce the same file
-- multiple times.
produce' :: FilePath -> Act () -> Act Answer
-- | Mark that a file is used. Do not chase dependencies on this file
-- though. (To be used eg. if a command uses an optional file).
use :: FilePath -> Act Answer
-- | File was modified by some command, but in a way that does not
-- invalidate previous computations. (This is probably only useful for
-- latex processing).
overwrote :: FilePath -> Act Answer
debug :: String -> Act ()
-- | Answer a question using the action given. The action must be
-- independent of the context.
distill :: Question -> Act Answer -> Act Answer
-- | Return a stamp (hash) for a file
fileStamp :: MonadIO m => FilePath -> m Answer
-- | Run the action in only in a clobbered state
cut :: Act () -> Act ()
data Question
FileContents :: FilePath -> Question
Listing :: FilePath -> String -> Question
Custom :: [String] -> Question
data Answer
Stamp :: (Maybe MD5Digest) -> Answer
Text :: [String] -> Answer
Failed :: Failure -> Answer
data Failure
CakeError :: String -> Failure
Panic :: Failure
ProcessError :: ExitCode -> Failure
-- | Is used within a monadic computation to begin exception processing.
throwError :: MonadError e m => forall a. e -> m a
instance Eq Status
instance Functor Act
instance Applicative Act
instance Monad Act
instance MonadIO Act
instance MonadState State Act
instance MonadWriter Written Act
instance MonadReader Context Act
instance MonadError Failure Act
instance Alternative P
instance Applicative P
instance Error Failure
instance Show Question
instance Binary Answer
instance Eq Answer
instance Show Answer
instance Binary Failure
instance Binary ExitCode
instance Eq Failure
instance Show Failure
instance Binary Question
instance Eq Question
instance Ord Question
module Cake.Process
processIO :: FilePath -> [String] -> Maybe FilePath -> Maybe FilePath -> Act ()
system :: [String] -> Act ()
module Cake.Rules
extension :: String -> P (String, String)
anyExtension :: [String] -> P (String, String)
copy :: FilePath -> FilePath -> Act ()
mkdir :: FilePath -> Act ()
touch :: FilePath -> Act ()
readFile :: FilePath -> Act String
_pdflatex :: String -> Act ()
_bibtex :: String -> Act ()
pandoc :: [Char] -> [Char] -> [String] -> Act ()
graphviz :: String -> [Char] -> [Char] -> [String] -> Act ()
needing :: [FilePath] -> Act () -> Act ()
simple :: String -> [Char] -> (String -> [Char] -> Act ()) -> Rule
tex_markdown_standalone :: Rule
pdf_tex :: Rule
argsOf :: [Char] -> [[Char]] -> [[Char]]
getBibFiles :: String -> Act Answer
(++?) :: Eq a => [a] -> [a] -> [a]
includedTex :: FilePath -> Act [[Char]]
chaseDeps :: FilePath -> Act ()
pdflatexBibtex :: [Char] -> Act ()
pdf_tex_bibtex :: Rule
pdflatexBiblatex :: [Char] -> Act ()
pdf_tex_biblatex :: Rule
_lhs2TeX :: String -> String -> Act ()
lhs2tex :: [Char] -> Act ()
tex_lhs :: Rule
allRules :: Parser Char (Act ())
module Cake.Marxup
ghcMake :: FilePath -> Act ()
marxup :: FilePath -> Act ()
mpost :: String -> Act ()
remove :: String -> Act ()
pdf_marxup :: FilePath -> Act ()
module Cake