<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mickey Vashchinsky on Medium]]></title>
        <description><![CDATA[Stories by Mickey Vashchinsky on Medium]]></description>
        <link>https://medium.com/@mickey.vip?source=rss-6348b569c284------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*VqT34Lrt-k6aMeUz.</url>
            <title>Stories by Mickey Vashchinsky on Medium</title>
            <link>https://medium.com/@mickey.vip?source=rss-6348b569c284------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 23:18:27 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mickey.vip/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[An Approach to Nested Reusable View Functions in Elm]]></title>
            <link>https://medium.com/@mickey.vip/an-approach-to-nested-reusable-view-functions-in-elm-a1531b9abaf3?source=rss-6348b569c284------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1531b9abaf3</guid>
            <category><![CDATA[elm]]></category>
            <dc:creator><![CDATA[Mickey Vashchinsky]]></dc:creator>
            <pubDate>Sun, 11 Nov 2018 18:15:46 GMT</pubDate>
            <atom:updated>2019-06-28T13:36:51.792Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*iMJK124TzKoRONYc3weCMg.png" /></figure><p><strong><em>Update 15 Nov 2018: </em></strong>After reading a comment from <a href="https://medium.com/@cj.duncan.a">Christopher Duncan-Araúz</a> I have realised that the <strong>colorSlider</strong> should be changed to accept toMsg of type (Int -&gt; msg) and not (String -&gt; msg), since it should pass to toMsg a color value of type Int, and it should do the conversion from String to Int. Thank you, Christopher!</p><p>At my work place I wanted to introduce my colleagues to the Elm programming language, so we had two Elm workshops lead by myself.</p><p>After getting the basics, one of the most frequent questions was: “How do we reuse components and work with deep nested views?”</p><h3>Components vs. View Functions</h3><p>The term <strong>component</strong> is a very common among modern JavaScript frameworks and usually used when talking about a self contained visual widget and objects. In functional world there are no objects, only functions — hence the term I use in this article is <strong>view functions</strong>.</p><p>The creator of Elm, Evan Czaplicki tweeted about the distinction: <a href="https://twitter.com/czaplic/status/903266544544878592">https://twitter.com/czaplic/status/903266544544878592</a>.</p><p>The closest we probably can get to self containment is by having a module with its model, view and update.</p><p>With that, very often things can be further simplified, avoiding the usage of the model, view and update and we will see that here.</p><h3>Color Picker as an Example</h3><p>To answer the question about reusability I suggested an example of a <strong>color picker</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/174/1*OPHfmuOihqT_K4hlUxxudg.png" /><figcaption>A Color Picker we want to build</figcaption></figure><ul><li>We have a <strong>slider</strong> for each color</li><li>We have a <strong>color picker</strong> that (re)uses it by having 3 <strong>sliders</strong> for each color channel (R, G, b) and shows a square with a corresponding color</li><li>We have 2 <strong>color pickers</strong> in the main view</li></ul><p>Thus there is 2-deep or even 3-deep (if you count reusing <strong>color picker</strong> in the main view) nested view.</p><h3>The Slider</h3><p>The slider is pretty straightforward since it’s supported by all major browsers:</p><pre>&lt;input type=&quot;range&quot; name=&quot;color-red&quot; min=&quot;0&quot; max=&quot;255&quot; value=&quot;50&quot; /&gt;</pre><p>So in Elm it would look something like this:</p><pre><strong>import</strong> Browser<br><strong>import </strong>Html<br><strong>import </strong>Html.Attributes <strong>as </strong>Attr<br><strong>import </strong>Html.Events <strong>as </strong>Evt</pre><pre><strong>type</strong> <strong>alias</strong> Model =<br>    { redValue : String }</pre><pre>initialModel : Model<br>initialModel =<br>    { redValue = &quot;50&quot; }</pre><pre><strong>type </strong>Msg<br>    = UpdateColorRed String</pre><pre>update : Msg -&gt; Model -&gt; Model<br>update msg model =<br>    <strong>case</strong> msg <strong>of</strong><br>        UpdateColorRed newRedValue -&gt;<br>            { model | redValue = newRedValue }</pre><pre>colorRedSlider : String -&gt; Html.Html Msg<strong><br></strong>colorRedSlider redValue =<br>    Html.input<br>            [ Attr.type_ &quot;range&quot;            <br>            , Attr.name &quot;color-red&quot;<br>            , Attr.min &quot;0&quot;<br>            , Attr.max &quot;255&quot;<br>            , Attr.value redValue<br>            , Evt.onInput UpdateColorRed<br>            ]<br>            []</pre><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorRedSlider model.redValue<br>        , Html.span [] [ Html.text model.redValue ]<br>        ]</pre><pre>main : Program () Model Msg<br>main =<br>    Browser.sandbox<br>        { init = initialModel<br>        , view = view<br>        , update = update<br>        }</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/165/1*v1wQiHf5MiP4r-s8HqYg0Q.png" /><figcaption>Red color channel slider</figcaption></figure><p><a href="https://ellie-app.com/3MNbRYJqbNBa1">https://ellie-app.com/3MNbRYJqbNBa1</a></p><p>There is a small issue with the current slider implementation — the red value is a String and we want it to be an Int between 0 and 255.</p><p>We can add a function for converting String value to Int:</p><pre>toInt : Int -&gt; String -&gt; Int<br>toInt defaultValue strValue =<br>    strValue<br>        |&gt; String.toInt<br>        |&gt; Maybe.withDefault defaultValue</pre><p>We need to supply to the function a fallback value (defaultValue) since String.toInt returns Maybe Int and we want to get an Int. In our case we always have a previous color channel value, because we have a color to start with and that will be this fallback.</p><p>It would also be nice if the Msg can be declared as UpdateColorRed Int instead of UpdateColorRed String. Function composition can help us with this:</p><pre>Evt.onInput (UpdateColorRed &lt;&lt; toInt redValue)</pre><p>When the user changes slider value, the String representation of it will be passed to the result of toInt redValue — a function that is waiting to get the last parameter (strValue).</p><p>This is Elm’s partial application in action. You can read more about it here: <a href="https://elmprogramming.com/function.html#partial-function-application">https://elmprogramming.com/function.html#partial-function-application</a>.</p><p>The result of all that is an Int and it will be passed to UpdateColorRed constructor of type Msg.</p><p>The updated fragments of our code looks like this:</p><pre>{- ommitted code -}</pre><pre><strong>type</strong> <strong>alias</strong> Model =<br>    { redValue : Int }</pre><pre>initialModel : Model<br>initialModel =<br>    { redValue = 50 }</pre><pre><strong>type</strong> Msg<br>    = UpdateColorRed Int</pre><pre><em>{- ommitted code -}</em></pre><pre>colorRedSlider : Int -&gt; Html.Html Msg<br>colorRedSlider redValue =<br>    Html.input<br>        [ Attr.type_ &quot;range&quot;<br>        , Attr.name &quot;color-red&quot;<br>        , Attr.min &quot;0&quot;<br>        , Attr.max &quot;255&quot;<br>        , Attr.value (String.fromInt redValue)<br>        , Evt.onInput (UpdateColorRed &lt;&lt; toInt redValue)<br>        ]<br>        []</pre><pre>toInt : Int -&gt; String -&gt; Int<br>toInt defaultValue strValue =<br>    strValue<br>        |&gt; String.toInt<br>        |&gt; Maybe.withDefault defaultValue</pre><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorRedSlider model.redValue<br>        , Html.span [] [ Html.text (String.fromInt model.redValue) ]<br>        ]</pre><p><a href="https://ellie-app.com/3MNmnfTXsjQa1">https://ellie-app.com/3MNmnfTXsjQa1</a></p><p>But we want to reuse the colorRedSlider view and not to hard code it with settings and a specific Msg. Reading through <a href="https://guide.elm-lang.org/architecture/forms.html">https://guide.elm-lang.org/architecture/forms.html</a> gives us a hint:</p><pre>viewInput : String -&gt; String -&gt; String -&gt; (String -&gt; msg) -&gt; Html msg<br>viewInput t p v toMsg =<br>  input [ type_ t, placeholder p, value v, onInput toMsg ] []</pre><p>We can pass all the custom settings to our colorRedSlider including the toMsg function for onInput.</p><p>The concrete Msg type can be changed to type variable msg. There is more about type variables here: <a href="https://guide.elm-lang.org/types/reading_types.html">https://guide.elm-lang.org/types/reading_types.html</a>.</p><p>We also will rename colorRedSlider to colorSlider, since it is now a generic slider and is not bound to a specific color.</p><p>Let’s also render a color label and a color value.</p><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorSlider<br>            &quot;Red&quot;<br>            model.redValue<br>            UpdateColorRed<br>        ]</pre><pre>colorSlider : String -&gt; Int -&gt; (Int -&gt; msg) -&gt; Html.Html msg<br>colorSlider name colorValue toMsg =<br>    Html.div []<br>        [ Html.p [] [ Html.text name ]<br>        , Html.input<br>            [ Attr.type_ &quot;range&quot;<br>            , Attr.name (&quot;color&quot; ++ name)<br>            , Attr.min &quot;0&quot;<br>            , Attr.max &quot;255&quot;<br>            , Attr.value (String.fromInt colorValue)<br>            , Evt.onInput (toMsg &lt;&lt; toInt colorValue)<br>            ]<br>            []<br>        , Html.span [] [ Html.text (String.fromInt colorValue) ]<br>        ]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/170/1*3OHjZAXaSBEkTyzeJYFr7w.png" /><figcaption>Slider with a color label</figcaption></figure><p><a href="https://ellie-app.com/3TgrjNCXKDna1">https://ellie-app.com/3TgrjNCXKDna1</a></p><p>We now have a generic slider view that we can reuse for our <strong>color picker</strong>!</p><p>Let’s put it to work. We’ll add 2 more sliders for the Green and Blue color channels and a box for showing the resulting color:</p><pre><strong>type</strong> <strong>alias</strong> Model =<br>    { redValue : Int<br>    , greenValue : Int<br>    , blueValue : Int<br>    }</pre><pre>initialModel : Model<br>initialModel =<br>    { redValue = 50, greenValue = 200, blueValue = 100 }</pre><pre><strong>type</strong> Msg<br>    = UpdateColorRed Int<br>    | UpdateColorGreen Int<br>    | UpdateColorBlue Int</pre><pre>update : Msg -&gt; Model -&gt; Model<br>update msg model =<br>    case msg of<br>        UpdateColorRed newRedValue -&gt;<br>            { model | redValue = newRedValue }</pre><pre>        UpdateColorGreen newGreenValue -&gt;<br>            { model | greenValue = newGreenValue }</pre><pre>        UpdateColorBlue newBlueValue -&gt;<br>            { model | blueValue = newBlueValue }</pre><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorSlider &quot;Red&quot; model.redValue UpdateColorRed<br>        , colorSlider &quot;Green&quot; model.greenValue UpdateColorGreen<br>        , colorSlider &quot;Blue&quot; model.blueValue UpdateColorBlue<br>        , Html.div<br>            [ Attr.style &quot;width&quot; &quot;100px&quot;<br>            , Attr.style &quot;height&quot; &quot;100px&quot;<br>            , Attr.style &quot;background-color&quot;<br>                (toColorCss<br>                    model.redValue<br>                    model.greenValue<br>                    model.blueValue<br>                )<br>            ]<br>            []<br>        ]</pre><pre>toColorCss red green blue =<br>    &quot;rgb(&quot;<br>        ++ String.fromInt red<br>        ++ &quot;,&quot;<br>        ++ String.fromInt green<br>        ++ &quot;,&quot;<br>        ++ String.fromInt blue<br>        ++ &quot;)&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/181/1*zpcplUWCEu-SZVFWRKTMuw.png" /><figcaption>Color sliders for each color channel</figcaption></figure><p><a href="https://ellie-app.com/3TgwYQ3pkLpa1">https://ellie-app.com/3TgwYQ3pkLpa1</a></p><p>We have constructed a <strong>color picker</strong> from 3 <strong>color sliders.</strong></p><h3>The Color Picker</h3><p>Next we create a colorPicker view that will reuse colorSlider and render the view we have right now.</p><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorPicker<br>            model.redValue<br>            model.greenValue<br>            model.blueValue<br>        ]</pre><pre>colorPicker : Int -&gt; Int -&gt; Int -&gt; Html.Html Msg<br>colorPicker redValue greenValue blueValue =<br>    Html.div []<br>        [ colorSlider &quot;Red&quot; redValue UpdateColorRed<br>        , colorSlider &quot;Green&quot; greenValue UpdateColorGreen<br>        , colorSlider &quot;Blue&quot; blueValue UpdateColorBlue<br>        , Html.div<br>            [ Attr.style &quot;width&quot; &quot;100px&quot;<br>            , Attr.style &quot;height&quot; &quot;100px&quot;<br>            , Attr.style &quot;background-color&quot;<br>                (toColorCss<br>                    model.redValue<br>                    model.greenValue<br>                    model.blueValue<br>                )<br>            ]<br>            []<br>        ]</pre><p><a href="https://ellie-app.com/3TgBpdyTPJpa1">https://ellie-app.com/3TgBpdyTPJpa1</a></p><p>Let’s improve a little by making our <strong>color</strong> <strong>picker</strong> to take a <strong>color</strong> as an argument and not 3 color channel values.</p><p>Since Elm 0.19 there is no Color (elm-lang/core#Color) module in the core library, but there is one in the Elm repository — the-sett/elm-color. Not to confuse it with avh4/elm-color which is very similar, but it gives us color channels only in Float (0.0-1.0) and we want them in Int (0-255). Let’s add it to our project:</p><pre>&gt; elm install the-sett/elm-color</pre><p>As a first step we will replace all the individual color values with Color.</p><pre><strong>import</strong> Color <strong>exposing</strong> (Color)</pre><pre><strong>type</strong> <strong>alias</strong> Model =<br>    { color : Color<br>    }</pre><pre>initialModel : Model<br>initialModel =<br>    { color = Color.rgb 50 200 100 }</pre><pre>update : Msg -&gt; Model -&gt; Model<br>update msg model =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb model.color<br>    <strong>in</strong><br>    case msg of<br>        UpdateColorRed newRedValue -&gt;<br>            { model | color = Color.rgb newRedValue green blue }</pre><pre>        UpdateColorGreen newGreenValue -&gt;<br>            { model | color = Color.rgb red newGreenValue blue }</pre><pre>        UpdateColorBlue newBlueValue -&gt;<br>            { model | color = Color.rgb red green newBlueValue }</pre><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorPicker model.color<br>        ]</pre><pre>colorPicker : Color -&gt; Html.Html Msg<br>colorPicker color =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>    Html.div []<br>        [ colorSlider &quot;Red&quot; red UpdateColorRed<br>        , colorSlider &quot;Green&quot; green UpdateColorGreen<br>        , colorSlider &quot;Blue&quot; blue UpdateColorBlue<br>        , Html.div<br>            [ Attr.style &quot;width&quot; &quot;100px&quot;<br>            , Attr.style &quot;height&quot; &quot;100px&quot;<br>            , Attr.style &quot;background-color&quot; (toColorCss color)<br>            ]<br>            []<br>        ]</pre><pre>toColorCss : Color -&gt; String<br>toColorCss color =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>    &quot;rgb(&quot;<br>        ++ String.fromInt red<br>        ++ &quot;,&quot;<br>        ++ String.fromInt green<br>        ++ &quot;,&quot;<br>        ++ String.fromInt blue<br>        ++ &quot;)&quot;</pre><p><a href="https://ellie-app.com/3TgG7CRZ4kCa1">https://ellie-app.com/3TgG7CRZ4kCa1</a></p><p>We use pattern matching to extract each color channel from a color record:</p><pre>{ red, green, blue } = Color.toRgb color</pre><p>Our colorPicker view is tightly coupled with our module — it uses UpdateColorRed, UpdateColorGreen and UpdateColorBlue messages (hence the return type is alsoHtml.Html Msg). We would like to make it generic.</p><p>At this point, when I was going over this with people at my work, we moved the <strong>color picker</strong> code to its own module, that had the triplet model, view and update.</p><p>It worked, but it made us need to:</p><ul><li>have Html.map ColorChange ColorPicker.ColorChange to map Msg from ColorPicker module to main module’s</li><li>call ColorPicker.update in main module’s update</li><li>call ColorPicker.view in main module’s view</li></ul><p>I am not going show the code for this step, instead we will skip to simplifying the <strong>color picker</strong> to be similar to the <strong>color slider</strong> view. It will take a toMsg function that will construct a message that will accept Color.</p><p>Lets update the Msg type and the update function:</p><pre><strong>type</strong> Msg<br>    = UpdateColor Color</pre><pre>update : Msg -&gt; Model -&gt; Model<br>update msg model =<br>    <strong>case</strong> msg <strong>of</strong><br>        UpdateColor newColor -&gt;<br>            { model | color = newColor }</pre><p>They look a lot simpler now.</p><p>For the colorPicker we’ll add (Color -&gt; msg) and change Msg to msg:</p><pre>colorPicker : Color -&gt; (Color -&gt; msg) -&gt; Html.Html msg<br>colorPicker color toMsg =</pre><p>And just as we used function composition to turn String to Int before, we will use the same technic in order to convert Int to Color:</p><pre>{- colorSlider -}<br>toMsg &lt;&lt; toInt colorValue</pre><pre>{- colorPicker -}<br>toMsg &lt;&lt; (\newRed -&gt; Color.rgb newRed green blue)</pre><p>The slider’s onInput will get a String value, which will be passed to toInt and become an Int, then the Int value will be passed to the inline function and be used in the construction of the new Color value, while the rest of the color channel values will remain unchanged.</p><p>For readability we can refactor inline functions to their own:</p><pre>redToColor : Color -&gt; Int -&gt; Color<br>redToColor color newRed =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>        Color.rgb newRed green blue</pre><pre>greenToColor : Color -&gt; Int -&gt; Color<br>greenToColor color newGreen =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>    Color.rgb red newGreen blue</pre><pre>blueToColor : Color -&gt; Int -&gt; Color<br>blueToColor color newBlue =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>    Color.rgb red green newBlue</pre><p>and use them like this:</p><pre>toMsg &lt;&lt; redToColor color</pre><p>Let’s also update the view function:</p><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorPicker model.color UpdateColor<br>        ]</pre><p>The complete colorPicker:</p><pre>colorPicker : Color -&gt; (Color -&gt; msg) -&gt; Html.Html msg<br>colorPicker color toMsg =<br>    <strong>let</strong><br>        { red, green, blue } =<br>            Color.toRgb color<br>    <strong>in</strong><br>    Html.div []<br>        [ colorSlider &quot;Red&quot; red (toMsg &lt;&lt; redToColour color)<br>        , colorSlider &quot;Green&quot; green (toMsg &lt;&lt; greenToColour color)<br>        , colorSlider &quot;Blue&quot; blue (toMsg &lt;&lt; blueToColour color)<br>        , Html.div<br>            [ Attr.style &quot;width&quot; &quot;100px&quot;<br>            , Attr.style &quot;height&quot; &quot;100px&quot;<br>            , Attr.style &quot;background-color&quot; (toColorCss color)<br>            ]<br>            []<br>        ]</pre><p><a href="https://ellie-app.com/3TgMGjx5Ddra1">https://ellie-app.com/3TgMGjx5Ddra1</a></p><p>We made colorPicker a generic view function, that can be used anywhere!</p><h3>Reuse</h3><p>We can put all that code in ColorPicker.Elm and expose only colorPicker.</p><pre><strong>module</strong> ColorPicker <strong>exposing</strong> (colorPicker)</pre><p>We can now easily reuse colorPicker in our module:</p><pre><strong>module</strong> Main <strong>exposing</strong> (..)</pre><pre><strong>import</strong> Browser<br><strong>import</strong> Html<br><strong>import</strong> ColorPicker <strong>exposing</strong> (colorPicker)</pre><pre><strong>type</strong> <strong>alias</strong> Model =<br>    { color1 : Color<br>    , color2 : Color<br>    }</pre><pre>initialModel : Model<br>initialModel =<br>    { color1 = Color.rgb 50 200 100<br>    , color2 = Color.rgb 255 255 255<br>    }</pre><pre><strong>type</strong> Msg<br>    = UpdateColor1 Color<br>    | UpdateColor2 Color</pre><pre>update : Msg -&gt; Model -&gt; Model<br>update msg model =<br>    <strong>case</strong> msg <strong>of</strong><br>        UpdateColor1 newColor1 -&gt;<br>            { model | color1 = newColor1 }</pre><pre>        UpdateColor2 newColor2 -&gt;<br>            { model | color2 = newColor2 }</pre><pre>view : Model -&gt; Html.Html Msg<br>view model =<br>    Html.div []<br>        [ colorPicker model.color1 UpdateColor1<br>        , Html.hr [] []<br>        , colorPicker model.color2 UpdateColor2<br>        ]</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/256/1*lF4duYit_BB0IEWaBUQc7w.png" /><figcaption>Color Picker reused in the main <strong>view</strong></figcaption></figure><p><a href="https://ellie-app.com/3TgPtZcpyK9a1">https://ellie-app.com/3TgPtZcpyK9a1</a></p><p>We added another colorPicker to our application with only a few changes!</p><p>As Joël has pointed out — we are passing the whole Color to our update function, although we might pass it only the relevant color channel. There is a discussion on Elm Discourse on this topic: <a href="https://discourse.elm-lang.org/t/message-types-carrying-new-state">https://discourse.elm-lang.org/t/message-types-carrying-new-state</a>. I chose to pass the whole Color, since our <strong>color picker</strong> will be reused and it simper to have it handle the whole thing instead of a specific color channel, but you may prefer the other way.</p><h3>Summary</h3><p>We saw that reusing view functions in Elm, regardless of how nested they are, is pretty straightforward. This is possible because everything in Elm is… a function, including Msg.</p><p>There are cases where it is appropriate to have full blown module with model, view and update, but it is often preferable to have composable view functions that can take state and message constructors as their arguments.</p><p>I hope this was useful for you.</p><h3>Thank Yous</h3><p>Special thanks to Joël Quenneville for helping me with this writing.</p><p>Thanks to Pawan Poudel for the amazing <a href="https://elmprogramming.com/">https://elmprogramming.com/</a>.</p><p>Thanks to Evan Czaplicki for giving us Elm.</p><p>And thank you for reading!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1531b9abaf3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>