morning
yesterday
Hello.
I want to make some screencasts showing code and I want to make sure it’s readable. Can you take a quick look at this and tell me whether it works for you: https://carouselapps.wistia.com/medias/p91hhnt9xw
yes I can read it
thomas: mind me asking screen size?
1280x1024
and I can read the browser stuff as well
Great. Thanks.
oi gals/guys. I want to refactor a piece of code doing quite a few transformations on a collection. what i have is basically a thread last threading macro with map
s and mapcat
s
I’d like to refactor this to use transducers and thought it should be kinda simple. like use comp instead of the threading macro and don’t pass in the initial input (as map, mapcat should return a transducer when called with one param) and the call the resulting function on my input. does not work tho
any ideas/advice how to compose map
transducers if that makes sense?
are you calling into, sequence or transduce?
nope. so I should use something like (into [] (comp … myinput))
?
yeah
there’s a little comparison between thread last and transducers
@benedek: interested to know you want to refactor like this
it hardly makes the code more readable
@martintrojer: i did not say it makes sense i am just playing around with something 😉
it can be uglier if you don’t have a performance reason for doing it
which i might be having 😉
Yeah, transducers is clever and all, I’m just left with the big question; why?
it starts looking nicer when you know it’s making a slow thing fast
well, writing web apps. clojure threading macros is never the bottleneck
i basically have a big pipe of transformations on a relatively big/complex data structure. i am looking into ways of making it faster
but yeah i don’t know if i’ve actually needed the perf
Def can make sense if you have lots of steps
things like spark do lots of fusion between mapping functions
initially i thought of transient but quickly realised it is not an easy answer...
for complex stuff with loads of lazyseqs
maybe I find a use for transducers if I look hard enough. But then again, I have a job to do aswell.
I think if i needed the performance i’d already be using something like spark anyway
fair enough. thanks for the comments guys
where big pipelines of transformations are common
Its a art project to confuse haskell-ers right?
I mean, that was its true purpose
In the end it wasn’t so confusing for them
was quite entertaining tho