-- 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.19.2 module Tree module Textual module Text module Set -- | A set of values a. data Set a :: * -> * sing :: Getter a (Set a) 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 () hGetLine :: (MonadIO m) => Handle -> m Text hPutStr :: (MonadIO m) => Handle -> Text -> m () hPutStrLn :: (MonadIO m) => Handle -> Text -> m () module Generics module Time data Time -- | 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 day :: Lens' Time Day time :: Lens' Time DiffTime now :: IO Time instance Data.Binary.Class.Binary Time.Time instance Data.Textual.Printable 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 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 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 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 addExtension :: FilePath os ar -> String -> FilePath os ar combine :: DirPath os ar -> RelPath os fd -> Path os ar fd currentDir :: RelDir dropExtension :: FilePath os ar -> FilePath os ar dropExtensions :: FilePath os ar -> FilePath os ar 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 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) splitExtension :: FilePath os ar -> (FilePath os ar, String) splitExtensions :: FilePath os ar -> (FilePath os ar, String) splitFileName :: FilePath os ar -> (DirPath os ar, RelFile os) splitPath :: (AbsRel ar, FileOrDir fd) => Path os ar fd -> (Bool, [RelDir os], Maybe (RelFile os)) takeBaseName :: FilePath os ar -> RelFile os takeDirName :: DirPath os ar -> Maybe (RelDir os) takeDirectory :: FilePath os ar -> DirPath os ar takeExtension :: FilePath os ar -> String takeExtensions :: FilePath os ar -> String takeFileName :: FilePath os ar -> RelFile os takeSuperDirectory :: DirPath os ar -> Maybe (DirPath os ar) toString :: (AbsRel ar, FileDir fd) => Path ar fd -> String 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 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) genericMakeAbsolute :: (System os, AbsRel ar) => AbsDir os -> Path os ar fd -> AbsPath os fd genericMakeAbsoluteFromCwd :: (System os, AbsRel ar) => Path os ar fd -> IO (AbsPath os fd) joinPath :: FileDir fd => [String] -> RelPath os fd makeAbsolute :: System os => AbsDir os -> RelPath os fd -> AbsPath os fd makeAbsoluteFromCwd :: System os => RelPath os fd -> IO (AbsPath os fd) 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) normalise :: System os => Path os ar fd -> Path os ar fd pathMap :: FileDir fd => (String -> String) -> Path os ar fd -> Path os ar fd toFileDir :: FileDir fd => Path os ar fd -> FileDirPath os ar isAbsolute :: AbsRel ar => Path os ar fd -> Bool isRelative :: AbsRel ar => Path os ar fd -> Bool isAbsoluteString :: String -> Bool isRelativeString :: String -> Bool hasAnExtension :: FilePath os ar -> Bool hasExtension :: String -> FilePath os ar -> Bool extSeparator :: Char searchPathSeparator :: Char isExtSeparator :: Char -> Bool isSearchPathSeparator :: Char -> Bool 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 () :: DirPath os ar -> RelPath os fd -> Path os ar fd (<.>) :: FilePath os ar -> String -> FilePath os ar (<++>) :: FilePath os ar -> String -> FilePath os ar 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 putStr :: (MonadIO m, Printable p) => p -> m () putStrLn :: (MonadIO m, Printable p) => p -> m () managed :: (forall r. (a -> IO r) -> IO r) -> Managed a data Managed a :: * -> * class MonadIO m => MonadManaged (m :: * -> *) using :: MonadManaged m => Managed a -> m a runManaged :: Managed () -> IO () data TempFile tfPath :: Lens' TempFile AbsFile tfHandle :: Lens' TempFile Handle tempFile :: AbsDir -> RelFile -> Managed TempFile -- | 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 -- | Computation hSeek hdl mode i sets the position of -- handle hdl depending on mode. The offset i -- is given in terms of 8-bit bytes. -- -- If hdl is block- or line-buffered, then seeking to a position -- which is not in the current buffer will first cause any items in the -- output buffer to be written to the device, and then cause the input -- buffer to be discarded. Some handles may not be seekable (see -- hIsSeekable), or only support a subset of the possible -- positioning operations (for instance, it may only be possible to seek -- to the end of a tape, or to a positive offset from the beginning or -- current position). It is not possible to set a negative I/O position, -- or for a physical file, an I/O position beyond the current -- end-of-file. -- -- This operation may fail with: -- -- hSeek :: Handle -> SeekMode -> Integer -> IO () -- | A mode that determines the effect of hSeek hdl mode -- i. data SeekMode :: * -- | the position of hdl is set to i. AbsoluteSeek :: SeekMode -- | the position of hdl is set to offset i from the -- current position. RelativeSeek :: SeekMode -- | the position of hdl is set to offset i from the end -- of the file. SeekFromEnd :: SeekMode -- | See openFile data IOMode :: * ReadMode :: IOMode WriteMode :: IOMode AppendMode :: IOMode ReadWriteMode :: IOMode -- | Binary files, no buffering. file :: AbsRel ar => File ar -> IOMode -> Managed Handle -- | Text files, line-buffered. tfile :: AbsRel ar => File ar -> IOMode -> Managed Handle textMode :: MonadIO m => Handle -> m () binaryMode :: MonadIO m => Handle -> m () hIsEOF :: MonadIO m => Handle -> m Bool hClose :: MonadIO m => Handle -> m () doesFileExist :: (MonadIO m, AbsRel ar) => File ar -> m Bool removeFile :: (MonadIO m, AbsRel ar) => File ar -> 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 :: * module Text.Machine -- | Read lines from a Handle until $EOF$ is reached. readLines :: MonadIO m => Handle -> SourceT m Text -- | Write lines to a Handle until there are no more. Forwards them -- on. writeLines :: MonadIO m => Handle -> ProcessT m Text Text