Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Bash conditional commands.
Synopsis
- data CondExpr a
- data UnaryOp
- data BinaryOp
- parseTestExpr :: [String] -> Either ParseError (CondExpr String)
Documentation
Bash conditional expressions.
Unary UnaryOp a | |
Binary a BinaryOp a | |
Not (CondExpr a) | |
And (CondExpr a) (CondExpr a) | |
Or (CondExpr a) (CondExpr a) |
Instances
Unary conditional operators.
BlockFile | -b |
CharacterFile | -c |
Directory | -d |
FileExists |
|
RegularFile | -f |
SetGID | -g |
Sticky | -k |
NamedPipe | -p |
Readable | -r |
FileSize | -s |
Terminal | -t |
SetUID | -u |
Writable | -w |
Executable | -x |
GroupOwned | -G |
SymbolicLink |
|
Modified | -N |
UserOwned | -O |
Socket | -S |
Optname | -o |
Varname | -v |
ZeroString | -z |
NonzeroString |
|
Instances
Bounded UnaryOp Source # | |
Enum UnaryOp Source # | |
Eq UnaryOp Source # | |
Data UnaryOp Source # | |
Defined in Language.Bash.Cond gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UnaryOp -> c UnaryOp # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c UnaryOp # toConstr :: UnaryOp -> Constr # dataTypeOf :: UnaryOp -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c UnaryOp) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UnaryOp) # gmapT :: (forall b. Data b => b -> b) -> UnaryOp -> UnaryOp # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UnaryOp -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UnaryOp -> r # gmapQ :: (forall d. Data d => d -> u) -> UnaryOp -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UnaryOp -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UnaryOp -> m UnaryOp # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UnaryOp -> m UnaryOp # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UnaryOp -> m UnaryOp # | |
Ord UnaryOp Source # | |
Read UnaryOp Source # | |
Show UnaryOp Source # | |
Generic UnaryOp Source # | |
Pretty UnaryOp Source # | |
Defined in Language.Bash.Cond | |
type Rep UnaryOp Source # | |
Defined in Language.Bash.Cond type Rep UnaryOp = D1 (MetaData "UnaryOp" "Language.Bash.Cond" "language-bash-0.9.2-7LQ9cF1Zv4R62KH6GXzHUN" False) ((((C1 (MetaCons "BlockFile" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "CharacterFile" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "Directory" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "FileExists" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "RegularFile" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "SetGID" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Sticky" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "NamedPipe" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "Readable" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "FileSize" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Terminal" PrefixI False) (U1 :: Type -> Type))))) :+: (((C1 (MetaCons "SetUID" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Writable" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Executable" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "GroupOwned" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "SymbolicLink" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Modified" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "UserOwned" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Socket" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Optname" PrefixI False) (U1 :: Type -> Type))) :+: (C1 (MetaCons "Varname" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ZeroString" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "NonzeroString" PrefixI False) (U1 :: Type -> Type)))))) |
Binary conditional operators.
SameFile | -ef |
NewerThan | -nt |
OlderThan | -ot |
StrMatch | =~ |
StrEQ |
|
StrNE | != |
StrLT | < |
StrGT | > |
ArithEQ | -eq |
ArithNE | -ne |
ArithLT | -lt |
ArithLE | -le |
ArithGT | -gt |
ArithGE | -ge |
Instances
Bounded BinaryOp Source # | |
Enum BinaryOp Source # | |
Eq BinaryOp Source # | |
Data BinaryOp Source # | |
Defined in Language.Bash.Cond gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BinaryOp -> c BinaryOp # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BinaryOp # toConstr :: BinaryOp -> Constr # dataTypeOf :: BinaryOp -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BinaryOp) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BinaryOp) # gmapT :: (forall b. Data b => b -> b) -> BinaryOp -> BinaryOp # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BinaryOp -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BinaryOp -> r # gmapQ :: (forall d. Data d => d -> u) -> BinaryOp -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> BinaryOp -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> BinaryOp -> m BinaryOp # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BinaryOp -> m BinaryOp # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BinaryOp -> m BinaryOp # | |
Ord BinaryOp Source # | |
Defined in Language.Bash.Cond | |
Read BinaryOp Source # | |
Show BinaryOp Source # | |
Generic BinaryOp Source # | |
Pretty BinaryOp Source # | |
Defined in Language.Bash.Cond | |
type Rep BinaryOp Source # | |
Defined in Language.Bash.Cond type Rep BinaryOp = D1 (MetaData "BinaryOp" "Language.Bash.Cond" "language-bash-0.9.2-7LQ9cF1Zv4R62KH6GXzHUN" False) (((C1 (MetaCons "SameFile" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "NewerThan" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "OlderThan" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "StrMatch" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "StrEQ" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "StrNE" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "StrLT" PrefixI False) (U1 :: Type -> Type)))) :+: ((C1 (MetaCons "StrGT" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "ArithEQ" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ArithNE" PrefixI False) (U1 :: Type -> Type))) :+: ((C1 (MetaCons "ArithLT" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ArithLE" PrefixI False) (U1 :: Type -> Type)) :+: (C1 (MetaCons "ArithGT" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "ArithGE" PrefixI False) (U1 :: Type -> Type))))) |
parseTestExpr :: [String] -> Either ParseError (CondExpr String) Source #
Parse a conditional expression for the Bash test
builtin.