An Array Monad in Haskell

- This is an implementation of an array---using a size-balanced binary search tree under the hood---for a course in programming languages this summer. Some functions may look awkward as they are based on catamorphisms. Global definitions fromList, singleton, toList, set, get, size, contains, inverse, and trim   Test   As a functor   As a monad     Download   [...]

By |2016-04-22T03:29:39+00:00August 9th, 2013|Functional Programming|0 Comments

Haskell State Monad Tutorial

Background The concept of state refers to a function/computation global or non-local state of memory at any given time. When the output of a function/computation depends solely on its inputs, we say it is stateless -- an example of this is combinatory logic. Conversely, when the output depends not only on the received input but also [...]

By |2016-04-22T03:33:28+00:00July 25th, 2013|Functional Programming|0 Comments