-- 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.2.0

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.
type GenMorph db m1 m2 = (CorrectPath m1 m2 (Path db m1 m2), GeneratableMorph db (Path db m1 m2), Morph' (Path db m1 m2) m1 m2)
type DB = ConnectMorph_2m Maybe MaybeT :+: ConnectMorph_mt MaybeT :+: ConnectMorph Maybe [] :+: ConnectMorph_2m [] ListT :+: ConnectMorph (MaybeT IO) (ListT IO) :+: NoMorph
db :: DB

-- | 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.
type Morph m1 m2 = GenMorph DB m1 m2

-- | Lifts the first monad into the second.
morph :: Morph m1 m2 => m1 a -> m2 a
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 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 (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 Control.Instances.Morph.GeneratableMorph db r => Control.Instances.Morph.GeneratableMorph db (Control.Instances.Morph.IdentityMorph m Control.Instances.Morph.:+: r)
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 forall k1 (k2 :: * -> *) (a :: k1 -> *) (b :: (* -> *) -> k1 -> *) r. GHC.Base.Monad k2 => Control.Instances.Morph.HasMorph (Control.Instances.Morph.ConnectMorph_2m a b Control.Instances.Morph.:+: r) (Control.Instances.Morph.ConnectMorph a (b k2))
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 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 k1 k2 (from :: k2) (to :: k1) a b. Control.Instances.Morph.CorrectPath from to (a Control.Instances.Morph.:+: b)
instance forall k1 k2 (from :: k2) (to :: k1). Control.Instances.Morph.CorrectPath from to Control.Instances.Morph.NoMorph
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 Control.Instances.Morph.GeneratableMorph db Control.Instances.Morph.NoMorph
instance forall k (x :: k -> *). Control.Instances.Morph.Morph' Control.Instances.Morph.NoMorph x x
