Skip to content
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

Loosens the record type on <: from PlainRec to Rec #15

Merged
merged 1 commit into from
May 15, 2013
Merged

Loosens the record type on <: from PlainRec to Rec #15

merged 1 commit into from
May 15, 2013

Conversation

nkpart
Copy link
Contributor

@nkpart nkpart commented May 15, 2013

This lets you use cast on records that are not built with the Identity functor. My use case was refining something like the validator example from the tutorial:

type Aged = "age" :: Int ': '[]

ageValidator :: Rec Age (Validator [String])
ageValidator = cast vperson

I'm not sure if this affects type inference, I found I've had to be pretty liberal in my type annotations when using cast.

@jonsterling
Copy link
Contributor

Ah, nice! I'll have a look and most likely merge this in. Thanks!

jonsterling added a commit that referenced this pull request May 15, 2013
Loosens the record type on `<:` from PlainRec to Rec
@jonsterling jonsterling merged commit 33106f7 into VinylRecords:master May 15, 2013
@nkpart nkpart deleted the nkpart/rec-subtyping branch May 15, 2013 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants