Validate International Securities Identification Number: Difference between revisions
Content added Content deleted
(→{{header|Haskell}}: added missing test case to 1st version (+ minor linting)) |
m (→{{header|Haskell}}: used quotRem in lieu of divMod) |
||
Line 938: | Line 938: | ||
(`mod` 10) . |
(`mod` 10) . |
||
sum . |
sum . |
||
fmap (uncurry (+) . (` |
fmap (uncurry (+) . (`quotRem` 10)) . |
||
zipWith id (cycle [id, (2 *)]) . stringInts . reverse |
zipWith id (cycle [id, (2 *)]) . stringInts . reverse |
||
Line 947: | Line 947: | ||
capitals, digits :: String |
capitals, digits :: String |
||
capitals = ['A' .. 'Z'] |
capitals = ['A' .. 'Z'] |
||
digits = ['0' .. '9'] |
digits = ['0' .. '9'] |
||