Yes I had that same with reduce (to be precise with foldl and foldr in Haskell). When it clicked it was such a wonderful feeling.
Reduce is very powerful stuff.
I think a couple days ago I got what a flip function means.
flip f a b = f b a
It's useful when you want to partially apply a function but the arguments are not in the place where they should be. You just flip them and that's it.
It didn't click until I saw a good example.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Yes I had that same with reduce (to be precise with foldl and foldr in Haskell). When it clicked it was such a wonderful feeling.
Reduce is very powerful stuff.
I think a couple days ago I got what a flip function means.
flip f a b = f b a
It's useful when you want to partially apply a function but the arguments are not in the place where they should be. You just flip them and that's it.
It didn't click until I saw a good example.