pointless-haskell-0.0.8: Pointless Haskell library

Portabilitynon-portable
Stabilityexperimental
Maintainerhpacheco@di.uminho.pt

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 whereSource

Class for mapping observations over functor representations.

Methods

functorOf :: Ann (Fix f) -> StringSource

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 -> StringSource

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.