File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog #
2
2
3
+ ## Version 2.3.4
4
+
5
+ Date: 2020-02-11
6
+
7
+ - gets can receive monad context as argument
8
+
3
9
## Version 2.3.3
4
10
5
11
Date: 2019-10-02
Original file line number Diff line number Diff line change 1
- (defproject funcool /cats " 2.3.3 "
1
+ (defproject funcool /cats " 2.3.4 "
2
2
:description " Category Theory abstractions for Clojure"
3
3
:url " https://github.com/funcool/cats"
4
4
:license {:name " BSD (2 Clause)"
Original file line number Diff line number Diff line change 167
167
(defn gets
168
168
" State monad that returns the result of applying
169
169
a function to a state"
170
- [projfn]
171
- (m/mlet [s (get )]
172
- (m/return (projfn s))))
170
+ ([projfn context]
171
+ (m/mlet [s (get context)]
172
+ (m/return (projfn s))))
173
+ ([projfn]
174
+ (gets projfn (get-context ))))
173
175
174
176
(defn wrap-fn
175
177
" Wraps a (possibly side-effecting) function to a state monad"
You can’t perform that action at this time.
0 commit comments