zrho / purescript-optic-ui

PureScript UI framework based on lenses.
122 stars 10 forks source link

Add 'zoomMaybe' #5

Closed paf31 closed 9 years ago

paf31 commented 9 years ago

This seems like it would be useful for applications with multiple tabs.

zrho commented 9 years ago

I think we are even better off if we make zoomAll produce an element in some Plus functor, by folding the resulting list with <|> and empty. This would include the list type as currently there, but also arrays and maybe. That would not check the traversal to be a prism, but in the case it is not, it degrades gracefully by only picking the first target of the traversal.

paf31 commented 9 years ago

Sounds much better.