zip

File zip.str
Author unknown
Since unknown

Zipping two lists into a list of pairs is a useful operationin many situations. There are many variants of zipping, forinstance in the way lists of unequal length are treated. Thismodule defines a collection of zip-like strategies for listsbased on one underlying control scheme.




Statistics


General
Lines of code 62
Stratego
Module number 1 (0% documented)
Constructor number 0
Overlay number 0
Strategy number 3 (0% documented)
Rule number 1 (0% documented)
DynamicRule number 0



Strategy summary


lzip(Strategy s) n/a zip.str
lzipFetch(Strategy s) n/a zip.str
nzip(Strategy s) n/a zip.str
nzip0(Strategy s) n/a zip.str
rest-zip(Strategy s) n/a zip.str
rzip(Strategy s) n/a zip.str
rzipFetch(Strategy s) n/a zip.str
unzip n/a zip.str
unzip(Strategy s) Splits a list of pairs into two separate lists, applying s to the pair before splitting zip.str
zip n/a zip.str
zip(Strategy s) Combines two lists into one by pairing up the elements from both lists, applying s to the pair zip.str
zip(Strategy s, ATerm ys) Combines two lists into one by pairing up the elements from both lists zip.str
zip'(Strategy s) n/a zip.str
zip-skip(Strategy pred, Strategy s) n/a zip.str
zip-tail n/a zip.str
zipFetch(Strategy s) n/a zip.str
zipl(Strategy s) n/a zip.str
zipl-tail-match(Strategy s) n/a zip.str
zipPad(Strategy s, Strategy padding) Combines two lists, which may have different lengths, into one by pairing up the elements from both lists, applying s to the pair zip.str
zipr(Strategy s) n/a zip.str
zipr-tail-match(Strategy s) n/a zip.str

Rule summary


cart(Strategy s) Create the cartesian product of two lists, i zip.str
join(Strategy s) Creates the cartesian product of two lists and select only those combined elements <s>(x, y) that succeed zip.str



Strategy details


ATerm nzip0(Strategy s)
File zip.str
Author unknown
Since unknown
 

No information available.



 
ATerm unzip(Strategy s)
File zip.str
Author unknown
Since unknown
 

Splits a list of pairs into two separate lists, applying s tothe pair before splitting. This strategyis the inverse of zip.

Example: <unzip((inc, inc))> [(1,2),(3,4)] => ([2,4],[3,5])


type List(a * b) -> List(a) * List(b)

 
ATerm zip(Strategy s)
File zip.str
Author unknown
Since unknown
 
Parameters
Strategy s s a * b -> c

Combines two lists into one by pairing up the elements from both lists,applying s to the pair. Starts at the beginning of the lists. Both listsmust be of equal length.

Example: <zip(add)> ([1,2], [3,4]) => [4,6]


type List(a) * List(b) -> List(c)

 
ATerm zip(Strategy s, ATerm ys)
File zip.str
Author unknown
Since unknown
 
Parameters
Strategy s Strategy s(|y : b) : a -> c
ATerm ys Second list : List(b)

Combines two lists into one by pairing up the elements from both lists.Both lists must be of equal length.


type List(a) -> List(c)

 
ATerm zipPad(Strategy s, Strategy padding)
File zip.str
Author unknown
Since unknown
 
Parameters
Strategy s s a * b -> c
Strategy padding padding _ -> d

Combines two lists, which may have different lengths, into one by pairingup the elements from both lists, applying s to the pair. Starts at the beginning of the lists. The shorter list will be padded with the resultthe padding strategy.

Example: <zipPad(id, !0)> ([1,2], [3,4,5]) => [(1,3),(2,4),(0,5)]


type List(a) * List(b) -> List(c)

 

Rule details


ATerm cart(Strategy s)
File zip.str
Author unknown
Since unknown
 
Parameters
Strategy s s a * b -> c

Create the cartesian product of two lists, i.e., combineeach element of the first list which each element from the secondlist. The strategy s is used to combine the pairs of elements<s>(x,y).

Example: <cart(id)> ([1,2],[5,6]) => [(1,5),(1,6),(2,5),(2,6)]


type List(a) * List(b) -> List(c)

 
ATerm join(Strategy s)
File zip.str
Author unknown
Since unknown
 
Parameters
Strategy s s a * b -> c

Creates the cartesian product of two lists and select onlythose combined elements <s>(x, y) that succeed.


type List(a) * List(b) -> List(c)