Posted by dennisreimann on Thu, 11/17/2016 - 13:00

Some very good and useful plugins that will enhance your Elm editing in Atom.

Posted by dennisreimann on Mon, 11/14/2016 - 12:00

A list of tools and resources I found valuable when working with Elm. It contains useful tools that will help in your day to day work and links to learn Elm as well as to deepen your knowledge.

Posted by Brian Hicks on Mon, 11/14/2016 - 06:30

Today we’re starting a series on building functional data structures using Elm.
The goal: build a native set implementation from first principles.
We’re going to reimplement the standard library’s Set API.
This is going to be a toy implementation, so we won’t optimize as much as we could, but we’ll be able to learn some new things!

Posted by Gizra on Wed, 11/09/2016 - 00:00

Elm, like any rising open source project, is getting both positive endorsements and negative critiques. Reading the good ones, is always fun; but the negative ones are just as important.

Today, I came across this: Elm Is Wrong, and realized that I’ve always read the good and bad critiques from a technical point of view, but I have yet to read about what it means from a business perspective.

I can assure you it’s a different perspective. One that is about dollars and the cost of bugs - not about “type classes” or “higher kinded types.”

Continue reading…

Posted by dennisreimann on Mon, 11/07/2016 - 16:00

As Elm is a statically typed language, everything has a type. Type annotations are an optional feature and the compiler can infer the types of your functions and value. Even though you do not have to write the type annotations yourself you probably should: They document your code and make it more explicit.

Posted by dennisreimann on Wed, 11/02/2016 - 13:00

Opposed to JavaScript and many other programming languages, Elm does not have the concept of undefined or null values. Of course there are cases in which variables contain nothing or functions cannot return a proper value – but instead of leaving it up to you whether or not to handle these cases, Elm makes them explicit with a type called Maybe and enforces the handling thereof.

Posted by Brian Hicks on Mon, 10/31/2016 - 07:00

You’re hacking along on your JSON decoder. Life is rosy, the birds are singing,
the sun is shining, but then… you get an email: JSON Schema change.

(lightning cracks, a vampire cackles in the distance)

So how do you deal with that? You’re not just gonna give up, but your data model
is already pretty set. Are you going to have to change everything?

Posted by Brian Hicks on Mon, 10/31/2016 - 07:00

 A Halloween Horror Story
You’re hacking along on your JSON decoder. Life is rosy, the birds are singing,
the sun is shining, but then… you get an email: JSON Schema change.

(lightning cracks, a vampire cackles in the distance)

So how do you deal with that? You’re not just gonna give up, but your data model
is already pretty set. Are you going to have to change everything?

Continue Reading

Posted by Brian Hicks on Mon, 10/24/2016 - 17:00

Last week Murphy Randle had me on Elm Town as a guest to talk about JSON.
We walked through the Elm JSON.Decode documentation, and talked about hairy things we’d run into.
If you want a good overview of the landscape for the JSON.Decode API, give it a listen.

Posted by Brian Hicks on Mon, 10/24/2016 - 17:00

JSON Street in Elm Town
Last week Murphy Randle had me on Elm Town as a guest to talk about JSON.
We walked through the Elm JSON.Decode documentation, and talked about hairy things we’d run into.
If you want a good overview of the landscape for the JSON.Decode API, give it a listen.

Continue Reading

Posted by Brian Hicks on Mon, 10/17/2016 - 17:00

First-time Elm users have a hard time learning how to compose decoders.
People tend to get stuck on what they all mean, but it’s not too hard: just think of them like LEGO.

Posted by Brian Hicks on Mon, 10/10/2016 - 17:00

A recurring theme in the Elm community (and this blog) is that JSON is kind of
difficult to get started with. This makes sense, since it’s all about dealing
with data that other people provide for us. It’s hard to debug what’s happening
with JSON decoders since they’re often used in HTTP response decoders. So today
we’re going to talk about some general advice: how do you even debug JSON?

Posted by Brian Hicks on Mon, 10/03/2016 - 17:00

Sometimes JSON just doesn’t play nice with our nice type systems. Consuming JSON
from a wide variety of sources can be challenging. Even when working with an
internal team you can be dealing with strange encodings. One common pattern is a
JSON object with dynamic keys. How we deal with this depends on the semantics of
the data, but it breaks down into two distinct patterns.

Posted by Brian Hicks on Mon, 09/26/2016 - 17:00

Richard Feldman spoke two weeks ago at the first elm-conf. (it went quite well,
thank you for asking!) He pointed out something as a code smell that’s been
bothering me for a while. I want to emphasize it, so go ahead and watch the
recording and then we’ll talk about it. It’s only 25 minutes and well worth your
time:

Posted by Gizra on Sat, 09/24/2016 - 00:00

Baseball, Apple Pie, and Web Frameworks
I like baseball better than football (the American version). Football is a game of inches – but it’s measured in yards. Imprecise scope is built into the system. Baseball, on the other hand, is a game of wildly random occurrences that are often measured to the third decimal place. An entire framework exists to understand the smallest, yet important, details of the game.

