{-# Language FlexibleInstances #-}
module Csound.Typed.Types.Lift(
    GE, E,
    -- * Lifters
    -- ** Pure single
    PureSingle, pureSingle,

    -- ** Dirty single
    DirtySingle, dirtySingle,

    -- ** Procedure
    Procedure, procedure,

    -- ** Pure multi
    PureMulti, Pm, fromPm, pureMulti,

    -- ** Dirty multi
    DirtyMulti, Dm, fromDm, dirtyMulti

) where

import Csound.Dynamic
import Csound.Typed.Types.Prim
import Csound.Typed.Types.Tuple
import Csound.Typed.GlobalState

pureSingle :: PureSingle a => ([E] -> E) -> a
pureSingle :: ([E] -> E) -> a
pureSingle = GE ([E] -> E) -> a
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE (GE ([E] -> E) -> a)
-> (([E] -> E) -> GE ([E] -> E)) -> ([E] -> E) -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([E] -> E) -> GE ([E] -> E)
forall (m :: * -> *) a. Monad m => a -> m a
return

dirtySingle :: DirtySingle a => ([E] -> Dep E) -> a
dirtySingle :: ([E] -> Dep E) -> a
dirtySingle = GE ([E] -> Dep E) -> a
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE (GE ([E] -> Dep E) -> a)
-> (([E] -> Dep E) -> GE ([E] -> Dep E)) -> ([E] -> Dep E) -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([E] -> Dep E) -> GE ([E] -> Dep E)
forall (m :: * -> *) a. Monad m => a -> m a
return

procedure :: Procedure a => ([E] -> Dep ()) -> a
procedure :: ([E] -> Dep ()) -> a
procedure = GE ([E] -> Dep ()) -> a
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE (GE ([E] -> Dep ()) -> a)
-> (([E] -> Dep ()) -> GE ([E] -> Dep ())) -> ([E] -> Dep ()) -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([E] -> Dep ()) -> GE ([E] -> Dep ())
forall (m :: * -> *) a. Monad m => a -> m a
return

newtype Pm = Pm (GE (MultiOut [E]))

pureMulti :: PureMulti a => ([E] -> MultiOut [E]) -> a
pureMulti :: ([E] -> MultiOut [E]) -> a
pureMulti = GE ([E] -> MultiOut [E]) -> a
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE (GE ([E] -> MultiOut [E]) -> a)
-> (([E] -> MultiOut [E]) -> GE ([E] -> MultiOut [E]))
-> ([E] -> MultiOut [E])
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([E] -> MultiOut [E]) -> GE ([E] -> MultiOut [E])
forall (m :: * -> *) a. Monad m => a -> m a
return

newtype Dm = Dm (GE (MultiOut (Dep [E])))

dirtyMulti :: DirtyMulti a => ([E] -> MultiOut (Dep [E])) -> a
dirtyMulti :: ([E] -> MultiOut (Dep [E])) -> a
dirtyMulti = GE ([E] -> MultiOut (Dep [E])) -> a
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE (GE ([E] -> MultiOut (Dep [E])) -> a)
-> (([E] -> MultiOut (Dep [E])) -> GE ([E] -> MultiOut (Dep [E])))
-> ([E] -> MultiOut (Dep [E]))
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ([E] -> MultiOut (Dep [E])) -> GE ([E] -> MultiOut (Dep [E]))
forall (m :: * -> *) a. Monad m => a -> m a
return

class PureSingle a where
    pureSingleGE :: GE ([E] -> E) -> a

class DirtySingle a where
    dirtySingleGE :: GE ([E] -> Dep E) -> a

class Procedure a where
    procedureGE :: GE ([E] -> Dep ()) -> a

class PureMulti a where
    pureMultiGE :: GE ([E] -> MultiOut [E]) -> a

class DirtyMulti a where
    dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> a

-- multi out helpers

fromPm :: Tuple a => Pm -> a
fromPm :: Pm -> a
fromPm (Pm GE (MultiOut [E])
a) = a
res
    where res :: a
res = GE [E] -> a
forall a. Tuple a => GE [E] -> a
toTuple (GE [E] -> a) -> GE [E] -> a
forall a b. (a -> b) -> a -> b
$ (MultiOut [E] -> [E]) -> GE (MultiOut [E]) -> GE [E]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ( MultiOut [E] -> MultiOut [E]
forall a b. (a -> b) -> a -> b
$ a -> Int
forall a. Tuple a => a -> Int
tupleArity a
res) GE (MultiOut [E])
a

fromDm :: Tuple a => Dm -> SE a
fromDm :: Dm -> SE a
fromDm (Dm GE (MultiOut (Dep [E]))
a) = SE a
res
    where
        res :: SE a
res = (GE [E] -> a) -> SE (GE [E]) -> SE a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GE [E] -> a
forall a. Tuple a => GE [E] -> a
toTuple (SE (GE [E]) -> SE a) -> SE (GE [E]) -> SE a
forall a b. (a -> b) -> a -> b
$ Dep [E] -> SE (GE [E])
forall a. Dep a -> SE (GE a)
fromDep (Dep [E] -> SE (GE [E])) -> Dep [E] -> SE (GE [E])
forall a b. (a -> b) -> a -> b
$ GE (Dep [E]) -> Dep [E]
forall a. GE (Dep a) -> Dep a
hideGEinDep (GE (Dep [E]) -> Dep [E]) -> GE (Dep [E]) -> Dep [E]
forall a b. (a -> b) -> a -> b
$ (MultiOut (Dep [E]) -> Dep [E])
-> GE (MultiOut (Dep [E])) -> GE (Dep [E])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ( MultiOut (Dep [E]) -> MultiOut (Dep [E])
forall a b. (a -> b) -> a -> b
$ (a -> Int
forall a. Tuple a => a -> Int
tupleArity (a -> Int) -> a -> Int
forall a b. (a -> b) -> a -> b
$ SE a -> a
forall a. SE a -> a
proxy SE a
res)) GE (MultiOut (Dep [E]))
a

        proxy :: SE a -> a
        proxy :: SE a -> a
proxy = a -> SE a -> a
forall a b. a -> b -> a
const a
forall a. HasCallStack => a
undefined

-- pure single

instance PureSingle (GE E) where
    pureSingleGE :: GE ([E] -> E) -> GE E
pureSingleGE = (([E] -> E) -> E) -> GE ([E] -> E) -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (([E] -> E) -> [E] -> E
forall a b. (a -> b) -> a -> b
$ [])

instance PureSingle b => PureSingle (GE E -> b) where
    pureSingleGE :: GE ([E] -> E) -> GE E -> b
pureSingleGE GE ([E] -> E)
mf = \GE E
ma -> GE ([E] -> E) -> b
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE (GE ([E] -> E) -> b) -> GE ([E] -> E) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> E
f E
a [E]
as -> [E] -> E
f (E
aE -> [E] -> [E]
forall a. a -> [a] -> [a]
:[E]
as)) (([E] -> E) -> E -> [E] -> E)
-> GE ([E] -> E) -> GE (E -> [E] -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> E)
mf GE (E -> [E] -> E) -> GE E -> GE ([E] -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE E
ma

instance PureSingle b => PureSingle (GE [E] -> b) where
    pureSingleGE :: GE ([E] -> E) -> GE [E] -> b
pureSingleGE GE ([E] -> E)
mf = \GE [E]
mas -> GE ([E] -> E) -> b
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE (GE ([E] -> E) -> b) -> GE ([E] -> E) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> E
f [E]
as [E]
bs -> [E] -> E
f ([E]
as [E] -> [E] -> [E]
forall a. [a] -> [a] -> [a]
++ [E]
bs)) (([E] -> E) -> [E] -> [E] -> E)
-> GE ([E] -> E) -> GE ([E] -> [E] -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> E)
mf GE ([E] -> [E] -> E) -> GE [E] -> GE ([E] -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE [E]
mas

ps0 :: (Val a) => GE ([E] -> E) -> a
ps0 :: GE ([E] -> E) -> a
ps0 = GE E -> a
forall a. Val a => GE E -> a
fromGE (GE E -> a) -> (GE ([E] -> E) -> GE E) -> GE ([E] -> E) -> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GE ([E] -> E) -> GE E
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE

ps1 :: (Val a, PureSingle b) => GE ([E] -> E) -> (a -> b)
ps1 :: GE ([E] -> E) -> a -> b
ps1 GE ([E] -> E)
f = GE ([E] -> E) -> GE E -> b
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE GE ([E] -> E)
f (GE E -> b) -> (a -> GE E) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> GE E
forall a. Val a => a -> GE E
toGE

pss :: (Val a, PureSingle b) => GE ([E] -> E) -> ([a] -> b)
pss :: GE ([E] -> E) -> [a] -> b
pss GE ([E] -> E)
f = GE ([E] -> E) -> GE [E] -> b
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE GE ([E] -> E)
f (GE [E] -> b) -> ([a] -> GE [E]) -> [a] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> GE E) -> [a] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> GE E
forall a. Val a => a -> GE E
toGE

