Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Expr = Expr {}
- data ExprF f
- data Op
- foldExpr :: (ExprF r -> r) -> Expr -> r
- var :: Var -> Expr
- lam :: Var -> Expr -> Expr
- app :: Expr -> Expr -> Expr
- cond :: Expr -> Expr -> Expr -> Expr
- attrs :: [Var] -> [(Expr, [Key])] -> [(Key, Expr)] -> Expr
- sel :: Expr -> Key -> Expr
- let' :: [(Var, Expr)] -> Expr -> Expr
- int :: Integer -> Expr
- double :: Double -> Expr
- string :: Text -> Expr
- list :: [Expr] -> Expr
- bin :: Op -> Expr -> Expr -> Expr
- path :: Text -> Expr
- constructorFieldNames :: [Var]
- not' :: Expr -> Expr
- builtin :: Key -> Expr
- constructor :: Text -> [Var] -> Expr
Documentation
The fixpoint over ExprF
, see haddocks there for more information.
Base functor for a Nix expression. We don't aim to be able to represent every valid Nix expression, just the ones that are relevant for PureNix.
ExprF
is the base functor for the Expr
fixpoint.
This allows us to easily annotate and consume it during pretty-printing.
Note that ExprF
, unlike Key
and ExprF
, is a raw representation of the intended string, completely unquoted and unescaped.
That means that it might consist of, for example, a single '"'.
It is the job of the printer to figure out how to correctly escape those.
Var Var | |
Lam Var f | |
App f f | |
Attrs [Var] [(f, [Key])] [(Key, f)] | |
Cond f f f | |
List [f] | |
Bin Op f f | |
Not f | |
Sel f Key | |
Let (NonEmpty (Var, f)) f | |
Int Integer | |
Double Double | |
String Text | |
Path Text |
Instances
Foldable ExprF Source # | |
Defined in PureNix.Expr fold :: Monoid m => ExprF m -> m # foldMap :: Monoid m => (a -> m) -> ExprF a -> m # foldMap' :: Monoid m => (a -> m) -> ExprF a -> m # foldr :: (a -> b -> b) -> b -> ExprF a -> b # foldr' :: (a -> b -> b) -> b -> ExprF a -> b # foldl :: (b -> a -> b) -> b -> ExprF a -> b # foldl' :: (b -> a -> b) -> b -> ExprF a -> b # foldr1 :: (a -> a -> a) -> ExprF a -> a # foldl1 :: (a -> a -> a) -> ExprF a -> a # elem :: Eq a => a -> ExprF a -> Bool # maximum :: Ord a => ExprF a -> a # minimum :: Ord a => ExprF a -> a # | |
Traversable ExprF Source # | |
Functor ExprF Source # | |
Show f => Show (ExprF f) Source # | |
constructorFieldNames :: [Var] Source #