Tagged “monad”
-
Idris FizzBuzz Part II: Maybes, Infix Notation, and Idris Holes
idris monadLet's conntinue on our journey of writing FizzBuzz in the Idris programming language. If you haven't already, I encourage you to read Part I for an introduction to the problem as well as some basic syntax, and, importantly, information on totality checking.
-
Idris FizzBuzz Part I: Monads, Comments, and
idris monad totalityassert_smaller
My journey of learning the Idris programming language continues! This article will start a tutorial series detailing how to write FizzBuzz in Idris. As before, my goal is to write without the assumption that all Idris learners already know Haskell. We will start by implementing
modulo
in Idris, and toward that goal we will go painfully slow because frankly this stuff is hard.
-
Parsing JSON in ReScript Part III: Getting to the Point
bucklescript rescript reasonml monadAfter having established some requirements and some basic utilities, we're ready for the fun part: putting the pieces together. At the end of this post, we will have our working parser.
-
Parsing JSON in ReScript Part II: Building Blocks
bucklescript rescript reasonml monadThis is the second in a series of articles on how to build one's own, general-purpose parsing library. After having established a few expectations in the previous post, we are ready to begin building our utilities for our library. Let's start with some highly generalized utilities for functional programming.
-
Parsing JSON in ReScript Part I: Prerequisites and Requirements
bucklescript monad rescript reasonmlThere are few things more satisfying than a slick, readable, and safe JSON parser. It's one of the joys of functional programming. Using a good JSON parsing pipeline can feel like magic. This series seeks to lift the veil and empower readers (and, importantly, my future self) to build their own customizable and extensible parsing libraries. This article, the first of several, will be a skimmable introduction to the subject as I see it.
-
Safer Data Parsing with Try Monads
csharp monadI have written previously on maybe monads and how to use them with lists to eliminate the possibility of null references in an object-oriented programming language. This standalone post walks through how to use a more generalized kind of monad to prevent all other kinds of unhandled exceptions, using data parsing exceptions as an example.
-
Error-Free C# Part II: Functional Data Processing
csharp monadMutability bugs and thread-unsafety are big problems in data processing. Fortunately, the .NET Framework has strong support for immutable collections, eliminating entire categories of bugs. This post will show how to use extension methods to create even safer ways to interact with with lists in C# by building on the IMaybe monad type we created in the previous post in this series.
-
Error-Free C# Part I: The Maybe Monad
csharp monadMost people would probably be surprised to find that I consider myself both a professional C# developer and a professional functional programmer. C# is mainly an object-oriented language. The syntax isn't optimized for functional programming. This is entirely true, but just because Microsoft is behind the curve in supporting the new best practices in programming doesn't mean I have to be. This series will walk through how to build and use C# code that is guaranteed to run without any runtime errors.
-
Dynamic Options and Optional Parameters in ReasonML
bucklescript monad reasonmlThe next type I want to bind from the JavaScript ServiceWorker API is Cache. At first glance,
Cache
doesn't have any dependencies on any JavaScript interfaces we don't already have access to, but its methods do use dynamic JavaScriptoptions
parameters, and the way we deal with this in typed languages is to name and create new specialized types. In this post, I will implement types for theseoptions
and the functions that use them.
See all tags.