{"size": 1023, "ext": "scrbl", "max_stars_repo_path": "kw-utils/docs/kw-map.scrbl", "max_stars_repo_name": "AlexKnauth/kw-utils", "max_stars_repo_stars_event_min_datetime": "2015-12-07T01:34:35.000Z", "max_stars_repo_stars_event_max_datetime": "2021-09-09T23:57:57.000Z", "max_issues_repo_path": "kw-utils/docs/kw-map.scrbl", "max_issues_repo_name": "AlexKnauth/kw-utils", "max_issues_repo_issues_event_min_datetime": "2016-01-26T22:27:53.000Z", "max_issues_repo_issues_event_max_datetime": "2017-11-26T17:45:58.000Z", "max_forks_repo_path": "kw-utils/docs/kw-map.scrbl", "max_forks_repo_name": "AlexKnauth/kw-utils", "max_forks_repo_forks_event_min_datetime": "2016-01-26T21:28:35.000Z", "max_forks_repo_forks_event_max_datetime": "2016-09-02T17:08:40.000Z"}
{"max_stars_count": 4, "max_issues_count": 4, "max_forks_count": 2, "avg_line_length": 30.0882352941, "max_line_length": 80, "alphanum_fraction": 0.5562072336}
#lang scribble/manual

@(require scribble/eval
          (for-label kw-utils/kw-map
                     racket/math))

@(module original-ids racket/base
   (require scribble/manual
            (for-label racket/base))
   (provide (all-defined-out))
   (define rkt:map @racket[map]))
@(require 'original-ids)

@title[#:tag "kw-map.scrbl"]{map with keyword arguments}

@defmodule[kw-utils/kw-map]

@defproc[(map [proc procedure?] [lst list?] ... [#:<kw> lst2 list?] ...) list?]{
like @rkt:map from @racketmodname[racket/base], but accepts keyword arguments as
well as positional arguments.

@examples[
  (require kw-utils/kw-map racket/math)
  (map (λ (x) (+ x 1)) '(1 2 3 4))
  (map (λ (#:x x) (+ x 1)) #:x '(1 2 3 4))
  (map (λ (x y) (+ x y)) '(1 2 3 4) '(10 100 1000 10000))
  (map (λ (x #:y y) (+ x y)) '(1 2 3 4) #:y '(10 100 1000 10000))
  (define (KE #:m m #:v v)
    (* 1/2 m (sqr v)))
  (map KE #:m '(2 2 2 2) #:v '(0 1 2 3))
  (map KE #:m '(0 1 2 3) #:v '(0 1 2 3))
  (map KE #:m '(1 2 1/2 2/9) #:v '(0 1 2 3))
]}
