Module
Data.Undefined.NoProblem
- Package
- purescript-undefined-is-not-a-problem
- Repository
- paluh/purescript-undefined-is-not-a-problem
#Req Source
newtype Req a
Denotes a required record field, the opposite of Opt
. Note that using
this type is only required for polymorphic fields, due to complicated type
system reasons. Fields that have concrete types are not required to use
Req
. For example:
type Args a =
{ polymorphicField :: Req a -- `Req` is needed here
, optionalField :: Opt a
, concreteTypedField :: Int -- no need for `Req` here
}
Constructors
Req a
Instances
#fromOptFlipped Source
fromOptFlipped :: forall a. Opt a -> a -> a
#(!) Source
Operator alias for Data.Undefined.NoProblem.fromOptFlipped (left-associative / precedence 9)
#isUndefined Source
isUndefined :: forall a. Opt a -> Boolean
#unsafeUnwrap Source
unsafeUnwrap :: forall a. Opt a -> a
#pseudoBind Source
pseudoBind :: forall a b. Opt a -> (a -> Opt b) -> Opt b
This is not dedicated for providing bind
.
We are not able to have Monad
here.
It is only to provide nice operator: (coerce {}) ? .a ? .b ? _.c.d ! "default"
#type (<>) Source
Operator alias for Prim.TypeError.Beside (right-associative / precedence 2)
Ripped from typelevel-eval
#SCons Source
data SCons :: Symbol -> SList -> SList
data SCons t0 t1
Instances
RenderPath (SCons n SNil) (QuoteLabel n)
(RenderPath tail p) => RenderPath (SCons segment tail) (Beside p (Beside (Text ".") (QuoteLabel segment)))
#SNil Source
data SNil :: SList
data SNil
Instances
RenderPath SNil (Text "")
RenderPath (SCons n SNil) (QuoteLabel n)
#type (:::) Source
Operator alias for Data.Undefined.NoProblem.SCons (right-associative / precedence 6)
#RenderPath Source
class RenderPath :: SList -> Doc -> Constraint
class RenderPath (path :: SList) (render :: Doc) | path -> render
Instances
RenderPath SNil (Text "")
RenderPath (SCons n SNil) (QuoteLabel n)
(RenderPath tail p) => RenderPath (SCons segment tail) (Beside p (Beside (Text ".") (QuoteLabel segment)))
#TypeMismatchErr Source
class TypeMismatchErr :: Type -> Type -> SList -> Doc -> Constraint
class TypeMismatchErr (given :: Type) (expected :: Type) (path :: SList) (msg :: Doc) | path expected given -> msg
Instances
(RenderPath p p') => TypeMismatchErr given expected p (Above (Beside (Text "Type mismatch on the path: { ") (Beside p' (Text " }. Expecting"))) (Above (Text "") (Above (Quote expected) (Above (Text "") (Above (Text "but got") (Above (Text "") (Above (Quote given) (Above (Text "") (Above (Text "If one of the types above is a type variable like `t2` or `r172`") (Above (Text "it probably means that you should provide type annotation to some") (Text "parts of your value (like `[] ∷ Array Int` or `Nothing ∷ Maybe String`)")))))))))))