You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ian, thank you for writing. I agree that there's some hand-waving going on in that article. To make a long story short, that particular code base also includes this overload of <code>Apply</code>:
I keep learning during and after writing these articles, and it's possible that some of the connections you point out weren't entirely clear to me when I wrote. Or perhaps I was driven by a didactic motivation of presenting the concept in as clean a way as possible. Sometimes, I gloss over some details in order to get an overall point across. I honestly no longer remember exactly what motivated me to leave out that detail back then, but it was probably some combination of the above.
497
+
</p>
498
+
<p>
499
+
You are correct that currying is the key to making this simpler. <ahref="/2018/10/15/an-applicative-password-list#0ded7ac93aad8ba7b1063dd49c2051f1">Tyson Williams pointed this out to me in 2018</a>.
500
+
</p>
501
+
<p>
502
+
FWIW, until recently I had a tendency to forget about <code>liftA2</code> and its cousins, so I developed a habit of writing Haskell expressions like <code>(+) <$> (Just 10) <*> (Just 32)</code>, as witnessed by, among others, <ahref="/2022/01/17/enumerate-wordle-combinations-with-an-applicative-functor">this article</a>.
503
+
</p>
504
+
<p>
505
+
Is your final C# example to be preferred? I'm not sure. I haven't tried to actually write it out, so perhaps I'm missing something, but as far as I can tell, it's an extension method on <code>Func</code> that takes a single 'applicative value' as an argument. If so, isn't it more or less the above <code>Apply</code> overload with a different name?
506
+
</p>
507
+
<p>
508
+
As far as I can tell, that's not the idiomatic <code>Select</code> shape that most C# developers are used to, since it has its arguments swapped. You and I may realize that this is still isomorphic to the 'standard' <code>Select</code> signature, but I think that we've now moved beyond what most professional C# developers are willing to grapple with.
509
+
</p>
510
+
<p>
511
+
I don't mean that as an attack on your comments. I think that you are correct. Rather, during and after writing this article series on applicative functors, I've come to appreciate that however useful that abstraction is, it's not a good fit in C#.
0 commit comments