next node: DArrayFold,
prev node: DArrayMap,
up to node: Subsystem Dynamic Arrays


DArrayFilter

Signature of DArrayFilter

List of Import References :
See Array
See BOOL
See Bitset
See DArray
See DENOTATION
See Nat
See Option

SIGNATURE DArrayFilter[data]

$Date: 2010-09-30 18:24:17 +0200 (Do, 30. Sep 2010) $ ($Revision: 616 $)

--

-- Parameter
SORT data

IMPORT DArray[data] ONLY dArray

--  %@code{P | [e0,e1,...,en] == [e_i0, e_i1, ..., e_in] with P(e_ij)}
FUN | : (data -> bool) ** dArray -> dArray

--  %informally:@code{partition(P, M) = (P |M, ~P |M)}
FUN partition : (data -> bool) ** dArray -> dArray ** dArray

take (p, s1) = s2: take all components of s1 (from left to right) fulfilling predicate p just upto the first component, which does not fulfill p.

FUN take        : (data -> bool) ** dArray -> dArray

drop (p, s1) = s2: drop all components of s1 (from left to right) fulfilling predicate p just upto the first component, which does not fulfill p.

FUN drop        : (data -> bool) ** dArray -> dArray    
                

split (p, s) = (take (p,s), drop (p, s)): split s before the first component (operating from left to right) which does not fulfill predicate p.

FUN split       : (data -> bool) ** dArray -> dArray ** dArray


next node: DArrayFold,
prev node: DArrayMap,
up to node: Subsystem Dynamic Arrays