File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ fix f =
329329-- |
330330-- | ```purescript
331331-- | nonEmptyString ∷ CA.JsonCodec NES.NonEmptyString
332- -- | nonEmptyString = CA.prismaticCodec NES.fromString NES.toString CA.string
332+ -- | nonEmptyString = CA.prismaticCodec "NonEmptyString" NES.fromString NES.toString CA.string
333333-- | ```
334334-- |
335335-- | Another example might be to handle a mapping from a small sum type to
@@ -339,7 +339,7 @@ fix f =
339339-- | data Direction = North | South | West | East
340340-- |
341341-- | directionCodec :: JsonCodec Direction
342- -- | directionCodec = prismaticCodec dec enc string
342+ -- | directionCodec = CA. prismaticCodec "Direction" dec enc string
343343-- | where
344344-- | dec = case _ of
345345-- | "N" -> Just North
@@ -357,8 +357,8 @@ fix f =
357357-- |
358358-- | Although for this latter case there are some other options too, in the form
359359-- | of `Data.Codec.Argonaut.Generic.nullarySum` and `Data.Codec.Argonaut.Sum.enumSum`.
360- prismaticCodec ∷ ∀ a b . (a → Maybe b ) → (b → a ) → JsonCodec a → JsonCodec b
361- prismaticCodec f g orig =
360+ prismaticCodec ∷ ∀ a b . String → (a → Maybe b ) → (b → a ) → JsonCodec a → JsonCodec b
361+ prismaticCodec name f g orig =
362362 basicCodec
363- (\json' → note (UnexpectedValue json') <<< f =<< decode orig json')
363+ (\json' → note (Named name ( UnexpectedValue json') ) <<< f =<< decode orig json')
364364 (encode orig <<< g)
You can’t perform that action at this time.
0 commit comments