Fork me on GitHub
#clojure-uk
<
2020-09-20
>
mccraigmccraig15:09:50

well that was fun... had some hours alone, wrote a sketch of a monad lib which fixes the principal difficulties i've been having with funcool/cats (principally around lifting and cats' use of dynvars)

promesante23:09:57

do you plan to share it?

mccraigmccraig07:09:16

still very much a work-in-progress though

mccraigmccraig07:09:51

no comments and all in one repl-driven ns 😬

mccraigmccraig07:09:56

but it lets me define some more complex monad types like promise-of-reader-and-writer, and can auto-lift from other types - which is roughly where i wanted to get to

mccraigmccraig07:09:46

the background being that i've got a load of code structured with a promise monad, but i would like to introduce a reader and a writer

mccraigmccraig07:09:24

the reader so i can pass around a log-context-value for easier tracing of production log messages, and also to pass around the system map

mccraigmccraig07:09:49

the writer so i can introduce some improved tracing of async code for debugging

mccraigmccraig07:09:28

and i wanted it to auto-lift so that i could incrementally add the new monads in to the old system, witthout being forced to refactor the whole thing in one hit

alexlynham08:09:04

isn't the system map a pretty large context to carry around on every call?

mccraigmccraig08:09:09

it's just a reference

mccraigmccraig08:09:34

and we currently have to pass it around everywhere it might be needed as an explicit parameter anyway

alexlynham09:09:59

okay yeah that makes sense

alexlynham09:09:58

the debug-ctx stuff in liberator was super useful for that in the context of v complex http routing so can imagine having that extra info would make debugging all the wild promise stuff easier