I\'m trying to do this from scratch, without the use of a library outside the standard lib. Heres my code:
permutations :: [a] -> [[a]] permutations (x:xs
Maybe you should use existing code:
import Data.List permutations [1,2,3,4]