Innhold om Elm
Totalt 26 innlegg
Side 2 av 2
Lord of the pipes
If the bulk of your programming experience comes from C-like languages, there’s a chance you find pipes, |>and <| some of the most distinct features of Elm. Roll up your sleeves, it's time to master the art of piping.
If the bulk of your programming experience comes from C-like languages, there’s a chance you find pipes, |>and <| some of the most distinct features of Elm. Roll up your sleeves, it's time to master the art of piping.
Partial application of functions!
Currying (👈 which you read about in yesterday's post) enables partial application, which lets us split up functions into small logical building blocks which are easier to both read and work with.
Currying (👈 which you read about in yesterday's post) enables partial application, which lets us split up functions into small logical building blocks which are easier to both read and work with.
Hurry, curry!
Today we'll look at an interesting property of Elm known as currying. We will only explain the principle today, then spend the next two days seeing how it can be useful in practise.
Today we'll look at an interesting property of Elm known as currying. We will only explain the principle today, then spend the next two days seeing how it can be useful in practise.
Peeking Inside Lists
Working with lists in Elm is nice, but getting a sense of what’s inside a list can be tricky. In this article we will look at a techinque that allows us to get access to the elements inside a list.
Working with lists in Elm is nice, but getting a sense of what’s inside a list can be tricky. In this article we will look at a techinque that allows us to get access to the elements inside a list.
Simplify your code with ad hoc tuples
With Elm's strong types, we must be precise when writing our business code. Precision is a good thing, but it often has the drawback of being verbose. Ad hoc tuples can save the day with clear and precise syntax!
With Elm's strong types, we must be precise when writing our business code. Precision is a good thing, but it often has the drawback of being verbose. Ad hoc tuples can save the day with clear and precise syntax!
Climbing trees
Custom types are powerful data structures that might seem somewhat complicated to work with, at least if they are nested. Let's take a look at how we can deal with nested custom types in a simple way! 🍊
Custom types are powerful data structures that might seem somewhat complicated to work with, at least if they are nested. Let's take a look at how we can deal with nested custom types in a simple way! 🍊
Letting functions in
The power of let expressions
In the previous christmas articles we have seen how to destructure tuples, records, and single-value custom types in the function arguments. Today we take a look at how to destructure values in let expressions, along with some of the use-cases where I find this the most helpful.
In the previous christmas articles we have seen how to destructure tuples, records, and single-value custom types in the function arguments. Today we take a look at how to destructure values in let expressions, along with some of the use-cases where I find this the most helpful.
Single-Constructor Custom Types
Unpacking Records
Records in Elm are quite like JavaScript objects. In ES6, destructuring objects can produce compact and concise code. This article explores some techniques that Elm offers to the same effect.
Records in Elm are quite like JavaScript objects. In ES6, destructuring objects can produce compact and concise code. This article explores some techniques that Elm offers to the same effect.
Once, twice, three times a value
Welcome to the Elm christmas calendar, and to the first of 24 articles that will teach you some tricks and useful concepts you might not already know. Today we are discussing Tuples. It is perhaps Elm's simplest way of structuring data. We also introduce a concept recurring across several days; pattern matching, or destructuring. The first use-case is pattern matching of tuples in function declarations.
Welcome to the Elm christmas calendar, and to the first of 24 articles that will teach you some tricks and useful concepts you might not already know. Today we are discussing Tuples. It is perhaps Elm's simplest way of structuring data. We also introduce a concept recurring across several days; pattern matching, or destructuring. The first use-case is pattern matching of tuples in function declarations.