instance PureSingle Sig   where   pureSingleGE :: GE ([E] -> E) -> Sig
pureSingleGE = GE ([E] -> E) -> Sig
forall a. Val a => GE ([E] -> E) -> a
ps0
instance PureSingle D     where   pureSingleGE :: GE ([E] -> E) -> D
pureSingleGE = GE ([E] -> E) -> D
forall a. Val a => GE ([E] -> E) -> a
ps0
instance PureSingle Str   where   pureSingleGE :: GE ([E] -> E) -> Str
pureSingleGE = GE ([E] -> E) -> Str
forall a. Val a => GE ([E] -> E) -> a
ps0
instance PureSingle Tab   where   pureSingleGE :: GE ([E] -> E) -> Tab
pureSingleGE = GE ([E] -> E) -> Tab
forall a. Val a => GE ([E] -> E) -> a
ps0
instance PureSingle Spec  where   pureSingleGE :: GE ([E] -> E) -> Spec
pureSingleGE = GE ([E] -> E) -> Spec
forall a. Val a => GE ([E] -> E) -> a
ps0
instance PureSingle Wspec where   pureSingleGE :: GE ([E] -> E) -> Wspec
pureSingleGE = GE ([E] -> E) -> Wspec
forall a. Val a => GE ([E] -> E) -> a
ps0

