Innhold om Funksjonell
Totalt 52 innlegg
Side 3 av 4
Using the Try Monad for exception handling in GraphQL-java
Functional Data Validation
Functors - What are they?
A functor might sound very strange and esoteric but chances are you have used it in some ways. Some of you probably a lot! In this article we will look at what they are and some reasons they are useful.
A functor might sound very strange and esoteric but chances are you have used it in some ways. Some of you probably a lot! In this article we will look at what they are and some reasons they are useful.
On combining stuff
In this article we will take a small peak into the general concept of combining things with other things. We all know about and how to use the plus operator from everyday math and programming. So why do I want to write it? There is in fact a generalization of the concept that is pretty neat that I hope you also will find useful. It can be a door opener for understanding the behaviour you get from algebraic laws. First things first, what are we actually talking about? Let us take a look at a few different operations on text and numbers.
In this article we will take a small peak into the general concept of combining things with other things. We all know about and how to use the plus operator from everyday math and programming. So why do I want to write it? There is in fact a generalization of the concept that is pretty neat that I hope you also will find useful. It can be a door opener for understanding the behaviour you get from algebraic laws. First things first, what are we actually talking about? Let us take a look at a few different operations on text and numbers.
That one time I thought I understood recursion
A short tale about my struggle to comprehend why C# isn't a functional language.
A short tale about my struggle to comprehend why C# isn't a functional language.
Visualize bike rental data in Clojure
Referential transparency - Or how I learned to stop worrying and love the effects
Map and bind - A hidden functional concept in C#
In this post, I'll show that C# implements the functional concepts map and bind. I'll further show that these are useful for other contexts than just collections with an example implementation for Task<T>. We'll then clean up a process by using map and bind to compose a new process of several smaller processes. Hopefully this will show that functional concepts both exists and are useful even in non-functional languages.
In this post, I'll show that C# implements the functional concepts map and bind. I'll further show that these are useful for other contexts than just collections with an example implementation for Task<T>. We'll then clean up a process by using map and bind to compose a new process of several smaller processes. Hopefully this will show that functional concepts both exists and are useful even in non-functional languages.
Kleisli composition and other fishy operators
In this article I would like to introduce you to two common composition operators and explain some of their utility, using first a made up example, and then an example from the real world. These operators are all about composing functions of slightly weird types. For while regular function composition combines functions of types a -> b and b -> c, these guys concern themselves with combining functions of types which don't naturally fit perfectly together.
In this article I would like to introduce you to two common composition operators and explain some of their utility, using first a made up example, and then an example from the real world. These operators are all about composing functions of slightly weird types. For while regular function composition combines functions of types a -> b and b -> c, these guys concern themselves with combining functions of types which don't naturally fit perfectly together.
Functional Generative Art Using ClojureScript
This post explores how you can create your own generative art in the web browser using functional programming in the ClojureScript programming language.
This post explores how you can create your own generative art in the web browser using functional programming in the ClojureScript programming language.
Tail recursion
Tail recursion is a special way of writing recursive functions such that a compiler can optimize the recursion away and implement the algorithm as a loop instead. This is not because loops are inherently faster, but because every function call generally incurs the cost of a new stack frame in which it executes, sometimes leading to the dreaded stack overflow - where the beloved site of the same name, gets its name. Let's investigate how this works.
Tail recursion is a special way of writing recursive functions such that a compiler can optimize the recursion away and implement the algorithm as a loop instead. This is not because loops are inherently faster, but because every function call generally incurs the cost of a new stack frame in which it executes, sometimes leading to the dreaded stack overflow - where the beloved site of the same name, gets its name. Let's investigate how this works.