On Fri, Jul 15, 2011 at 2:00 PM, Iustin Pop <ius...@google.com> wrote:
> Mmm, I can fmap this to make it even more clear: > > fmap (flip (-1) 1) > > as Maybe is a functor instance, and we only need to work on the 'inside' > value. Not sure this is clear to me. Feel free to apply it this way though. Any explanation or nice references? :) > Not really, as the mutation function would be too unreadable? > > maybe (False, Nothing) (\n -> n <= ixes_cnt, Just (n - ixes_cnt)) limit > Not too bad, I can read it, but feel free to live it the other way if you prefer. Guido