Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.
GADTs are used in reflex apps to model request / response types, and pass them in the wire (websockets, etc.) as JSON. This library just released to tie it all together: https://github.com/reflex-frp/reflex-gadt-api
finally, do you think this library will replace the need on Servant in reflex world?
This existed in rhyolite for a long while anyway. I never needed servant.
nice... I wanted to remove Servant from my head nowadays
I find servant really nice, why do you want to remove it besides being able to have an "isomorphic app"?
I find it nice too.. I just don't want it for my next reflex project because it feels too cumbersome for me when develop the project with it. Also, I have another project using another frontend beside haskell (GHCJS), and I feel I don't need servant in my backend. It's a matter of preference though.
Another (very interesting) use for GADTs (at the kind-level)
From the first example,
Locked ---Unlock--> Closed ---Open--> Opened
^ | ^ |
| | | |
data DoorS = Locked | Closed | Opened
data DoorG :: DoorS -> DoorS -> Type where
Unlock :: DoorG Locked Closed
Lock :: DoorG Closed Locked
Open :: DoorG Closed Opened
Close :: DoorG Opened Closed
I came up with a use case that we actually kinda need in our app
I may write it soon