CurryInfo: string-trie-0.0.2 / Data.Trie.Internal.delete'

definition: Info
 
delete' :: String -> InternalTrie a -> Maybe (InternalTrie a)
delete' k (InternalTrie v ts) = do
  res <- case k of
    []     -> v *> Just (InternalTrie Nothing ts)
    (c:cs) -> do 
      t  <- Prelude.lookup c ts
      t' <- delete' cs t
      let e  = (c, t') 
          es = filter ((/= c) . fst) ts
      return $ InternalTrie v (if null' t then es else e : es)
  return $ sanitize res
 where
  sanitize :: InternalTrie a -> InternalTrie a
  sanitize (InternalTrie v' ts') =
    InternalTrie v' (filter (not . null' . snd) ts')
demand: Info
 arguments 1 2
deterministic: Info
 deterministic operation
documentation: Info
 
Tries to delete a key from the internal trie. If the key is not in the trie,
`Nothing` is returned. This feedback is used to determine whether the size of the trie
has changed.
failfree: Info
 (_, _)
indeterministic: Info
 referentially transparent operation
infix: Info
 no fixity defined
iotype: Info
 {(_,{InternalTrie}) |-> _}
name: Info
 delete'
precedence: Info
 no precedence defined
result-values: Info
 _
signature: Info
 String -> InternalTrie a -> Prelude.Maybe (InternalTrie a)
solution-complete: Info
 operation might suspend on free variables
terminating: Info
 possibly non-terminating
totally-defined: Info
 possibly non-reducible on same data term