## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
##### Activity
Jean-Louis Giordano
@Jell
Side-by-side comparison:
(def in [1 2 3 4 5 6 7 8 9])
(def xform (comp (map (fn [x] (quot x 2)))
(take 5)
(map (fn [x] (* x 2)))
(map (fn [x] (* x 2)))
(map (fn [x] (* x 2)))))
(def out (into [] xform in))
    in := []int{1,2,3,4,5,6,7,8,9}
xform := Compose(Compose(Compose(Compose(
Map(int,int,[]int)(func (x int) int { return x / 2 }),
Take(int,[]int)(5)),
Map(float32,int,[]int)(func (x int) float32 { return float32(x * 2) })),
Map(int,float32,[]int)(func (x float32) int { return int(x * 2) })),
Map(int,int,[]int)(func (x int) int { return x * 2 }))
out := into([]int{}, xform, in)
I think it's great because in go with generics:
1. it's possible to implement transducer
2. you really shouldn't :D
Veit Heller
@hellerve
looks great! are they streamable/lazy or do they realize every value right away (i.e. intermediate arrays)
Jean-Louis Giordano
@Jell
they do not realize intermediate arrays (like in Clojure), but in that first version I wrote they actually only work from and to arrays, I need to put a collection interface to make into more "generic"
(I mean, into only accepts arrays as in & out, xform doesn't care)
(ok rather, xform cares because you need to give the right type annotation when instantiating it, but you could replace []int with whatever type instead in the type annotations)
Veit Heller
@hellerve
neat!
Magnus Therning
@magthe
I found what I think is a rather good example of refactoring to FCIS. The original is in Python and I attempted a version in Haskell: https://gitlab.com/magus/sync-fcis-refactor
What do you think about it? Maybe it couybe used in a meetup, a group exercise, ...
Or maybe someone wants to contribute a version in another language? Clojure? OCaml? F#? Why not JavaScript or C#?
jolod
@jolod
Tiny poll: do you use qualified or unqualified imports in Haskell? (In most languages "import all" statements are shunned, but they are common practice in Haskell. Personally I generally import types and operators unqualified, and qualify everything else.)
Veit Heller
@hellerve
personally i qualify everything until it becomes ridiculous. if i import more than, say, 10 things, then i either import qualifiedly, or just import it all directly (though i don’t really like that all that much tbh)
jolod
@jolod
@hellerve When does it become ridiculous to qualify? :-)
Magnus Therning
@magthe

Organising the imports in Haskell sometimes feels rather silly.

Stuff like this

import Data.Conduit ((.|))
import qualified Data.Conduit as C

is a bit laughable, but feels necessary.

Veit Heller
@hellerve
@jolod sorry, unclear language: when it becomes ridiculous to list the individual functions to import (which is a different qualification than importing using qualified)
jolod
@jolod
Have any of you found import Mod as Foo (x,y) or import qualified Mod as Foo (x,y) useful (in real code)?
Veit Heller
@hellerve
i cant say ive used it very much
jolod
@jolod
I've never used it. :-)
Magnus Therning
@magthe
@jolod you mean using both named import and limit what functions to import? No, never used that. Also never used import Mod as Foo except (x,y).
Magnus Therning
@magthe
Now I've added a few languages to the FCIS refactoring kata/exercise at https://gitlab.com/magus/sync-fcis-refactor/
Marco Z
@ocramz
:wave:
Magnus Therning
@magthe
Hi @ocramz
jolod
@jolod
@magthe So the idea is to refactor these snippets to FCIS?
Magnus Therning
@magthe
Yes, that's the idea.
Marco Z
@ocramz
hullo again! been missing for a while, how are you all doing?
Magnus Therning
@magthe
Doing well, but there's been very little meetup goodness in my life lately.
Erik Svedäng
@eriksvedang
@ocramz all good, though I don’t live in Gbg at the moment... How are you?
Magnus Therning
@magthe
So, a bit tired, but rather happy with the FCIS refactoring exercise we ran today :)
Magnus Therning
@magthe
Carp just popped up in a discussion on funprog@zulip 👍
Erik Svedäng
@eriksvedang
nice :)
Magnus Therning
@magthe
Time for a meeting soon?
Jean-Louis Giordano
@Jell
we should! I wouldn't mind finally doing an Idris presentation, that would make me refresh my knowledge :p I also have some nice callcc fun in ruby to share (inspired by @magthe! :p ). I also had some go generics thing but tbh I kinda forgot about it now already. And we have advent of code coming up? Perhaps something around that?
jolod
@jolod
Oh oh oh! Remote group programming on AoC!!!
Jean-Louis Giordano
@Jell
yeah that could be something!
jolod
@jolod
Also, would love an Idris presentation.
But splitting up into groups of 4 and work on a AoC problem, and then join the main room and talk about the solutions. Would be super great.
Erik Svedäng
@eriksvedang
Yeah!
Jean-Louis Giordano
@Jell
you think Zoom would work out? are there some good tools for impromptu pair-programming?
I've used tmate but then kind requires a terminal editor
I've heard good things about remote pairing function of VS Code but haven't really tried it
jolod
@jolod
I have been group programming regularly since last sprin. We have just used screen sharing and commit when handing over, circulating who is typing.
Magnus Therning
@magthe
I have the impression zoom has improved the "breakout feature". The agile meetup did a session where we were randomly divided into groups and then the organiser could push us out into group discussions for 5 min after which we were pulled back in again.
It might be worth checking if there's anything else they've added.
Magnus Therning
@magthe
Re. your callcc rumination, @Jell , I was pondering the joy of having several short presentations of mind bending solutions to small problems. Use of callcc would be one, fix point another, and maybe clever use of laziness in Haskell.
jolod
@jolod
In a talk, I saw a clever (?) Haskell solution to fizzbuzz that avoided the repeated checks you typically have. @magthe
Magnus Therning
@magthe
👍
I saw a clever solution to "replace every number in a list with the max" in a single pass by passing the passing the maximum before it's available. Laziness put to good use.
jolod
@jolod
I'm up for both, AoC and "cleverness".
Maybe AoC first. If we schedule it now, we can pick a day in the first week, and work on that days problem. Then it's new to everyone, and those problems tend to be fairly easy.
Jean-Louis Giordano
@Jell
but let's do that! maybe on 2nd or 3rd of december? that would give us a few days of AoC without being a friday