Skip to content

Fay.Convert doesn't check for newtypes #413

Open
@bergmark

Description

@bergmark
λ> showToFay (NewType 1)
Just (Object (fromList [("instance",String "NewType"),("slot1",Number 1.0)]))

The result should be Just (Number 1.0).

Currently we're using Data.Data for this and afaict it can't check for newtypes. GHC Generics can but only in >= 7.8. In the short term #412 provides a solution by removing the newtype optimizations so you'll be able to use that if you need to pass newtypes through the server side.

Another user workaround is to use a normal data type for types that are shared with the server side.

I think we need to wait a bit before dropping GHC 7.6 support, let me know if this is a hindrance for anyone.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions