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.
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 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.
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…