Numbers with prime digits whose sum is 13: Difference between revisions
Numbers with prime digits whose sum is 13 (view source)
Revision as of 19:00, 21 October 2020
, 3 years ago→{{header|Haskell}}
(→{{header|Haskell}}: concatMap rather than (>) |
|||
Line 181:
=={{header|Haskell}}==
As an unfold, in the recursive pattern described by Nigel Galloway on the Talk page.
<lang haskell>import Data.List.Split (
import Data.List
primeDigitsNumsSummingTo13 :: [Int]
primeDigitsNumsSummingTo13 =
where
primeDigits = [2, 3, 5, 7]
Line 199:
| 12 > snd nv ]
in ((,) . concatMap f <*> concatMap g)
(((,) <*> sum) <$> ((<$> xs) .
unDigits :: [Int] -> Int
|