# Add composition operator ⨟ Unicode 2A1F for flipped ∘

**URL:** <https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436>\
**Category:** Internals & Design\
**Tags:** question\
**Created:** [February 10, 2020, 8:58pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436 "2020-02-10T20:58:42Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 10, 2020, 8:58pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/1 "2020-02-10T20:58:42Z")

</div>

Dear Julia designers,

having read parts of the Applied Category Book Seven Sketches of Compositionality by Brendan Fong and David I. Spivak I really appreciate the use of the [\fatsemi](https://tex.stackexchange.com/questions/125012/what-is-the-latex-code-for-an-open-semicolon) operator ⨟

It is just the reversed \circ ∘ function composition operator which is much more inuitive in many situations, because it rather mirrors how you would construct pipelines.

Unfortunately the character is not recognized by julia currently but instead if you try to assign to it you get the following error (julia 1.3.1)

```julia
ERROR: syntax: invalid character "⨟" near column 2

```

My suggestion is to add this character to valid characters and define it as the flipped function composition.

```julia
f ⨟ g = g ∘ f

```

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [February 10, 2020, 9:02pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/2 "2020-02-10T21:02:55Z")

</div>

My browser doesn’t even display the symbol…

---

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [February 10, 2020, 9:04pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/3 "2020-02-10T21:04:41Z")

</div>

I like how this operator symbol is made up of `∘` for composition and `;` which runs stuff in the left to right order.

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [February 10, 2020, 9:37pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/4 "2020-02-10T21:37:37Z")

</div>

This is great! Here is a PR to add this [Add \bbsemi as a binary operator by tkf · Pull Request #34722 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/34722)

Beautiful 🙂

![image](https://global.discourse-cdn.com/julialang/original/3X/0/a/0a3361ab5f45c40d79807a54bed496beb4ce2b9d.png)

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [February 10, 2020, 10:44pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/5 "2020-02-10T22:44:03Z")

</div>

IS this operator used anywhere besides in that book? I’ve never seen it before 😛

> [@jw3126](#):
>
> and `;` which runs stuff in the left to right

in what way does `;` run stuff left to right? As far as I know it suppresses output, delimits vectors and expressions in julia.

---

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [February 10, 2020, 10:46pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/6 "2020-02-10T22:46:47Z")

</div>

Yeah you are of course right. What I wanted to say is that composition is `executed_second ∘ executed_first`. While we have `executed_first; executed_second`.

---

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [February 10, 2020, 10:52pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/7 "2020-02-10T22:52:11Z")

</div>

Another option that already works is to define this on `\circ` with a unicode modifier, i.e. `∘̂` (typed `\circ<TAB>\hat<TAB>`):

```julia
julia> ∘̂(f, g) = g ∘ f
∘̂ (generic function with 1 method)

julia> (sin ∘̂ cos)(1)
0.6663667453928805

julia> (cos ∘ sin)(1)
0.6663667453928805

help?> ∘̂
"∘̂" can be typed by \circ<tab>\hat<tab>

search: ∘̂

  No documentation found.

  ∘̂ is a Function.

  # 1 method for generic function "∘̂":
  [1] ∘̂(f, g) in Main at REPL[25]:1

```

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [February 10, 2020, 11:20pm UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/8 "2020-02-10T23:20:44Z")

</div>

In [Add \bbsemi as a binary operator by tkf · Pull Request #34722 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/pull/34722) I added `\fatsemi<TAB>` completion. But I just realized that `⨟` almost looks like the “blackboard font” version of `;` so maybe `\bb;<TAB>` (like `\bbX<TAB>` expands to `𝕏`) also makes sense?

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 11, 2020, 8:03am UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/9 "2020-02-11T08:03:26Z")

</div>

> [@tkf](#):
>
> `⨟` almost looks like the “blackboard font” version of `;`

I think it is really decisive for intuitive readability and semantics that the \fatsemi has \circ as part of it. Hence I wouldn’t go for the “filled” blackboard font version.

---

<div class="post-metadata">

**Author:** ![tkf](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkf/32/17635_2.png) [@tkf](https://discourse.julialang.org/u/tkf)\
**Post date:** [February 11, 2020, 8:11am UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/10 "2020-02-11T08:11:30Z")

</div>

I’m not sure if I understand what you are talking about. My comment on `\bb;` was about how this character is entered in the REPL. More precisely the addition of this line in the PR:

> <https://github.com/JuliaLang/julia/blob/37e239ce7fb04c16598e969350c53ab75a93afaf/stdlib/REPL/src/latex_symbols.jl#L528>

I’m not changing the character itself. (OK, right now I’m suggesting to use `⨾` (U+2A3E) instead of `⨟` (U+2A1F) in the PR but that look pretty much identical to me in my browser.)

---

<div class="post-metadata">

**Author:** ![schlichtanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schlichtanders/32/32145_2.png) [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Post date:** [February 11, 2020, 8:16am UTC](https://discourse.julialang.org/t/add-composition-operator-unicode-2a1f-for-flipped/34436/11 "2020-02-11T08:16:08Z")

</div>

My misunderstanding. Thanks for pointing out that it is actually the same symbol (which unicode version or whether both will be best decided in the pullrequest).

For better autocompletion \fatsemi is very nice to have. For those who know the \bb family, I guess that one is more self-explanatory (haven’t used that so far). Would go with both or if only one is required, prefer \fatsemi
