
29 Jul
2012
29 Jul
'12
4:38 p.m.
On Sun, Jul 29, 2012 at 11:37 AM, Antoine Latter
The downside to this proposal is that the requester (Edward) actually wants a function of type "a -> Maybe Int", so his polymorphic function can handle both infinite bit-types and finite bit-types.
With the new class, Edward could write:
class BitTraversable i where traverseBits :: <sometype>
instance (BitSize i) => BitTraversable i where traverseBits = <something>
instance BitTraversable Integer where traverseBits = <something else>
I should add that this approach looks like it would require OverlappingInstances. Antoine