Closed quicksnap closed 6 years ago
screenable
allows it to "hide" a type within itself. Note how the Screen
constructor mentions the 'state
variable, but type screenable('context, 'transition, 'wrappedState)
doesn't mention 'state
. This means that you can have a list of screenable
s, where each one has a different 'state
type, which is critical for my screen management to work.Thanks for the info! I can grok most of the code now =)
Hello! I was looking through the code to refresh myself on Reason, and had a couple questions on your code:
1) Why did you chose to use polymorphic variants here? https://github.com/jaredly/gravitron/blob/master/src/Main.re#L90-L121
2)
screenable
is a GADT, right? I see that it's being used as a kind of container, and its constructor values are being pulled out in other places in the code. Why use a GADT instead of a record or something? https://github.com/jaredly/gravitron/blob/master/src/ScreenManager.re#L17-L18Thanks for your time if you're able to help =) Just curious..