{-# LANGUAGE LambdaCase #-}
module KDL.Decoder.Monad (
fail,
module KDL.Decoder.Arrow,
) where
import Control.Arrow (arr, (>>>))
import Data.Text (Text)
import KDL.Decoder.Arrow hiding (
fail,
)
import KDL.Decoder.Arrow qualified as Arrow
import Prelude hiding (any, fail, null)
fail :: forall a o. Text -> Decoder o a
fail :: forall a o. Text -> Decoder o a
fail Text
msg = (() -> Text) -> DecodeArrow o () Text
forall b c. (b -> c) -> DecodeArrow o b c
forall (a :: * -> * -> *) b c. Arrow a => (b -> c) -> a b c
arr (\() -> Text
msg) DecodeArrow o () Text -> DecodeArrow o Text a -> DecodeArrow o () a
forall {k} (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k).
Category cat =>
cat a b -> cat b c -> cat a c
>>> DecodeArrow o Text a
forall b o. DecodeArrow o Text b
Arrow.fail