Skip to content

Commit 7c1715d

Browse files
committed
Document the Data.Codec.Argonaut.Migration module
This module is specifically about migrating forward. Without knowing this context, but knowing how codecs work, it's easy to think that this module provides migrations both ways. We make it clearer that these values are only about going one way. We also provide hints at where to go for migrating the other way, or what to do when this module doesn't provide everything needed. Hopefully, this is useful context to have and it helps people. We might also want to throw together some examples. Prose has its place, but code also has its place.
1 parent 688808a commit 7c1715d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Data/Codec/Argonaut/Migration.purs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
-- | Codecs that provide forward migrations. In a forward migration, the decoder
2+
-- | migrates to the new format while decoding from JSON and the encoder uses
3+
-- | the new format while encoding to JSON.
4+
-- |
5+
-- | If you need more control over a forward migration, the `Functor` instance
6+
-- | allows operating on the underlying `Json` value directly.
7+
-- |
8+
-- | If you need both forward and backward migrations, the `Profunctor` instance
9+
-- | allows operating on the underlying `Json` value directly in both directions.
110
module Data.Codec.Argonaut.Migration
211
( addDefaultField
312
, updateField

0 commit comments

Comments
 (0)