Fit works as expected, sort needs work

This commit is contained in:
pingu 2024-12-09 11:02:42 +01:00
parent 2e810eb03b
commit 397a741931

View File

@ -34,7 +34,7 @@ fit :: [[]] -> [] -> []
fit s t = let (p,a) = break (elem None) s
(n,a') = span (elem None) a in
if null n then concat s ++ t else
concat p ++ if length n >= length t then t ++ concat a' ++ replicate (length n) None else fit a' t
concat p ++ if length (head n) >= length t then t ++ replicate (length n) None ++ concat a' else concat n ++ fit a' t
sort2 :: [] -> []
sort2 s = let c = chunks s -- TODO: needs more work here