-
Notifications
You must be signed in to change notification settings - Fork 38
Show instances for ground types #1123
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
base: master
Are you sure you want to change the base?
Conversation
The current implementation can already generate the following core code for type MaybeInt {
Nothing()
Just(x: Int, y: Int)
}
but when being called in main like this
the compiler fails in Transformer with |
Since it is a "user defined" function, you need to call it with App, not PureApp |
4de036e
to
7f9a458
Compare
val TString = ValueType.Data(builtins.StringSymbol, Nil) | ||
val TDouble = ValueType.Data(builtins.DoubleSymbol, Nil) | ||
|
||
val Builtins = List(TUnit, TInt, TChar, TByte, TBoolean, TString, TDouble) |
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.
Nitpick:
val Builtins = List(TUnit, TInt, TChar, TByte, TBoolean, TString, TDouble) | |
val builtins = List(TUnit, TInt, TChar, TByte, TBoolean, TString, TDouble) |
- Start synthesizing all show definitions, not just missing ones
Then we don't need to filter out the definition
eca7730
to
c36c748
Compare
also delete old show functions, this works for all non-generic data types
Implement new Core -> Core Phase which
synthesizes
show
definitions for any type based on ground show definitionsFor example
could generate something along the lines of