fork download
  1. bubblesort xs
  2. | xs == xs' = xs'
  3. | otherwise = bubblesort xs'
  4. where
  5. xs' = bubblesortIterate xs
  6. bubblesortIterate lst@(x:xs)
  7. | nil . xs = xs
  8. | x <= head xs = x:bubblesortIterate xs
  9. | otherwise = bubblesortSwap lst
  10. bubblesortSwap (x:y:xs) = y:x:xs
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
[1 of 1] Compiling Main             ( prog.hs, prog.o )

prog.hs:7:5: Not in scope: `nil'
stdout
Standard output is empty