diff options
author | Hugo Hörnquist <hugo@hornquist.se> | 2018-11-10 23:57:53 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@hornquist.se> | 2018-11-10 23:57:53 +0100 |
commit | d86d88b96cd7aba976ab58b909fd4eae48323bb0 (patch) | |
tree | 0c7f93144cbe8c93a5a7c838165bd0e8a0cf24b0 /data/optional.scm | |
parent | Add README. (diff) | |
download | scheme-monad-d86d88b96cd7aba976ab58b909fd4eae48323bb0.tar.gz scheme-monad-d86d88b96cd7aba976ab58b909fd4eae48323bb0.tar.xz |
Add >>, fix do to use it.
Diffstat (limited to 'data/optional.scm')
-rw-r--r-- | data/optional.scm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/data/optional.scm b/data/optional.scm index e71c10d..b008471 100644 --- a/data/optional.scm +++ b/data/optional.scm @@ -40,3 +40,10 @@ ((just? this) (match this (($ <optional> slot) (proc slot)))))) + +(define-method (>> (a <optional>) + (b <optional>)) + (if (or (nothing? a) + (nothing? b)) + (nothing) + b)) |