module Nix.Expr.Shorthands where
import Nix.Prelude
import Data.Fix
import Nix.Atoms
import Nix.Expr.Types
mkConst :: NAtom -> NExpr
mkConst :: NAtom -> NExpr
mkConst = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. NAtom -> NExprF r
NConstant
mkNull :: NExpr
mkNull :: NExpr
mkNull = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall a. NExprF a
mkNullF
mkBool :: Bool -> NExpr
mkBool :: Bool -> NExpr
mkBool = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Bool -> NExprF a
mkBoolF
mkInt :: Integer -> NExpr
mkInt :: Integer -> NExpr
mkInt = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Integer -> NExprF a
mkIntF
mkFloat :: Float -> NExpr
mkFloat :: Float -> NExpr
mkFloat = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Float -> NExprF a
mkFloatF
mkStr :: Text -> NExpr
mkStr :: Text -> NExpr
mkStr = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. NString r -> NExprF r
NStr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. [Antiquoted Text r] -> NString r
DoubleQuoted forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. a -> (Text -> a) -> Text -> a
whenText
forall a. Monoid a => a
mempty
(forall x. One x => OneItem x -> x
one forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v r. v -> Antiquoted v r
Plain)
mkIndentedStr :: Int -> Text -> NExpr
mkIndentedStr :: Int -> Text -> NExpr
mkIndentedStr Int
w = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. NString r -> NExprF r
NStr forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. Int -> [Antiquoted Text r] -> NString r
Indented Int
w forall b c a. (b -> c) -> (a -> b) -> a -> c
.
forall a. a -> (Text -> a) -> Text -> a
whenText
forall a. Monoid a => a
mempty
(forall x. One x => OneItem x -> x
one forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v r. v -> Antiquoted v r
Plain)
mkPath :: Bool -> FilePath -> NExpr
mkPath :: Bool -> FilePath -> NExpr
mkPath Bool
b = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Bool -> FilePath -> NExprF a
mkPathF Bool
b
mkEnvPath :: FilePath -> NExpr
mkEnvPath :: FilePath -> NExpr
mkEnvPath = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. FilePath -> NExprF a
mkEnvPathF
mkRelPath :: FilePath -> NExpr
mkRelPath :: FilePath -> NExpr
mkRelPath = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. FilePath -> NExprF a
mkRelPathF
mkSym :: Text -> NExpr
mkSym :: Text -> NExpr
mkSym = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Text -> NExprF a
mkSymF
mkSynHole :: Text -> NExpr
mkSynHole :: Text -> NExpr
mkSynHole = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. Text -> NExprF a
mkSynHoleF
mkSelector :: Text -> NAttrPath NExpr
mkSelector :: Text -> NAttrPath NExpr
mkSelector = forall x. One x => OneItem x -> x
one forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. VarName -> NKeyName r
StaticKey forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce
mkApp :: NExpr -> NExpr -> NExpr
mkApp :: NExpr -> NExpr -> NExpr
mkApp NExpr
a = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. r -> r -> NExprF r
NApp NExpr
a
mkOp :: NUnaryOp -> NExpr -> NExpr
mkOp :: NUnaryOp -> NExpr -> NExpr
mkOp NUnaryOp
op = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. NUnaryOp -> r -> NExprF r
NUnary NUnaryOp
op
mkNot :: NExpr -> NExpr
mkNot :: NExpr -> NExpr
mkNot = NUnaryOp -> NExpr -> NExpr
mkOp NUnaryOp
NNot
mkNeg :: NExpr -> NExpr
mkNeg :: NExpr -> NExpr
mkNeg = NUnaryOp -> NExpr -> NExpr
mkOp NUnaryOp
NNeg
mkOp2 :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
op NExpr
a = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. NBinaryOp -> r -> r -> NExprF r
NBinary NBinaryOp
op NExpr
a
mkParamSet :: [(Text, Maybe NExpr)] -> Params NExpr
mkParamSet :: [(Text, Maybe NExpr)] -> Params NExpr
mkParamSet [(Text, Maybe NExpr)]
pset = Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet forall a. Maybe a
Nothing [(Text, Maybe NExpr)]
pset Bool
False
mkVariadicParamSet :: [(Text, Maybe NExpr)] -> Params NExpr
mkVariadicParamSet :: [(Text, Maybe NExpr)] -> Params NExpr
mkVariadicParamSet [(Text, Maybe NExpr)]
pset = Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet forall a. Maybe a
Nothing [(Text, Maybe NExpr)]
pset Bool
True
mkNamedParamSet :: Text -> [(Text, Maybe NExpr)] -> Params NExpr
mkNamedParamSet :: Text -> [(Text, Maybe NExpr)] -> Params NExpr
mkNamedParamSet Text
name [(Text, Maybe NExpr)]
pset = Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet (forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
name) [(Text, Maybe NExpr)]
pset Bool
False
mkNamedVariadicParamSet :: Text -> [(Text, Maybe NExpr)] -> Params NExpr
mkNamedVariadicParamSet :: Text -> [(Text, Maybe NExpr)] -> Params NExpr
mkNamedVariadicParamSet Text
name [(Text, Maybe NExpr)]
params = Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet (forall (f :: * -> *) a. Applicative f => a -> f a
pure Text
name) [(Text, Maybe NExpr)]
params Bool
True
mkGeneralParamSet :: Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet :: Maybe Text -> [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkGeneralParamSet Maybe Text
mname [(Text, Maybe NExpr)]
params Bool
variadic = forall r. Maybe VarName -> Variadic -> ParamSet r -> Params r
ParamSet (coerce :: forall a b. Coercible a b => a -> b
coerce Maybe Text
mname) (Variadic
Variadic forall a. Monoid a => a -> Bool -> a
`whenTrue` Bool
variadic) (coerce :: forall a b. Coercible a b => a -> b
coerce [(Text, Maybe NExpr)]
params)
mkRecSet :: [Binding NExpr] -> NExpr
mkRecSet :: [Binding NExpr] -> NExpr
mkRecSet = Recursivity -> [Binding NExpr] -> NExpr
mkSet Recursivity
Recursive
mkNonRecSet :: [Binding NExpr] -> NExpr
mkNonRecSet :: [Binding NExpr] -> NExpr
mkNonRecSet = Recursivity -> [Binding NExpr] -> NExpr
mkSet forall a. Monoid a => a
mempty
mkSet :: Recursivity -> [Binding NExpr] -> NExpr
mkSet :: Recursivity -> [Binding NExpr] -> NExpr
mkSet Recursivity
r = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. Recursivity -> [Binding r] -> NExprF r
NSet Recursivity
r
emptySet :: NExpr
emptySet :: NExpr
emptySet = [Binding NExpr] -> NExpr
mkNonRecSet forall a. Monoid a => a
mempty
mkList :: [NExpr] -> NExpr
mkList :: [NExpr] -> NExpr
mkList = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. [r] -> NExprF r
NList
emptyList :: NExpr
emptyList :: NExpr
emptyList = [NExpr] -> NExpr
mkList forall a. Monoid a => a
mempty
mkLets :: [Binding NExpr] -> NExpr -> NExpr
mkLets :: [Binding NExpr] -> NExpr -> NExpr
mkLets [Binding NExpr]
bindings = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. [Binding r] -> r -> NExprF r
NLet [Binding NExpr]
bindings
mkWith :: NExpr -> NExpr -> NExpr
mkWith :: NExpr -> NExpr -> NExpr
mkWith NExpr
e = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. r -> r -> NExprF r
NWith NExpr
e
mkAssert :: NExpr -> NExpr -> NExpr
mkAssert :: NExpr -> NExpr -> NExpr
mkAssert NExpr
e = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. r -> r -> NExprF r
NAssert NExpr
e
mkIf :: NExpr -> NExpr -> NExpr -> NExpr
mkIf :: NExpr -> NExpr -> NExpr -> NExpr
mkIf NExpr
e1 NExpr
e2 = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. r -> r -> r -> NExprF r
NIf NExpr
e1 NExpr
e2
mkFunction :: Params NExpr -> NExpr -> NExpr
mkFunction :: Params NExpr -> NExpr -> NExpr
mkFunction Params NExpr
params = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. Params r -> r -> NExprF r
NAbs Params NExpr
params
getRefOrDefault :: Maybe NExpr -> NExpr -> Text -> NExpr
getRefOrDefault :: Maybe NExpr -> NExpr -> Text -> NExpr
getRefOrDefault Maybe NExpr
alt NExpr
obj = forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall r. Maybe r -> r -> NAttrPath r -> NExprF r
NSelect Maybe NExpr
alt NExpr
obj forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> NAttrPath NExpr
mkSelector
mkNullF :: NExprF a
mkNullF :: forall a. NExprF a
mkNullF = forall r. NAtom -> NExprF r
NConstant NAtom
NNull
mkBoolF :: Bool -> NExprF a
mkBoolF :: forall a. Bool -> NExprF a
mkBoolF = forall r. NAtom -> NExprF r
NConstant forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> NAtom
NBool
mkIntF :: Integer -> NExprF a
mkIntF :: forall a. Integer -> NExprF a
mkIntF = forall r. NAtom -> NExprF r
NConstant forall b c a. (b -> c) -> (a -> b) -> a -> c
. Integer -> NAtom
NInt
mkFloatF :: Float -> NExprF a
mkFloatF :: forall a. Float -> NExprF a
mkFloatF = forall r. NAtom -> NExprF r
NConstant forall b c a. (b -> c) -> (a -> b) -> a -> c
. Float -> NAtom
NFloat
mkPathF :: Bool -> FilePath -> NExprF a
mkPathF :: forall a. Bool -> FilePath -> NExprF a
mkPathF Bool
False = forall r. Path -> NExprF r
NLiteralPath forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce
mkPathF Bool
True = forall r. Path -> NExprF r
NEnvPath forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce
mkEnvPathF :: FilePath -> NExprF a
mkEnvPathF :: forall a. FilePath -> NExprF a
mkEnvPathF = forall a. Bool -> FilePath -> NExprF a
mkPathF Bool
True
mkRelPathF :: FilePath -> NExprF a
mkRelPathF :: forall a. FilePath -> NExprF a
mkRelPathF = forall a. Bool -> FilePath -> NExprF a
mkPathF Bool
False
mkSymF :: Text -> NExprF a
mkSymF :: forall a. Text -> NExprF a
mkSymF = forall r. VarName -> NExprF r
NSym forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce
mkSynHoleF :: Text -> NExprF a
mkSynHoleF :: forall a. Text -> NExprF a
mkSynHoleF = forall r. VarName -> NExprF r
NSynHole forall b c a. (b -> c) -> (a -> b) -> a -> c
. coerce :: forall a b. Coercible a b => a -> b
coerce
inheritFrom :: e -> [VarName] -> Binding e
inheritFrom :: forall e. e -> [VarName] -> Binding e
inheritFrom e
expr [VarName]
ks = forall r. Maybe r -> [VarName] -> NSourcePos -> Binding r
Inherit (forall (f :: * -> *) a. Applicative f => a -> f a
pure e
expr) [VarName]
ks NSourcePos
nullPos
inherit :: [VarName] -> Binding e
inherit :: forall e. [VarName] -> Binding e
inherit [VarName]
ks = forall r. Maybe r -> [VarName] -> NSourcePos -> Binding r
Inherit forall a. Maybe a
Nothing [VarName]
ks NSourcePos
nullPos
($=) :: Text -> NExpr -> Binding NExpr
$= :: Text -> NExpr -> Binding NExpr
($=) = Text -> NExpr -> Binding NExpr
bindTo
infixr 2 $=
bindTo :: Text -> NExpr -> Binding NExpr
bindTo :: Text -> NExpr -> Binding NExpr
bindTo Text
name NExpr
x = forall r. NAttrPath r -> r -> NSourcePos -> Binding r
NamedVar (Text -> NAttrPath NExpr
mkSelector Text
name) NExpr
x NSourcePos
nullPos
appendBindings :: [Binding NExpr] -> NExpr -> NExpr
appendBindings :: [Binding NExpr] -> NExpr -> NExpr
appendBindings [Binding NExpr]
newBindings (Fix NExprF NExpr
e) =
case NExprF NExpr
e of
NLet [Binding NExpr]
bindings NExpr
e' -> [Binding NExpr] -> NExpr -> NExpr
mkLets ([Binding NExpr]
bindings forall a. Semigroup a => a -> a -> a
<> [Binding NExpr]
newBindings) NExpr
e'
NSet Recursivity
recur [Binding NExpr]
bindings -> forall (f :: * -> *). f (Fix f) -> Fix f
Fix forall a b. (a -> b) -> a -> b
$ forall r. Recursivity -> [Binding r] -> NExprF r
NSet Recursivity
recur ([Binding NExpr]
bindings forall a. Semigroup a => a -> a -> a
<> [Binding NExpr]
newBindings)
NExprF NExpr
_ -> forall a t. (HasCallStack, IsText t) => t -> a
error Text
"Can only append bindings to a set or a let"
modifyFunctionBody :: (NExpr -> NExpr) -> NExpr -> NExpr
modifyFunctionBody :: (NExpr -> NExpr) -> NExpr -> NExpr
modifyFunctionBody NExpr -> NExpr
transform (Fix (NAbs Params NExpr
params NExpr
body)) = Params NExpr -> NExpr -> NExpr
mkFunction Params NExpr
params forall a b. (a -> b) -> a -> b
$ NExpr -> NExpr
transform NExpr
body
modifyFunctionBody NExpr -> NExpr
_ NExpr
_ = forall a t. (HasCallStack, IsText t) => t -> a
error Text
"Not a function"
letsE :: [(Text, NExpr)] -> NExpr -> NExpr
letsE :: [(Text, NExpr)] -> NExpr -> NExpr
letsE [(Text, NExpr)]
pairs = [Binding NExpr] -> NExpr -> NExpr
mkLets forall a b. (a -> b) -> a -> b
$ forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> NExpr -> Binding NExpr
($=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Text, NExpr)]
pairs
letE :: Text -> NExpr -> NExpr -> NExpr
letE :: Text -> NExpr -> NExpr -> NExpr
letE Text
varName NExpr
varExpr = [(Text, NExpr)] -> NExpr -> NExpr
letsE forall a b. (a -> b) -> a -> b
$ forall x. One x => OneItem x -> x
one (Text
varName, NExpr
varExpr)
attrsE :: [(Text, NExpr)] -> NExpr
attrsE :: [(Text, NExpr)] -> NExpr
attrsE [(Text, NExpr)]
pairs = [Binding NExpr] -> NExpr
mkNonRecSet forall a b. (a -> b) -> a -> b
$ forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> NExpr -> Binding NExpr
($=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Text, NExpr)]
pairs
recAttrsE :: [(Text, NExpr)] -> NExpr
recAttrsE :: [(Text, NExpr)] -> NExpr
recAttrsE [(Text, NExpr)]
pairs = [Binding NExpr] -> NExpr
mkRecSet forall a b. (a -> b) -> a -> b
$ forall a b c. (a -> b -> c) -> (a, b) -> c
uncurry Text -> NExpr -> Binding NExpr
($=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Text, NExpr)]
pairs
(@@), ($==), ($!=), ($<), ($<=), ($>), ($>=), ($&&), ($||), ($->), ($//), ($+), ($-), ($*), ($/), ($++)
:: NExpr -> NExpr -> NExpr
(@.) :: NExpr -> Text -> NExpr
@. :: NExpr -> Text -> NExpr
(@.) = Maybe NExpr -> NExpr -> Text -> NExpr
getRefOrDefault forall a. Maybe a
Nothing
infix 9 @.
(@.<|>) :: NExpr -> Text -> NExpr -> NExpr
@.<|> :: NExpr -> Text -> NExpr -> NExpr
(@.<|>) NExpr
obj Text
name NExpr
alt = Maybe NExpr -> NExpr -> Text -> NExpr
getRefOrDefault (forall (f :: * -> *) a. Applicative f => a -> f a
pure NExpr
alt ) NExpr
obj Text
name
infix 9 @.<|>
@@ :: NExpr -> NExpr -> NExpr
(@@) = NExpr -> NExpr -> NExpr
mkApp
infixl 8 @@
$++ :: NExpr -> NExpr -> NExpr
($++) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NConcat
infixr 7 $++
$* :: NExpr -> NExpr -> NExpr
($*) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NMult
infixl 6 $*
$/ :: NExpr -> NExpr -> NExpr
($/) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NDiv
infixl 6 $/
$+ :: NExpr -> NExpr -> NExpr
($+) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NPlus
infixl 5 $+
$- :: NExpr -> NExpr -> NExpr
($-) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NMinus
infixl 5 $-
$// :: NExpr -> NExpr -> NExpr
($//) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NUpdate
infixr 5 $//
$> :: NExpr -> NExpr -> NExpr
($>) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NGt
infix 4 $>
infix 4 $>=
$>= :: NExpr -> NExpr -> NExpr
($>=) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NGte
$<= :: NExpr -> NExpr -> NExpr
($<=) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NLte
infix 4 $<=
$< :: NExpr -> NExpr -> NExpr
($<) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NLt
infix 4 $<
$== :: NExpr -> NExpr -> NExpr
($==) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NEq
infix 3 $==
$!= :: NExpr -> NExpr -> NExpr
($!=) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NNEq
infix 3 $!=
$&& :: NExpr -> NExpr -> NExpr
($&&) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NAnd
infixl 2 $&&
$|| :: NExpr -> NExpr -> NExpr
($||) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NOr
infixl 2 $||
$-> :: NExpr -> NExpr -> NExpr
($->) = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2 NBinaryOp
NImpl
infix 1 $->
(==>) :: Params NExpr -> NExpr -> NExpr
==> :: Params NExpr -> NExpr -> NExpr
(==>) = Params NExpr -> NExpr -> NExpr
mkFunction
infixr 1 ==>
mkOper :: NUnaryOp -> NExpr -> NExpr
mkOper :: NUnaryOp -> NExpr -> NExpr
mkOper = NUnaryOp -> NExpr -> NExpr
mkOp
mkOper2 :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkOper2 :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkOper2 = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2
mkBinop :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkBinop :: NBinaryOp -> NExpr -> NExpr -> NExpr
mkBinop = NBinaryOp -> NExpr -> NExpr -> NExpr
mkOp2
mkParamset :: [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkParamset :: [(Text, Maybe NExpr)] -> Bool -> Params NExpr
mkParamset [(Text, Maybe NExpr)]
params Bool
variadic = forall r. Maybe VarName -> Variadic -> ParamSet r -> Params r
ParamSet forall a. Maybe a
Nothing (Variadic
Variadic forall a. Monoid a => a -> Bool -> a
`whenTrue` Bool
variadic) (coerce :: forall a b. Coercible a b => a -> b
coerce [(Text, Maybe NExpr)]
params)