<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>The If Works</title>
    <link>https://blog.jcoglan.com/</link>
    <description></description>
    
      <item>
        <title>Uses for nested promises</title>
        <link>https://blog.jcoglan.com//2026/03/23/uses-for-nested-promises/</link>
        <description>&lt;p&gt;A recent conversation on Mastodon reminded me of some old JavaScript history.
When promises were relatively new and the &lt;a href=&quot;https://promisesaplus.com/&quot;&gt;Promises/A+&lt;/a&gt; spec was being
developed, there was a request from people with backgrounds in functional
programming to &lt;a href=&quot;https://github.com/promises-aplus/promises-spec/issues/94&quot;&gt;incorporate monads and category theory&lt;/a&gt;. This issue generated
a heated debate, the two sides so diametrically opposed that they both believed
their position was so obviously correct that they could not fathom why anyone
could believe anything else. Historically I have tended to side with the spec
authors in opposing this request, but I recently ran into a case where it would
have been useful for things to go the other way, which is a good prompt for
re-evaluating your positions.&lt;/p&gt;

</description>
        <pubDate>Mon, 23 Mar 2026 00:00:00 +0000</pubDate>
        <guid>https://blog.jcoglan.com//2026/03/23/uses-for-nested-promises</guid>
      </item>
    
      <item>
        <title>Quick binary diffs with XDelta</title>
        <link>https://blog.jcoglan.com//2024/01/04/quick-binary-diffs-with-xdelta/</link>
        <description>&lt;p&gt;Last month I decided to revive my long-neglected MP3 collection after relying on
Spotify for many years. This meant using Apple Music for the first time since it
was called iTunes, and in the course of ripping a few hundred CDs I found a
great many bugs. One particularly fun one was that sometimes, the application
will just stop accepting new artwork; you will drag an image into the file info
dialog as usual but the window then displays a placeholder image instead of the
one you just tried to save. The only way I have found to stop this happening is
to completely restart the computer.&lt;/p&gt;
</description>
        <pubDate>Thu, 04 Jan 2024 00:00:00 +0000</pubDate>
        <guid>https://blog.jcoglan.com//2024/01/04/quick-binary-diffs-with-xdelta</guid>
      </item>
    
      <item>
        <title>Announcing Canopy v0.4</title>
        <link>https://blog.jcoglan.com//2022/04/01/announcing-canopy-0-4/</link>
        <description>&lt;p&gt;Today I’m publishing version 0.4 of &lt;a href=&quot;https://canopy.jcoglan.com/&quot;&gt;Canopy&lt;/a&gt;, my PEG parser compiler for
Java, JS, Python and Ruby. This is long overdue and fixes a number of key
usability problems, as well as adding a few new features.&lt;/p&gt;

</description>
        <pubDate>Fri, 01 Apr 2022 00:00:00 +0000</pubDate>
        <guid>https://blog.jcoglan.com//2022/04/01/announcing-canopy-0-4</guid>
      </item>
    
      <item>
        <title>Named arguments in JavaScript</title>
        <link>https://blog.jcoglan.com//2021/06/07/named-arguments-in-javascript/</link>
        <description>&lt;p&gt;In &lt;a href=&quot;/2021/05/31/type-theory-for-named-arguments/&quot;&gt;type theory for named arguments&lt;/a&gt; we developed the idea of &lt;em&gt;named
arguments&lt;/em&gt; as a distinct type whose desired behaviour differs from that of
&lt;em&gt;records&lt;/em&gt;, which are the usual way of modelling polymorphic objects. We
determined that for record types, it’s fine for a caller to pass an object with
fields the called function does not use, but for named arguments this should be
considered an error. Conversely, a function with named arguments should be able
to add new option names without breaking existing callers, but callers should
&lt;em&gt;not&lt;/em&gt; be allowed to pass unrecognised names. In this article we’ll explore how
to realise these semantics in JavaScript, whose object model leans more towards
record semantics and doesn’t provide strong support for named arguments.&lt;/p&gt;

</description>
        <pubDate>Mon, 07 Jun 2021 00:00:00 +0000</pubDate>
        <guid>https://blog.jcoglan.com//2021/06/07/named-arguments-in-javascript</guid>
      </item>
    
      <item>
        <title>Type theory for named arguments</title>
        <link>https://blog.jcoglan.com//2021/05/31/type-theory-for-named-arguments/</link>
        <description>&lt;p&gt;One of the big challenges in maintaining open source software, or
service-oriented systems, or indeed any program where a function and its callers
can evolve independently and be maintained by different sets of people, is that
of maintaining compatibility. When we ship a new release of a package, we
usually want users to be able to upgrade without their programs breaking as a
result. This is especially tricky when the language we’re using does not have a
direct representation of a computational concept we’re using, as it leaves room
for a function’s author and its users to have different interpretations of what
the function does and how it should be used.&lt;/p&gt;
</description>
        <pubDate>Mon, 31 May 2021 00:00:00 +0000</pubDate>
        <guid>https://blog.jcoglan.com//2021/05/31/type-theory-for-named-arguments</guid>
      </item>
    
  </channel>
</rss>
