
31 Mar
2015
31 Mar
'15
3:15 p.m.
Dear Johannes, On 31/03/15 19:06, Johannes Waldmann wrote:
@Andres
I was not aware. But that looks like an actual copy of the IntMap code, so it does not get maintained/updated? That's why I was thinking of a wrapper module only.
There's also https://hackage.haskell.org/package/enummapset https://wiki.haskell.org/EnumSet_EnumMap so this must be a good idea, since it's come up so many times. :-) I've not looked at the performance overhead of this approach, but I have used something quite similar, which uses Coercible instead of Enum. Of course, that works only for newtypes of Int, but it is guaranteed to be zero-cost. Adam -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/