-
Notifications
You must be signed in to change notification settings - Fork 92
Add toRep #238
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
Add toRep #238
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ module Data.Generic.Rep | |
| ( class Generic | ||
| , to | ||
| , from | ||
| , toRep | ||
| , NoConstructors | ||
| , NoArguments(..) | ||
| , Sum(..) | ||
|
|
@@ -10,6 +11,8 @@ module Data.Generic.Rep | |
| , Argument(..) | ||
| ) where | ||
|
|
||
| import Type.Proxy (Proxy(..)) | ||
|
|
||
| -- | A representation for types with no constructors. | ||
| data NoConstructors | ||
|
|
||
|
|
@@ -34,3 +37,6 @@ newtype Argument a = Argument a | |
| class Generic a rep | a -> rep where | ||
| to :: rep -> a | ||
| from :: a -> rep | ||
|
|
||
| toRep :: forall from to. Generic from to => Proxy from -> Proxy to | ||
|
||
| toRep _ = Proxy | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we reuse
aandrepvariables, like in the class declaration?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.