3 ms·
In Haskell you can implement moveUpOne as: moveUpOne = fmap (+1) ...which uses a map over a functor, in this case a tuple. But once you're familiar with f
by antonvs 4y ago
In Haskell you can implement moveUpOne as:
moveUpOne = fmap (+1)
...which uses a map over a functor, in this case a tuple. But once you're familiar with functors, there's not that much benefit in naming something like that, much as you wouldn't typically define `add1 = (+1)`.
- skybrian 4y agoThat's significantly less readable since you can't see that you're working with ordered pairs that have x and y coordinates. Don't hide the data structure.