Fork me on GitHub
#clojure-uk
<
2018-11-28
>
thomas08:11:39

I don't know what a monoid is.

dominicm08:11:20

A burrito with an astronaut in

thomas08:11:48

that I can understand and makes sense.

mccraigmccraig08:11:22

@danieleneal cljsrn question - what's your android-app cold-start time like ? i'm considering what the next step with our app is, and whether cljsrn (which would be a relatively straightforward evolution) would give us the <1s cold-start times that many apps on android seem to achieve

dominicm08:11:03

@mccraigmccraig we are evaluating cordova, any major complaints?

danielneal08:11:30

@mccraigmccraig hmm the android version of the app is actually not working at the moment 😬 I did something incompatible at some point and we've been focusing on launching the iOS version so I haven't had the time to dedicate to get the android version up and running again. From memory, cold start time didn't seem too bad but I don't think it was sub second , but then I do have a video that needs to load on the very first screen.

danielneal08:11:24

very happy with the re-frame/react-native development experience though

mccraigmccraig08:11:32

@dominicm it's ok - build is straightforward-ish, and it's easy enough to target ios+android+web - cold-start time is kinda slow and some things are niggly - scrolling is hard to deal with and css transitions can be a bit janky

mccraigmccraig08:11:42

if RN had been viable when i started yapster i would probably have gone with it - but it only had an ios target at the time - now it has ios,android,web and even windows targets

dominicm08:11:59

We are put off by having to manage an osx build server

mccraigmccraig08:11:24

you are always going to have to run osx for xcode to package an ios app aren't you ?

danielneal08:11:36

@dominicm if you use expo you can run a 'build' command which will build on their servers which is great for CI. And the projects only contain js, no iOS or Android so you don't need xcode/mac for development

dominicm08:11:32

@danieleneal every time we revisit an app we made with expo, it doesn't work anymore

danielneal08:11:35

I think microsoft has something too for building but I'm not sure

dominicm08:11:51

Oh really? That's interesting

mccraigmccraig08:11:15

that's pretty cool

agile_geek08:11:51

Bore da pawb welsh_flag

alexlynham09:11:55

morning morning

mattford09:11:37

hey hey, do people think this is a crime?

(defn vectorize [rf]
  (fn
    ([]            [(rf) (rf)])
    ([[x y]]       [(rf x) (rf y)])       
    ([[x y] [a b]] [(rf x a) (rf y b)])))

(transduce (comp (map (juxt inc dec)) vectorize) + [0 0] (range 5))
[15 5]
Vectorize modifies the types over which the reducing function works and the map juxt bit ensures the range is of the right type.

mattford09:11:45

I’m uncomfortable with modifying the type signatures….is vectorize really a transducer?

reborg10:11:06

@mattford to be a transducer the 0 and 1 arity should propagate correctly downstream (for potential other transducers to pick up). See here for more info https://labs.uswitch.com/transducers-from-the-ground-up-the-practice/#customtransducers

reborg10:11:46

Sorry scratch that, it seems to be doing that correctly.

reborg10:11:05

Don’t see problems with that, interesting idea

rickmoynihan14:11:44

@mattford: Not sure what you’re trying to do but it seems a bit weird, possibly complected to me. When you see + as the reducing function you expect it to be working on types of number, but the starting value is not a number [0 0]… Then there’s a dependency in the xform on vectorize knowing how to apply the rf, so there’s a lot of coupling here. I’d be tempted to move that stuff into the reducing function itself… and possibly extract a vectorizing reducing function builder that takes +… This said I don’t know what you’re trying to do / abstract etc… so take with a pinch of salt.

maleghast14:11:31

Morning Everyone 🙂

alexlynham14:11:38

@maleghast are you there for the conj?

seancorfield15:11:44

I'll be there in about 11 hours!

seancorfield16:11:20

Er, make that eight hours. I can't timezone. Well, seven now I guess. See you in the bar of the Marriott this evening @maleghast?

maleghast18:11:43

Hey @seancorfield - I am not staying at the Marriott, but I may pop by to see you 🙂

maleghast18:11:51

If not I'll zero in on you tomorrow a.m.

seancorfield18:11:05

Cool. I'm delayed in SFO -- equipment problems -- still hoping to get in early enough for 🍻

yogidevbear20:11:05

I'm not envious in the least 😉 Enjoy it!

maleghast15:11:35

@seancorfield - Looking forward to saying Hi!

mattford15:11:23

@rickmoynihan Hi. I was actually seeing if I could do the first example from the redux library in a transducer only fashion..https://github.com/henrygarner/redux

(transduce identity (facet + [dec inc]) (range 5))

;; => [5 15]

rickmoynihan16:11:53

that seems much cleaner to my eyes

rickmoynihan16:11:10

as xform and rf don’t depend on each other

otfrom16:11:29

I wonder how much donut a man can eat w/o dying https://photos.app.goo.gl/hKm3h1HJKqRjTotG9

mattford16:11:47

it is cleaner to me to, but I couldn't' help feel that we had all the machinery in transducers to not have to do it

jasonbell16:11:19

@otfrom is that a question or the start of a quest?

😂 4
rickmoynihan16:11:24

@mattford I’m no expert but I think some operations are mapping ops (one at time), and some are reducing ops (folding multiple values into one). It seems like you’re trying to make mapping ops more like reducing ops… which you can of course do (because mapping is just another reduction with transducers), but it seems to do so you’re losing the separation of concerns which transducers bring… and I’m not sure what the benefit you’re getting is.

rickmoynihan16:11:09

The redux example is cleanly separated because you can have an arbitrary xform on the sequence of ints. With yours, as far as I understand it, you can’t.

mattford16:11:33

I wrote this gist (which I don't stand behind) about it.

rickmoynihan16:11:40

I think your feeling is right though… but I think the feeling is because mapping is reducing with transducers… so yes you certainly do have the machinery to move the reduction about.

mattford16:11:00

I think I shall abandon this line of thought as an interesting experiment.

rickmoynihan16:11:48

It is interesting… and yes you certainly can mess with the semantics in transducers; and have them still be valid as they’re allowed to do a lot of things.