ldnclj

Find us on #clojure-uk
thomas 2015-11-13T08:50:35.000042Z

morning

mccraigmccraig 2015-11-13T11:21:28.000043Z

yesterday

pupeno 2015-11-13T11:22:29.000044Z

Hello.

pupeno 2015-11-13T11:24:30.000045Z

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

👍 1
thomas 2015-11-13T11:34:58.000047Z

yes I can read it

pupeno 2015-11-13T11:35:13.000048Z

thomas: mind me asking screen size?

thomas 2015-11-13T11:35:57.000049Z

1280x1024

thomas 2015-11-13T11:36:24.000050Z

and I can read the browser stuff as well

pupeno 2015-11-13T11:39:38.000051Z

Great. Thanks.

benedek 2015-11-13T14:05:43.000052Z

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

benedek 2015-11-13T14:06:18.000053Z

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

minimal 2015-11-13T14:22:16.000054Z

are you calling into, sequence or transduce?

benedek 2015-11-13T14:43:19.000055Z

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

minimal 2015-11-13T14:45:38.000057Z

yeah

minimal 2015-11-13T14:46:45.000059Z

there’s a little comparison between thread last and transducers

martintrojer 2015-11-13T14:48:18.000060Z

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

martintrojer 2015-11-13T14:48:30.000061Z

it hardly makes the code more readable

benedek 2015-11-13T14:49:04.000062Z

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

minimal 2015-11-13T14:49:35.000063Z

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

benedek 2015-11-13T14:49:51.000064Z

which i might be having 😉

martintrojer 2015-11-13T14:50:08.000065Z

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

minimal 2015-11-13T14:50:22.000066Z

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

martintrojer 2015-11-13T14:50:43.000068Z

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

benedek 2015-11-13T14:50:51.000070Z

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

minimal 2015-11-13T14:50:59.000071Z

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

minimal 2015-11-13T14:51:46.000072Z

Def can make sense if you have lots of steps

minimal 2015-11-13T14:52:46.000073Z

things like spark do lots of fusion between mapping functions

benedek 2015-11-13T14:52:50.000074Z

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

benedek 2015-11-13T14:53:05.000075Z

for complex stuff with loads of lazyseqs

martintrojer 2015-11-13T14:53:59.000077Z

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

minimal 2015-11-13T14:54:36.000079Z

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

benedek 2015-11-13T14:55:07.000080Z

fair enough. thanks for the comments guys

minimal 2015-11-13T14:55:15.000081Z

where big pipelines of transformations are common

martintrojer 2015-11-13T14:58:22.000082Z

Its a art project to confuse haskell-ers right?

martintrojer 2015-11-13T14:58:30.000083Z

I mean, that was its true purpose

minimal 2015-11-13T15:00:26.000084Z

In the end it wasn’t so confusing for them

minimal 2015-11-13T15:01:02.000085Z

was quite entertaining tho