Safe Haskell | None |
---|---|
Language | Haskell2010 |
promoted io functions
Synopsis
- data ReadFile p
- data FileExists p
- data ReadDir p
- data DirExists p
- data ReadEnv p
- data ReadEnvAll
- data TimeUtc
- data TimeZt
- data AppendFile (s :: Symbol) p
- data WriteFile (s :: Symbol) p
- data WriteFile' (s :: Symbol) p
- data Stdout p
- data Stderr p
- data Stdin
- type ReadIO (t :: Type) = ReadIO' t "Enter value"
- type ReadIO' (t :: Type) s = Stdout (s <> ":") >> (Stdin >> ReadP t Id)
Documentation
similar to readFile
>>>
pz @(ReadFile "LICENSE" >> 'Just Id >> Len > 0) ()
TrueT
>>>
pz @(FileExists "xyzzy") ()
FalseT
>>>
pl @(FileExists "xxy") ()
False (IsJust) FalseT
data FileExists p Source #
similar to doesFileExist
Instances
P (FileExistsT p) x => P (FileExists p :: Type) x Source # | |
Defined in Predicate.Data.IO type PP (FileExists p) x :: Type Source # eval :: MonadEval m => proxy (FileExists p) -> POpts -> x -> m (TT (PP (FileExists p) x)) Source # | |
type PP (FileExists p :: Type) x Source # | |
Defined in Predicate.Data.IO |
similar to listDirectory
similar to doesDirectoryExist
>>>
pz @(DirExists ".") ()
TrueT
>>>
pl @(DirExists ".") ()
True (IsJust) TrueT
>>>
pl @(DirExists "xxy") ()
False (IsJust) FalseT
read an environment variable: similar to getEnv
>>>
pz @(ReadEnv "PATH" >> 'Just Id >> 'True) ()
TrueT
data ReadEnvAll Source #
read all the environment variables as key value pairs: similar to getEnvironment
Instances
P ReadEnvAll a Source # | |
Defined in Predicate.Data.IO type PP ReadEnvAll a :: Type Source # eval :: MonadEval m => proxy ReadEnvAll -> POpts -> a -> m (TT (PP ReadEnvAll a)) Source # | |
type PP ReadEnvAll a Source # | |
Defined in Predicate.Data.IO |
get the current time using UTCTime
get the current time using ZonedTime
data AppendFile (s :: Symbol) p Source #
append to a file
Instances
P (AppendFileT s p) x => P (AppendFile s p :: Type) x Source # | |
Defined in Predicate.Data.IO type PP (AppendFile s p) x :: Type Source # eval :: MonadEval m => proxy (AppendFile s p) -> POpts -> x -> m (TT (PP (AppendFile s p) x)) Source # | |
type PP (AppendFile s p :: Type) x Source # | |
Defined in Predicate.Data.IO |
data WriteFile (s :: Symbol) p Source #
write to file, without overwriting
data WriteFile' (s :: Symbol) p Source #
write to file, overwriting if needed
Instances
P (WriteFileT' s p) x => P (WriteFile' s p :: Type) x Source # | |
Defined in Predicate.Data.IO type PP (WriteFile' s p) x :: Type Source # eval :: MonadEval m => proxy (WriteFile' s p) -> POpts -> x -> m (TT (PP (WriteFile' s p) x)) Source # | |
type PP (WriteFile' s p :: Type) x Source # | |
Defined in Predicate.Data.IO |
write a string value to stdout
write a string value to stderr
read a value from stdin