compdata-0.12: Compositional Data Types

Copyright (c) 2014 Patrick Bahr BSD3 Patrick Bahr experimental non-portable (GHC Extensions) Safe Haskell98

Data.Comp.Projection

Description

This module provides a generic projection function pr for arbitrary nested binary products.

Synopsis
• pr :: forall p q. p :< q => q -> p
• type (:<) f g = Proj (ComprEmb (Elem f g)) f g

# Documentation

pr :: forall p q. p :< q => q -> p Source #

This function projects the component of type e out or the compound value of type p.

type (:<) f g = Proj (ComprEmb (Elem f g)) f g infixl 5 Source #

The constraint e :< p expresses that e is a component of the type p. That is, p is formed by binary products using the type e. The occurrence of e must be unique. For example we have Int :< (Bool,(Int,Bool)) but not Bool :< (Bool,(Int,Bool)).