Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Documentation
decodeWith :: ValueCodec a -> Value -> Result a Source #
encodeWith :: ValueCodec a -> a -> Value Source #
Instances
(Functor r, Functor w) => Functor (CodecOf r w i) Source # | |
(Applicative r, Applicative w) => Applicative (CodecOf r w i) Source # | |
Defined in Argo.Codec pure :: a -> CodecOf r w i a # (<*>) :: CodecOf r w i (a -> b) -> CodecOf r w i a -> CodecOf r w i b # liftA2 :: (a -> b -> c) -> CodecOf r w i a -> CodecOf r w i b -> CodecOf r w i c # (*>) :: CodecOf r w i a -> CodecOf r w i b -> CodecOf r w i b # (<*) :: CodecOf r w i a -> CodecOf r w i b -> CodecOf r w i a # | |
(Alternative r, Alternative w) => Alternative (CodecOf r w i) Source # | |
type ValueCodec a = Codec (ReaderT Value (ExceptT String Identity)) (MaybeT (StateT Value Identity)) a Source #
arrayCodec :: ValueCodec (ArrayOf Value) Source #
maybeCodec :: ValueCodec a -> ValueCodec (Maybe a) Source #
eitherCodec :: ValueCodec a -> ValueCodec b -> ValueCodec (Either a b) Source #
mapBoth :: (Functor r, Alternative w) => (o2 -> o1) -> (i1 -> Maybe i2) -> CodecOf r w i2 o2 -> CodecOf r w i1 o1 Source #
tagged :: String -> ValueCodec a -> ValueCodec a Source #
literalCodec :: Value -> ValueCodec () Source #
data Permission Source #
Instances
Eq Permission Source # | |
Defined in Argo.Codec (==) :: Permission -> Permission -> Bool # (/=) :: Permission -> Permission -> Bool # | |
Show Permission Source # | |
Defined in Argo.Codec showsPrec :: Int -> Permission -> ShowS # show :: Permission -> String # showList :: [Permission] -> ShowS # |
fromListCodec :: ValueCodec [e] -> Permission -> ListCodec e a -> ValueCodec a Source #
type ArrayCodec a = ListCodec Value a Source #
fromArrayCodec :: Permission -> ArrayCodec a -> ValueCodec a Source #
element :: ValueCodec a -> ArrayCodec a Source #
tupleCodec :: ValueCodec a -> ValueCodec b -> ValueCodec (a, b) Source #
fromObjectCodec :: Permission -> ObjectCodec a -> ValueCodec a Source #
required :: Name -> ValueCodec a -> ObjectCodec a Source #
optional :: Name -> ValueCodec a -> ObjectCodec (Maybe a) Source #
detectWith :: ([a] -> [a]) -> (a -> Bool) -> [a] -> Maybe (a, [a]) Source #