You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Encoding.hs file in the example directory shows multiple ways of writing encoders
using divided and chosen
using contrazip
using encodeOf and <>
But it misses a key use-case, which is contramap and <>, since many people are using plain old field accessors instead of lens. It's not explained anywhere that contramap is the function-based version of encodeOf. To make that leap requires knowledge of Contravariant and probably some knowledge of lens to make, so it would be best to have an example.
On the topic of Encoding.hs, it's quite a big example that shows a few different ways to achieve the same thing. Maybe it should be split up into a handful of examples to make it clearer where the separation is and show off the difference in code size between the various examples.
The text was updated successfully, but these errors were encountered:
The
Encoding.hs
file in the example directory shows multiple ways of writing encodersdivided
andchosen
contrazip
encodeOf
and<>
But it misses a key use-case, which is
contramap
and<>
, since many people are using plain old field accessors instead of lens. It's not explained anywhere thatcontramap
is the function-based version ofencodeOf
. To make that leap requires knowledge of Contravariant and probably some knowledge of lens to make, so it would be best to have an example.On the topic of
Encoding.hs
, it's quite a big example that shows a few different ways to achieve the same thing. Maybe it should be split up into a handful of examples to make it clearer where the separation is and show off the difference in code size between the various examples.The text was updated successfully, but these errors were encountered: