fork download
  1.  
  2.  
  3. bubblesort xs
  4. | xs == xs' = xs'
  5. | otherwise = bubblesort xs'
  6. where
  7. xs' = bubblesortIterate xs
  8. bubblesortIterate lst@(x:xs)
  9. | nil xs = xs
  10. | x <= head xs = x:bubblesortIterate xs
  11. | otherwise = bubblesortSwap lst
  12. 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:9:5: Not in scope: `nil'
stdout
Standard output is empty