Contents tagged with Functional Programming
-
Introduction to the Reactive Extensions for JavaScript – MooTools Integration
In the previous post, I covered a bit about how we’ve integrated the Dojo Toolkit into the Reactive Extensions for JavaScript (RxJS) where we can leverage Dojo’s eventing and AJAX programming model. Following onto that post, I wanted to move onto a different framework and show how we integrated it into RxJS. This time, it’s MooTools up to the plate.
-
Introduction to the Reactive Extensions for JavaScript – Wrapping the Dojo API
Recently in some of the comments I’ve received (keep them coming BTW), I get questions about taking existing APIs and moving them towards using the Reactive Extensions for JavaScript (RxJS). How can we get away from constant callback hell and move towards composable asynchronous and event-based blocks instead? In this post, I’m going to walk through how we wrapped the Dojo Toolkit APIs to provide both event handling and AJAX functionality.
-
A Kick in the Monads – Writer Edition
In the past couple of Monads posts, we’ve talked briefly about the State and Reader Monads and their potential uses and misuses. Before this series completes, I have a few more to cover including the Writer, Continuation and eventually Observable monad. Today, we’ll get started looking at the Writer Monad and what it can do for us.
-
A Kick in the Monads – Creating Extended Builders Part III
So far in this series, we’ve covered some of the methods you can implement for custom computation expressions (aka Monads) in F# such as bind and return, as well as exception and resource management. For the last part in the series, we’ll take a look at looping constructs. As we know, F# is a pragmatic multi-paradigm language which supports not only functional features, but imperative ones as well, which include mutability, looping constructs and so on. Just as regular F# supports for and while loops, we have the ability to take advantage of them as well inside of our computation expressions by implementing two methods. Let’s start with the while loop.
-
Much Ado About Monads – Creating Extended Builders Part II
In this series, we’ve looked custom computation expressions, what they are, how they are applicable to development and how we might implement them in F#. In the previous post, we went over some of the basic methods you can include on your custom computation expression to allow for a more rich programmatic model than the linear style provided via both Bind and Return.
-
Much Ado About Monads – Creating Extended Builders
In the past two posts in this series, we’ve covered both the State Monad and Reader Monad, not only the motivations, but how you would implement them in F#. With defining the Return and Bind methods on our computation expression builders, we’re able to do composable linear programming. But, what we lack is an imperative programming model on top to allow for such things as if statements, for and while loops, and try/catch or try/finally blocks. Luckily, there is a programmatic model to follow to make these things possible inside of our expressions. Let’s cover each of these functions in turn and see what each one does and in the process implement them for the Reader Monad.
-
[ANN] DC ALT.NET – 1/27/2010 - Clojure
The next meeting of DC ALT.NET will be held on January 27th from 7-9PM on Clojure with Craig Andera. Previously, he gave a talk about spending some time in Common Lisp and some of the lessons learned during his adventures. You may have noticed a lot of talk around this language, especially in the Java community. Where trends are concerned, momentum has shifted from Groovy to Scala and now to Clojure just in terms of sheer interest. It’s one that’s on the top of my list to dive deep into this year. So, what is it and what should we care?
-
Much Ado About Monads – Reader Edition
In the previous post, we talked a bit about the State Monad, what it is and how you could use it today in your F# application. But, with any new piece of information such as this, it should be taken in context, and there are other patterns as well when dealing with a multi-paradigm language such as F#. We also talked about how the State Monad might not have been the best choice for modeling our web scripting DSL as our browser state is encapsulated in the Browser class, and once it is set, it doesn’t change. With that, we could turn our eyes to using the Reader Monad as we read from our environment.
-
Much Ado About Monads – State Edition
Over the past year, I’ve had the opportunity to be a technical reviewer of a number of books including Chris Smith’s Programming F# book. During my recent trips, I had the chance to sit down and read through the book once again, and in particular Chapter 10 on Computation Expressions (aka Monads). A section worth noting in here is the use of the State Monad in order to create a library for web scripting. In the past, I’ve had a series on Much Ado About Monads where I look at the basic Monads such as Maybe and List, but this time, let’s look at what we can do with the State Monad.
-
Going Hybrid - Implementing a Shopping Cart in F#
One persistent question that keeps coming up to me is how to merge functional programming techniques with object oriented techniques that many are used to. My usual reply is to talk about how functional programming affects your code, programming in the big, programming in the medium and programming in the small. What I mean by those terms is: