Skip to content

Add instance for Ratio? #113

Open
Open
@kindaro

Description

@kindaro

I want to encode and decode values of type Ratio. It is not supported yet. My offer is to encode and decode the same way as Aeson:

λ encode (3 % 5 ∷ Ratio Int)
"{\"numerator\":3,\"denominator\":5}"

My case specifically is related to argonaut-aeson-generic and purescript-bridge, so it is important to me that the encoding matches the Haskell side of my code. Since PureScript does not support orphan instances, I have no other way of making stuff work.

I can write a patch in no time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions