Fork me on GitHub
#ldnclj
<
2015-11-13
>
Pablo Fernandez11:11:30

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

thomas11:11:58

yes I can read it

Pablo Fernandez11:11:13

thomas: mind me asking screen size?

thomas11:11:24

and I can read the browser stuff as well

benedek14:11:43

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 maps and mapcats 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

benedek14:11:18

any ideas/advice how to compose map transducers if that makes sense?

minimal14:11:16

are you calling into, sequence or transduce?

benedek14:11:19

nope. so I should use something like (into [] (comp … myinput))?

minimal14:11:45

there’s a little comparison between thread last and transducers

martintrojer14:11:18

@benedek: interested to know you want to refactor like this

martintrojer14:11:30

it hardly makes the code more readable

benedek14:11:04

@martintrojer: i did not say it makes sense i am just playing around with something 😉

minimal14:11:35

it can be uglier if you don’t have a performance reason for doing it

benedek14:11:51

which i might be having 😉

martintrojer14:11:08

Yeah, transducers is clever and all, I’m just left with the big question; why?

minimal14:11:22

it starts looking nicer when you know it’s making a slow thing fast

martintrojer14:11:43

well, writing web apps. clojure threading macros is never the bottleneck

benedek14:11:51

i basically have a big pipe of transformations on a relatively big/complex data structure. i am looking into ways of making it faster

minimal14:11:59

but yeah i don’t know if i’ve actually needed the perf

minimal14:11:46

Def can make sense if you have lots of steps

minimal14:11:46

things like spark do lots of fusion between mapping functions

benedek14:11:50

initially i thought of transient but quickly realised it is not an easy answer...

benedek14:11:05

for complex stuff with loads of lazyseqs

martintrojer14:11:59

maybe I find a use for transducers if I look hard enough. But then again, I have a job to do aswell.

minimal14:11:36

I think if i needed the performance i’d already be using something like spark anyway

benedek14:11:07

fair enough. thanks for the comments guys

minimal14:11:15

where big pipelines of transformations are common

martintrojer14:11:22

Its a art project to confuse haskell-ers right?

martintrojer14:11:30

I mean, that was its true purpose

minimal15:11:26

In the end it wasn’t so confusing for them

minimal15:11:02

was quite entertaining tho