remote: Data.Serializer, expand signature of mapIso/mapPrism*

This commit is contained in:
sorki 2023-12-01 06:07:32 +01:00
parent cbbc731519
commit 936fdf85f5

View File

@ -151,7 +151,8 @@ mapIsoSerializer
:: Functor (t Get)
=> (a -> b) -- ^ Map over @getS@
-> (b -> a) -- ^ Map over @putS@
-> (Serializer t a -> Serializer t b)
-> Serializer t a
-> Serializer t b
mapIsoSerializer f g s = Serializer
{ getS = f <$> getS s
, putS = putS s . g
@ -163,7 +164,8 @@ mapPrismSerializer
:: MonadError eGet (t Get)
=> (a -> Either eGet b) -- ^ Map over @getS@
-> (b -> a) -- ^ Map over @putS@
-> (Serializer t a -> Serializer t b)
-> Serializer t a
-> Serializer t b
mapPrismSerializer f g s = Serializer
{ getS = either throwError pure . f =<< getS s
, putS = putS s . g