[Haskell-cafe] Sparse records/ADTs
daniel.trstenjak at gmail.com
Wed Oct 24 13:02:15 CEST 2012
On Wed, Oct 24, 2012 at 11:08:29AM +0100, Jon Fairbairn wrote:
> for each field, which is tedious (and O(n)). Obviously Templates
> would help, but is there an alternative I’ve missed?
perhaps something like:
data Type = Ta | Tb | Tc ...
data E = Ea A | Eb B | Ec C | ...
type D = HashMap Type E
get :: Type -> D -> Maybe E
get = lookup
More information about the Haskell-Cafe