Browse Source

Improve function but duplicates

DricomDragon 5 years ago
parent
commit
dfed770022
1 changed files with 2 additions and 2 deletions
  1. 2 2
      anagram.hs

+ 2 - 2
anagram.hs

@@ -2,8 +2,8 @@ import Data.List
 
 sweep::(String -> [String]) -> String -> String -> [String]
 sweep f l stack = case stack of
-	[] -> []
+	[] -> [l]
 	cur:substack -> concat [map (\l -> cur:l) (f (delete cur l)), sweep f l substack]
 
 ana::String -> [String]
-ana l = sweep ana l l
+ana l = sweep (ana) l l