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
dharrigan 2020-09-15T05:08:44.279Z

Good Morning!

jiriknesl 2020-09-15T05:10:36.279200Z

Morning

jiriknesl 2020-09-15T05:10:45.279500Z

Wow, thanks for elaborate explanation!

thomas 2020-09-15T09:32:06.279700Z

morning

maleghast 2020-09-15T10:11:17.279900Z

Morning All…

dharrigan 2020-09-15T12:23:57.280500Z

Saw this on reddit/programming yesterday <https://github.com/tc39/proposal-pipeline-operator/wiki> It feels a lot like the threading macro -&gt; in clojure πŸ™‚

dharrigan 2020-09-15T12:24:39.280800Z

i.e.,

dharrigan 2020-09-15T12:24:42.281100Z

/ Complex example
anArray
  |&gt; (a =&gt; pickEveryN(a, 2))
  |&gt; (a =&gt; a.filter(...))
  |&gt; makeQuery
  |&gt; (a =&gt; readDB(a, config))
  |&gt; await
  |&gt; extractRemoteUrl
  |&gt; fetch
  |&gt; await
  |&gt; parse
  |&gt; console.log;

djm 2020-09-15T12:27:24.281700Z

Inspired by Elixir, I would guess: https://elixirschool.com/en/lessons/basics/pipe-operator/ (or maybe Elm?)

bronsa 2020-09-15T12:42:35.282800Z

ocaml has had |> since 2011

jiriknesl 2020-09-15T12:42:37.283Z

I have seen pipe operator for the first time in OCaml (if we don’t count shell).

jiriknesl 2020-09-15T12:42:44.283200Z

exactly @bronsa

djm 2020-09-15T12:43:20.283600Z

I did some ocaml at university, but that was before 2011, and I haven't looked at it since

bronsa 2020-09-15T12:43:33.283900Z

it's function composition tho, not syntax threading

bronsa 2020-09-15T12:44:59.284100Z

haskell has the same but calls it &amp;

jiriknesl 2020-09-15T12:47:54.285Z

Also LiveScript has it, they call it piping (https://livescript.net/#piping) and I remember I was using it ages back.

alexlynham 2020-09-15T12:48:10.285200Z

and F# iirc

dharrigan 2020-09-15T12:55:31.285500Z

I do believe it is yes, functional composition

dharrigan 2020-09-15T12:55:38.285800Z

just feels a bit like the threading macro πŸ™‚

alexlynham 2020-09-15T13:00:25.285900Z

i guess it's for langs that always curry cos all functions have only one argument, hence composition, right?

πŸ‘ 1
alexlynham 2020-09-15T13:01:00.286Z

whereas threading is giving its outputs to the next form, not composing together all the logic/operations and then applying

alexlynham 2020-09-15T13:01:22.286100Z

vaguely recall that the thrush combinator is somewhat the inverse of composition

alexlynham 2020-09-15T13:01:25.286200Z

lemme google

alexlynham 2020-09-15T13:01:35.286300Z

https://docs.racket-lang.org/point-free/index.html

alexlynham 2020-09-15T13:01:50.286400Z

with the caveat that as usual i have very little idea what i'm on about

2020-09-15T17:37:13.288Z

Am I now in a minority in finding using npm libs from clojurescript still can be fraught wish issues? Just surprised that cljsjs is talking about issuing a draft partial depreciation warning...

dominicm 2020-09-15T17:37:53.288400Z

I don't have any problems with them.

dominicm 2020-09-15T17:38:01.288700Z

Any bundles are smaller.

2020-09-15T17:39:03.289800Z

Well I'm using figwheel / webpack, and it's still really hit and miss. IE requires work, but then using that doesn't give you any working reflection or any js obj worth looking at...

2020-09-15T17:39:36.290200Z

Is it a case of just work out how to convert all your projects to shadow?

2020-09-15T18:07:17.290500Z

Perhaps this is a minority perspective πŸ˜ƒ...

dominicm 2020-09-15T20:16:07.291200Z

@folcon I use webpack and Figwheel :).

dominicm 2020-09-15T20:16:35.291700Z

I wouldn't advocate for migration to shadow.

dominicm 2020-09-15T20:18:32.293400Z

@folcon what problems are you encountering exactly? I'm surprised by your claims.

mccraigmccraig 2020-09-15T20:18:44.293700Z

we've had an overall good shadow experience... but we moved off of boot-cljs, rather than figwheel

2020-09-15T22:24:44.295300Z

@dominicm I think I've worked out the problem, at least in this case, blame poor errors perhaps? But webpack 5 doesn't say that they remove the node module polyfills that were bundled in by default...

2020-09-15T22:25:18.295900Z

Unfortunately still took a fair while to debug >_<...