instance (PureSingle b) => PureSingle (Sig -> b)    where   pureSingleGE :: GE ([E] -> E) -> Sig -> b
pureSingleGE = GE ([E] -> E) -> Sig -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1
instance (PureSingle b) => PureSingle (D -> b)      where   pureSingleGE :: GE ([E] -> E) -> D -> b
pureSingleGE = GE ([E] -> E) -> D -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1
instance (PureSingle b) => PureSingle (Str -> b)    where   pureSingleGE :: GE ([E] -> E) -> Str -> b
pureSingleGE = GE ([E] -> E) -> Str -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1
instance (PureSingle b) => PureSingle (Tab -> b)    where   pureSingleGE :: GE ([E] -> E) -> Tab -> b
pureSingleGE = GE ([E] -> E) -> Tab -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1
instance (PureSingle b) => PureSingle (Spec -> b)   where   pureSingleGE :: GE ([E] -> E) -> Spec -> b
pureSingleGE = GE ([E] -> E) -> Spec -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1
instance (PureSingle b) => PureSingle (Wspec -> b)  where   pureSingleGE :: GE ([E] -> E) -> Wspec -> b
pureSingleGE = GE ([E] -> E) -> Wspec -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> a -> b
ps1

instance (PureSingle b) => PureSingle ([Sig] -> b)  where   pureSingleGE :: GE ([E] -> E) -> [Sig] -> b
pureSingleGE = GE ([E] -> E) -> [Sig] -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> [a] -> b
pss
instance (PureSingle b) => PureSingle ([D] -> b)    where   pureSingleGE :: GE ([E] -> E) -> [D] -> b
pureSingleGE = GE ([E] -> E) -> [D] -> b
forall a b. (Val a, PureSingle b) => GE ([E] -> E) -> [a] -> b
pss

instance (PureSingle b) => PureSingle (Msg -> b)    where   pureSingleGE :: GE ([E] -> E) -> Msg -> b
pureSingleGE GE ([E] -> E)
f = b -> Msg -> b
forall a b. a -> b -> a
const (b -> Msg -> b) -> b -> Msg -> b
forall a b. (a -> b) -> a -> b
$ GE ([E] -> E) -> b
forall a. PureSingle a => GE ([E] -> E) -> a
pureSingleGE GE ([E] -> E)
f

-- dirty single

instance DirtySingle (SE (GE E)) where
    dirtySingleGE :: GE ([E] -> Dep E) -> SE (GE E)