What I like about baseball is what I like about the current state of web applications. There is a growing set of frameworks that allow you to “scratch your own itch” and be precise about your scope in ways that you never could before. I really like going to web conferences, and seeing things like Drupal being used as a backend to serve content to some other front-end framework (enter your favorite: Angular, React, Ember) that can bend, shape, and re-present that content in ways that Drupal never imagined.

And as a web development agency that focuses on complex content management, that has huge – and really exciting – implications for how we do business.

What’s a Major Corporation To Do?
Take for example a conversation that started with someone that does training and assessment at a Fortune 50 corporation – one that trains a lot of employees. At some point she asked me “Do you guys do inbox simulations?” I had to think for a second if I even knew what inbox simulation was - and it turns out, it’s exactly what it sounds like: a simulated email inbox to test and assess an employee’s response and prioritization skills.

My first response was “No,” and my second – almost immediate – followup was, “but I don’t see why we couldn’t.”

The problem they had was that none of the software they had tried was giving them precisely what they needed. And that’s not surprising. There are more than 500 Learning Management Systems on the market, each with it’s own bloated feature set trying to solve specific use cases with general tools. It’s also not surprising that fewer than 25% of corporate LMS users are “very satisfied” with their system. Given the large features sets and the likely time it took to get them to market, most of them are probably built on technology that’s already five years old.

Enter Proof of Concept
That conversation led to a “show us what you can do” meeting. This was a problem because, well, we had never done it before. My five-or-six-years-ago brain said to myself, “We can’t possibly create a demo of an inbox simulation – I’ll just put together a slide deck that explains what I’m talking about here with web frameworks.”

That’s when Amitai said, “Let’s create an inbox simulation for your meeting – we can do it in Elm. Open a repo and I’ll show you how. What should it have?”

I answered (dubiously), “Well, it should look and feel like an Outlook inbox, and we should be able to demonstrate that their training logic can be applied to simple email tasks.”

“You mean like if you respond one way, you get a certain response back.”

“Yeah, something like that.”

The Scaffolding of an Inbox
So I opened a repository for the project, which at Gizra starts with a stack that includes a location to create static prototype pages served by Jekyll and is automatically updated and published by Gulp. The Semantic UI CSS framework is included so that we get all the goodies that come with it and don’t need to recreate the wheel on design elements (we recently switched from Bootstrap, and I already like it a lot better, if not just because our prototypes don’t look like every Bootstrap website ever).

In a perfect world, I wanted three things:

  1. An inbox that looked realistic.
  2. A dashboard that reflected activity in the inbox.
  3. An admin screen that allowed manipulation of the inbox content.

I started with the admin screen, because that seemed the least daunting.

I am a terrible sketch artist, and I often don't carry paper. This was sketched on a napkin from a coffee shop.

Once I had the idea, I moved quickly into the static prototype, because my CSS skills dramatically outweigh my drawing skills.

That's a little better.

The next step was the inbox itself, and because I wanted it to look like Outlook, we figured we could try to grab the HTML, CSS and JS from an Outlook Online account that I had created for this purpose.

What a ridiculous mess that was.

Thirty minutes into that task, I realized it would be easier to recreate the inbox from scratch. Semantic UI made it pretty easy.The Font Awesome icons already there, and the fact that it’s flexbox friendly, meant that I had a pretty good static version up in about 4 hours (it could have been faster, but it was my first time really using Semantic UI, and I was trying to follow strict BEM principles, which we also recently started at Gizra).

Starting to look like the real thing.

And with that, I made a pull request, and went to bed.

Making it dynamic with Elm
The next day, some strange miracle had occurred.

Amitai had created a basic Elm app, converted my HTML markup to Elm, and created a basic model for a functioning app. I had heard Amitai speak and have read about how Elm’s compiler, which catches runtime errors, makes development so much faster, but seeing it in action was pretty amazing. Our conversation on Github:

The Elm is strong with this one.

Creating that dashboard referenced in the conversation was fairly easy too. Semantic UI has a lot of nice looking tables and classes to vary the look enough to get a lot of different options. I found one I liked, filled it with enough dummy data to give it the feel of a real dashboard, and we were all set.

In the meantime, Amitai created a nifty little delayed response function. If you choose a particular response (in this case, some version of “ignore”), you get a followup email demanding your attention.

Don't ignore my emails!

We spent the next day or two refining features, polishing the layout, and replacing the dummy text.

Of course, I needed to add a few tweaks to the layout, and add sample emails that were more realistic, and some logic that made sense. To do that I had to get into Elm and figure out how it works - in particular how to make it present the HTML syntax I needed. It turns out that was pretty logical and straightforward. I’ve barely scratched the surface, but I’m pretty pleased to have my first few commits on an Elm project.

The Result
You can look at the Github repository and try out the sample application, but the final product is a simple response to a complex need. We got there in several days by breaking down a complex problem into small surmountable tasks - a method we call The Gizra Way. In this case, we ignored all other features, even how to permanently store the data – just a simple single page application that shows a realistic inbox with a few features. I never got my admin screen - there wasn’t enough time, and there’s other stuff to do.

We are, of course, helped enormously by a robust set of web frameworks that are helping us do web tasks, faster, with greater flexibility, and with a preciseness like never before.

Continue reading…