Skip to content

Remove Data.Argonaut.Encode.Generic.Rep.EncodeRepFields #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Notable changes to this project are documented in this file. The format is based

Breaking changes (😱!!!):

- Removed vestigial `EncodeRepFields` class and its remaining instance for `Data.Generic.Rep.Product`.

New features:

Bugfixes:
Expand Down
10 changes: 0 additions & 10 deletions src/Data/Argonaut/Encode/Generic/Rep.purs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
module Data.Argonaut.Encode.Generic.Rep (
class EncodeRep,
class EncodeRepArgs,
class EncodeRepFields,
class EncodeLiteral,
encodeRep,
encodeRepWith,
encodeRepArgs,
encodeRepFields,
genericEncodeJson,
genericEncodeJsonWith,
encodeLiteralSum,
Expand Down Expand Up @@ -65,14 +63,6 @@ instance encodeRepArgsProduct :: (EncodeRepArgs a, EncodeRepArgs b) => EncodeRep
instance encodeRepArgsArgument :: (EncodeJson a) => EncodeRepArgs (Rep.Argument a) where
encodeRepArgs (Rep.Argument a) = [encodeJson a]

class EncodeRepFields r where
encodeRepFields :: r -> FO.Object Json

instance encodeRepFieldsProduct :: (EncodeRepFields a, EncodeRepFields b) => EncodeRepFields (Rep.Product a b) where
encodeRepFields (Rep.Product a b) =
FO.union (encodeRepFields a) (encodeRepFields b)


-- | Encode any `Generic` data structure into `Json`.
genericEncodeJson :: forall a r. Rep.Generic a r => EncodeRep r => a -> Json
genericEncodeJson = genericEncodeJsonWith defaultEncoding
Expand Down