nix-eval-0.4.1.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 # 
Instance details

Defined in Language.Eval.Internal

Methods

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

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

Ord Pkg Source # 
Instance details

Defined in Language.Eval.Internal

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 # 
Instance details

Defined in Language.Eval.Internal

Methods

showsPrec :: Int -> Pkg -> ShowS #

show :: Pkg -> String #

showList :: [Pkg] -> ShowS #

IsString Pkg Source # 
Instance details

Defined in Language.Eval.Internal

Methods

fromString :: String -> Pkg #

newtype Mod Source #

Constructors

Mod String 
Instances
Eq Mod Source # 
Instance details

Defined in Language.Eval.Internal

Methods

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

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

Ord Mod Source # 
Instance details

Defined in Language.Eval.Internal

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 # 
Instance details

Defined in Language.Eval.Internal

Methods

showsPrec :: Int -> Mod -> ShowS #

show :: Mod -> String #

showList :: [Mod] -> ShowS #

IsString Mod Source # 
Instance details

Defined in Language.Eval.Internal

Methods

fromString :: String -> Mod #

newtype Flag Source #

Constructors

Flag String 
Instances
Eq Flag Source # 
Instance details

Defined in Language.Eval.Internal

Methods

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

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

Ord Flag Source # 
Instance details

Defined in Language.Eval.Internal

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 # 
Instance details

Defined in Language.Eval.Internal

Methods

showsPrec :: Int -> Flag -> ShowS #

show :: Flag -> String #

showList :: [Flag] -> ShowS #

IsString Flag Source # 
Instance details

Defined in Language.Eval.Internal

Methods

fromString :: String -> Flag #

data Expr Source #

Constructors

Expr 

Fields

Instances
Eq Expr Source # 
Instance details

Defined in Language.Eval.Internal

Methods

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

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

Show Expr Source # 
Instance details

Defined in Language.Eval.Internal

Methods

showsPrec :: Int -> Expr -> ShowS #

show :: Expr -> String #

showList :: [Expr] -> ShowS #

IsString Expr Source # 
Instance details

Defined in Language.Eval.Internal

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