Haskell
import Data.Char (ord) wordsToMarks :: String > Int wordsToMarks = sum . map ((flip () 96) . ord)
Playground
Here.
The prelude defines subtract, so you don't need flip here:
subtract
flip
wordsToMarks = sum . map (subtract 96 . ord)
Another relatively common workaround is to use a rightsection that adds a negative number, i.e.
wordsToMarks = sum . map ((+(96)) . ord)
Thanks for your insight. I didn't know about subtract and when the second solution is kind of obscure to me it seems very cool and short.
Since  is both subtraction and unary minus one can’t use a rightsection like (1), but considering that subtracting is the same as adding a negative number the slightly obscure form makes sense. I’d still use subtract though.

(1)
We're a place where coders share, stay uptodate and grow their careers.
We strive for transparency and don't collect excess data.
re: Daily Challenge #110  Love VS. Friendship VIEW POST
FULL DISCUSSIONHaskell
Playground
Here.
The prelude defines
subtract
, so you don't needflip
here:Another relatively common workaround is to use a rightsection that adds a negative number, i.e.
Thanks for your insight. I didn't know about subtract and when the second solution is kind of obscure to me it seems very cool and short.
Since

is both subtraction and unary minus one can’t use a rightsection like(1)
, but considering that subtracting is the same as adding a negative number the slightly obscure form makes sense. I’d still usesubtract
though.