An Array Monad in Haskell

Posted By on Aug 9, 2013 | 0 comments


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

Array1

 

As a functor

array functor

 

As a monad

array monad

 

 

Download

 

Download

 

Submit a Comment

Your email address will not be published. Required fields are marked *