clojure-uk

A place for people in the UK, near the UK, visiting the UK, planning to visit the UK or just vaguely interested to randomly chat about things (often vi and emacs, occasionally clojure). More general the #ldnclj
mccraigmccraig 2020-09-20T15:47:50.014200Z

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)

mccraigmccraig 2020-09-21T07:30:16.015900Z

still very much a work-in-progress though

mccraigmccraig 2020-09-21T07:30:51.016100Z

no comments and all in one repl-driven ns 😬

mccraigmccraig 2020-09-21T07:32:56.016300Z

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

mccraigmccraig 2020-09-21T07:36:46.016800Z

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

mccraigmccraig 2020-09-21T07:37:24.017Z

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

mccraigmccraig 2020-09-21T07:37:49.017200Z

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

mccraigmccraig 2020-09-21T07:38:28.017400Z

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

alexlynham 2020-09-21T08:18:04.017700Z

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

mccraigmccraig 2020-09-21T08:24:09.017900Z

it's just a reference

mccraigmccraig 2020-09-21T08:27:34.018100Z

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

alexlynham 2020-09-21T09:46:53.018300Z

ahh gotcha

alexlynham 2020-09-21T09:46:59.018500Z

okay yeah that makes sense

alexlynham 2020-09-21T09:47:58.018700Z

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

promesante 2020-09-20T23:38:57.014300Z

do you plan to share it?