Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data EntityError = EntityError {}
- data EntityEncode d :: Effect where
- Encode :: d -> EntityEncode d m LByteString
- EncodeStrict :: d -> EntityEncode d m ByteString
- encode :: forall d r. Member (EntityEncode d) r => d -> Sem r LByteString
- encodeStrict :: forall d r. Member (EntityEncode d) r => d -> Sem r ByteString
- data EntityDecode d :: Effect where
- Decode :: LByteString -> EntityDecode d m (Either EntityError d)
- DecodeStrict :: ByteString -> EntityDecode d m (Either EntityError d)
- decode :: forall d r. Member (EntityDecode d) r => LByteString -> Sem r (Either EntityError d)
- decodeStrict :: forall d r. Member (EntityDecode d) r => ByteString -> Sem r (Either EntityError d)
- data Encode a
- data Decode a
- type family Entities es r :: Constraint where ...
- type family Encoders es r :: Constraint where ...
- type family Decoders ds r :: Constraint where ...
Documentation
data EntityError Source #
Generic error type for decoders.
Instances
Eq EntityError Source # | |
Defined in Polysemy.Http.Effect.Entity (==) :: EntityError -> EntityError -> Bool # (/=) :: EntityError -> EntityError -> Bool # | |
Show EntityError Source # | |
Defined in Polysemy.Http.Effect.Entity showsPrec :: Int -> EntityError -> ShowS # show :: EntityError -> String # showList :: [EntityError] -> ShowS # |
data EntityEncode d :: Effect where Source #
Abstraction of json encoding, potentially usable for other content types like xml.
Encode :: d -> EntityEncode d m LByteString | |
EncodeStrict :: d -> EntityEncode d m ByteString |
Instances
type DefiningModule EntityEncode Source # | |
Defined in Polysemy.Http.Effect.Entity |
encode :: forall d r. Member (EntityEncode d) r => d -> Sem r LByteString Source #
Lazily encode a value of type d
to a LByteString
encodeStrict :: forall d r. Member (EntityEncode d) r => d -> Sem r ByteString Source #
Strictly encode a value of type d
to a ByteString
data EntityDecode d :: Effect where Source #
Abstraction of json decoding, potentially usable for other content types like xml.
Decode :: LByteString -> EntityDecode d m (Either EntityError d) | |
DecodeStrict :: ByteString -> EntityDecode d m (Either EntityError d) |
Instances
type DefiningModule EntityDecode Source # | |
Defined in Polysemy.Http.Effect.Entity |
decode :: forall d r. Member (EntityDecode d) r => LByteString -> Sem r (Either EntityError d) Source #
Lazily decode a LByteString
to a value of type d
decodeStrict :: forall d r. Member (EntityDecode d) r => ByteString -> Sem r (Either EntityError d) Source #
Strictly decode a ByteString
to a value of type d
type family Entities es r :: Constraint where ... Source #
Convenience constraint for requiring multiple entity effects, to be used like Members
.
foo :: Entities [Encode Int, Decode Double] r => Sem r ()
type family Encoders es r :: Constraint where ... Source #
Convenience constraint for requiring multiple encoders.
foo :: Encoders [Int, Double] r => Sem r ()
Encoders '[] r = () | |
Encoders (d ': ds) r = (Member (EntityEncode d) r, Encoders ds r) |
type family Decoders ds r :: Constraint where ... Source #
Convenience constraint for requiring multiple decoders.
foo :: Decoders [Int, Double] r => Sem r ()
Decoders '[] r = () | |
Decoders (d ': ds) r = (Member (EntityDecode d) r, Decoders ds r) |