dirtySingleGE = Dep E -> SE (GE E)
forall a. Dep a -> SE (GE a)
fromDep (Dep E -> SE (GE E))
-> (GE ([E] -> Dep E) -> Dep E) -> GE ([E] -> Dep E) -> SE (GE E)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GE (Dep E) -> Dep E
forall a. GE (Dep a) -> Dep a
hideGEinDep (GE (Dep E) -> Dep E)
-> (GE ([E] -> Dep E) -> GE (Dep E)) -> GE ([E] -> Dep E) -> Dep E
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([E] -> Dep E) -> Dep E) -> GE ([E] -> Dep E) -> GE (Dep E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (([E] -> Dep E) -> [E] -> Dep E
forall a b. (a -> b) -> a -> b
$ [])

instance DirtySingle b => DirtySingle (GE E -> b) where
    dirtySingleGE :: GE ([E] -> Dep E) -> GE E -> b
dirtySingleGE GE ([E] -> Dep E)
mf = \GE E
ma -> GE ([E] -> Dep E) -> b
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE (GE ([E] -> Dep E) -> b) -> GE ([E] -> Dep E) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> Dep E
f E
a [E]
as -> [E] -> Dep E
f (E
aE -> [E] -> [E]
forall a. a -> [a] -> [a]
:[E]
as)) (([E] -> Dep E) -> E -> [E] -> Dep E)
-> GE ([E] -> Dep E) -> GE (E -> [E] -> Dep E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> Dep E)
mf GE (E -> [E] -> Dep E) -> GE E -> GE ([E] -> Dep E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE E
ma

instance DirtySingle b => DirtySingle (GE [E] -> b) where
    dirtySingleGE :: GE ([E] -> Dep E) -> GE [E] -> b
dirtySingleGE GE ([E] -> Dep E)
mf = \GE [E]
mas -> GE ([E] -> Dep E) -> b
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE (GE ([E] -> Dep E) -> b) -> GE ([E] -> Dep E) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> Dep E
f [E]
as [E]
bs -> [E] -> Dep E
f ([E]
as [E] -> [E] -> [E]
forall a. [a] -> [a] -> [a]
++ [E]
bs)) (([E] -> Dep E) -> [E] -> [E] -> Dep E)
-> GE ([E] -> Dep E) -> GE ([E] -> [E] -> Dep E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> Dep E)
mf GE ([E] -> [E] -> Dep E) -> GE [E] -> GE ([E] -> Dep E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE [E]
mas

ds0 :: (Val a) => GE ([E] -> Dep E) -> SE a
ds0 :: GE ([E] -> Dep E) -> SE a
ds0 = (GE E -> a) -> SE (GE E) -> SE a
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap GE E -> a
forall a. Val a => GE E -> a
fromGE (SE (GE E) -> SE a)
-> (GE ([E] -> Dep E) -> SE (GE E)) -> GE ([E] -> Dep E) -> SE a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GE ([E] -> Dep E) -> SE (GE E)
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE

ds1 :: (Val a, DirtySingle b) => GE ([E] -> Dep E) -> (a -> b)
ds1 :: GE ([E] -> Dep E) -> a -> b
ds1 GE ([E] -> Dep E)
f = GE ([E] -> Dep E) -> GE E -> b
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE GE ([E] -> Dep E)
f (GE E -> b) -> (a -> GE E) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> GE E
forall a. Val a => a -> GE E
toGE

dss :: (Val a, DirtySingle b) => GE ([E] -> Dep E) -> ([a] -> b)
dss :: GE ([E] -> Dep E) -> [a] -> b
dss GE ([E] -> Dep E)
f = GE ([E] -> Dep E) -> GE [E] -> b
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE GE ([E] -> Dep E)
f (GE [E] -> b) -> ([a] -> GE [E]) -> [a] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> GE E) -> [a] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> GE E
forall a. Val a => a -> GE E
toGE

instance DirtySingle (SE Sig)   where   dirtySingleGE :: GE ([E] -> Dep E) -> SE Sig
dirtySingleGE = GE ([E] -> Dep E) -> SE Sig
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0
instance DirtySingle (SE D)     where   dirtySingleGE :: GE ([E] -> Dep E) -> SE D
dirtySingleGE = GE ([E] -> Dep E) -> SE D
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0
instance DirtySingle (SE Str)   where   dirtySingleGE :: GE ([E] -> Dep E) -> SE Str
dirtySingleGE = GE ([E] -> Dep E) -> SE Str
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0
instance DirtySingle (SE Tab)   where   dirtySingleGE :: GE ([E] -> Dep E) -> SE Tab
dirtySingleGE = GE ([E] -> Dep E) -> SE Tab
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0
instance DirtySingle (SE Spec)  where   dirtySingleGE :: GE ([E] -> Dep E) -> SE Spec
dirtySingleGE = GE ([E] -> Dep E) -> SE Spec
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0
instance DirtySingle (SE Wspec) where   dirtySingleGE :: GE ([E] -> Dep E) -> SE Wspec
dirtySingleGE = GE ([E] -> Dep E) -> SE Wspec
forall a. Val a => GE ([E] -> Dep E) -> SE a
ds0

