Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data NixDoc ann = NixDoc {}
- antiquote :: NixDoc ann -> Doc ann
- mkNixDoc :: OperatorInfo -> Doc ann -> NixDoc ann
- simpleExpr :: Doc ann -> NixDoc ann
- pathExpr :: Doc ann -> NixDoc ann
- leastPrecedence :: Doc ann -> NixDoc ann
- appOp :: OperatorInfo
- appOpNonAssoc :: OperatorInfo
- selectOp :: OperatorInfo
- hasAttrOp :: OperatorInfo
- precedenceWrap :: OperatorInfo -> NixDoc ann -> Doc ann
- wrapPath :: OperatorInfo -> NixDoc ann -> Doc ann
- prettyString :: NString (NixDoc ann) -> Doc ann
- prettyVarName :: VarName -> Doc ann
- prettyParams :: Params (NixDoc ann) -> Doc ann
- prettyParamSet :: forall ann. Variadic -> ParamSet (NixDoc ann) -> Doc ann
- prettyBind :: Binding (NixDoc ann) -> Doc ann
- prettyKeyName :: NKeyName (NixDoc ann) -> Doc ann
- prettySelector :: NAttrPath (NixDoc ann) -> Doc ann
- prettyAtom :: NAtom -> NixDoc ann
- prettyNix :: NExpr -> Doc ann
- prettyOriginExpr :: forall t f m ann. HasCitations1 m (NValue t f m) f => NExprLocF (Maybe (NValue t f m)) -> Doc ann
- prettyExtractFromProvenance :: forall t f m ann. HasCitations1 m (NValue t f m) f => [Provenance m (NValue t f m)] -> Doc ann
- exprFNixDoc :: forall ann. NExprF (NixDoc ann) -> NixDoc ann
- valueToExpr :: forall t f m. MonadDataContext f m => NValue t f m -> NExpr
- prettyNValue :: forall t f m ann. MonadDataContext f m => NValue t f m -> Doc ann
- data ValueOrigin
- prettyProv :: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) => ValueOrigin -> NValue t f m -> Doc ann
- prettyNValueProv :: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) => NValue t f m -> Doc ann
- prettyNThunk :: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) => t -> m (Doc ann)
- printNix :: forall t f m. MonadDataContext f m => NValue t f m -> Text
Documentation
This type represents a pretty printed nix expression together with some information about the expression.
NixDoc | |
|
simpleExpr :: Doc ann -> NixDoc ann 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 ann -> NixDoc ann 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 parentheses 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 #
precedenceWrap :: OperatorInfo -> NixDoc ann -> Doc ann Source #
Determine if to return doc wraped into parens, according the given operator.
prettyString :: NString (NixDoc ann) -> Doc ann Source #
Handle Output representation of the string escape codes.
prettyVarName :: VarName -> Doc ann Source #
prettyAtom :: NAtom -> NixDoc ann Source #
prettyOriginExpr :: forall t f m ann. HasCitations1 m (NValue t f m) f => NExprLocF (Maybe (NValue t f m)) -> Doc ann Source #
prettyExtractFromProvenance :: forall t f m ann. HasCitations1 m (NValue t f m) f => [Provenance m (NValue t f m)] -> Doc ann Source #
Takes original expression from inside provenance information. Prettifies that expression.
valueToExpr :: forall t f m. MonadDataContext f m => NValue t f m -> NExpr Source #
prettyNValue :: forall t f m ann. MonadDataContext f m => NValue t f m -> Doc ann Source #
data ValueOrigin Source #
During the output, which can print only representation of value, lazy thunks need to looked into & so - be evaluated (*sic) This type is a simple manual witness "is the thunk gets shown".
Instances
Eq ValueOrigin Source # | |
Defined in Nix.Pretty (==) :: ValueOrigin -> ValueOrigin -> Bool # (/=) :: ValueOrigin -> ValueOrigin -> Bool # |
:: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) | |
=> ValueOrigin | Was thunk? |
-> NValue t f m | |
-> Doc ann |
prettyNValueProv :: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) => NValue t f m -> Doc ann Source #
prettyNThunk :: forall t f m ann. (HasCitations m (NValue t f m) t, HasCitations1 m (NValue t f m) f, MonadThunk t m (NValue t f m), MonadDataContext f m) => t -> m (Doc ann) Source #