Tuesday, September 24, 2013

My First Nontrivial Haskell Program

:{
let perm x = _perm x []
    _perm [] [] = [[]]
    _perm [] ys = []
    _perm (x:xs) ys = map (\t -> x:t) (_perm (xs++ys) []) ++ _perm xs (x:ys)
:}

No comments:

Post a Comment