instance (DirtySingle b) => DirtySingle (Sig -> b)    where   dirtySingleGE :: GE ([E] -> Dep E) -> Sig -> b
dirtySingleGE = GE ([E] -> Dep E) -> Sig -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1
instance (DirtySingle b) => DirtySingle (D -> b)      where   dirtySingleGE :: GE ([E] -> Dep E) -> D -> b
dirtySingleGE = GE ([E] -> Dep E) -> D -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1
instance (DirtySingle b) => DirtySingle (Str -> b)    where   dirtySingleGE :: GE ([E] -> Dep E) -> Str -> b
dirtySingleGE = GE ([E] -> Dep E) -> Str -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1
instance (DirtySingle b) => DirtySingle (Tab -> b)    where   dirtySingleGE :: GE ([E] -> Dep E) -> Tab -> b
dirtySingleGE = GE ([E] -> Dep E) -> Tab -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1
instance (DirtySingle b) => DirtySingle (Spec -> b)   where   dirtySingleGE :: GE ([E] -> Dep E) -> Spec -> b
dirtySingleGE = GE ([E] -> Dep E) -> Spec -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1
instance (DirtySingle b) => DirtySingle (Wspec -> b)  where   dirtySingleGE :: GE ([E] -> Dep E) -> Wspec -> b
dirtySingleGE = GE ([E] -> Dep E) -> Wspec -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> a -> b
ds1

instance (DirtySingle b) => DirtySingle ([Sig] -> b)  where   dirtySingleGE :: GE ([E] -> Dep E) -> [Sig] -> b
dirtySingleGE = GE ([E] -> Dep E) -> [Sig] -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> [a] -> b
dss
instance (DirtySingle b) => DirtySingle ([D] -> b)    where   dirtySingleGE :: GE ([E] -> Dep E) -> [D] -> b
dirtySingleGE = GE ([E] -> Dep E) -> [D] -> b
forall a b. (Val a, DirtySingle b) => GE ([E] -> Dep E) -> [a] -> b
dss

instance (DirtySingle b) => DirtySingle (Msg -> b)    where   dirtySingleGE :: GE ([E] -> Dep E) -> Msg -> b
dirtySingleGE GE ([E] -> Dep E)
f = b -> Msg -> b
forall a b. a -> b -> a
const (b -> Msg -> b) -> b -> Msg -> b
forall a b. (a -> b) -> a -> b
$ GE ([E] -> Dep E) -> b
forall a. DirtySingle a => GE ([E] -> Dep E) -> a
dirtySingleGE GE ([E] -> Dep E)
f

-- procedure

instance Procedure (SE ()) where
    procedureGE :: GE ([E] -> Dep ()) -> SE ()
procedureGE = Dep () -> SE ()
fromDep_ (Dep () -> SE ())
-> (GE ([E] -> Dep ()) -> Dep ()) -> GE ([E] -> Dep ()) -> SE ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. GE (Dep ()) -> Dep ()
forall a. GE (Dep a) -> Dep a
hideGEinDep (GE (Dep ()) -> Dep ())
-> (GE ([E] -> Dep ()) -> GE (Dep ()))
-> GE ([E] -> Dep ())
-> Dep ()
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([E] -> Dep ()) -> Dep ()) -> GE ([E] -> Dep ()) -> GE (Dep ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (([E] -> Dep ()) -> [E] -> Dep ()
forall a b. (a -> b) -> a -> b
$ [])

instance Procedure b => Procedure (GE E -> b) where
    procedureGE :: GE ([E] -> Dep ()) -> GE E -> b
procedureGE GE ([E] -> Dep ())
mf = \GE E
ma -> GE ([E] -> Dep ()) -> b
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE (GE ([E] -> Dep ()) -> b) -> GE ([E] -> Dep ()) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> Dep ()
f E
a [E]
as -> [E] -> Dep ()
f (E
aE -> [E] -> [E]
forall a. a -> [a] -> [a]
:[E]
as)) (([E] -> Dep ()) -> E -> [E] -> Dep ())
-> GE ([E] -> Dep ()) -> GE (E -> [E] -> Dep ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> Dep ())
mf GE (E -> [E] -> Dep ()) -> GE E -> GE ([E] -> Dep ())
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE E
ma

instance Procedure b => Procedure (GE [E] -> b) where
    procedureGE :: GE ([E] -> Dep ()) -> GE [E] -> b
procedureGE GE ([E] -> Dep ())
mf = \GE [E]
mas -> GE ([E] -> Dep ()) -> b
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE (GE ([E] -> Dep ()) -> b) -> GE ([E] -> Dep ()) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> Dep ()
f [E]
as [E]
bs -> [E] -> Dep ()
f ([E]
as [E] -> [E] -> [E]
forall a. [a] -> [a] -> [a]
++ [E]
bs)) (([E] -> Dep ()) -> [E] -> [E] -> Dep ())
-> GE ([E] -> Dep ()) -> GE ([E] -> [E] -> Dep ())
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> Dep ())
mf GE ([E] -> [E] -> Dep ()) -> GE [E] -> GE ([E] -> Dep ())
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE [E]
mas

