Innhold om Funksjonell
Totalt 52 innlegg
Side 4 av 4
Iteration without for, foreach or while
Iteration is part of the bread and butter of any programming language, and this is the case in functional programming just as much as in imperative programming, but how is it possible to iterate without for, foreach or while?
Iteration is part of the bread and butter of any programming language, and this is the case in functional programming just as much as in imperative programming, but how is it possible to iterate without for, foreach or while?
The Lens Pattern in TypeScript
An overview of the monad
In this article I will give a brief overview of what a monad is. Later articles in this series will use monadic features in different programming examples, therefore I thought it would be a good idea to first give an overview of what a monad is. I will use metaphors to explain the concept, and I will not give any code examples in this article.
In this article I will give a brief overview of what a monad is. Later articles in this series will use monadic features in different programming examples, therefore I thought it would be a good idea to first give an overview of what a monad is. I will use metaphors to explain the concept, and I will not give any code examples in this article.
Minesweeper in Elm
Immutable by default
You should always strive to make, and make use of, immutable data structures. Even if your domain is inherently mutable (like most domains, really), there are quite a few pitfalls that can give you headaches later on if you also use mutable data structures. Many of them are avoidable simply by making it harder to accidentally modify data.
You should always strive to make, and make use of, immutable data structures. Even if your domain is inherently mutable (like most domains, really), there are quite a few pitfalls that can give you headaches later on if you also use mutable data structures. Many of them are avoidable simply by making it harder to accidentally modify data.
The F of FP
Architecture in Functional Programming (FP) and Object Oriented Programming (OOP) is very different. While the class is the main abstraction in OOP, the function is the abstraction in FP. Looking over the fence, it seems impossible to solve problems using the other paradigm. In order to learn how to design program with functions, we must first learn how they work in FP as a function is not the same as a method.
Architecture in Functional Programming (FP) and Object Oriented Programming (OOP) is very different. While the class is the main abstraction in OOP, the function is the abstraction in FP. Looking over the fence, it seems impossible to solve problems using the other paradigm. In order to learn how to design program with functions, we must first learn how they work in FP as a function is not the same as a method.