VinylRecords / Vinyl

Extensible Records for Haskell. Pull requests welcome! Come visit us on #vinyl on freenode.
http://hackage.haskell.org/package/vinyl
MIT License
261 stars 49 forks source link

Build CoRec ElField value #127

Closed vdorr closed 5 years ago

vdorr commented 5 years ago

Using ElField as CoRec functor and field value type is not fully known, ghc ends with "Ambiguous type" error, even when field name is unique. As in this example:

value :: CoRec ElField '[ '("a", Int) ] value = CoRec (#a =: 1)

I need in my use-case ghc to infer fairly long type, so i'd like to make this work using unique labels, how i can do it with ElField? Or possibly user type while keeping rest of vinyl's CoRec machinery.

acowley commented 5 years ago

Sorry that commit closed this a bit eagerly. Does the corec function help you out? If not, please re-open and we'll take another crack at it.

vdorr commented 5 years ago

It works perfectly. Thank you!