Functional programming fans, a challenge:
Here are two problems I've needed to solve lately where I don't see any reasonable way to do them with your average set of basic functional tools and immutable data, and instead I've ended up having to write very procedural loops-and-mutable-arrays type of code.
That code is generally not very satisfying to look at, but I just don't know any other reasonable solution, so, I'd love to hear how you would solve these:
@cthulahoops That fails the requirement I forgot and put in a later reply, I think?
@WAHa_06x36 I'm not seeing that. Unless you mean that ordering? In which case it's fine.
*Main> groupSnd [(1, 'a'), (2, 'b'), (3, 'a')]
Not quite unchanged, but the type of the function would be weird if it was.
A mastodon instance for anyone who likes green, purple, any colour that can be mixed from green or purple, or any colour that can be used to mix green or purple.
Just a personal instance to experiment with Mastodon.