<p>By using <code>.</code> you are already using denotational semantic</p>
<blockquote>
<p>In computer science, denotational semantics (initially known as mathematical semantics or Scott–Strachey semantics) is an approach of formalizing the meanings of programming languages by constructing mathematical objects</p>
</blockquote>
<p>(<a href="https://en.wikipedia.org/wiki/Denotational_semantics" rel="nofollow noreferrer">source</a>)</p>
<p>in fact the <code>.</code> aims to emulate the <a href="https://en.wikipedia.org/wiki/Function_composition" rel="nofollow noreferrer">function composition operator in math</a> ( <code>∘</code>, used as <code>g  ∘  f</code> to indicate a function that acts as <code>g(f(x))</code> ).</p>
<p>with that being said there are still your question to answer to:</p>
<h1>how do I use/write this into my code?</h1>
<p>in Haskell is as simple as:</p>
<pre class="lang-hs prettyprint-override"><code>circle :: ( b -&gt; c ) -&gt; ( a -&gt; b ) -&gt; ( a -&gt; c )
circle = (.)
</code></pre>
<h1>how is the conversion between the two handled?</h1>
<p>being Haskell lazy-evaluated, when you get to the point of calling</p>
<pre class="lang-hs prettyprint-override"><code>circle g f
</code></pre>
<p>it will be substituted to</p>
<pre class="lang-hs prettyprint-override"><code>(.) g f
</code></pre>
<p>which is equivalent to</p>
<pre class="lang-hs prettyprint-override"><code>g . f
</code></pre>
<h1>does this come with time or security concerns?</h1>
<p>no security concerns, this is all handled by haskell.</p>
<h1>does this still compile to plutus-core correctly?</h1>
<p>as long it is <code>{-# INLINEABLE circle #-}</code> it doesn't comes to my mind a reason why it wouldn't</p>

CC BY-SA 4.0
2022-07-11T21:39:31.303Z
2022-07-11T21:39:31.303Z
Michele Nuzzi
<p>So i heard you can use denotational semantics to write Haskell code using math notation for example <code>circle</code> in place of <code>.</code> to denote function composition. My question is in four parts:</p>
<ol>
<li>how do I use/write this into my code?</li>
<li>how is the conversion between the two handled?</li>
<li>does this come with time or security concerns?</li>
<li>does this still compile to plutus-core correctly?</li>
</ol>

<plutus><haskell><plutus-core>
How Do You Convert Math Symbols in Haskell?
# How Do You Convert Math Symbols in Haskell?

(Asked by: username_0 on 2022-07-11)

So i heard you can use denotational semantics to write Haskell code using math notation for example `circle` in place of `.` to denote function composition. My question is in four parts:

1. how do I use/write this into my code?
2. how is the conversion between the two handled?
3. does this come with time or security concerns?
4. does this still compile to plutus-core correctly?

**Tags:** plutus, haskell, plutus-core

---

## 1 answers

### Answer by username_1 on 2022-07-11. Score: 2

By using . you are already using denotational semantic

In computer science, denotational semantics (initially known as mathematical semantics or Scott–Strachey semantics) is an approach of formalizing the meanings of programming languages by constructing mathematical objects

(source)
in fact the . aims to emulate the function composition operator in math ( ∘, used as g  ∘  f to indicate a function that acts as g(f(x)) ).
with that being said there are still your question to answer to:
how do I use/write this into my code?
in Haskell is as simple as:
circle :: ( b -> c ) -> ( a -> b ) -> ( a -> c )
circle = (.)

how is the conversion between the two handled?
being Haskell lazy-evaluated, when you get to the point of calling
circle g f

it will be substituted to
(.) g f

which is equivalent to
g . f

does this come with time or security concerns?
no security concerns, this is all handled by haskell.
does this still compile to plutus-core correctly?
as long it is {-# INLINEABLE circle #-} it doesn't comes to my mind a reason why it wouldn't


---

