diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-14 20:08:58 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2019-03-14 20:08:58 +0100 |
commit | a4a7edd487d4d2207829462d06c40578dc757337 (patch) | |
tree | 0c65527665b628b64a09d1ea001727e9a64d7da2 /data/functor.scm | |
parent | Remove empty file state-monad.scm. (diff) | |
download | scheme-monad-a4a7edd487d4d2207829462d06c40578dc757337.tar.gz scheme-monad-a4a7edd487d4d2207829462d06c40578dc757337.tar.xz |
Generilified return, monads now truly functors.
Diffstat (limited to 'data/functor.scm')
-rw-r--r-- | data/functor.scm | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/data/functor.scm b/data/functor.scm deleted file mode 100644 index 4e4722f..0000000 --- a/data/functor.scm +++ /dev/null @@ -1,19 +0,0 @@ -(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)) |