Skip to content

Commit

Permalink
Fixing the typo in traversals post https://blog.ploeh.dk/2024/11/11/t…
Browse files Browse the repository at this point in the history
…raversals/

Fixing the typo in traversals post

Post URL:
https://blog.ploeh.dk/2024/11/11/traversals/

Actual text:
Since tasks (e.g. Task<T>) are applicative functors (the are, because they are monads, and all monads are applicative functors), that second requirement is fulfilled for the above example.

Fixed text:
Since tasks (e.g. Task<T>) are applicative functors (they are, because they are monads, and all monads are applicative functors), that second requirement is fulfilled for the above example.
  • Loading branch information
PraveenTalari authored Nov 13, 2024
1 parent 674bf89 commit f2225b0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posts/2024-11-11-traversals.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h3 id="b962041a5e3d4eb9ba5101641407ca3f">
The <em>sequence</em> function doesn't work for any old functor. First, <code>t</code> has to be a <em>traversable functor</em>. We'll get back to that later. Second, <code>f</code> has to be an <a href="/2018/10/01/applicative-functors">applicative functor</a>. (To be honest, I'm not sure if this is <em>always</em> required, or if it's possible to produce an example of a specific functor that isn't applicative, but where it's still possible to implement a <em>sequence</em> function. The Haskell <code>sequenceA</code> function has <code>Applicative f</code> as a constraint, but as far as I can tell, this only means that this is a <em>sufficient</em> requirement - not that it's necessary.)
</p>
<p>
Since tasks (e.g. <code>Task&lt;T&gt;</code>) are applicative functors (the are, because <a href="/2022/06/06/asynchronous-monads">they are monads</a>, and <a href="/2022/03/28/monads">all monads are applicative functors</a>), that second requirement is fulfilled for the above example. I'll show you how to implement a <code>Sequence</code> function in C# and how to use it, and then we'll return to the general discussion of what a traversable functor is:
Since tasks (e.g. <code>Task&lt;T&gt;</code>) are applicative functors (they are, because <a href="/2022/06/06/asynchronous-monads">they are monads</a>, and <a href="/2022/03/28/monads">all monads are applicative functors</a>), that second requirement is fulfilled for the above example. I'll show you how to implement a <code>Sequence</code> function in C# and how to use it, and then we'll return to the general discussion of what a traversable functor is:
</p>
<p>
<pre><span style="color:blue;">public</span>&nbsp;<span style="color:blue;">static</span>&nbsp;Task&lt;IEnumerable&lt;T&gt;&gt;&nbsp;Sequence&lt;<span style="color:#2b91af;">T</span>&gt;(
Expand Down Expand Up @@ -369,4 +369,4 @@ <h3 id="cc6c409706e24ea9b3ebefa49fcc3235">
<p>
<strong>Next:</strong> Nested monads.
</p>
</div>
</div>

0 comments on commit f2225b0

Please sign in to comment.