Advanced Search

Browse by Discipline

Scientific Societies

E-print Alerts

Add E-prints

E-print Network

  Advanced Search  

Haskell Examples for Iteration and Coiteration on Higher-Order Datatypes

Summary: Haskell Examples for Iteration and Coiteration
on Higher-Order Datatypes
Andreas Abel
Theoretical Computer Science, University of Munich
January 31, 2003
This document gives a Haskell implementations of the examples in the article It-
eration and Coiteration for Higher-Order Nested Datatypes by Abel and Matthes
[AM03]. The programs make essential use of the rank-2 extensions of Haskell
98 and can be run under hugs -98 or compiled with ghc -fglasgow-exts.
Thanks to Ralph Hinze who provided lhs2TeX which was used to type-set
the literate Haskell sources automatically.
1 (Co)inductive types
module Rank1 where
Inductive types.
data Mu1 f = In1 (f (Mu1 f ))
it1 :: Functor f (f a a) Mu1 f a
it1 s (In1 t) = s (fmap (it1 s ) t)
Coinductive types.
data Nu1 f = forall a. Coit1 (a f a) a


Source: Abel, Andreas - Theoretische Informatik, Ludwig-Maximilians-Universit√§t M√ľnchen


Collections: Computer Technologies and Information Sciences