Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data NixDoc = NixDoc {
- withoutParens :: Doc
- rootOp :: OperatorInfo
- wasPath :: Bool
- mkNixDoc :: Doc -> OperatorInfo -> NixDoc
- simpleExpr :: Doc -> NixDoc
- pathExpr :: Doc -> NixDoc
- leastPrecedence :: Doc -> NixDoc
- appOp :: OperatorInfo
- appOpNonAssoc :: OperatorInfo
- selectOp :: OperatorInfo
- hasAttrOp :: OperatorInfo
- wrapParens :: OperatorInfo -> NixDoc -> Doc
- wrapPath :: OperatorInfo -> NixDoc -> Doc
- prettyString :: NString NixDoc -> Doc
- prettyParams :: Params NixDoc -> Doc
- prettyParamSet :: ParamSet NixDoc -> Bool -> Doc
- prettyBind :: Binding NixDoc -> Doc
- prettyKeyName :: NKeyName NixDoc -> Doc
- prettySelector :: NAttrPath NixDoc -> Doc
- prettyAtom :: NAtom -> NixDoc
- prettyNix :: NExpr -> Doc
- prettyOriginExpr :: NExprLocF (Maybe (NValue m)) -> Doc
- exprFNixDoc :: NExprF NixDoc -> NixDoc
- prettyNValueNF :: Functor m => NValueNF m -> Doc
- printNix :: Functor m => NValueNF m -> String
- removeEffects :: Functor m => NValueF m (NThunk m) -> NValueNF m
- removeEffectsM :: MonadVar m => NValueF m (NThunk m) -> m (NValueNF m)
- prettyNValueF :: MonadVar m => NValueF m (NThunk m) -> m Doc
- prettyNValue :: MonadVar m => NValue m -> m Doc
- prettyNValueProv :: MonadVar m => NValue m -> m Doc
- prettyNThunk :: MonadVar m => NThunk m -> m Doc
- dethunk :: MonadVar m => NThunk m -> m (NValueNF m)
Documentation
This type represents a pretty printed nix expression together with some information about the expression.
NixDoc | |
|
simpleExpr :: Doc -> NixDoc Source #
A simple expression is never wrapped in parentheses. The expression behaves as if its root operator had a precedence higher than all other operators (including function application).
leastPrecedence :: Doc -> NixDoc Source #
An expression that behaves as if its root operator had a precedence lower than all other operators. That ensures that the expression is wrapped in parantheses in almost always, but it's still rendered without parentheses in cases where parentheses are never required (such as in the LHS of a binding).
appOp :: OperatorInfo Source #
wrapParens :: OperatorInfo -> NixDoc -> Doc Source #
prettyAtom :: NAtom -> NixDoc Source #