Partition an integer x into n primes: Difference between revisions

m
(Added Rust Solution)
Line 754:
 
=={{header|Haskell}}==
<lang haskell>import Data.BoolList (booldelete, intercalate)
import Data.Numbers.Primes (primes)
import Data.ListBool (delete, intercalatebool)
 
-------------------- PRIME PARTITIONS ---------------------
Line 785:
[ justifyLeft 9 ' ' (show (x, n))
, let xs = partitions x n
in bool (intercalate "+" (show <$> xs)) "(no solution)" (null xs)
(tail $ concatMap (('+' :) . show) xs)
"(no solution)"
(null xs)
]) <$>
concat
9,655

edits