Module

Ctl.Internal.Error

#E

type E :: Row Type -> Type -> Typetype E v a = Either (Variant v) a

#NotImplementedError

type NotImplementedError :: Row Type -> Row Typetype NotImplementedError r = (notImplementedError :: String | r)

#_notImplementedError

_notImplementedError :: Proxy @Symbol "notImplementedError"

#notImplementedError

notImplementedError :: forall (r :: Row Type) (a :: Type). Warn (Text "Function not implemented!") => String -> E (NotImplementedError + r) a

#traceAndHushAll

traceAndHushAll :: forall (v :: Row Type) (m :: Type -> Type) (a :: Type). DebugWarning => Monad m => ExceptV v m a -> MaybeT m a

Allows hush errors tracing as debug outputs. For use when error hadling is not yet supported at a call site.

#traceAndHushAll_

traceAndHushAll_ :: forall (v :: Row Type) (a :: Type). DebugWarning => ExceptV v Identity a -> Maybe a

Allows hush errors tracing as debug outputs. For use when error hadling is not yet supported at a call site.

#hushedErr

hushedErr :: forall (a :: Type) (b :: Type) (m :: Type -> Type) (r :: Row Type). Monad m => ExceptV r (MaybeT m) a

A Nothing based error value.

#hushable

hushable :: forall (v :: Row Type) (m :: Type -> Type) (a :: Type). Monad m => ExceptV v m a -> ExceptV v (MaybeT m) a

Lifts underlying monad to MaybeT allowing hushing selected errors. Example:

hushNotImplemented :: forall (m :: Type -> Type) (r :: Row Type) . Monad m => ExceptV (NotImplementedError + r) m Int -> ExceptV r (MaybeT m) Int hushNotImplemented m = hushable m # handleError { notImplementedError: _ -> hushedErr }

#safe_

safe_ :: forall (a :: Type). ExceptV () Identity a -> a

#noteE

noteE :: forall v a. E v a -> Maybe a -> E v a

Annotates Maybe with more proper error instead of the Nothing case

Modules