pr1 :: (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1 :: GE ([E] -> Dep ()) -> a -> b
pr1 GE ([E] -> Dep ())
f = GE ([E] -> Dep ()) -> GE E -> b
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE GE ([E] -> Dep ())
f (GE E -> b) -> (a -> GE E) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> GE E
forall a. Val a => a -> GE E
toGE

prs :: (Val a, Procedure b) => GE ([E] -> Dep ()) -> ([a] -> b)
prs :: GE ([E] -> Dep ()) -> [a] -> b
prs GE ([E] -> Dep ())
f = GE ([E] -> Dep ()) -> GE [E] -> b
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE GE ([E] -> Dep ())
f (GE [E] -> b) -> ([a] -> GE [E]) -> [a] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> GE E) -> [a] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> GE E
forall a. Val a => a -> GE E
toGE

instance (Procedure b) => Procedure (Sig -> b)    where   procedureGE :: GE ([E] -> Dep ()) -> Sig -> b
procedureGE = GE ([E] -> Dep ()) -> Sig -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1
instance (Procedure b) => Procedure (D -> b)      where   procedureGE :: GE ([E] -> Dep ()) -> D -> b
procedureGE = GE ([E] -> Dep ()) -> D -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1
instance (Procedure b) => Procedure (Str -> b)    where   procedureGE :: GE ([E] -> Dep ()) -> Str -> b
procedureGE = GE ([E] -> Dep ()) -> Str -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1
instance (Procedure b) => Procedure (Tab -> b)    where   procedureGE :: GE ([E] -> Dep ()) -> Tab -> b
procedureGE = GE ([E] -> Dep ()) -> Tab -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1
instance (Procedure b) => Procedure (Spec -> b)   where   procedureGE :: GE ([E] -> Dep ()) -> Spec -> b
procedureGE = GE ([E] -> Dep ()) -> Spec -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1
instance (Procedure b) => Procedure (Wspec -> b)  where   procedureGE :: GE ([E] -> Dep ()) -> Wspec -> b
procedureGE = GE ([E] -> Dep ()) -> Wspec -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> a -> b
pr1

instance (Procedure b) => Procedure ([Sig] -> b)  where   procedureGE :: GE ([E] -> Dep ()) -> [Sig] -> b
procedureGE = GE ([E] -> Dep ()) -> [Sig] -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> [a] -> b
prs
instance (Procedure b) => Procedure ([D] -> b)    where   procedureGE :: GE ([E] -> Dep ()) -> [D] -> b
procedureGE = GE ([E] -> Dep ()) -> [D] -> b
forall a b. (Val a, Procedure b) => GE ([E] -> Dep ()) -> [a] -> b
prs

instance (Procedure b) => Procedure (Msg -> b)    where   procedureGE :: GE ([E] -> Dep ()) -> Msg -> b
procedureGE GE ([E] -> Dep ())
f = b -> Msg -> b
forall a b. a -> b -> a
const (b -> Msg -> b) -> b -> Msg -> b
forall a b. (a -> b) -> a -> b
$ GE ([E] -> Dep ()) -> b
forall a. Procedure a => GE ([E] -> Dep ()) -> a
procedureGE GE ([E] -> Dep ())
f

-- pure multi

instance PureMulti Pm where
    pureMultiGE :: GE ([E] -> MultiOut [E]) -> Pm
pureMultiGE = GE (MultiOut [E]) -> Pm
Pm (GE (MultiOut [E]) -> Pm)
-> (GE ([E] -> MultiOut [E]) -> GE (MultiOut [E]))
-> GE ([E] -> MultiOut [E])
-> Pm
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([E] -> MultiOut [E]) -> MultiOut [E])
-> GE ([E] -> MultiOut [E]) -> GE (MultiOut [E])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (([E] -> MultiOut [E]) -> [E] -> MultiOut [E]
forall a b. (a -> b) -> a -> b
$ [])

instance PureMulti b => PureMulti (GE E -> b) where
    pureMultiGE :: GE ([E] -> MultiOut [E]) -> GE E -> b
pureMultiGE GE ([E] -> MultiOut [E])
mf = \GE E
ma -> GE ([E] -> MultiOut [E]) -> b
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE (GE ([E] -> MultiOut [E]) -> b) -> GE ([E] -> MultiOut [E]) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> MultiOut [E]
f E
a [E]
as -> [E] -> MultiOut [E]
f (E
aE -> [E] -> [E]
forall a. a -> [a] -> [a]
:[E]
as)) (([E] -> MultiOut [E]) -> E -> [E] -> MultiOut [E])
-> GE ([E] -> MultiOut [E]) -> GE (E -> [E] -> MultiOut [E])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> MultiOut [E])
mf GE (E -> [E] -> MultiOut [E]) -> GE E -> GE ([E] -> MultiOut [E])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE E
ma

