Skip to content

Conversation

@ajnsit
Copy link
Contributor

@ajnsit ajnsit commented Mar 14, 2019

What does this pull request do?

Adds trivial encode/decode instances for Identity a. I ran into this when trying to encode a data type that looks like this -

data Entity f = Entity
  { guid :: f Guid
  , <some other fields here>
  }

When the entity has a Guid it can be persisted as Entity Identity. This is a very common pattern.

However in the absence of an encode instance for Identity a, I have to manually encode Entity while unwrapping the guid field, which is a bit ugly.

@thomashoneyman thomashoneyman self-assigned this Apr 23, 2019
@thomashoneyman thomashoneyman merged commit 9a1c0e0 into purescript-contrib:master May 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants