Ever needed to have a dropdown on a form? Or on a configuration page? Maybe multiple dropdowns for different ends with different types? elm-ui is great, but it doesn’t offer a primitive for dropdowns. In this guide, you’ll build a reusable dropdown and, along the way, you’ll learn about parameterized types.

We’ll build on top of work done in the part I, but if you’re familiar with Elm, you should have no trouble jumping right in. The complete code from part I is available in this Github repository.

In part I we built this:

The way we did it, we…

If you’re getting into Elm and still handling CSS files, just thrash them. Really. Go ahead and do it, because in Elm, we have the beautiful Elm-UI. You’ll get to write design in a language that’s actually understandable. However, Elm-UI probably still doesn’t have everything you might need. One simple thing it doesn’t have builtin is a dropdown, something you see everywhere.

Follow along and learn how to build a barebones dropdown with Elm and elm-ui. In part II, we’ll make a parameterized version using Elm’s powerful types. More specifically, you’ll master parameterized types!

If you regularly work with remote, screenless machines, you probably regularly work with SSH too. SSH is great to access a machine, but what if it sits behind a router or firewall and you can’t change the rules? That’s what this is article is about: reverse tunnels!

The typical SSH connection

The simplest scenario is a direct connection between host A and B. Let’s say A wants to SSH into B. You simply type ssh username@B in a terminal in host A.

Simple enough. This is just a normal SSH connection. Let’s get into tunnels.

The forward tunnel

You use tunnels when you want to forward connections…

You do it like this:

unique : List a -> List a
unique l =
incUnique : a -> List a -> List a
intUnique elem lst =
case List.member elem lst of
True -> lst
False -> elem :: lst
List.foldr incUnique [] l

There you go. Have fun!

Oh, still here? Let’s see what this is doing then.

So, you have a list in Elm and you want to get the unique values in it. And there is no way to write a simple imperative loop to iterate over the list. List.fold to the rescue. We…

Diogo Silva

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store