Raku's junctions reconstructed in #Haskell, and then again in Raku. A sneak preview:
data JType = Any | All | One | None
data Junction a = Junction JType [a]
(•￮) :: (a -> b) -> Junction a -> Junction b
(￮•) :: Junction (b -> c) -> b -> Junction c
(￮￮) :: Junction (b -> c) -> Junction b -> Junction (Junction c)
so :: Junction Bool -> Bool
I wrote two new articles, both dealing with junctions in raku.
Junctions are these cool quantum superposition data types that result in auto-threaded computations.
But there is something odd about them, and that is the topic of my first article:
"The strange case of the greedy junction"
That article was just the starting point. Then I tried to account for this strange behaviour by deconstructing and then reconstructing theses junctions in sound statically typed terms. That is the (much longer) second article:
"Reconstructing Raku's Junctions"
Even if you don't care for Raku at all, I think these articles might be of interest as examples of functional programming in a language with gradual typing.
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!