Hi Jon

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


Greetings,
Daniel

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to