instance PureMulti b => PureMulti (GE [E] -> b) where
    pureMultiGE :: GE ([E] -> MultiOut [E]) -> GE [E] -> b
pureMultiGE GE ([E] -> MultiOut [E])
mf = \GE [E]
mas -> GE ([E] -> MultiOut [E]) -> b
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE (GE ([E] -> MultiOut [E]) -> b) -> GE ([E] -> MultiOut [E]) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> MultiOut [E]
f [E]
as [E]
bs -> [E] -> MultiOut [E]
f ([E]
as [E] -> [E] -> [E]
forall a. [a] -> [a] -> [a]
++ [E]
bs)) (([E] -> MultiOut [E]) -> [E] -> [E] -> MultiOut [E])
-> GE ([E] -> MultiOut [E]) -> GE ([E] -> [E] -> MultiOut [E])
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> MultiOut [E])
mf GE ([E] -> [E] -> MultiOut [E])
-> GE [E] -> GE ([E] -> MultiOut [E])
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE [E]
mas

pm1 :: (Val a, PureMulti b) => GE ([E] -> MultiOut [E]) -> (a -> b)
pm1 :: GE ([E] -> MultiOut [E]) -> a -> b
pm1 GE ([E] -> MultiOut [E])
f = GE ([E] -> MultiOut [E]) -> GE E -> b
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE GE ([E] -> MultiOut [E])
f (GE E -> b) -> (a -> GE E) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> GE E
forall a. Val a => a -> GE E
toGE

pms :: (Val a, PureMulti b) => GE ([E] -> MultiOut [E]) -> ([a] -> b)
pms :: GE ([E] -> MultiOut [E]) -> [a] -> b
pms GE ([E] -> MultiOut [E])
f = GE ([E] -> MultiOut [E]) -> GE [E] -> b
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE GE ([E] -> MultiOut [E])
f (GE [E] -> b) -> ([a] -> GE [E]) -> [a] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> GE E) -> [a] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> GE E
forall a. Val a => a -> GE E
toGE

instance (PureMulti b) => PureMulti (Sig -> b)    where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Sig -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> Sig -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1
instance (PureMulti b) => PureMulti (D -> b)      where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> D -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> D -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1
instance (PureMulti b) => PureMulti (Str -> b)    where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Str -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> Str -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1
instance (PureMulti b) => PureMulti (Tab -> b)    where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Tab -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> Tab -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1
instance (PureMulti b) => PureMulti (Spec -> b)   where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Spec -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> Spec -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1
instance (PureMulti b) => PureMulti (Wspec -> b)  where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Wspec -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> Wspec -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> a -> b
pm1

instance (PureMulti b) => PureMulti ([Sig] -> b)  where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> [Sig] -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> [Sig] -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> [a] -> b
pms
instance (PureMulti b) => PureMulti ([D] -> b)    where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> [D] -> b
pureMultiGE = GE ([E] -> MultiOut [E]) -> [D] -> b
forall a b.
(Val a, PureMulti b) =>
GE ([E] -> MultiOut [E]) -> [a] -> b
pms

instance (PureMulti b) => PureMulti (Msg -> b)    where   pureMultiGE :: GE ([E] -> MultiOut [E]) -> Msg -> b
pureMultiGE GE ([E] -> MultiOut [E])
f = b -> Msg -> b
forall a b. a -> b -> a
const (b -> Msg -> b) -> b -> Msg -> b
forall a b. (a -> b) -> a -> b
$ GE ([E] -> MultiOut [E]) -> b
forall a. PureMulti a => GE ([E] -> MultiOut [E]) -> a
pureMultiGE GE ([E] -> MultiOut [E])
f

-- dirty multi

instance DirtyMulti Dm where
    dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Dm
dirtyMultiGE = GE (MultiOut (Dep [E])) -> Dm
Dm (GE (MultiOut (Dep [E])) -> Dm)
-> (GE ([E] -> MultiOut (Dep [E])) -> GE (MultiOut (Dep [E])))
-> GE ([E] -> MultiOut (Dep [E]))
-> Dm
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (([E] -> MultiOut (Dep [E])) -> MultiOut (Dep [E]))
-> GE ([E] -> MultiOut (Dep [E])) -> GE (MultiOut (Dep [E]))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap (([E] -> MultiOut (Dep [E])) -> [E] -> MultiOut (Dep [E])
forall a b. (a -> b) -> a -> b
$ [])

