|
definition: |
update' :: String -> (Maybe a -> a) -> InternalTrie a -> (Bool, InternalTrie a)
update' [] f (InternalTrie old ts) = (isNothing old, InternalTrie (Just $ f old) ts)
update' (c:cs) f (InternalTrie v' ts) = case Prelude.lookup c ts of
Nothing -> let t' = singleton' cs (f Nothing)
in (True, InternalTrie v' ((c, t') : ts))
Just t -> let (incr, t') = update' cs f t
in (incr, InternalTrie v' ((c, t') : (filter (\(c', _) -> c' /= c) ts)))
|
|
demand: |
arguments 1 3 |
|
deterministic: |
deterministic operation |
|
documentation: |
Updates or inserts a value in the internal trie and returns whether the size has increased. |
|
failfree: |
(_, _, _) |
|
indeterministic: |
referentially transparent operation |
|
infix: |
no fixity defined |
|
iotype: |
{({[]},_,{InternalTrie}) |-> {(,)} || ({:},_,{InternalTrie}) |-> {(,)}}
|
|
name: |
update' |
|
precedence: |
no precedence defined |
|
result-values: |
{(,)}
|
|
signature: |
String -> (Prelude.Maybe a -> a) -> InternalTrie a -> (Prelude.Bool, InternalTrie a) |
|
solution-complete: |
operation might suspend on free variables |
|
terminating: |
possibly non-terminating |
|
totally-defined: |
possibly non-reducible on same data term |