File: map2.doc

package info (click to toggle)
hol-light 20170109-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 36,568 kB
  • ctags: 8,549
  • sloc: ml: 540,018; cpp: 439; lisp: 286; java: 279; makefile: 262; sh: 229; yacc: 108; perl: 78; ansic: 57; sed: 39
file content (23 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\DOC map2

\TYPE {map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list}

\SYNOPSIS
Maps a binary function over two lists to create one new list.

\DESCRIBE
{map2 f ([x1;...;xn],[y1;...;yn])} returns {[f(x1,y1);...;f(xn,yn)]}.

\FAILURE
Fails with {map2} if the two lists are of different lengths.

\EXAMPLE
{
  # map2 (+) [1;2;3] [30;20;10];;   
  val it : int list = [31; 22; 13]
}

\SEEALSO
map, uncurry.

\ENDDOC