Hopp til hovedinnhold

Innhold om Elm

Totalt 26 innlegg

Side 1 av 2

Mapping more than lists

Elm, Funksjonell
Artikkel (4 min)
Fra Eivind Dagsland Halderaker

Using the function map to change the elements of a list has become a common pattern in modern programming languages. It is often used in Elm and map is also used in Elm for the Maybe and Result types.

Fixing a performance problem in Elm using Html.Lazy

Elm
Artikkel (9 min)
Fra Robin Heggelund Hansen

How you can increase the performance of your Elm application using Html.Lazy, and why that motivated me to look into elm-css.

Log Off and Read Some Docs

Elm
Artikkel (2 min)
Fra Aksel Wester

Wow! It's Christmas Eve, and elm.christmas is drawing to a close. We've published 24 articles, and I want to thank you for visiting our advent calendar, regardless of whether you've read all 24 articles, or if this is the first one you've read. This last article won't be long, as I just want to highlight a neat tool that you might not have used for your Elm project.

When it comes to ports, three's a crowd.

Elm
Artikkel (4 min)
Fra Robin Heggelund Hansen

Now that you've learned how to define both incomming and outgoing ports, you might wonder how many of them you need. It might seem reasonable to require two ports for each javascript function you wish to call, but what if I told you'll need, at most, two for the entire application?

Outbound ports

Elm
Artikkel (2 min)
Fra Anonym

In yesterday's post, we learned about inbound ports in Elm. Today, instead of receiving a message, we want to send a message from our Elm application to the outside world that is JavaScript.

Inbound ports

Elm
Artikkel (3 min)
Fra Anonym

What if your elm program needs to communicate with the JavaScript enclosing your application? Maybe you need some kind of messages flowing into the elm lifecycle and need to act on such events? To receive messages from JavaScript we can make use of inbound ports🌈

Remote Data

Elm
Artikkel (7 min)
Fra Aksel Wester

Let's talk about TEA - The Elm Architecture!

Elm
Artikkel (5 min)
Fra Anonym

Elm and other functional programming languages might look weird and scary to newcomers. Once you get to know them, however, functional languages becomes very clear and satisfying to work with Let's look at the MVU - Model, View, Update - architecture. The architecture is also known as TEA - The Elm Architecture - but is useful in other languages as well

The Builder Pattern

Elm
Artikkel (5 min)
Fra Aksel Wester

Elm doesn't have a concept of required and optional arguments. Every function takes all the arguments they specify, no more, no less. But sometimes we want to be able to specify only some arguments to a function, and use default values for the rest. The builder pattern is one solution to that challenge.

Greater type safety with opaque types!

Elm
Artikkel (4 min)
Fra Vetle Bu Solgård

It may become tedious to always check if a value in your records is on the supposed format. To be absolutely certain that a value correctly represents a property in your records, we can use opaque types!

A Bunch of Nothing

Elm
Artikkel (3 min)
Fra Gaute Berge

One of the great advantages of Elm is its strong runtime guarantees, and one important technique it uses to achieve this is using data types such as Maybe and Result to handle errors, instead of having values like null or undefined in the language. These structures are very nice to work with, but if you don't know the tools at your disposal, they can be tricky.

Reducing boilerplate code in Elm with Maybe.andThen

Elm
Artikkel (3 min)
Fra Simen Fonnes

Working with the Maybe type in Elm may result in excessive pattern matching because Elm forces us to handle all possible outcomes. In this article, we investigate how the Maybe.andThen function can be used to improve readability by reducing unnecessary pattern matching and boilerplate code.

Combining Maybes in Elm

Elm
Artikkel (3 min)
Fra Fredrik Løberg

Have you ever needed to combine different Maybe-values to produce another value? In this article, we explore just that.

What do we do with what's inside the box?

Elm
Artikkel (3 min)
Fra Robin Heggelund Hansen

Elm doesn't have nulls or undefineds, it has a Maybe type. While it's a pleasent type to work with, it might take some getting used to if you're coming from a language like Java or Python. Let's take a look at how we perform some basic operations over the Maybe type.

Operators are functions, too

Elm
Artikkel (3 min)
Fra Robin Heggelund Hansen

Much of Elm's power stems from the fact that most things are just functions. So how do operators fit in?