Module
Record.Optional.Fields.Errors
- Package
- purescript-record-ptional-fields
- Repository
- katsujukou/purescript-record-optional-fields
#RenderErrorContext Source
class RenderErrorContext :: Context -> Doc -> Constraint
class RenderErrorContext (ctx :: Context) (doc :: Doc) | ctx -> doc
Instances
(RenderErrorContext (parent t) above, TypeEquals doc (Above above (Beside (Text "- At field `") (Beside (QuoteLabel prop) (Text "`: "))))) => RenderErrorContext (AtProp parent prop r t) doc
RenderErrorContext (Root r t) (Above (Text "An error occurred while checking input option type:") (Text ""))
#RenderErrorDesc Source
class RenderErrorDesc :: ErrorDesc -> Doc -> Constraint
class RenderErrorDesc (desc :: ErrorDesc) (doc :: Doc) | desc -> doc
Instances
(RowToList r rl, RenderLabels rl labelsDoc) => RenderErrorDesc (UnsupportedProp prop r) (Above (Beside (Text " Unsupported field name: `") (Beside (QuoteLabel prop) (Text "`."))) (Above (Text "") (Beside (Text "💡 Supported fields include: ") labelsDoc)))
RenderErrorDesc (UnexpectedType a b) (Above (Beside (Text " Unexpected value type: `") (Beside (Quote b) (Text "`"))) (Above (Text "") (Beside (Text "💡 You must specify a value of type `") (Beside (Quote a) (Text "`.")))))
#RenderLabels Source
class RenderLabels :: RowList Type -> Doc -> Constraint
class RenderLabels (rl :: RowList Type) (doc :: Doc) | rl -> doc
Instances
RenderLabels Nil (Text "There are no available fields.")
RenderLabels (Cons l _1 Nil) (Beside (Text "`") (Beside (QuoteLabel l) (Text "`")))
(RenderLabels ls rest) => RenderLabels (Cons l _1 ls) (Beside (Text "`") (Beside (QuoteLabel l) (Beside (Text "` ") rest)))
#RenderError Source
class RenderError :: Type -> Doc -> Constraint
class RenderError (e :: Type) (doc :: Doc) | e -> doc
Instances
(RenderErrorContext ctx header, RenderErrorDesc desc body) => RenderError (TypeError ctx desc) (Above header body)