map and fmap
Bulat Ziganshin
bulat.ziganshin at gmail.com
Tue Aug 15 02:19:28 EDT 2006
Hello Duncan,
Tuesday, August 15, 2006, 2:37:50 AM, you wrote:
> If it goes in that direction it'd be nice to consider the issue of
> structures which cannot support a polymorphic map. Of course such
> specialised containers (eg unboxed arrays or strings) are not functors
> but they are still useful containers with a sensible notion of map.
unboxed arrays - not if you using implementation from ArrayRef lib
ByteStrings - can be also parameterized by its type elements, as i
always suggested. of course, these elements should be unboxable and
belong to the Storable class in order to allow peek/poke them
there is also faking solution:
type ByteStr a = ByteString
instance Functor ByteStr
(although i never tested it)
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-prime
mailing list