Fork me on GitHub
Daniel Tan08:06:25

do sequences also happen to be monads?


No. What makes you think that?

Colin (fosskers)09:06:03

Check out Transducers if you're interested in generalised iteration over many different source/container types

Daniel Tan09:06:34

@U04V4KLKC from what i understand seq are functors which also fulfill the monadic laws via map and mapcat

👍 2

Sequences can be monads if you say they denote finite lists. The same goes for any other list-like type such as vectors, arrays, lists. You can check that you can define unit and join and verify the monad laws ( The list monad is what academics would say is useful for modelling non-determinism. Software engineers would probably think of it as “list comprehension” instead. for in Clojure is for example an implementation of syntactic sugar for monadic bind for the list monad. Whether this is useful knowledge, I couldn’t say.

👍 4

Sequences are not monads in and of themselves, but can be used "monadicly" with some discipline. But this doesn't really make much sense in the context of Clojure. Monads seem to me to be an attempt to classify the work that's being done by your program to make it easier to enforce restrictions on that work statically. Clojure focuses on making it as easy as possible to run your code at the REPL. This is kind of at odds with the idea static enforcement.


They are monad values, but clojure has no monad functions for composing them.


I was wondering if there's any progress I might've missed wrt varargs? like

Alex Miller (Clojure team)12:06:37

It’s in scope for 1.12 but we haven’t worked on it much yet


I hope it makes it to 1.12! It'd be a huge QOL improvement for interop with certain libraries that use a lot of varargs ❤️


Hello all, I saw today this nvd -> ageneau.utils-0.1.1.jar - CVE-2023-2972, but CVE-2023-2972 is related to npm package antfu/utils. Is it a false positive?



👍 2