Explorar el Código

Improve function but duplicates

DricomDragon hace 5 años
padre
commit
dfed770022
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  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