nix-eval-0.3.3.0: Evaluate Haskell expressions using Nix to get packages

Safe HaskellNone
LanguageHaskell2010

Language.Eval

Synopsis

Documentation

newtype Pkg Source #

Constructors

Pkg String 

Instances

Eq Pkg Source # 

Methods

(==) :: Pkg -> Pkg -> Bool #

(/=) :: Pkg -> Pkg -> Bool #

Ord Pkg Source # 

Methods

compare :: Pkg -> Pkg -> Ordering #

(<) :: Pkg -> Pkg -> Bool #

(<=) :: Pkg -> Pkg -> Bool #

(>) :: Pkg -> Pkg -> Bool #

(>=) :: Pkg -> Pkg -> Bool #

max :: Pkg -> Pkg -> Pkg #

min :: Pkg -> Pkg -> Pkg #

Show Pkg Source # 

Methods

showsPrec :: Int -> Pkg -> ShowS #

show :: Pkg -> String #

showList :: [Pkg] -> ShowS #

IsString Pkg Source # 

Methods

fromString :: String -> Pkg #

newtype Mod Source #

Constructors

Mod String 

Instances

Eq Mod Source # 

Methods

(==) :: Mod -> Mod -> Bool #

(/=) :: Mod -> Mod -> Bool #

Ord Mod Source # 

Methods

compare :: Mod -> Mod -> Ordering #

(<) :: Mod -> Mod -> Bool #

(<=) :: Mod -> Mod -> Bool #

(>) :: Mod -> Mod -> Bool #

(>=) :: Mod -> Mod -> Bool #

max :: Mod -> Mod -> Mod #

min :: Mod -> Mod -> Mod #

Show Mod Source # 

Methods

showsPrec :: Int -> Mod -> ShowS #

show :: Mod -> String #

showList :: [Mod] -> ShowS #

IsString Mod Source # 

Methods

fromString :: String -> Mod #

newtype Flag Source #

Constructors

Flag String 

Instances

Eq Flag Source # 

Methods

(==) :: Flag -> Flag -> Bool #

(/=) :: Flag -> Flag -> Bool #

Ord Flag Source # 

Methods

compare :: Flag -> Flag -> Ordering #

(<) :: Flag -> Flag -> Bool #

(<=) :: Flag -> Flag -> Bool #

(>) :: Flag -> Flag -> Bool #

(>=) :: Flag -> Flag -> Bool #

max :: Flag -> Flag -> Flag #

min :: Flag -> Flag -> Flag #

Show Flag Source # 

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

IsString Flag Source # 

Methods

fromString :: String -> Flag #

data Expr Source #

Constructors

Expr 

Fields

Instances

Eq Expr Source # 

Methods

(==) :: Expr -> Expr -> Bool #

(/=) :: Expr -> Expr -> Bool #

Show Expr Source # 

Methods

showsPrec :: Int -> Expr -> ShowS #

show :: Expr -> String #

showList :: [Expr] -> ShowS #

IsString Expr Source # 

Methods

fromString :: String -> Expr #

eval :: Expr -> IO (Maybe String) Source #

Evaluate an Expr; this is where the magic happens! If successful, returns Just a String, which you can do what you like with.

raw :: String -> Expr Source #

A raw String of Haskell code, with no packages or modules. You can use OverloadedStrings to call this automatically.

($$) :: Expr -> Expr -> Expr infixr 8 Source #

Apply the first Expr to the second, eg. `f $$ x` ==> `f x`

asString :: Show a => a -> Expr Source #

Convert the argument to a String, then send to raw

qualified :: Mod -> Expr -> Expr Source #

Qualify an expression, eg. `qualified Data.Bool "not"` gives the expression not with Data.Bool in its module list

withMods :: [Mod] -> Expr -> Expr Source #

Append modules to an expression's context

withPkgs :: [Pkg] -> Expr -> Expr Source #

Append packages to an expression's context

withFlags :: [Flag] -> Expr -> Expr Source #

Append arguments to an expression's context