fork download
  1. ascendings str = let
  2. dividens = [ n : ns |
  3. i <- [ 1.. length str - 1 ],
  4. let n = toInt $ take i str,
  5. ns <- ascendings $ drop i str,
  6. n < ( head $ ns ) ]
  7. toInt x = read x :: Int
  8. in [ toInt str ] : dividens
  9.  
  10. main = do
  11. print $ ascendings "20210401"
Success #stdin #stdout 0s 4804KB
stdin
Standard input is empty
stdout
[[20210401],[2,210401],[2,21,401],[2,210,401],[20,210401],[20,21,401],[20,210,401],[202,10401]]