commit 96331db074f3c11b64bd370965d6cff4d2dbbdf3 parent e05f4a4ee3e95c870ccf56b3fd925ffa52fb9705 Author: Andreas Olsson <photoguy.apo@gmail.com> Date: Tue, 3 Jan 2017 23:34:56 +0100 Add files via upload Diffstat:
| M | pmap.scrbl | | | 19 | +++++++++++++++++-- |
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/pmap.scrbl b/pmap.scrbl @@ -1,4 +1,6 @@ #lang scribble/manual + + @require[@for-label[pmap racket/base racket/future]] @@ -8,6 +10,18 @@ @defmodule[pmap] -"pmap" is a map function using futures to apply a function to all items in a list i parallel. +@section{General behavior} + +pmap works as map but applies the function to every item in the list/lists in parallel using futures. +It's restrictions is the same as for futures and map in general in Racket. + +@section{Use} +@racketblock[ + (pmap function list/lists) + + >(map + '(1 2 3) '(1 2 3)) + >'(2 4 6) + ] -It's restrictions is the same as for futures in general in Racket. +If the function applied is to simple pmap might perform worse than map because of the +overhead a future generates. +\ No newline at end of file