Tagged: programming

Drawing Triangles in Elm (Beginner)
Hey, let’s draw some triangles! If you’ve been following my last two posts on mouse chasing and drawing rays using Elm, this post will be a simple extension. If you haven’t already read those posts, I encourage you to start from the beginning, because we’ll be making iterative updates to practice getting our hands dirty with Elm.
Once again, this is targeted at newcomers to Elm, so we won’t be covering any advanced topics. If you want to see a quick demo, follow this link and start clicking around!

Drawing Rays in Elm (Beginners)
In my last post, I showed how you can generate a simple mouse-chasing effect with Elm. That was an accidental side-effect for my true purpose: To demonstrate how to draw triangles in Elm. This post will continue along that journey, demonstrating how to generate rays from a fixed point out to the current mouse location using the standard Elm Architecture.
I won’t be introducing any new concepts here; I’ll simply be layering on a little bit more complexity on top of what we’ve learned in the previous posts.
Continue reading

Mouse Chasing in Elm (Beginners)
Continuing upon my last post, I’ll be showing how basic Signal functionality can be used to update a data model in Elm.
Signals are a non-obvious concept to grasp at first glance. The Reactivity guide contains good in-depth instruction about how Signals work, but spending a little time playing with them can really help grasp how they work.
We’ll walk through a simple example to generate a snake-line line that follows the mouse. To see what we’re going to build, you can open up the demo here. (Note that this only works with a mouse, not with touch events. Exercise: Extend this example to support touch events using Elm’s Touch module.)
Let’s explore!

Composing Styles in Elm (Beginners)
I’ve recently started learning Elm and I’ve been excited to find this to be a very powerful language. I thought I’d share some tips as I learn. This post will be about structuring Elm-defined CSS styles in a way that they can be easily composed together.
My target audience for this post is users new to Elm. If you’re already familiar with Elm or Haskell, this will be pretty trivial, but if you’re new to functional programming, the syntax may confuse you!
To see what we’re going to build, you can open up the demo here.
Actions, Objects, and Context
Nouns
Nouns describe things: objects.
- The noun itself carries some description of the thing: “rabbit”
- That description can be extended through adjectives: “dark rabbit”
Nouns have a limited context. They give you a concept of a thing at a particular snapshot in time. Without more context, they are limited.
Think of full sentences:
- car
- What does this mean? It doesn’t convey much information without more context.
- If you Google “car”, you get a lot of very broad results – but does it help you solve your problem?
- move car
- Full context, assuming a car can move. Grammatically limited, but gives a broader idea.
- You can Google “move car” and it gives very specific, contextually useful results.

When Worlds Collide: How Writing Fiction Intersects with Writing Code
I’ve recently become a big fan of author Trevor Schmidt’s science fiction novels. They’re pacing is perfect and the characters are wonderfully engaging. Despite his latest book being set in a truly alien environment, his writing is so immersive that you don’t even notice it. Trevor recently posted a guide to world-building for authors. As I read through his recommendations, I found a lot of his suggestions also apply to programming.
Zippers: Not Just for Pants Anymore!
Real-World Problems
We’ll walk through some real-world problems, then introduce a little-known data structure that helps us solve all of them. This concept is often utilized in Haskell and Clojure, but don’t worry if you don’t know these languages. You won’t see any Haskell here.

Intro to Haskell’s conduit library (Conduit 101)
Haskell’s conduit
library provides some deep capabilities for building transformative workflows, while providing many useful guarantees (such as constant memory usage – something that often bites Haskell developers). In this post, I’ll walk you through some simple examples of using conduit
to transform text, but also demonstrate some useful variations on input and output.
Building APIs, Part 1: Halting-Driven Development
Far too often, we developers go to solve a problem and find ourselves in the mindless drudgery of writing boilerplate. Often, this boilerplate can distract us from the bigger picture of what we’re trying to accomplish.
This is a blog-ized version of a talk I gave recently. The talk was an interactive experience which doesn’t translate directly to text, but I’ll attempt to convey the same concepts.
If I fail, just remember: It’s December! Go play in the snow!
You must be logged in to post a comment.