{-# OPTIONS_GHC -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- |
  Module       :   Control . Morphism . Destroy
  Copyright    :   ( C ) 2008  
-- License     :  BSD-style (see the file LICENSE)
--
  Maintainer   :     <  >
-- Stability   :  experimental
-- Portability :  non-portable (rank-2 polymorphism)
-- 
----------------------------------------------------------------------------
module Control.Morphism.Destroy where

import Control.Functor.Extras
import Control.Functor.HigherOrder
import Control.Functor.KanExtension
  import Control . Morphism . 

  | @forall h g .   .   = g h@ can not be realized as a RULE .
hdestroy :: (HFunctor f, Functor c) => (forall g. HCoalgebra f g -> g :~> c) -> FixH f :~> c
hdestroy g = g outH

  | @forall h g .   .     ( cointerpreterCoalgebra h)@ can not be realized as a RULE
kdestroy :: HFunctor f => (forall x. HCoalgebra f x -> x :~> Ran g h) -> FixH f :~> Ran g h
kdestroy = kdestroy

# OPTIONS_GHC -fglasgow-exts #
---------------------------------------------------------------------------
 |
 License     :  BSD-style (see the file LICENSE)

 Stability   :  experimental
 Portability :  non-portable (rank-2 polymorphism)
 
--------------------------------------------------------------------------
  Module       :   Control . Morphism . Destroy
  Copyright    :   ( C ) 2008  
  Maintainer   :     <  >
module Control.Morphism.Destroy where

import Control.Functor.Extras
import Control.Functor.HigherOrder
import Control.Functor.KanExtension
  import Control . Morphism . 

  | @forall h g .   .   = g h@ can not be realized as a RULE .
hdestroy :: (HFunctor f, Functor c) => (forall g. HCoalgebra f g -> g :~> c) -> FixH f :~> c
hdestroy g = g outH

  | @forall h g .   .     ( cointerpreterCoalgebra h)@ can not be realized as a RULE
kdestroy :: HFunctor f => (forall x. HCoalgebra f x -> x :~> Ran g h) -> FixH f :~> Ran g h
kdestroy = kdestroy
