pointless-haskell-0.0.9: Pointless Haskell library

Copyright(c) 2008 University of Minho
LicenseBSD3
Maintainerhpacheco@di.uminho.pt
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell98

Generics.Pointless.Observe.Functors

Contents

Description

Pointless Haskell: point-free programming with recursion patterns as hylomorphisms

This module defines generic GHood observations for user-defined data types.

Synopsis

Definition of generic observations

class FunctorO f where Source

Class for mapping observations over functor representations.

Methods

functorOf :: Ann (Fix f) -> String Source

Derives a type representation for a functor. This is used for showing the functor for reursion trees.

watch :: Ann (Fix f) -> Ann x -> Rep f x -> String Source

Watch values of a functor. Since the fixpoint of a functor recurses over himself, we cannot use the Show instance for functor values applied to their fixpoint.

fmapO :: Ann (Fix f) -> (x -> ObserverM y) -> Rep f x -> ObserverM (Rep f y) Source

Maps an observation over a functor representation.

Instances

FunctorO Id 
(Typeable * a, Observable a) => FunctorO (Const a) 
(FunctorO g, FunctorO h) => FunctorO ((:@:) g h) 
(FunctorO f, FunctorO g) => FunctorO ((:*:) f g) 
(FunctorO f, FunctorO g) => FunctorO ((:+:) f g) 

omap :: FunctorO (PF a) => Ann a -> (x -> ObserverM y) -> F a x -> ObserverM (F a y) Source

Polytypic mapping of observations.