@@ -25,10 +25,10 @@ import Network.TypedProtocol.Codec
2525import Network.TypedProtocol.Core
2626
2727
28- -- | Construct a 'Codec ' for a CBOR based serialisation format, using strict
28+ -- | Construct a 'CodecF ' for a CBOR based serialisation format, using strict
2929-- 'BS.ByteString's.
3030--
31- -- This is an adaptor between the @cborg@ library and the 'Codec ' abstraction.
31+ -- This is an adaptor between the @cborg@ library and the 'CodecF ' abstraction.
3232--
3333-- It takes encode and decode functions for the protocol messages that use the
3434-- CBOR library encoder and decoder.
@@ -38,7 +38,7 @@ import Network.TypedProtocol.Core
3838-- natively produces chunks).
3939--
4040mkCodecCborStrictBS
41- :: forall ps m . MonadST m
41+ :: forall ps m f . MonadST m
4242
4343 => (forall (st :: ps ) (st' :: ps ).
4444 StateTokenI st
@@ -49,10 +49,10 @@ mkCodecCborStrictBS
4949 -> (forall (st :: ps ) s .
5050 ActiveState st
5151 => StateToken st
52- -> CBOR. Decoder s (SomeMessage st ))
52+ -> CBOR. Decoder s (f st ))
5353 -- ^ cbor decoder
5454
55- -> Codec ps CBOR. DeserialiseFailure m BS. ByteString
55+ -> CodecF ps CBOR. DeserialiseFailure m f BS. ByteString
5656mkCodecCborStrictBS cborMsgEncode cborMsgDecode =
5757 Codec {
5858 encode = \ msg -> convertCborEncoder cborMsgEncode msg,
@@ -65,11 +65,12 @@ mkCodecCborStrictBS cborMsgEncode cborMsgDecode =
6565 . cborEncode
6666
6767 convertCborDecoder
68- :: (forall s . CBOR. Decoder s a )
69- -> m (DecodeStep BS. ByteString CBOR. DeserialiseFailure m a )
68+ :: (forall s . CBOR. Decoder s ( f a ) )
69+ -> m (DecodeStep BS. ByteString CBOR. DeserialiseFailure m ( f a ) )
7070 convertCborDecoder cborDecode =
7171 convertCborDecoderBS cborDecode stToIO
7272
73+
7374convertCborDecoderBS
7475 :: forall s m a . Functor m
7576 => CBOR. Decoder s a
@@ -89,16 +90,16 @@ convertCborDecoderBS cborDecode liftST =
8990 go (CBOR. Partial k) = DecodePartial (fmap go . liftST . k)
9091
9192
92- -- | Construct a 'Codec ' for a CBOR based serialisation format, using lazy
93+ -- | Construct a 'CodecF ' for a CBOR based serialisation format, using lazy
9394-- 'BS.ByteString's.
9495--
95- -- This is an adaptor between the @cborg@ library and the 'Codec ' abstraction.
96+ -- This is an adaptor between the @cborg@ library and the 'CodecF ' abstraction.
9697--
9798-- It takes encode and decode functions for the protocol messages that use the
9899-- CBOR library encoder and decoder.
99100--
100101mkCodecCborLazyBS
101- :: forall ps m . MonadST m
102+ :: forall ps m f . MonadST m
102103
103104 => (forall (st :: ps ) (st' :: ps ).
104105 StateTokenI st
@@ -109,10 +110,10 @@ mkCodecCborLazyBS
109110 -> (forall (st :: ps ) s .
110111 ActiveState st
111112 => StateToken st
112- -> CBOR. Decoder s (SomeMessage st ))
113+ -> CBOR. Decoder s (f st ))
113114 -- ^ cbor decoder
114115
115- -> Codec ps CBOR. DeserialiseFailure m LBS. ByteString
116+ -> CodecF ps CBOR. DeserialiseFailure m f LBS. ByteString
116117mkCodecCborLazyBS cborMsgEncode cborMsgDecode =
117118 Codec {
118119 encode = \ msg -> convertCborEncoder cborMsgEncode msg,
@@ -126,11 +127,12 @@ mkCodecCborLazyBS cborMsgEncode cborMsgDecode =
126127 . cborEncode
127128
128129 convertCborDecoder
129- :: (forall s . CBOR. Decoder s a )
130- -> m (DecodeStep LBS. ByteString CBOR. DeserialiseFailure m a )
130+ :: (forall s . CBOR. Decoder s ( f a ) )
131+ -> m (DecodeStep LBS. ByteString CBOR. DeserialiseFailure m ( f a ) )
131132 convertCborDecoder cborDecode =
132133 convertCborDecoderLBS cborDecode stToIO
133134
135+
134136convertCborDecoderLBS
135137 :: forall s m a . Monad m
136138 => CBOR. Decoder s a
0 commit comments