-
Notifications
You must be signed in to change notification settings - Fork 32
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
Options with newtypes #10
Comments
Couldn't you use {-# LANGUAGE GeneralizedNewtypeDeriving #-}
newtype Foo = Foo { getFoo :: Bar } deriving (ParseRecord) |
Gabriel Gonzalez [email protected] writes:
This almost works, indeed:
However:
..instead of:
{-# LANGUAGE Arrows #-}
|
In the worst case you can just hand-write the instance, which would be: instance ParseField PAlias where
parseField m = fmap PAlias (parseField m) |
How does one provide for using newtypes as option record types?
Currently the failure mentions missing
ParseFields
instance, but when one tries to provide a hand-written one, along the lines of the existingParseField
instances, one faces the fact thatparseString
is not exported.Are there plans to automate instances for newtypes? Or to document how to define
ParseFields
instances for own types?The text was updated successfully, but these errors were encountered: