Numbers with prime digits whose sum is 13: Difference between revisions

m
(→‎{{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 (sort, unfoldrchunksOf)
import Data.List.Split (chunksOfunfoldr)
 
primeDigitsNumsSummingTo13 :: [Int]
primeDigitsNumsSummingTo13 = sort $ concat $ unfoldr go (return <$> primeDigits)
where
primeDigits = [2, 3, 5, 7]
Line 199:
| 12 > snd nv ]
in ((,) . concatMap f <*> concatMap g)
(((,) <*> sum) <$> ((<$> xs) . flip (<>) . return =<< primeDigits))
 
unDigits :: [Int] -> Int
9,655

edits