MinaProtocol / mina

Mina is a cryptocurrency protocol with a constant size blockchain, improving scaling while maintaining decentralization and security.
https://minaprotocol.com
Apache License 2.0
2k stars 528 forks source link

Versioning for GADT types #2024

Closed wu-s-john closed 3 years ago

wu-s-john commented 5 years ago

Recently, I implemented a database that can store heterogenous key-value pairs and I used GADTs to cleanly do this in a type-safe way:

https://github.com/CodaProtocol/coda/blob/75606fed412a93520b12d96d437c26abef134198/src/lib/rocksdb/serializable.ml

This now requires GADTs to be versioned.

psteckler commented 5 years ago

I'm not following why this code involves a GADT.

My understanding of a GADT is that it's an algebraic data type with a type parameter, where the instantiation of the type parameter is implied by the choice of constructor for the data type.

The versioning mechanism does work (now) with data types with a type parameter, in any case.

psteckler commented 3 years ago

Stale.