definition:
|
withOthers :: Data a => [a] -> [a] -> [a]
withOthers ys zs = withAcc [] ys zs
where -- Accumulate remaining elements:
withAcc prevs [] others | others=:=prevs++suffix = suffix
where suffix free
withAcc prevs (x:xs) others =
prefix ++ x : withAcc (prevs++prefix) xs others
where prefix free
|
demand:
|
argument 2
|
deterministic:
|
possibly non-deterministic operation
|
documentation:
|
--- The operation `withOthers` is similar to 'with' but has a second argument
--- that contains the child nodes that are present but not part of the
--- first argument. One can use this operation to denote the
--- `unmatched` part of an XML structure in order to put conditions on it.
--- For instance, if one wants to get the name and phone number of an entry
--- that has no email address, one can use the following definition:
---
--- getNamePhoneWithoutEmail
--- (deepXml "entry"
--- (withOthers [xml "name" [xtxt name], xml "phone" [xtxt phone]]
--- others))
--- | "email" `noTagOf` others
--- = name ++ ": " ++ phone
|
failfree:
|
<FAILING>
|
indeterministic:
|
referentially transparent operation
|
infix:
|
no fixity defined
|
iotype:
|
{(_,_,_) |-> _}
|
name:
|
withOthers
|
precedence:
|
no precedence defined
|
result-values:
|
_
|
signature:
|
Prelude.Data a => [a] -> [a] -> [a]
|
solution-complete:
|
operation might suspend on free variables
|
terminating:
|
possibly non-terminating
|
totally-defined:
|
possibly non-reducible on same data term
|