Gábor Lehel <illissius-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:this may be a bit off-topic, but I've been wondering for some time now,
> Compatibility issues aside, is there any reason newtypes aren't a good
> solution here? You could get away with just one:
how to compose newtype-based typeclass instances?
for instance, now we have a special newtype for 'Int's,
then for some reson we have a another package, which uses newtypes to
> instance Hashable (FasterInsecureHashing Int) where
> hash = unFIH
provide alternative instances for newtypes, let's say the binary package
starts defining a 'Binary' newtype-wrapped instance for serializing to
PDP-byteordering, .i.e.
instance Binary (PdpSerialization Int) where
put i = ...
get = ...
How do would I combine those two newtypes, if I wanted to have a nested
data-structure such as
IntMap Int (Int,[(Int,Int)])
hashed with the FasterInsecureHashing variant, as well as serialized
with the PdpSerialization instances?
cheers,
hvr