-
Notifications
You must be signed in to change notification settings - Fork 1
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
Support type synonyms in datatypes #22
Comments
how much do we want this feature? This will be much harder to achieve mainly because of how the type MyType = MyOtherType Int (Bool, [Float]) If you think this is an important feature to support, I'll think harder about it. |
I also ran into this in the wild; I'd like to tackle this for this 2.2 version unifying with |
Note that the |
@serras That seems like a lovely library; I have just tried implementing our tl;drA naive impl based on Reason 1All the generation is based on our own datatype: data DTI var = ADT Name ... [CI var] | New Name ... (CI var)
data CI var = NormalConstr ... | RecordConstr ... And the beauty of it is that the type pipeline is as follows:
Once we reach a fixpoint of the process above, we end up with a Reason 2The |
I believe I found a decent hack for it in 7c8cdab Type synonyms seem to be working when generating codes. data Idxs
= Idxs { idxsNext :: Int
, idxsMap :: M.Map STy (Int , Maybe (DTI IK))
}
deriving (Show) I have added an explicit "this type is equivalent to this" in there: data Idxs
= Idxs { idxsNext :: Int
, idxsMap :: M.Map STy (Int , Maybe (DTI IK))
, idxsSyns :: M.Map STy STy
}
deriving (Show) Now, every time we see a type synonym we exand, reduce and register as equivalent, |
No description provided.
The text was updated successfully, but these errors were encountered: