-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Prelude based on protolude for GHC 8 and beyond. -- -- A Prelude relpacement for GHC 8 with a focus on building applications -- with Lenses, Machines, and Applicatives. @package liblawless @version 0.25.2 module Unicode module Tree module Textual module Text module Set -- | A set of values a. data Set a :: * -> * sing :: Getter a (Set a) module Printer module Parser -- | Network type library module Networking module Map -- | A Map from keys k to values a. data Map k a :: * -> * -> * -- | O(1). A map with a single element. -- --
--   singleton 1 'a'        == fromList [(1, 'a')]
--   size (singleton 1 'a') == 1
--   
singleton :: k -> a -> Map k a module Lawless module Machine (⇝) :: Monad m => MachineT m k b -> ProcessT m b c -> MachineT m k c infixl 9 ⇝ (⇜) :: Monad m => ProcessT m b c -> MachineT m k b -> MachineT m k c infixr 9 ⇜ (↣) :: MonadBaseControl IO m => MachineT m k b -> ProcessT m b c -> MachineT m k c infixl 7 ↣ (↢) :: MonadBaseControl IO m => ProcessT m b c -> MachineT m k b -> MachineT m k c infixr 7 ↢ (⧻) :: forall m a b c d. MonadBaseControl IO m => ProcessT m a b -> ProcessT m c d -> ProcessT m (Either a c) (Either b d) infixr 6 ⧻ (⫴) :: forall m a b r. MonadBaseControl IO m => ProcessT m a r -> ProcessT m b r -> ProcessT m (Either a b) r infixr 6 ⫴ module Text.IO readFile :: (MonadIO m) => AbsRelFile -> m Text writeFile :: (MonadIO m) => AbsRelFile -> Text -> m () appendFile :: (MonadIO m) => AbsRelFile -> Text -> m () getLine :: (MonadIO m) => m Text putStr :: (MonadIO m) => Text -> m () putStrLn :: (MonadIO m) => Text -> m () hGetLine :: (MonadIO m) => Handle -> m Text hPutStr :: (MonadIO m) => Handle -> Text -> m () hPutStrLn :: (MonadIO m) => Handle -> Text -> m () -- | Read lines of Text from a Handle until $EOF$ is reached. readLines :: forall (m :: * -> *). (MonadIO m) => Handle -> SourceT m Text -- | Write lines of Text to a Handle until there are no more. -- Forwards them on. writeLines :: forall (m :: * -> *). (MonadIO m) => Handle -> ProcessT m Text Text module IO.Base module Random -- | Generate an endless range of random numbers between [a, a] -- inclusive. (This is randomRIO lifted.) randomR :: (Random a, MonadBase IO m) => (a, a) -> m a -- | Generate an endless stream of values. (This is randomIO -- lifted.) random :: (Random a, MonadBase IO m) => m a module STM.Base -- | A value of type IO a is a computation which, when -- performed, does some I/O before returning a value of type a. -- -- There is really only one way to "perform" an I/O action: bind it to -- Main.main in your program. When your program is run, the I/O -- will be performed. It isn't possible to perform I/O from an arbitrary -- function, unless that function is itself in the IO monad and -- called at some point, directly or indirectly, from Main.main. -- -- IO is a monad, so IO actions can be combined using -- either the do-notation or the >> and >>= -- operations from the Monad class. data IO a :: * -> * -- | A monad supporting atomic memory transactions. data STM a :: * -> * -- | atomically lifted to MonadBase IO. atomically :: MonadBase IO m => STM α -> m α -- | newTVarIO at the top level, lifted. newTVarIO :: MonadBase IO m => a -> m (TVar a) -- | newTMVarIO at the top level, lifted. newTMVarIO :: MonadBase IO m => a -> m (TMVar a) -- | newTMVarIO at the top level, lifted. newEmptyTMVarIO :: MonadBase IO m => m (TMVar a) -- | newTBChanIO at the top level, lifted, only with a saturated -- length. newTBChanIO :: (MonadBase IO m, Integral l) => l -> m (TBChan a) newTBChan :: Integral l => l -> STM (TBChan a) instance GHC.Real.Real STM.Base.BoundedLength instance GHC.Real.Integral STM.Base.BoundedLength instance GHC.Num.Num STM.Base.BoundedLength instance GHC.Enum.Enum STM.Base.BoundedLength instance GHC.Enum.Bounded STM.Base.BoundedLength instance GHC.Show.Show STM.Base.BoundedLength instance GHC.Classes.Ord STM.Base.BoundedLength instance GHC.Classes.Eq STM.Base.BoundedLength module STM.Flag -- | A Flag used for mutexes. newtype Flag Flag :: TSem -> Flag -- | Creates a new Flag in the held state. newFlag :: (MonadBase IO m) => m Flag -- | Waits for a Flag to be unheld. waitFlag :: Flag -> STM () -- | Signals a Flag has been released. lowerFlag :: Flag -> STM () -- | Runs f in a new Async, waiting for the Async to -- start before continuing. run :: MonadBaseControl IO m => m a -> m (Async (StM m a)) module STM.Hub -- | The length of a Hub, guaranteed to be positive. data HubLength -- | The Hub receives the messages from various Sources. data Hub a hub :: MonadBase IO m => HubLength -> m (Hub a) hubMsg :: MonadBase IO m => (Hub a) -> (m a) hubEmpty :: MonadBase IO m => (Hub a) -> (m Bool) -- | A Source attached to a Hub that can send messages to it. data Source a -- | Create a Source attached to a Hub. source :: Getter (Hub a) (Source a) -- | Send a message to a Hub through a Source. sourceMsg :: MonadBase IO m => Source a -> a -> m () instance GHC.Real.Real STM.Hub.HubLength instance GHC.Real.Integral STM.Hub.HubLength instance GHC.Num.Num STM.Hub.HubLength instance GHC.Enum.Enum STM.Hub.HubLength instance GHC.Enum.Bounded STM.Hub.HubLength instance GHC.Show.Show STM.Hub.HubLength instance GHC.Classes.Ord STM.Hub.HubLength instance GHC.Classes.Eq STM.Hub.HubLength module STM.Scatter -- | A Scatter is a single source that can broadcast messages to any -- number of subscribers. data Scatter a -- | Creates a new Scatter. scatter :: MonadBase IO m => m (Scatter a) -- | Post a message to a Scatter to all the subscribed -- Gathers. scatterMsg :: MonadBase IO m => Scatter a -> a -> m () -- | A Gather receives copies of all messages posted to the -- Scatter it was derived from. data Gather a -- | Create a new Gather from a given Scatter. gather :: MonadBase IO m => Getter (Scatter a) (m (Gather a)) -- | Read a message posted to a Gather by a Scatter. gatherMsg :: MonadBase IO m => Gather a -> m a module STM module Generics module Exception module ByteString module Boomerang type TextBoomerang a b = Boomerang TextError Text a b parseText :: forall r b. (IsText b) => StringBoomerang () (r :- ()) -> b -> Either TextError r unparseText :: forall r b. (IsText b) => StringBoomerang () (r :- ()) -> r -> Maybe b (∘) :: forall (b :: k) (c :: k) (a :: k) (cat :: k -> k -> *). Category cat => cat b c -> cat a b -> cat a c infixr 9 ∘ module Aeson lawlessJSONOptions :: Options lawlessToJSONEncoding :: forall a. (GToEncoding (Rep a), Generic a) => a -> Encoding lawlessParseJSON :: forall a. (GFromJSON (Rep a), Generic a) => Value -> Parser a module Path -- | Add an extension, even if there is already one there. E.g. -- addExtension "foo.txt" "bat" -> "foo.txt.bat". -- --
--   > Path.addExtension (relFile "file.txt") "bib" == Posix.relFile "file.txt.bib"
--   > Path.addExtension (relFile "file.") ".bib" == Posix.relFile "file..bib"
--   > Path.addExtension (relFile "file") ".bib" == Posix.relFile "file.bib"
--   > Path.addExtension Path.emptyFile "bib" == Posix.relFile ".bib"
--   > Path.addExtension Path.emptyFile ".bib" == Posix.relFile ".bib"
--   > Path.takeFileName (Path.addExtension Path.emptyFile "ext") == Posix.relFile ".ext"
--   
addExtension :: FilePath os ar -> String -> FilePath os ar -- | Join an (absolute or relative) directory path with a relative (file or -- directory) path to form a new path. combine :: DirPath os ar -> RelPath os fd -> Path os ar fd currentDir :: RelDir -- | Remove last extension, and the "." preceding it. -- --
--   > Path.dropExtension x == fst (Path.splitExtension x)
--   
dropExtension :: FilePath os ar -> FilePath os ar -- | Drop all extensions -- --
--   > not $ Path.hasAnExtension (Path.dropExtensions x)
--   
dropExtensions :: FilePath os ar -> FilePath os ar -- | Synonym for takeDirectory dropFileName :: FilePath os ar -> DirPath os ar emptyFile :: RelFile mapFileName :: (String -> String) -> FilePath os ar -> FilePath os ar mapFileNameF :: Functor f => (String -> f String) -> FilePath os ar -> f (FilePath os ar) replaceBaseName :: FilePath os ar -> String -> FilePath os ar replaceDirectory :: FilePath os ar1 -> DirPath os ar2 -> FilePath os ar2 -- | Set the extension of a file, overwriting one if already present. -- --
--   > Path.replaceExtension (relFile "file.txt") ".bob" == Posix.relFile "file.bob"
--   > Path.replaceExtension (relFile "file.txt") "bob" == Posix.relFile "file.bob"
--   > Path.replaceExtension (relFile "file") ".bob" == Posix.relFile "file.bob"
--   > Path.replaceExtension (relFile "file.txt") "" == Posix.relFile "file"
--   > Path.replaceExtension (relFile "file.fred.bob") "txt" == Posix.relFile "file.fred.txt"
--   
replaceExtension :: FilePath os ar -> String -> FilePath os ar replaceFileName :: FilePath os ar -> String -> FilePath os ar rootDir :: AbsDir splitDirName :: DirPath os ar -> Maybe (DirPath os ar, RelDir os) -- | Split on the extension. addExtension is the inverse. -- --
--   > uncurry (<.>) (Path.splitExtension x) == x
--   > uncurry Path.addExtension (Path.splitExtension x) == x
--   > Path.splitExtension (relFile "file.txt") == (Posix.relFile "file",".txt")
--   > Path.splitExtension (relFile ".bashrc") == (Posix.emptyFile, ".bashrc")
--   > Path.splitExtension (relFile "file") == (Posix.relFile "file","")
--   > Path.splitExtension (relFile "file/file.txt") == (Posix.relFile "file/file",".txt")
--   > Path.splitExtension (relFile "file.txt/boris") == (Posix.relFile "file.txt/boris","")
--   > Path.splitExtension (relFile "file.txt/boris.ext") == (Posix.relFile "file.txt/boris",".ext")
--   > Path.splitExtension (relFile "file/path.txt.bob.fred") == (Posix.relFile "file/path.txt.bob",".fred")
--   
splitExtension :: FilePath os ar -> (FilePath os ar, String) -- | Split on all extensions -- --
--   > Path.splitExtensions (relFile "file.tar.gz") == (Posix.relFile "file",".tar.gz")
--   
splitExtensions :: FilePath os ar -> (FilePath os ar, String) splitFileName :: FilePath os ar -> (DirPath os ar, RelFile os) -- | Deconstructs a path into its components. -- --
--   > Path.splitPath (Posix.absDir "/tmp/someDir/mydir.dir") == (True, map relDir ["tmp","someDir","mydir.dir"], Nothing)
--   > Path.splitPath (Posix.absFile "/tmp/someDir/myfile.txt") == (True, map relDir ["tmp","someDir"], Just $ relFile "myfile.txt")
--   
splitPath :: (AbsRel ar, FileOrDir fd) => Path os ar fd -> (Bool, [RelDir os], Maybe (RelFile os)) -- | Get the basename of a file -- --
--   > Path.takeBaseName (absFile "/tmp/somedir/myfile.txt") == Posix.relFile "myfile"
--   > Path.takeBaseName (relFile "./myfile.txt") == Posix.relFile "myfile"
--   > Path.takeBaseName (relFile "myfile.txt") == Posix.relFile "myfile"
--   
takeBaseName :: FilePath os ar -> RelFile os takeDirName :: DirPath os ar -> Maybe (RelDir os) takeDirectory :: FilePath os ar -> DirPath os ar -- | Get the extension of a file, returns "" for no extension, -- .ext otherwise. -- --
--   > Path.takeExtension x == snd (Path.splitExtension x)
--   > Path.takeExtension (Path.addExtension x "ext") == ".ext"
--   > Path.takeExtension (Path.replaceExtension x "ext") == ".ext"
--   
takeExtension :: FilePath os ar -> String -- | Get all extensions -- --
--   > Path.takeExtensions (Posix.relFile "file.tar.gz") == ".tar.gz"
--   
takeExtensions :: FilePath os ar -> String -- | Get the filename component of a file path (ie stripping all parent -- dirs) -- --
--   > Path.takeFileName (absFile "/tmp/somedir/myfile.txt") == Posix.relFile "myfile.txt"
--   > Path.takeFileName (relFile "./myfile.txt") == Posix.relFile "myfile.txt"
--   > Path.takeFileName (relFile "myfile.txt") == Posix.relFile "myfile.txt"
--   
takeFileName :: FilePath os ar -> RelFile os takeSuperDirectory :: DirPath os ar -> Maybe (DirPath os ar) toString :: (AbsRel ar, FileDir fd) => Path ar fd -> String -- | Convert a file to a directory path. Obviously, the corresponding disk -- object won't change accordingly. The purpose of this function is to be -- an intermediate step when deriving a directory name from a file name. dirFromFile :: FilePath os ar -> DirPath os ar dirFromFileDir :: FileDirPath os ar -> DirPath os ar dynamicMakeAbsolute :: System os => AbsDir os -> AbsRelPath os fd -> AbsPath os fd dynamicMakeAbsoluteFromCwd :: System os => AbsRelPath os fd -> IO (AbsPath os fd) equalFilePath :: String -> String -> Bool -- | Convert a directory to a file path. The function returns -- Nothing if the directory path is empty. The purpose of this -- function is to be an intermediate step when deriving a file name from -- a directory name. fileFromDir :: DirPath os ar -> Maybe (FilePath os ar) fileFromFileDir :: FileDirPath os ar -> Maybe (FilePath os ar) fromFileDir :: FileDir fd => FileDirPath os ar -> Maybe (Path os ar fd) -- | As for makeAbsolute, but for use when the path may already be -- absolute (in which case it is left unchanged). You should avoid the -- use of genericMakeAbsolute-type functions, because then you -- avoid to absolutize a path that was already absolutized. -- --
--   > Path.genericMakeAbsolute (absDir "/tmp") (relFile "file.txt")       == Posix.absFile "/tmp/file.txt"
--   > Path.genericMakeAbsolute (absDir "/tmp") (relFile "adir/file.txt")  == Posix.absFile "/tmp/adir/file.txt"
--   > Path.genericMakeAbsolute (absDir "/tmp") (absFile "/adir/file.txt") == Posix.absFile "/adir/file.txt"
--   
genericMakeAbsolute :: (System os, AbsRel ar) => AbsDir os -> Path os ar fd -> AbsPath os fd -- | As for makeAbsoluteFromCwd, but for use when the path may -- already be absolute (in which case it is left unchanged). genericMakeAbsoluteFromCwd :: (System os, AbsRel ar) => Path os ar fd -> IO (AbsPath os fd) -- | Constructs a RelPath from a list of components. It is an -- unchecked error if the path components contain path separators. It is -- an unchecked error if a RelFile path is empty. -- --
--   > Path.joinPath ["tmp","someDir","dir"] == Posix.relDir "tmp/someDir/dir"
--   > Path.joinPath ["tmp","someDir","file.txt"] == Posix.relFile "tmp/someDir/file.txt"
--   
joinPath :: FileDir fd => [String] -> RelPath os fd -- | Joins an absolute directory with a relative path to construct a new -- absolute path. -- --
--   > Path.makeAbsolute (absDir "/tmp") (relFile "file.txt")      == Posix.absFile "/tmp/file.txt"
--   > Path.makeAbsolute (absDir "/tmp") (relFile "adir/file.txt") == Posix.absFile "/tmp/adir/file.txt"
--   > Path.makeAbsolute (absDir "/tmp") (relDir  "adir/dir")      == Posix.absDir "/tmp/adir/dir"
--   
makeAbsolute :: System os => AbsDir os -> RelPath os fd -> AbsPath os fd -- | Converts a relative path into an absolute one by prepending the -- current working directory. makeAbsoluteFromCwd :: System os => RelPath os fd -> IO (AbsPath os fd) -- | This function can be used to construct a relative path by removing the -- supplied AbsDir from the front. It is a runtime error if -- the supplied AbsPath doesn't start with the AbsDir. -- --
--   > Path.makeRelative (absDir "/tmp/somedir") (absFile "/tmp/somedir/anotherdir/file.txt") == Posix.relFile "anotherdir/file.txt"
--   > Path.makeRelative (absDir "/tmp/somedir") (absDir "/tmp/somedir/anotherdir/dir") == Posix.relDir "anotherdir/dir"
--   > Path.makeRelative (absDir "c:\\tmp\\somedir") (absFile "C:\\Tmp\\SomeDir\\AnotherDir\\File.txt") == Windows.relFile "AnotherDir\\File.txt"
--   > Path.makeRelative (absDir "c:\\tmp\\somedir") (absDir "c:\\tmp\\somedir\\anotherdir\\dir") == Windows.relDir "anotherdir\\dir"
--   > Path.makeRelative (absDir "c:tmp\\somedir") (absDir "c:tmp\\somedir\\anotherdir\\dir") == Windows.relDir "anotherdir\\dir"
--   
makeRelative :: (System os, FileDir fd) => AbsDir os -> AbsPath os fd -> RelPath os fd makeRelativeMaybe :: (System os, FileDir fd) => AbsDir os -> AbsPath os fd -> Maybe (RelPath os fd) -- | Currently just transforms: -- --
--   > Path.normalise (absFile "/tmp/fred/./jim/./file") == Posix.absFile "/tmp/fred/jim/file"
--   
normalise :: System os => Path os ar fd -> Path os ar fd -- | Map over the components of the path. -- --
--   > Path.pathMap (map toLower) (absDir "/tmp/Reports/SpreadSheets") == Posix.absDir "/tmp/reports/spreadsheets"
--   
pathMap :: FileDir fd => (String -> String) -> Path os ar fd -> Path os ar fd toFileDir :: FileDir fd => Path os ar fd -> FileDirPath os ar -- | Test whether a Path ar fd is absolute. -- --
--   > Path.isAbsolute (Posix.absFile "/fred")
--   > Path.isAbsolute (Windows.absFile "\\fred")
--   > Path.isAbsolute (Windows.absFile "c:\\fred")
--   > Path.isAbsolute (Windows.absFile "c:fred")
--   
isAbsolute :: AbsRel ar => Path os ar fd -> Bool -- | Invariant - this should return True iff arg is of type Path -- Part.Rel _ -- --
--    isRelative = not . isAbsolute
--   > Path.isRelative (Posix.relFile "fred")
--   > Path.isRelative (Windows.relFile "fred")
--   
isRelative :: AbsRel ar => Path os ar fd -> Bool isAbsoluteString :: String -> Bool isRelativeString :: String -> Bool -- | Does the given filename have an extension? -- --
--   > null (Path.takeExtension x) == not (Path.hasAnExtension x)
--   
hasAnExtension :: FilePath os ar -> Bool -- | Does the given filename have the given extension? -- --
--   > Path.hasExtension ".hs" (Posix.relFile "MyCode.hs")
--   > Path.hasExtension ".hs" (Posix.relFile "MyCode.bak.hs")
--   > not $ Path.hasExtension ".hs" (Posix.relFile "MyCode.hs.bak")
--   
hasExtension :: String -> FilePath os ar -> Bool -- | Part.File extension character -- --
--   > Posix.extSeparator == '.'
--   
extSeparator :: Char -- | The character that is used to separate the entries in the $PATH -- environment variable. searchPathSeparator :: Char -- | Is the character an extension character? -- --
--   > Posix.isExtSeparator a == (a == Posix.extSeparator)
--   
isExtSeparator :: Char -> Bool -- | Is the character a file separator? -- --
--   > Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)
--   
isSearchPathSeparator :: Char -> Bool -- | This is a more flexible variant of addExtension / -- <.> which can work with files or directories -- --
--   > Path.genericAddExtension (absDir "/") "x" == Posix.absDir "/.x"
--   > Path.genericAddExtension (absDir "/a") "x" == Posix.absDir "/a.x"
--   > Path.genericAddExtension Path.emptyFile "x" == Posix.relFile ".x"
--   > Path.genericAddExtension Path.emptyFile "" == Posix.emptyFile
--   
genericAddExtension :: FileDir fd => Path os ar fd -> String -> Path os ar fd genericDropExtension :: FileDir fd => Path os ar fd -> Path os ar fd genericDropExtensions :: FileDir fd => Path os ar fd -> Path os ar fd genericSplitExtension :: FileDir fd => Path os ar fd -> (Path os ar fd, String) genericSplitExtensions :: FileDir fd => Path os ar fd -> (Path os ar fd, String) genericTakeExtension :: FileDir fd => Path os ar fd -> String genericTakeExtensions :: FileDir fd => Path os ar fd -> String parse :: (AbsRel ar, FileDir fd) => String -> Either String (Path ar fd) toText :: (AbsRel ar, FileDir fd) => Path ar fd -> Text type AbsFile = AbsFile System type RelFile = RelFile System type AbsDir = AbsDir System type RelDir = RelDir System type AbsRelFile = AbsRelFile System type AbsRelDir = AbsRelDir System type File ar = File System ar absFile :: (IsText t) => t -> AbsFile relFile :: (IsText t) => t -> RelFile absDir :: (IsText t) => t -> AbsDir relDir :: (IsText t) => t -> RelDir absRelFile :: (IsText t) => t -> AbsRelFile absRelDir :: (IsText t) => t -> AbsRelDir -- | Infix variant of combine. -- --
--   > Posix.toString (Posix.absDir "/tmp" </> Posix.relFile "file.txt") == "/tmp/file.txt"
--   > Posix.toString (Posix.absDir "/tmp" </> Posix.relDir "dir" </> Posix.relFile "file.txt") == "/tmp/dir/file.txt"
--   > Posix.toString (Posix.relDir "dir" </> Posix.relFile "file.txt") == "dir/file.txt"
--   > Windows.toString (Windows.absDir "\\tmp" </> Windows.relFile "file.txt") == "\\tmp\\file.txt"
--   > Windows.toString (Windows.absDir "c:\\tmp" </> Windows.relFile "file.txt") == "c:\\tmp\\file.txt"
--   > Windows.toString (Windows.absDir "c:tmp" </> Windows.relFile "file.txt") == "c:tmp\\file.txt"
--   > Windows.toString (Windows.absDir "c:\\" </> Windows.relDir "tmp" </> Windows.relFile "file.txt") == "c:\\tmp\\file.txt"
--   > Windows.toString (Windows.absDir "c:" </> Windows.relDir "tmp" </> Windows.relFile "file.txt") == "c:tmp\\file.txt"
--   > Windows.toString (Windows.relDir "dir" </> Windows.relFile "file.txt") == "dir\\file.txt"
--   
() :: DirPath os ar -> RelPath os fd -> Path os ar fd infixr 5 -- | Infix variant of addExtension. We only allow files (and not -- directories) to have extensions added by this function. This is -- because it's the vastly common case and an attempt to add one to a -- directory will - more often than not - represent an error. We don't -- however want to prevent the corresponding operation on directories, -- and so we provide a function that is more flexible: -- genericAddExtension. (<.>) :: FilePath os ar -> String -> FilePath os ar infixl 7 <.> (<++>) :: FilePath os ar -> String -> FilePath os ar infixl 7 <++> instance Data.Aeson.Types.Class.FromJSON System.Path.Posix.AbsFile instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.AbsFile instance Data.Aeson.Types.Class.FromJSON System.Path.Posix.AbsDir instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.AbsDir instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.RelFile instance Data.Aeson.Types.Class.FromJSON System.Path.Posix.RelDir instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.RelDir instance Data.Aeson.Types.Class.FromJSON System.Path.Posix.AbsRelDir instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.AbsRelDir instance Data.Aeson.Types.Class.FromJSON System.Path.Posix.AbsRelFile instance Data.Aeson.Types.Class.ToJSON System.Path.Posix.AbsRelFile module IO -- | Read and parse a 'Textual" from stdin. getLine :: (MonadIO m, MonadThrow m, Textual t) => m t -- | Read and parse a Textual from a Handle. hGetLine :: (MonadIO m, MonadThrow m, Textual t) => Handle -> m t -- | Write a Printer to stdout. putStr :: (MonadIO m) => Builder -> m () -- | Write a Printer plus a newline to stdout. putStrLn :: MonadIO m => Builder -> m () -- | Write a Printer to a Handle. hPutStr :: (MonadIO m) => Handle -> Builder -> m () -- | Write a Printer plus a newline to stderr. hPutStrLn :: (MonadIO m) => Handle -> Builder -> m () -- | Exception representing a failure to parse a Textual. data ParseError peReason :: Lens' ParseError Text peStack :: Lens' ParseError [Text] -- | A class for monads in which exceptions may be thrown. -- -- Instances should obey the following law: -- --
--   throwM e >> x = throwM e
--   
-- -- In other words, throwing an exception short-circuits the rest of the -- monadic computation. class Monad m => MonadThrow (m :: * -> *) -- | A class for monads which allow exceptions to be caught, in particular -- exceptions which were thrown by throwM. -- -- Instances should obey the following law: -- --
--   catch (throwM e) f = f e
--   
-- -- Note that the ability to catch an exception does not guarantee -- that we can deal with all possible exit points from a computation. -- Some monads, such as continuation-based stacks, allow for more than -- just a success/failure strategy, and therefore catch -- cannot be used by those monads to properly implement a function -- such as finally. For more information, see MonadMask. class MonadThrow m => MonadCatch (m :: * -> *) -- | A class for monads which provide for the ability to account for all -- possible exit points from a computation, and to mask asynchronous -- exceptions. Continuation-based monads, and stacks such as ErrorT e -- IO which provide for multiple failure modes, are invalid -- instances of this class. -- -- Note that this package does provide a MonadMask -- instance for CatchT. This instance is only valid if -- the base monad provides no ability to provide multiple exit. For -- example, IO or Either would be invalid base monads, -- but Reader or State would be acceptable. -- -- Instances should ensure that, in the following code: -- --
--   f `finally` g
--   
-- -- The action g is called regardless of what occurs within -- f, including async exceptions. class MonadCatch m => MonadMask (m :: * -> *) -- | Haskell defines operations to read and write characters from and to -- files, represented by values of type Handle. Each value of -- this type is a handle: a record used by the Haskell run-time -- system to manage I/O with file system objects. A handle has at -- least the following properties: -- -- -- -- Most handles will also have a current I/O position indicating where -- the next input or output operation will occur. A handle is -- readable if it manages only input or both input and output; -- likewise, it is writable if it manages only output or both -- input and output. A handle is open when first allocated. Once -- it is closed it can no longer be used for either input or output, -- though an implementation cannot re-use its storage while references -- remain to it. Handles are in the Show and Eq classes. -- The string produced by showing a handle is system dependent; it should -- include enough information to identify the handle for debugging. A -- handle is equal according to == only to itself; no attempt is -- made to compare the internal state of different handles for equality. data Handle :: * data TemporaryFile tfPath :: Lens' TemporaryFile AbsFile tfHandle :: Lens' TemporaryFile Handle binaryTemporaryFile :: (MonadIO m, MonadMask m, MonadThrow m) => AbsDir -> RelFile -> (TemporaryFile -> m a) -> m a textTemporaryFile :: (MonadIO m, MonadMask m, MonadThrow m) => AbsDir -> RelFile -> (TemporaryFile -> m a) -> m a -- | Save the current file position, seek relative to it, perform a -- function, and then return to the original position. withOffset :: (MonadIO m, MonadMask m) => Handle -> FileOffset -> (Handle -> m a) -> m a -- | Save the current file position, seek to a new position, perform a -- function, then return to the original position. withPosition :: (MonadIO m, MonadMask m) => Handle -> FilePosition -> (Handle -> m a) -> m a withCurrentPosition :: (MonadIO m, MonadMask m) => Handle -> (Handle -> m a) -> m a -- | Monads in which IO computations may be embedded. Any monad -- built by applying a sequence of monad transformers to the IO -- monad will be an instance of this class. -- -- Instances should satisfy the following laws, which state that -- liftIO is a transformer of monads: -- -- class Monad m => MonadIO (m :: * -> *) -- | Lift a computation from the IO monad. liftIO :: MonadIO m => IO a -> m a -- | Lift a computation from the IO monad. liftIO :: MonadIO m => forall a. IO a -> m a -- | See openFile data IOMode :: * ReadMode :: IOMode WriteMode :: IOMode AppendMode :: IOMode ReadWriteMode :: IOMode -- | Binary files, no buffering. binaryFile :: (MonadIO m, MonadMask m, AbsRel ar) => File ar -> IOMode -> (Handle -> m a) -> m a -- | Text files, line-buffered. textFile :: (MonadIO m, MonadMask m, AbsRel ar) => File ar -> IOMode -> (Handle -> m a) -> m a isEOF :: MonadIO m => Handle -> m Bool close :: MonadIO m => Handle -> m () doesFileExist :: (MonadIO m, AbsRel ar) => File ar -> m Bool removeFile :: (MonadIO m, AbsRel ar) => File ar -> m () -- | A handle managing input from the Haskell program's standard input -- channel. stdin :: Handle -- | A handle managing output to the Haskell program's standard output -- channel. stdout :: Handle -- | A handle managing output to the Haskell program's standard error -- channel. stderr :: Handle instance Data.Textual.Printable IO.FilePosition instance GHC.Real.Integral IO.FilePosition instance GHC.Num.Num IO.FilePosition instance GHC.Real.Real IO.FilePosition instance GHC.Enum.Enum IO.FilePosition instance GHC.Show.Show IO.FilePosition instance GHC.Classes.Ord IO.FilePosition instance GHC.Classes.Eq IO.FilePosition instance Data.Textual.Printable IO.FileOffset instance GHC.Real.Integral IO.FileOffset instance GHC.Num.Num IO.FileOffset instance GHC.Real.Real IO.FileOffset instance GHC.Enum.Enum IO.FileOffset instance GHC.Show.Show IO.FileOffset instance GHC.Classes.Ord IO.FileOffset instance GHC.Classes.Eq IO.FileOffset instance Data.Textual.Printable IO.ParseError instance GHC.Show.Show IO.ParseError instance GHC.Exception.Exception IO.ParseError instance GHC.Classes.Ord IO.ParseError instance GHC.Classes.Eq IO.ParseError module Environment -- | A key in the Environment. data EnvName _EnvName :: Iso' EnvName Text -- | A value in the Environment data EnvValue _EnvValue :: Iso' EnvValue Text -- | Lens for the system environment. -- -- lens ∷ Functor f => (s -> a) -> (s -> b -> t) -> (a -- -> f b) -> s -> f t -- -- Lens s t a b = Functor f ⇒ (a → f b) → s → f t -- -- lookupEnv s → a: EnvName → m (Maybe EnvValue) -- -- setEnv s → b → t: EnvName → EnvValue → m () -- -- s: EnvName t: m () a: m (Maybe EnvValue) b: EnvValue environment :: MonadIO m => Lens EnvName (m ()) (m (Maybe EnvValue)) EnvValue data Arg _Arg :: Iso' Arg Text args :: (MonadIO m) => m [Arg] data ProgName _ProgName :: Iso' ProgName Text progName :: (MonadIO m) => m ProgName instance Data.Text.Lens.IsText Environment.ProgName instance Data.Textual.Printable Environment.ProgName instance GHC.Classes.Ord Environment.ProgName instance GHC.Show.Show Environment.ProgName instance GHC.Classes.Eq Environment.ProgName instance Data.Text.Lens.IsText Environment.Arg instance Data.Textual.Printable Environment.Arg instance GHC.Classes.Ord Environment.Arg instance GHC.Show.Show Environment.Arg instance GHC.Classes.Eq Environment.Arg instance Data.Text.Lens.IsText Environment.EnvValue instance Data.Textual.Printable Environment.EnvValue instance GHC.Show.Show Environment.EnvValue instance GHC.Classes.Ord Environment.EnvValue instance GHC.Classes.Eq Environment.EnvValue instance Data.Text.Lens.IsText Environment.EnvName instance Data.Textual.Printable Environment.EnvName instance GHC.Show.Show Environment.EnvName instance GHC.Classes.Ord Environment.EnvName instance GHC.Classes.Eq Environment.EnvName module Time data Time data Seconds -- | The class of types which can be parsed given a UNIX-style time format -- string. class ParseTime t -- | Builds a time value from a parsed input string. If the input does not -- include all the information needed to construct a complete value, any -- missing parts should be taken from 1970-01-01 00:00:00 +0000 (which -- was a Thursday). In the absence of %C or %Y, century -- is 1969 - 2068. buildTime :: ParseTime t => TimeLocale -> [(Char, String)] -> Maybe t class FormatTime t formatCharacter :: FormatTime t => Char -> Maybe (TimeLocale -> Maybe NumericPadOption -> t -> String) _Time :: Iso' Time UTCTime -- | Lens for the Day component of a Time. day :: Lens' Time Day -- | Lens for the DiffTime component of a Time. time :: Lens' Time DiffTime -- | Get the current system time. now :: MonadIO m => m Time -- | Convert between Double and Seconds. seconds :: Iso' Double DiffTime instance GHC.Real.RealFrac Time.Seconds instance GHC.Real.Real Time.Seconds instance GHC.Num.Num Time.Seconds instance Data.Data.Data Time.Seconds instance GHC.Real.Fractional Time.Seconds instance GHC.Enum.Enum Time.Seconds instance GHC.Show.Show Time.Seconds instance GHC.Classes.Ord Time.Seconds instance GHC.Classes.Eq Time.Seconds instance Data.Aeson.Types.Class.ToJSON Time.Time instance Data.Aeson.Types.Class.FromJSON Time.Time instance Data.Aeson.Types.Class.FromJSON Time.Seconds instance Data.Aeson.Types.Class.ToJSON Time.Seconds instance Data.Binary.Class.Binary Time.Seconds instance Data.Binary.Class.Binary Time.Time instance Data.Textual.Printable Time.Time instance Data.Textual.Textual Time.Time instance GHC.Generics.Generic Time.Time instance Data.Time.Format.FormatTime Time.Time instance Data.Time.Format.Parse.ParseTime Time.Time instance GHC.Classes.Ord Time.Time instance GHC.Classes.Eq Time.Time instance GHC.Show.Show Time.Time module Arbitrary instance Test.QuickCheck.Arbitrary.Arbitrary Data.Text.Internal.Text instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Calendar.Days.Day instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Clock.Scale.DiffTime instance Test.QuickCheck.Arbitrary.Arbitrary Data.Time.Clock.UTC.UTCTime instance Test.QuickCheck.Arbitrary.Arbitrary Time.Time