ascendings str = let dividens = [ n : ns | i <- [ 1.. length str - 1 ], let n = toInt $ take i str, ns <- ascendings $ drop i str, n < ( head $ ns ) ] toInt x = read x :: Int in [ toInt str ] : dividens main = do print $ ascendings "20210401"
Standard input is empty
[[20210401],[2,210401],[2,21,401],[2,210,401],[20,210401],[20,21,401],[20,210,401],[202,10401]]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!