-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Controls how the compiler searches for instances using type families.
--   
--   GHC has no capability to perform graph searches on instance
--   definition. Because of that, transitive rules for type classes cannot
--   be defined. This package solves the issue with type functions
--   performing a search on the graph where nodes are types and edges are
--   rules from a given rule database. After constructing the type-level
--   representation of the wanted path, the system constructs the needed
--   functions from the value-level representation of the database.
@package instance-control
@version 0.1.1.1

module Control.Instances.Morph

-- | A generalized version of <a>Morph</a>. Can work on different rulesets,
--   so this should be used if the ruleset is to be extended.
class GenMorph db (m1 :: * -> *) (m2 :: * -> *)

-- | Lifts the first monad into the second.
genMorph :: GenMorph db m1 m2 => db -> m1 a -> m2 a

-- | States that <tt>m1</tt> can be represented with <tt>m2</tt>. That is
--   because <tt>m2</tt> contains more infromation than <tt>m1</tt>.
--   
--   The <tt>MMorph</tt> relation defines a natural transformation from
--   <tt>m1</tt> to <tt>m2</tt> that keeps the following laws:
--   
--   <pre>
--   morph (return x)  =  return x
--   morph (m &gt;&gt;= f)   =  morph m &gt;&gt;= morph . f
--   </pre>
--   
--   It is a reflexive and transitive relation.
class Morph (m1 :: * -> *) (m2 :: * -> *)

-- | Lifts the first monad into the second.
morph :: Morph m1 m2 => m1 a -> m2 a
instance Control.Instances.Morph.GenMorph Control.Instances.Morph.DB m1 m2 => Control.Instances.Morph.Morph m1 m2
instance (fl ~ Control.Instances.Morph.TransformPath (Control.Instances.Morph.PathFromList (Control.Instances.ShortestPath.ShortestPath (Control.Instances.Morph.ToMorphRepo Control.Instances.Morph.DB) x y)), Control.Instances.Morph.CorrectPath x y fl, Control.Instances.Morph.GeneratableMorph Control.Instances.Morph.DB fl, Control.Instances.Morph.Morph' fl x y) => Control.Instances.Morph.GenMorph Control.Instances.Morph.DB x y
instance forall k r (y :: k -> *) (z :: k -> *) (x :: k -> *). Control.Instances.Morph.Morph' r y z => Control.Instances.Morph.Morph' (Control.Instances.Morph.ConnectMorph x y Control.Instances.Morph.:+: r) x z
instance (Control.Instances.Morph.Morph' r m x, GHC.Base.Monad m) => Control.Instances.Morph.Morph' (Control.Instances.Morph.IdentityMorph m Control.Instances.Morph.:+: r) Data.Functor.Identity.Identity x
instance forall k (m :: k -> *) r. Control.Instances.Morph.Morph' (Control.Instances.Morph.MUMorph m Control.Instances.Morph.:+: r) m Data.Proxy.Proxy
instance forall k (x :: k -> *). Control.Instances.Morph.Morph' Control.Instances.Morph.NoMorph x x
instance Control.Instances.Morph.GeneratableMorph db Control.Instances.Morph.NoMorph
instance Control.Instances.Morph.GeneratableMorph db r => Control.Instances.Morph.GeneratableMorph db (Control.Instances.Morph.IdentityMorph m Control.Instances.Morph.:+: r)
instance forall k db r (m :: k). Control.Instances.Morph.GeneratableMorph db r => Control.Instances.Morph.GeneratableMorph db (Control.Instances.Morph.MUMorph m Control.Instances.Morph.:+: r)
instance forall k db (a :: k -> *) (b :: k -> *) r. (Control.Instances.Morph.HasMorph db (Control.Instances.Morph.ConnectMorph a b), Control.Instances.Morph.GeneratableMorph db r) => Control.Instances.Morph.GeneratableMorph db (Control.Instances.Morph.ConnectMorph a b Control.Instances.Morph.:+: r)
instance forall k (k1 :: * -> *) (a :: k -> *) (b :: (* -> *) -> k -> *) r. GHC.Base.Monad k1 => Control.Instances.Morph.HasMorph (Control.Instances.Morph.ConnectMorph_2m a b Control.Instances.Morph.:+: r) (Control.Instances.Morph.ConnectMorph a (b k1))
instance GHC.Base.Monad k => Control.Instances.Morph.HasMorph (Control.Instances.Morph.ConnectMorph_mt t Control.Instances.Morph.:+: r) (Control.Instances.Morph.ConnectMorph k (t k))
instance Control.Instances.Morph.HasMorph r m => Control.Instances.Morph.HasMorph (c Control.Instances.Morph.:+: r) m
instance Control.Instances.Morph.HasMorph (m Control.Instances.Morph.:+: r) m
instance forall k k1 (from :: k1) (to :: k) a b. Control.Instances.Morph.CorrectPath from to (a Control.Instances.Morph.:+: b)
instance forall k k1 (from :: k1) (to :: k). Control.Instances.Morph.CorrectPath from to Control.Instances.Morph.NoMorph
