APPSEM '98

Program Structuring in Haskell

Mark P Jones

Slide 9

Back to start

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

Previous

Next

The second extension was first introduced about five years ago, where it was christened "constructor classes" because it allowed the definition of classes whose instances were type constructors, and not just simple types. One of the most popular applications of constructor classes has been to provide support for programming in a monadic style. The class declaration on this slide is based on the Haskell definition of a monad. Note that the parameter "m" used here ranges of type constructors, and instances of the class include the familiar list monad, the trivial identity monad, and the standard IO monad, which is used for top-level I/O in Haskell programs.

Next...