Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Mark Engelberg
Documentation for latest features in the 2.0.1 branch: https://github.com/Engelberg/better-cond/tree/v2.0.1 An example: (cond (odd? a) 1 :let [a (quot a 2)] :when-let [x (fn-which-may-return-nil a), y (fn-which-may-return-nil (* 2 a))] :when (seq x) :do (println x)

[ANN] Clojure 1.10.0-alpha9

2018-10-04 Thread Alex Miller
1.10.0-alpha9 is now available. You can try it with clj using: clj -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.0-alpha9"}}}' 1.10.0-alpha9 includes the following changes since 1.10.0-alpha8: - CLJ-2374 - Add type hint to

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Alan Thompson
How would the :when and :do forms work? Alan On Wed, Oct 3, 2018 at 7:22 PM Mark Engelberg wrote: > This looks like a case of "convergent evolution". > > Having the ability to do a :let in the middle of a cond feels like one of > those things that *should* be in the core language, so if it's

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Howard Lewis Ship
Yes, I wouldn't have bothered if I had known about better-cond, so there you go. I think I first wrote this code at Aviso at least five years ago. On Wed, Oct 3, 2018 at 7:22 PM Mark Engelberg wrote: > This looks like a case of "convergent evolution". > > Having the ability to do a :let in the

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Gary Trakhman
The short-circuiting is a 'feature' of letting the type control the sequencing of operations. In practice you mix multiple interacting monads depending on what your requirements are, for example I regularly work with Deferred Options and Deferred Results. In clojure, you could try to add a

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread lei Shulang
But a Maybe/Nothing will short-circuit the whole flow where cond-let won't? On Thursday, 4 October 2018 08:38:05 UTC-7, Moe Aboulkheir wrote: > > See https://funcool.github.io/cats/latest/#mlet for something closer to > home, in the monadic vein. > > > On Thu, Oct 4, 2018 at 4:10 PM Gary

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Moe Aboulkheir
See https://funcool.github.io/cats/latest/#mlet for something closer to home, in the monadic vein. On Thu, Oct 4, 2018 at 4:10 PM Gary Trakhman wrote: > These are all just sugar over monadic bind, right? > > Here's one way to do it in the ocaml alternate universe: >

Re: [ANN] com.walmartlabs/cond-let 1.0.0

2018-10-04 Thread Gary Trakhman
These are all just sugar over monadic bind, right? Here's one way to do it in the ocaml alternate universe: https://github.com/janestreet/ppx_let#syntactic-forms-and-actual-rewriting But it can be made to work for async or options or whatever, too. We can put the async helpers in the same

[ANN] Polylith: A software architecture based on Lego-like blocks

2018-10-04 Thread Joakim Tengstrand
Polylith is an architecture that has been inspired by the simplicity and composability of functions. We asked ourselves the question "what would a system look like if we could build it with high-level blocks that share the properties of functions?". It turned out that the answer looks a lot