Themes on Streams
> {-# LANGUAGE DeriveFunctor, FlexibleInstances #-} Recall that a stream is a countably infinite sequence of values: > data Stream a = a :> Stream a > deriving (Functor, Show) > >...
View ArticleParsing context-sensitive languages with Applicative
Many parser combinator libraries in Haskell (such as parsec) have both a Monad interface as well as an Applicative interface. (Actually, to be really useful, you also need MonadPlus along with Monad,...
View ArticleTeaching abstraction
I’m just beginning to prepare for the third incarnation of CIS 194, Introduction to Haskell in the spring. It’s occasioned some general thoughts on teaching abstraction which seemed worth writing down....
View ArticleMonad transformers: a cautionary tale
When writing the code in my previous post, I wanted to have a monad which combined the ability to generate random numbers with the ability to fail. Naturally, I decided to use RandT Maybe. But when I...
View ArticleMonadRandom 0.5 and mwc-random: feedback wanted
Since 2013 or so I have been the maintainer of the MonadRandom package, which provides an mtl-style type class for monads with support for generation of pseudorandom values, along with a concrete...
View ArticleMonadRandom 0.5 released
I’m happy to announce the release of MonadRandom-0.5, a package which provides a convenient monadic interface for random number generation in the style of transformers and mtl: a Rand monad...
View Article
More Pages to Explore .....