instance DirtyMulti b => DirtyMulti (GE E -> b) where
    dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> GE E -> b
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
mf = \GE E
ma -> GE ([E] -> MultiOut (Dep [E])) -> b
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE (GE ([E] -> MultiOut (Dep [E])) -> b)
-> GE ([E] -> MultiOut (Dep [E])) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> MultiOut (Dep [E])
f E
a [E]
as -> [E] -> MultiOut (Dep [E])
f (E
aE -> [E] -> [E]
forall a. a -> [a] -> [a]
:[E]
as)) (([E] -> MultiOut (Dep [E])) -> E -> [E] -> MultiOut (Dep [E]))
-> GE ([E] -> MultiOut (Dep [E]))
-> GE (E -> [E] -> MultiOut (Dep [E]))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> MultiOut (Dep [E]))
mf GE (E -> [E] -> MultiOut (Dep [E]))
-> GE E -> GE ([E] -> MultiOut (Dep [E]))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE E
ma

instance DirtyMulti b => DirtyMulti (GE [E] -> b) where
    dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> GE [E] -> b
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
mf = \GE [E]
mas -> GE ([E] -> MultiOut (Dep [E])) -> b
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE (GE ([E] -> MultiOut (Dep [E])) -> b)
-> GE ([E] -> MultiOut (Dep [E])) -> b
forall a b. (a -> b) -> a -> b
$ (\[E] -> MultiOut (Dep [E])
f [E]
as [E]
bs -> [E] -> MultiOut (Dep [E])
f ([E]
as [E] -> [E] -> [E]
forall a. [a] -> [a] -> [a]
++ [E]
bs)) (([E] -> MultiOut (Dep [E])) -> [E] -> [E] -> MultiOut (Dep [E]))
-> GE ([E] -> MultiOut (Dep [E]))
-> GE ([E] -> [E] -> MultiOut (Dep [E]))
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> GE ([E] -> MultiOut (Dep [E]))
mf GE ([E] -> [E] -> MultiOut (Dep [E]))
-> GE [E] -> GE ([E] -> MultiOut (Dep [E]))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> GE [E]
mas

dm1 :: (Val a, DirtyMulti b) => GE ([E] -> MultiOut (Dep [E])) -> (a -> b)
dm1 :: GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1 GE ([E] -> MultiOut (Dep [E]))
f = GE ([E] -> MultiOut (Dep [E])) -> GE E -> b
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
f (GE E -> b) -> (a -> GE E) -> a -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> GE E
forall a. Val a => a -> GE E
toGE

dms :: (Val a, DirtyMulti b) => GE ([E] -> MultiOut (Dep [E])) -> ([a] -> b)
dms :: GE ([E] -> MultiOut (Dep [E])) -> [a] -> b
dms GE ([E] -> MultiOut (Dep [E]))
f = GE ([E] -> MultiOut (Dep [E])) -> GE [E] -> b
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
f (GE [E] -> b) -> ([a] -> GE [E]) -> [a] -> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> GE E) -> [a] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
mapM a -> GE E
forall a. Val a => a -> GE E
toGE

instance (DirtyMulti b) => DirtyMulti (Sig -> b)    where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Sig -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> Sig -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1
instance (DirtyMulti b) => DirtyMulti (D -> b)      where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> D -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> D -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1
instance (DirtyMulti b) => DirtyMulti (Str -> b)    where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Str -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> Str -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1
instance (DirtyMulti b) => DirtyMulti (Tab -> b)    where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Tab -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> Tab -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1
instance (DirtyMulti b) => DirtyMulti (Spec -> b)   where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Spec -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> Spec -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1
instance (DirtyMulti b) => DirtyMulti (Wspec -> b)   where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Wspec -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> Wspec -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> a -> b
dm1

instance (DirtyMulti b) => DirtyMulti ([Sig] -> b)  where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> [Sig] -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> [Sig] -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> [a] -> b
dms
instance (DirtyMulti b) => DirtyMulti ([D] -> b)    where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> [D] -> b
dirtyMultiGE = GE ([E] -> MultiOut (Dep [E])) -> [D] -> b
forall a b.
(Val a, DirtyMulti b) =>
GE ([E] -> MultiOut (Dep [E])) -> [a] -> b
dms

instance (DirtyMulti b) => DirtyMulti (Msg -> b)    where   dirtyMultiGE :: GE ([E] -> MultiOut (Dep [E])) -> Msg -> b
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
f = b -> Msg -> b
forall a b. a -> b -> a
const (b -> Msg -> b) -> b -> Msg -> b
forall a b. (a -> b) -> a -> b
$ GE ([E] -> MultiOut (Dep [E])) -> b
forall a. DirtyMulti a => GE ([E] -> MultiOut (Dep [E])) -> a
dirtyMultiGE GE ([E] -> MultiOut (Dep [E]))
f