Browse Source

clean up code

pull/1/head
wes 7 years ago
parent
commit
372ce4229e
  1. 12
      suffixes.hs

12
suffixes.hs

@ -17,11 +17,13 @@ data Trie = TBranch {
compress t@(TBranch root []) = t compress t@(TBranch root []) = t
compress (TBranch root children) compress (TBranch root (child:[])) =
| length children == 1 = let compressed = compress child
let compressed = (compress $ head children) in TBranch
in TBranch (root++(getRoot compressed)) (getChildren compressed) (root++(getRoot compressed))
| otherwise = TBranch root (map compress children) (getChildren compressed)
compress (TBranch root children) = TBranch root (map compress children)
notEmpty [] = False notEmpty [] = False
notEmpty _ = True notEmpty _ = True

Loading…
Cancel
Save