You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(macroexpand '(alet [a (just1)
b (just41)]
(+ a b)))
;; =>
(fapply
(fmap
(fn [a]
(fn [b]
(do (+ a b))))
(just1))
(just41))
;; the documentation suggests it returns:
(fapply (fn [a]
(fn [b]
(do
(+ a b))))
(just1)
(just41))
The asynchronous code raises an exception:
(defnsleep-promise"A simple function that emulates an asynchronous operation."
[wait]
(p/promise (fn [resolve reject]
(future
(Thread/sleep wait)
(resolve wait)))))
(time
@(mlet [x (sleep-promise42)
y (sleep-promise41)]
(return (+ x y))))
;; Execution error (ClassCastException) at user/eval34213$fn$fn (user.clj:4).;; class user$sleep_promise$fn__34206 cannot be cast to class java.lang.Number (user$sleep_promise$fn__34206 is in unnamed module of loader clojure.lang.DynamicClassLoader @571ca823; java.lang.Number is in module java.base of loader 'bootstrap')
Anyway thanks for the work already done on this library!
The text was updated successfully, but these errors were encountered:
Versions used:
[org.clojure/clojure "1.10.1"]
[funcool/cats "2.3.6"]
[funcool/promesa "5.1.0"]
ns form:
When evaluating the examples provided in https://funcool.github.io/cats/latest/#alet, some results don't match what is shown in the doc:
The asynchronous code raises an exception:
Anyway thanks for the work already done on this library!
The text was updated successfully, but these errors were encountered: