<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://jlk.co/feed.xml" rel="self" type="application/atom+xml" /><link href="https://jlk.co/" rel="alternate" type="text/html" /><updated>2026-10-10T19:29:52+00:00</updated><id>https://jlk.co/feed.xml</id><title type="html">Jonathan King</title><subtitle></subtitle><entry><title type="html">Netlify + PureScript?</title><link href="https://jlk.co/purescript/complete/2018/04/20/purescript-netlify.html" rel="alternate" type="text/html" title="Netlify + PureScript?" /><published>2018-04-20T00:00:00+00:00</published><updated>2018-04-20T00:00:00+00:00</updated><id>https://jlk.co/purescript/complete/2018/04/20/purescript-netlify</id><content type="html" xml:base="https://jlk.co/purescript/complete/2018/04/20/purescript-netlify.html"><![CDATA[<p>The answer is yes!</p>

<p>I’m a <strong>huge</strong> fan of <a href="https://netlify.com">Netlify</a>, but couldn’t find any resources on building (and hosting) a PureScript site on the platform.</p>

<p>It turned out to be pretty straightforward, however I wanted to share a minimal example with instructions so that it’s <em>even easier</em> for people in the future.</p>

<p>A couple of points:</p>

<ul>
  <li>
    <p><del>I found the only way to install binaries (e.g. <code class="language-plaintext highlighter-rouge">purescript</code> or <code class="language-plaintext highlighter-rouge">psc-package</code>) is if they are bundled as npm packages.</del> (I was wrong about this, thanks <a href="https://twitter.com/alex_berg/status/987322450022162432">@alex_berg</a>)</p>
  </li>
  <li>
    <p>As their <a href="https://github.com/netlify/build-image">build image</a> doesn’t have any PureScript support, you have to download and install everything fresh each time, which can add a few minutes to build times.</p>
  </li>
  <li>
    <p>In my example the build command is <code class="language-plaintext highlighter-rouge">npm run build</code> and publish directory is <code class="language-plaintext highlighter-rouge">dist</code>.</p>
  </li>
</ul>

<p>My example repo is on <a href="https://github.com/jonathanlking/purescript-netlify">GitHub</a> and you can visit it at <a href="https://purescript-netlify.jlk.co">purescript-netlify.jlk.co</a> - although it just logs “Hello sailor!” to the console!</p>]]></content><author><name></name></author><category term="purescript" /><category term="complete" /><summary type="html"><![CDATA[The answer is yes!]]></summary></entry><entry><title type="html">Viewing types of Generic representations in PureScript</title><link href="https://jlk.co/purescript/complete/2018/02/17/purescript-generic-type.html" rel="alternate" type="text/html" title="Viewing types of Generic representations in PureScript" /><published>2018-02-17T00:32:31+00:00</published><updated>2018-02-17T00:32:31+00:00</updated><id>https://jlk.co/purescript/complete/2018/02/17/purescript-generic-type</id><content type="html" xml:base="https://jlk.co/purescript/complete/2018/02/17/purescript-generic-type.html"><![CDATA[<p>Recently I’ve been looking at <a href="https://github.com/purescript/purescript-generics-rep"><code class="language-plaintext highlighter-rouge">purescript-generics-rep</code></a>, however I struggled with knowing where the various generic <a href="https://github.com/purescript/purescript-generics-rep/blob/master/src/Data/Generic/Rep.purs">constructors</a> could appear (and at which level) and the only example I could find was for <code class="language-plaintext highlighter-rouge">Maybe</code>.</p>

<p>I wanted a way to view the type of the derived generic representation, so I could easily play around with different data types and see what they looked like. The easiest way (thanks <a href="https://twitter.com/jusrin00">@jusrin00</a>) is to query the type of <code class="language-plaintext highlighter-rouge">from :: forall rep a. Generic a rep =&gt; a -&gt; rep</code>, the function that converts <em>from</em> a data type to its generic representation, specialising <code class="language-plaintext highlighter-rouge">a</code> (the data type):</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>&gt; import Data.Generic.Rep
&gt; import Data.Maybe
&gt; :t from :: forall a. Maybe a -&gt; _
forall a
    . Maybe a
   -&gt; Sum (Constructor "Nothing" NoArguments)
          (Constructor "Just" (Argument a0))
</code></pre></div></div>

<p>I initially came up with an alternative (over engineered) approach, which reports the generic type in an error message using <code class="language-plaintext highlighter-rouge">TypeString</code>.
It’s definitely a case of <em>“they didn’t stop to think if they should”</em>, but you can play around with it on <a href="http://try.purescript.org/?gist=f85d0d8955f656e96d383a2354779741">Try PureScript</a>.</p>]]></content><author><name></name></author><category term="purescript" /><category term="complete" /><summary type="html"><![CDATA[Recently I’ve been looking at purescript-generics-rep, however I struggled with knowing where the various generic constructors could appear (and at which level) and the only example I could find was for Maybe.]]></summary></entry></feed>