shell-monad-0.6.9: shell monad

Safe HaskellNone
LanguageHaskell98

Control.Monad.Shell.Quote

Description

Shell quoting

Synopsis

Documentation

newtype Quoted a Source #

A value that is safely quoted so that it can be exposed to the shell.

While the constructor is exposed, you should avoid directly constucting Quoted values. Instead, use quote.

Constructors

Q 

Fields

Instances
Eq a => Eq (Quoted a) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

(==) :: Quoted a -> Quoted a -> Bool #

(/=) :: Quoted a -> Quoted a -> Bool #

Ord a => Ord (Quoted a) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

compare :: Quoted a -> Quoted a -> Ordering #

(<) :: Quoted a -> Quoted a -> Bool #

(<=) :: Quoted a -> Quoted a -> Bool #

(>) :: Quoted a -> Quoted a -> Bool #

(>=) :: Quoted a -> Quoted a -> Bool #

max :: Quoted a -> Quoted a -> Quoted a #

min :: Quoted a -> Quoted a -> Quoted a #

Show a => Show (Quoted a) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

showsPrec :: Int -> Quoted a -> ShowS #

show :: Quoted a -> String #

showList :: [Quoted a] -> ShowS #

IsString (Quoted Text) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Semigroup a => Semigroup (Quoted a) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

(<>) :: Quoted a -> Quoted a -> Quoted a #

sconcat :: NonEmpty (Quoted a) -> Quoted a #

stimes :: Integral b => b -> Quoted a -> Quoted a #

Monoid a => Monoid (Quoted a) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

mempty :: Quoted a #

mappend :: Quoted a -> Quoted a -> Quoted a #

mconcat :: [Quoted a] -> Quoted a #

Param (Quoted Text) Source #

Quoted Text arguments are passed as-is.

Instance details

Defined in Control.Monad.Shell

Methods

toTextParam :: Quoted Text -> Env -> Text

class Quotable t where Source #

Quotes a value to allow it to be safely exposed to the shell.

The method used is to replace ' with '"'"' and wrap the value inside single quotes. This works for POSIX shells, as well as other shells like csh.

The single quotes are omitted for simple values that do not need any quoting.

Methods

quote :: t -> Quoted Text Source #

Instances
Quotable String Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Quotable Text Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

quote :: Text -> Quoted Text Source #

Show v => Quotable (Val v) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

quote :: Val v -> Quoted Text Source #

Quotable (Val String) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Quotable (Val Text) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

newtype Val v Source #

An arbitrary value.

Constructors

Val v 
Instances
Show v => Quotable (Val v) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Methods

quote :: Val v -> Quoted Text Source #

Quotable (Val String) Source # 
Instance details

Defined in Control.Monad.Shell.Quote

Quotable (Val Text) Source # 
Instance details

Defined in Control.Monad.Shell.Quote