PasteRack.org
Paste # 88150
2015-03-04 03:03:55

Fork as a new paste.

Paste viewed 1116 times.


Embed:

  1. #lang racket
  2.  
  3. (define (curry-all fs arg)
  4.   (map (λ (f) (curry f arg)) fs))
  5.  
  6. (define (fa n x y)
  7.   (+ n x y))
  8.  
  9. (define (fb n x)
  10.   (+ n x))
  11.  
  12. (define fs (list fa fb))
  13.  
  14. (match-define (list a b) (curry-all fs 10))
  15.  
  16. (a 1 1)
  17. (b 10)

=>

12

20