[Haskell-cafe] Zippers from any traversable [Was: Looking for practical examples of Zippers]

wren ng thornton wren at freegeek.org
Wed Apr 1 20:21:10 EDT 2009


oleg at okmij.org wrote:
> wren ng thornton wrote:
> > > how, for instance, turn a nested Map like
> > >
> > > Map Int (Map Int (Map String Double)
> > >
> > > into a "zipped" version.
> > You can't. Or rather, you can't unless you have access to the
> > implementation of the datastructure itself; and Data.Map doesn't provide
> > enough details to do it.
> 
> Actually Data.Map does provide enough details: Data.Map is a member of
> Traversable and anything that supports Traversable (at the very least,

Ah right, I forgot it had a Traversable instance (which is as good as 
having the implementation ;)

-- 
Live well,
~wren


More information about the Haskell-Cafe mailing list