(define-module (data functor) #:use-module (oop goops) #:use-module (srfi srfi-1) #:use-module (ice-9 curried-definitions) #:export (fmap <$> cmap)) ;;; 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)) ;; Curried map (define ((cmap f) item) (fmap f item))