I wanted to try to write this function completely using point-free style. It led to me having to write that >.< operator, which you can see from the type definition exactly what it does. It was a good mental exercise in types for me, a Haskell beginner.
You don't need your filter isAlpha and isAlpha functions, since toNumber already returns None when the character isn't a letter, which chops off a nice bit of the solution!
You can also use findIndex from Data.List instead of find-with-zip (though that solution is cool! 😋
toNumber=(fmap(+1)).(flipfindIndexalpha).(==)
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.
I wanted to try to write this function completely using point-free style. It led to me having to write that
>.<operator, which you can see from the type definition exactly what it does. It was a good mental exercise in types for me, a Haskell beginner.You don't need your
filter isAlphaandisAlphafunctions, sincetoNumberalready returnsNonewhen the character isn't a letter, which chops off a nice bit of the solution!You can also use
findIndexfromData.Listinstead of find-with-zip (though that solution is cool! 😋