aboutsummaryrefslogtreecommitdiff
path: root/data/functor.scm
blob: 2286337175ee0741e8efcb58873f1f284c1a0590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
(define-module (data functor)
  #:use-module (oop goops)
  #:use-module (srfi srfi-1)
  #:export (fmap <$>))

;;; We don't overwrite the default map since that creates way to many
;;; namespace problems.

(define-generic fmap)
(define <$> fmap)

;;; Default fallback for fmap is regular (srfi-1) map.
(define-method (fmap f . lists)
  (apply map f lists))