Safe Haskell | None |
---|---|
Language | Haskell2010 |
LiveCoding
Synopsis
- module Data.Data
- module Data.Profunctor.Strong
- module Data.Profunctor.Traversing
- module LiveCoding.Bind
- module LiveCoding.Cell
- module LiveCoding.Cell.Feedback
- module LiveCoding.Cell.HotCodeSwap
- module LiveCoding.Cell.Monad
- module LiveCoding.Cell.NonBlocking
- module LiveCoding.Cell.Resample
- module LiveCoding.Cell.Util
- module LiveCoding.CellExcept
- module LiveCoding.Coalgebra
- module LiveCoding.Debugger
- module LiveCoding.Debugger.StatePrint
- module LiveCoding.Exceptions
- module LiveCoding.Exceptions.Finite
- module LiveCoding.Forever
- module LiveCoding.Handle
- module LiveCoding.Handle.Examples
- module LiveCoding.LiveProgram
- module LiveCoding.LiveProgram.HotCodeSwap
- module LiveCoding.LiveProgram.Monad.Trans
- module LiveCoding.Migrate
- module LiveCoding.Migrate.Debugger
- module LiveCoding.Migrate.Migration
- stateT :: State stateT stateInternal -> stateT
- stateInternal :: State stateT stateInternal -> stateInternal
- class Category a => Arrow (a :: Type -> Type -> Type) where
- (>>>) :: forall {k} cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
- class Arrow a => ArrowChoice (a :: Type -> Type -> Type) where
- class Arrow a => ArrowLoop (a :: Type -> Type -> Type) where
- loop :: a (b, d) (c, d) -> a b c
- data Handling h = Handling {}
- (<<<) :: forall {k} cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- newtype ArrowMonad (a :: Type -> Type -> Type) b = ArrowMonad (a () b)
- class Arrow a => ArrowApply (a :: Type -> Type -> Type)
- class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type) where
- (<+>) :: a b c -> a b c -> a b c
- class Arrow a => ArrowZero (a :: Type -> Type -> Type) where
- zeroArrow :: a b c
- newtype Kleisli (m :: Type -> Type) a b = Kleisli {
- runKleisli :: a -> m b
- returnA :: Arrow a => a b b
- (^>>) :: Arrow a => (b -> c) -> a c d -> a b d
- (>>^) :: Arrow a => a b c -> (c -> d) -> a b d
- (<<^) :: Arrow a => a c d -> (b -> c) -> a b d
- (^<<) :: Arrow a => (c -> d) -> a b c -> a b d
- leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d)
- class Monad m => Launchable (m :: Type -> Type) where
- runIO :: LiveProgram m -> LiveProgram IO
- newtype WrappedArrow (p :: k -> k1 -> Type) (a :: k) (b :: k1) = WrapArrow {
- unwrapArrow :: p a b
- type (:->) (p :: k -> k1 -> Type) (q :: k -> k1 -> Type) = forall (a :: k) (b :: k1). p a b -> q a b
- update :: forall (m :: Type -> Type). Launchable m => LaunchedProgram m -> LiveProgram m -> IO ()
- class Profunctor (p :: Type -> Type -> Type) where
- newtype Forget r a (b :: k) = Forget {
- runForget :: a -> r
- newtype Costar (f :: k -> Type) (d :: k) c = Costar {
- runCostar :: f d -> c
- newtype Star (f :: k -> Type) d (c :: k) = Star {
- runStar :: d -> f c
- class Profunctor p => Closed (p :: Type -> Type -> Type) where
- closed :: p a b -> p (x -> a) (x -> b)
- curry' :: Closed p => p (a, b) c -> p a (b -> c)
- class Profunctor p => Cochoice (p :: Type -> Type -> Type) where
- left' :: Choice p => p a b -> p (Either a c) (Either b c)
- right' :: Choice p => p a b -> p (Either c a) (Either c b)
- class (Traversing p, Closed p) => Mapping (p :: Type -> Type -> Type) where
- data HandlingState (m :: Type -> Type) = HandlingState {
- nHandles :: Key
- destructors :: Destructors m
- type HandlingStateT (m :: Type -> Type) = StateT (HandlingState m) m
- isRegistered :: Destructor m -> Bool
- runHandlingState :: forall (m :: Type -> Type). (Monad m, Typeable m) => LiveProgram (HandlingStateT m) -> LiveProgram m
- runHandlingStateC :: forall (m :: Type -> Type) a b. (Monad m, Typeable m) => Cell (HandlingStateT m) a b -> Cell m a b
- runHandlingStateT :: Monad m => HandlingStateT m a -> m a
- data NoMigration a
- = Initialized a
- | Uninitialized
- foreground :: Monad m => LiveProgram m -> m ()
- runStateC :: forall stateT (m :: Type -> Type) a b. (Data stateT, Monad m) => Cell (StateT stateT m) a b -> stateT -> Cell m a (b, stateT)
- runStateC_ :: forall stateT (m :: Type -> Type) a b. (Data stateT, Monad m) => Cell (StateT stateT m) a b -> stateT -> Cell m a b
- runReaderC :: forall r (m :: Type -> Type) a b. r -> Cell (ReaderT r m) a b -> Cell m a b
- runReaderC' :: forall (m :: Type -> Type) r a b. Monad m => Cell (ReaderT r m) a b -> Cell m (r, a) b
- readerC' :: forall (m :: Type -> Type) r a b. Monad m => Cell m (r, a) b -> Cell (ReaderT r m) a b
- runWriterC :: forall w (m :: Type -> Type) a b. (Monoid w, Monad m) => Cell (WriterT w m) a b -> Cell m a (w, b)
- stop :: forall (m :: Type -> Type). Launchable m => LaunchedProgram m -> IO ()
- fromNoMigration :: a -> NoMigration a -> a
- dataTypeNoMigration :: DataType
- initializedConstr :: Constr
- uninitializedConstr :: Constr
- arrChangesM :: (Monad m, Typeable a, Typeable b, Eq a) => (a -> m b) -> Cell m a b
- cellNoMigration :: (Typeable s, Functor m) => s -> (s -> a -> m (b, s)) -> Cell m a b
- data LaunchedProgram (m :: Type -> Type) = LaunchedProgram {
- programVar :: MVar (LiveProgram IO)
- threadId :: ThreadId
- stepProgram :: Monad m => LiveProgram m -> m (LiveProgram m)
- launch :: forall (m :: Type -> Type). Launchable m => LiveProgram m -> IO (LaunchedProgram m)
- liveMain :: forall (m :: Type -> Type). Launchable m => LiveProgram m -> IO ()
- background :: MVar (LiveProgram IO) -> IO ()
- stepLaunchedProgram :: forall (m :: Type -> Type). (Monad m, Launchable m) => LaunchedProgram m -> IO ()
- launchWithDebugger :: forall (m :: Type -> Type). (Monad m, Launchable m) => LiveProgram m -> Debugger m -> IO (LaunchedProgram m)
Documentation
module Data.Data
module Data.Profunctor.Strong
module Data.Profunctor.Traversing
module LiveCoding.Bind
module LiveCoding.Cell
module LiveCoding.Cell.Feedback
module LiveCoding.Cell.HotCodeSwap
module LiveCoding.Cell.Monad
module LiveCoding.Cell.NonBlocking
module LiveCoding.Cell.Resample
module LiveCoding.Cell.Util
module LiveCoding.CellExcept
module LiveCoding.Coalgebra
module LiveCoding.Debugger
module LiveCoding.Exceptions
module LiveCoding.Exceptions.Finite
module LiveCoding.Forever
module LiveCoding.Handle
module LiveCoding.Handle.Examples
module LiveCoding.LiveProgram
module LiveCoding.Migrate
module LiveCoding.Migrate.Debugger
module LiveCoding.Migrate.Migration
stateInternal :: State stateT stateInternal -> stateInternal Source #
class Category a => Arrow (a :: Type -> Type -> Type) where #
The basic arrow class.
Instances should satisfy the following laws:
arr
id =id
arr
(f >>> g) =arr
f >>>arr
gfirst
(arr
f) =arr
(first
f)first
(f >>> g) =first
f >>>first
gfirst
f >>>arr
fst
=arr
fst
>>> ffirst
f >>>arr
(id
*** g) =arr
(id
*** g) >>>first
ffirst
(first
f) >>>arr
assoc =arr
assoc >>>first
f
where
assoc ((a,b),c) = (a,(b,c))
The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
Lift a function to an arrow.
first :: a b c -> a (b, d) (c, d) #
Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
second :: a b c -> a (d, b) (d, c) #
A mirror image of first
.
The default definition may be overridden with a more efficient version if desired.
(***) :: a b c -> a b' c' -> a (b, b') (c, c') infixr 3 #
Split the input between the two argument arrows and combine their output. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(&&&) :: a b c -> a b c' -> a b (c, c') infixr 3 #
Fanout: send the input to both argument arrows and combine their output.
The default definition may be overridden with a more efficient version if desired.
Instances
Monad m => Arrow (Cell m) Source # | |
Monad m => Arrow (Kleisli m) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
Arrow p => Arrow (Closure p) | |
Defined in Data.Profunctor.Closed | |
Arrow p => Arrow (Tambara p) | |
Defined in Data.Profunctor.Strong | |
Arrow (->) | Since: base-2.1 |
Arrow p => Arrow (WrappedArrow p) | |
Defined in Data.Profunctor.Types Methods arr :: (b -> c) -> WrappedArrow p b c # first :: WrappedArrow p b c -> WrappedArrow p (b, d) (c, d) # second :: WrappedArrow p b c -> WrappedArrow p (d, b) (d, c) # (***) :: WrappedArrow p b c -> WrappedArrow p b' c' -> WrappedArrow p (b, b') (c, c') # (&&&) :: WrappedArrow p b c -> WrappedArrow p b c' -> WrappedArrow p b (c, c') # | |
(Arrow p, Arrow q) => Arrow (Product p q) | |
Defined in Data.Bifunctor.Product Methods arr :: (b -> c) -> Product p q b c # first :: Product p q b c -> Product p q (b, d) (c, d) # second :: Product p q b c -> Product p q (d, b) (d, c) # (***) :: Product p q b c -> Product p q b' c' -> Product p q (b, b') (c, c') # (&&&) :: Product p q b c -> Product p q b c' -> Product p q b (c, c') # | |
(Applicative f, Arrow p) => Arrow (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
(Applicative f, Arrow p) => Arrow (Cayley f p) | |
Defined in Data.Profunctor.Cayley |
(>>>) :: forall {k} cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c infixr 1 #
Left-to-right composition
class Arrow a => ArrowChoice (a :: Type -> Type -> Type) where #
Choice, for arrows that support it. This class underlies the
if
and case
constructs in arrow notation.
Instances should satisfy the following laws:
left
(arr
f) =arr
(left
f)left
(f >>> g) =left
f >>>left
gf >>>
arr
Left
=arr
Left
>>>left
fleft
f >>>arr
(id
+++ g) =arr
(id
+++ g) >>>left
fleft
(left
f) >>>arr
assocsum =arr
assocsum >>>left
f
where
assocsum (Left (Left x)) = Left x assocsum (Left (Right y)) = Right (Left y) assocsum (Right z) = Right (Right z)
The other combinators have sensible default definitions, which may be overridden for efficiency.
Methods
left :: a b c -> a (Either b d) (Either c d) #
Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.
right :: a b c -> a (Either d b) (Either d c) #
A mirror image of left
.
The default definition may be overridden with a more efficient version if desired.
(+++) :: a b c -> a b' c' -> a (Either b b') (Either c c') infixr 2 #
Split the input between the two argument arrows, retagging and merging their outputs. Note that this is in general not a functor.
The default definition may be overridden with a more efficient version if desired.
(|||) :: a b d -> a c d -> a (Either b c) d infixr 2 #
Fanin: Split the input between the two argument arrows and merge their outputs.
The default definition may be overridden with a more efficient version if desired.
Instances
class Arrow a => ArrowLoop (a :: Type -> Type -> Type) where #
The loop
operator expresses computations in which an output value
is fed back as input, although the computation occurs only once.
It underlies the rec
value recursion construct in arrow notation.
loop
should satisfy the following laws:
- extension
loop
(arr
f) =arr
(\ b ->fst
(fix
(\ (c,d) -> f (b,d))))- left tightening
loop
(first
h >>> f) = h >>>loop
f- right tightening
loop
(f >>>first
h) =loop
f >>> h- sliding
loop
(f >>>arr
(id
*** k)) =loop
(arr
(id
*** k) >>> f)- vanishing
loop
(loop
f) =loop
(arr
unassoc >>> f >>>arr
assoc)- superposing
second
(loop
f) =loop
(arr
assoc >>>second
f >>>arr
unassoc)
where
assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)
Instances
MonadFix m => ArrowLoop (Cell m) Source # | |
Defined in LiveCoding.Cell | |
MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
ArrowLoop p => ArrowLoop (Closure p) | |
Defined in Data.Profunctor.Closed | |
ArrowLoop p => ArrowLoop (Tambara p) | |
Defined in Data.Profunctor.Strong | |
ArrowLoop (->) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
ArrowLoop p => ArrowLoop (WrappedArrow p) | |
Defined in Data.Profunctor.Types Methods loop :: WrappedArrow p (b, d) (c, d) -> WrappedArrow p b c # | |
(ArrowLoop p, ArrowLoop q) => ArrowLoop (Product p q) | |
Defined in Data.Bifunctor.Product | |
(Applicative f, ArrowLoop p) => ArrowLoop (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
(Applicative f, ArrowLoop p) => ArrowLoop (Cayley f p) | |
Defined in Data.Profunctor.Cayley |
(<<<) :: forall {k} cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c infixr 1 #
Right-to-left composition
newtype ArrowMonad (a :: Type -> Type -> Type) b #
The ArrowApply
class is equivalent to Monad
: any monad gives rise
to a Kleisli
arrow, and any instance of ArrowApply
defines a monad.
Constructors
ArrowMonad (a () b) |
Instances
class Arrow a => ArrowApply (a :: Type -> Type -> Type) #
Some arrows allow application of arrow inputs to other inputs. Instances should satisfy the following laws:
first
(arr
(\x ->arr
(\y -> (x,y)))) >>>app
=id
first
(arr
(g >>>)) >>>app
=second
g >>>app
first
(arr
(>>> h)) >>>app
=app
>>> h
Such arrows are equivalent to monads (see ArrowMonad
).
Minimal complete definition
Instances
Monad m => ArrowApply (Kleisli m) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
ArrowApply p => ArrowApply (Tambara p) | |
Defined in Data.Profunctor.Strong | |
ArrowApply (->) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
ArrowApply p => ArrowApply (WrappedArrow p) | |
Defined in Data.Profunctor.Types Methods app :: WrappedArrow p (WrappedArrow p b c, b) c # |
class ArrowZero a => ArrowPlus (a :: Type -> Type -> Type) where #
A monoid on arrows.
class Arrow a => ArrowZero (a :: Type -> Type -> Type) where #
Instances
MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1 |
Defined in GHC.Internal.Control.Arrow | |
ArrowZero p => ArrowZero (Closure p) | |
Defined in Data.Profunctor.Closed | |
ArrowZero p => ArrowZero (Tambara p) | |
Defined in Data.Profunctor.Strong | |
ArrowZero p => ArrowZero (WrappedArrow p) | |
Defined in Data.Profunctor.Types Methods zeroArrow :: WrappedArrow p b c # | |
(ArrowZero p, ArrowZero q) => ArrowZero (Product p q) | |
Defined in Data.Bifunctor.Product | |
(Applicative f, ArrowZero p) => ArrowZero (Tannen f p) | |
Defined in Data.Bifunctor.Tannen | |
(Applicative f, ArrowZero p) => ArrowZero (Cayley f p) | |
Defined in Data.Profunctor.Cayley |
newtype Kleisli (m :: Type -> Type) a b #
Kleisli arrows of a monad.
Constructors
Kleisli | |
Fields
|
Instances
Monad m => Category (Kleisli m :: Type -> Type -> Type) | Since: base-3.0 | ||||
Generic1 (Kleisli m a :: Type -> Type) | |||||
Defined in GHC.Internal.Control.Arrow Associated Types
| |||||
Monad m => Arrow (Kleisli m) | Since: base-2.1 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
Monad m => ArrowApply (Kleisli m) | Since: base-2.1 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
Monad m => ArrowChoice (Kleisli m) | Since: base-2.1 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
MonadFix m => ArrowLoop (Kleisli m) | Beware that for many monads (those for which the Since: base-2.1 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
MonadPlus m => ArrowPlus (Kleisli m) | Since: base-2.1 | ||||
MonadPlus m => ArrowZero (Kleisli m) | Since: base-2.1 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
Monad m => Choice (Kleisli m) | |||||
(Distributive f, Monad f) => Closed (Kleisli f) | |||||
Defined in Data.Profunctor.Closed | |||||
(Monad m, Distributive m) => Mapping (Kleisli m) | |||||
(Monad m, Functor m) => Representable (Kleisli m) | |||||
MonadFix m => Costrong (Kleisli m) | |||||
Monad m => Strong (Kleisli m) | |||||
Monad m => Traversing (Kleisli m) | |||||
Defined in Data.Profunctor.Traversing | |||||
Monad m => Profunctor (Kleisli m) | |||||
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d # lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c # rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c # (#.) :: forall a b c q. Coercible c b => q b c -> Kleisli m a b -> Kleisli m a c # (.#) :: forall a b c q. Coercible b a => Kleisli m b c -> q a b -> Kleisli m a c # | |||||
(Monad m, Functor m) => Sieve (Kleisli m) m | |||||
Defined in Data.Profunctor.Sieve | |||||
Alternative m => Alternative (Kleisli m a) | Since: base-4.14.0.0 | ||||
Applicative m => Applicative (Kleisli m a) | Since: base-4.14.0.0 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
Functor m => Functor (Kleisli m a) | Since: base-4.14.0.0 | ||||
Monad m => Monad (Kleisli m a) | Since: base-4.14.0.0 | ||||
MonadPlus m => MonadPlus (Kleisli m a) | Since: base-4.14.0.0 | ||||
Generic (Kleisli m a b) | |||||
Defined in GHC.Internal.Control.Arrow Associated Types
| |||||
type Rep1 (Kleisli m a :: Type -> Type) | Since: base-4.14.0.0 | ||||
Defined in GHC.Internal.Control.Arrow | |||||
type Rep (Kleisli m) | |||||
Defined in Data.Profunctor.Rep | |||||
type Rep (Kleisli m a b) | Since: base-4.14.0.0 | ||||
Defined in GHC.Internal.Control.Arrow |
(<<^) :: Arrow a => a c d -> (b -> c) -> a b d infixr 1 #
Precomposition with a pure function (right-to-left variant).
(^<<) :: Arrow a => (c -> d) -> a b c -> a b d infixr 1 #
Postcomposition with a pure function (right-to-left variant).
leftApp :: ArrowApply a => a b c -> a (Either b d) (Either c d) #
Any instance of ArrowApply
can be made into an instance of
ArrowChoice
by defining left
= leftApp
.
class Monad m => Launchable (m :: Type -> Type) where Source #
Monads in which live programs can be launched in IO
,
for example when you have special effects that have to be handled on every reload.
The only thing necessary is to transform the LiveProgram
into one in the IO
monad, and the rest is taken care of in the framework.
Methods
runIO :: LiveProgram m -> LiveProgram IO Source #
Instances
Launchable IO Source # | |
Defined in LiveCoding.RuntimeIO.Launch Methods runIO :: LiveProgram IO -> LiveProgram IO Source # | |
(Typeable m, Launchable m) => Launchable (HandlingStateT m) Source # | |
Defined in LiveCoding.RuntimeIO.Launch Methods runIO :: LiveProgram (HandlingStateT m) -> LiveProgram IO Source # | |
(Data e, Finite e, Launchable m) => Launchable (ExceptT e m) Source # | Upon an exception, the program is restarted. To handle or log the exception, see LiveCoding.LiveProgram.Except. |
Defined in LiveCoding.RuntimeIO.Launch Methods runIO :: LiveProgram (ExceptT e m) -> LiveProgram IO Source # |
newtype WrappedArrow (p :: k -> k1 -> Type) (a :: k) (b :: k1) #
Wrap an arrow for use as a Profunctor
.
WrappedArrow
has a polymorphic kind since 5.6
.
Constructors
WrapArrow | |
Fields
|
Instances
type (:->) (p :: k -> k1 -> Type) (q :: k -> k1 -> Type) = forall (a :: k) (b :: k1). p a b -> q a b infixr 0 #
(:->
) has a polymorphic kind since 5.6
.
update :: forall (m :: Type -> Type). Launchable m => LaunchedProgram m -> LiveProgram m -> IO () Source #
Migrate (using hotCodeSwap
) the LiveProgram
to a new version.
class Profunctor (p :: Type -> Type -> Type) where #
Formally, the class Profunctor
represents a profunctor
from Hask
-> Hask
.
Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.
You can define a Profunctor
by either defining dimap
or by defining both
lmap
and rmap
.
If you supply dimap
, you should ensure that:
dimap
id
id
≡id
If you supply lmap
and rmap
, ensure:
lmap
id
≡id
rmap
id
≡id
If you supply both, you should also ensure:
dimap
f g ≡lmap
f.
rmap
g
These ensure by parametricity:
dimap
(f.
g) (h.
i) ≡dimap
g h.
dimap
f ilmap
(f.
g) ≡lmap
g.
lmap
frmap
(f.
g) ≡rmap
f.
rmap
g
Instances
Monad m => Profunctor (Cell m) Source # | |
Defined in LiveCoding.Cell Methods dimap :: (a -> b) -> (c -> d) -> Cell m b c -> Cell m a d # lmap :: (a -> b) -> Cell m b c -> Cell m a c # rmap :: (b -> c) -> Cell m a b -> Cell m a c # (#.) :: forall a b c q. Coercible c b => q b c -> Cell m a b -> Cell m a c # (.#) :: forall a b c q. Coercible b a => Cell m b c -> q a b -> Cell m a c # | |
Monad m => Profunctor (Kleisli m) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d # lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c # rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c # (#.) :: forall a b c q. Coercible c b => q b c -> Kleisli m a b -> Kleisli m a c # (.#) :: forall a b c q. Coercible b a => Kleisli m b c -> q a b -> Kleisli m a c # | |
Profunctor (CopastroSum p) | |
Defined in Data.Profunctor.Choice Methods dimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d # lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c # rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c # (#.) :: forall a b c q. Coercible c b => q b c -> CopastroSum p a b -> CopastroSum p a c # (.#) :: forall a b c q. Coercible b a => CopastroSum p b c -> q a b -> CopastroSum p a c # | |
Profunctor (CotambaraSum p) | |
Defined in Data.Profunctor.Choice Methods dimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d # lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c # rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c # (#.) :: forall a b c q. Coercible c b => q b c -> CotambaraSum p a b -> CotambaraSum p a c # (.#) :: forall a b c q. Coercible b a => CotambaraSum p b c -> q a b -> CotambaraSum p a c # | |
Profunctor (PastroSum p) | |
Defined in Data.Profunctor.Choice Methods dimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d # lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c # rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c # (#.) :: forall a b c q. Coercible c b => q b c -> PastroSum p a b -> PastroSum p a c # (.#) :: forall a b c q. Coercible b a => PastroSum p b c -> q a b -> PastroSum p a c # | |
Profunctor p => Profunctor (TambaraSum p) | |
Defined in Data.Profunctor.Choice Methods dimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d # lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c # rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c # (#.) :: forall a b c q. Coercible c b => q b c -> TambaraSum p a b -> TambaraSum p a c # (.#) :: forall a b c q. Coercible b a => TambaraSum p b c -> q a b -> TambaraSum p a c # | |
Profunctor p => Profunctor (Closure p) | |
Defined in Data.Profunctor.Closed Methods dimap :: (a -> b) -> (c -> d) -> Closure p b c -> Closure p a d # lmap :: (a -> b) -> Closure p b c -> Closure p a c # rmap :: (b -> c) -> Closure p a b -> Closure p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Closure p a b -> Closure p a c # (.#) :: forall a b c q. Coercible b a => Closure p b c -> q a b -> Closure p a c # | |
Profunctor (Environment p) | |
Defined in Data.Profunctor.Closed Methods dimap :: (a -> b) -> (c -> d) -> Environment p b c -> Environment p a d # lmap :: (a -> b) -> Environment p b c -> Environment p a c # rmap :: (b -> c) -> Environment p a b -> Environment p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Environment p a b -> Environment p a c # (.#) :: forall a b c q. Coercible b a => Environment p b c -> q a b -> Environment p a c # | |
Profunctor p => Profunctor (CofreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods dimap :: (a -> b) -> (c -> d) -> CofreeMapping p b c -> CofreeMapping p a d # lmap :: (a -> b) -> CofreeMapping p b c -> CofreeMapping p a c # rmap :: (b -> c) -> CofreeMapping p a b -> CofreeMapping p a c # (#.) :: forall a b c q. Coercible c b => q b c -> CofreeMapping p a b -> CofreeMapping p a c # (.#) :: forall a b c q. Coercible b a => CofreeMapping p b c -> q a b -> CofreeMapping p a c # | |
Profunctor (FreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods dimap :: (a -> b) -> (c -> d) -> FreeMapping p b c -> FreeMapping p a d # lmap :: (a -> b) -> FreeMapping p b c -> FreeMapping p a c # rmap :: (b -> c) -> FreeMapping p a b -> FreeMapping p a c # (#.) :: forall a b c q. Coercible c b => q b c -> FreeMapping p a b -> FreeMapping p a c # (.#) :: forall a b c q. Coercible b a => FreeMapping p b c -> q a b -> FreeMapping p a c # | |
Profunctor (Copastro p) | |
Defined in Data.Profunctor.Strong Methods dimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d # lmap :: (a -> b) -> Copastro p b c -> Copastro p a c # rmap :: (b -> c) -> Copastro p a b -> Copastro p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Copastro p a b -> Copastro p a c # (.#) :: forall a b c q. Coercible b a => Copastro p b c -> q a b -> Copastro p a c # | |
Profunctor (Cotambara p) | |
Defined in Data.Profunctor.Strong Methods dimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d # lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c # rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Cotambara p a b -> Cotambara p a c # (.#) :: forall a b c q. Coercible b a => Cotambara p b c -> q a b -> Cotambara p a c # | |
Profunctor (Pastro p) | |
Defined in Data.Profunctor.Strong Methods dimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d # lmap :: (a -> b) -> Pastro p b c -> Pastro p a c # rmap :: (b -> c) -> Pastro p a b -> Pastro p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Pastro p a b -> Pastro p a c # (.#) :: forall a b c q. Coercible b a => Pastro p b c -> q a b -> Pastro p a c # | |
Profunctor p => Profunctor (Tambara p) | |
Defined in Data.Profunctor.Strong Methods dimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d # lmap :: (a -> b) -> Tambara p b c -> Tambara p a c # rmap :: (b -> c) -> Tambara p a b -> Tambara p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Tambara p a b -> Tambara p a c # (.#) :: forall a b c q. Coercible b a => Tambara p b c -> q a b -> Tambara p a c # | |
Profunctor (Baz t) | |
Defined in Data.Profunctor.Traversing Methods dimap :: (a -> b) -> (c -> d) -> Baz t b c -> Baz t a d # lmap :: (a -> b) -> Baz t b c -> Baz t a c # rmap :: (b -> c) -> Baz t a b -> Baz t a c # (#.) :: forall a b c q. Coercible c b => q b c -> Baz t a b -> Baz t a c # (.#) :: forall a b c q. Coercible b a => Baz t b c -> q a b -> Baz t a c # | |
Profunctor (Bazaar a) | |
Defined in Data.Profunctor.Traversing Methods dimap :: (a0 -> b) -> (c -> d) -> Bazaar a b c -> Bazaar a a0 d # lmap :: (a0 -> b) -> Bazaar a b c -> Bazaar a a0 c # rmap :: (b -> c) -> Bazaar a a0 b -> Bazaar a a0 c # (#.) :: forall a0 b c q. Coercible c b => q b c -> Bazaar a a0 b -> Bazaar a a0 c # (.#) :: forall a0 b c q. Coercible b a0 => Bazaar a b c -> q a0 b -> Bazaar a a0 c # | |
Profunctor p => Profunctor (CofreeTraversing p) | |
Defined in Data.Profunctor.Traversing Methods dimap :: (a -> b) -> (c -> d) -> CofreeTraversing p b c -> CofreeTraversing p a d # lmap :: (a -> b) -> CofreeTraversing p b c -> CofreeTraversing p a c # rmap :: (b -> c) -> CofreeTraversing p a b -> CofreeTraversing p a c # (#.) :: forall a b c q. Coercible c b => q b c -> CofreeTraversing p a b -> CofreeTraversing p a c # (.#) :: forall a b c q. Coercible b a => CofreeTraversing p b c -> q a b -> CofreeTraversing p a c # | |
Profunctor (FreeTraversing p) | |
Defined in Data.Profunctor.Traversing Methods dimap :: (a -> b) -> (c -> d) -> FreeTraversing p b c -> FreeTraversing p a d # lmap :: (a -> b) -> FreeTraversing p b c -> FreeTraversing p a c # rmap :: (b -> c) -> FreeTraversing p a b -> FreeTraversing p a c # (#.) :: forall a b c q. Coercible c b => q b c -> FreeTraversing p a b -> FreeTraversing p a c # (.#) :: forall a b c q. Coercible b a => FreeTraversing p b c -> q a b -> FreeTraversing p a c # | |
Profunctor (Coyoneda p) | |
Defined in Data.Profunctor.Yoneda Methods dimap :: (a -> b) -> (c -> d) -> Coyoneda p b c -> Coyoneda p a d # lmap :: (a -> b) -> Coyoneda p b c -> Coyoneda p a c # rmap :: (b -> c) -> Coyoneda p a b -> Coyoneda p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Coyoneda p a b -> Coyoneda p a c # (.#) :: forall a b c q. Coercible b a => Coyoneda p b c -> q a b -> Coyoneda p a c # | |
Profunctor (Yoneda p) | |
Defined in Data.Profunctor.Yoneda Methods dimap :: (a -> b) -> (c -> d) -> Yoneda p b c -> Yoneda p a d # lmap :: (a -> b) -> Yoneda p b c -> Yoneda p a c # rmap :: (b -> c) -> Yoneda p a b -> Yoneda p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Yoneda p a b -> Yoneda p a c # (.#) :: forall a b c q. Coercible b a => Yoneda p b c -> q a b -> Yoneda p a c # | |
Profunctor (Tagged :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d # lmap :: (a -> b) -> Tagged b c -> Tagged a c # rmap :: (b -> c) -> Tagged a b -> Tagged a c # (#.) :: forall a b c q. Coercible c b => q b c -> Tagged a b -> Tagged a c # (.#) :: forall a b c q. Coercible b a => Tagged b c -> q a b -> Tagged a c # | |
Functor w => Profunctor (Cokleisli w) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d # lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c # rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c # (#.) :: forall a b c q. Coercible c b => q b c -> Cokleisli w a b -> Cokleisli w a c # (.#) :: forall a b c q. Coercible b a => Cokleisli w b c -> q a b -> Cokleisli w a c # | |
Functor f => Profunctor (Costar f) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d # lmap :: (a -> b) -> Costar f b c -> Costar f a c # rmap :: (b -> c) -> Costar f a b -> Costar f a c # (#.) :: forall a b c q. Coercible c b => q b c -> Costar f a b -> Costar f a c # (.#) :: forall a b c q. Coercible b a => Costar f b c -> q a b -> Costar f a c # | |
Profunctor (Forget r :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d # lmap :: (a -> b) -> Forget r b c -> Forget r a c # rmap :: (b -> c) -> Forget r a b -> Forget r a c # (#.) :: forall a b c q. Coercible c b => q b c -> Forget r a b -> Forget r a c # (.#) :: forall a b c q. Coercible b a => Forget r b c -> q a b -> Forget r a c # | |
Functor f => Profunctor (Star f) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d # lmap :: (a -> b) -> Star f b c -> Star f a c # rmap :: (b -> c) -> Star f a b -> Star f a c # (#.) :: forall a b c q. Coercible c b => q b c -> Star f a b -> Star f a c # (.#) :: forall a b c q. Coercible b a => Star f b c -> q a b -> Star f a c # | |
Profunctor (->) | |
Defined in Data.Profunctor.Unsafe | |
Contravariant f => Profunctor (Clown f :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Clown f b c -> Clown f a d # lmap :: (a -> b) -> Clown f b c -> Clown f a c # rmap :: (b -> c) -> Clown f a b -> Clown f a c # (#.) :: forall a b c q. Coercible c b => q b c -> Clown f a b -> Clown f a c # (.#) :: forall a b c q. Coercible b a => Clown f b c -> q a b -> Clown f a c # | |
Functor f => Profunctor (Joker f :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Joker f b c -> Joker f a d # lmap :: (a -> b) -> Joker f b c -> Joker f a c # rmap :: (b -> c) -> Joker f a b -> Joker f a c # (#.) :: forall a b c q. Coercible c b => q b c -> Joker f a b -> Joker f a c # (.#) :: forall a b c q. Coercible b a => Joker f b c -> q a b -> Joker f a c # | |
Profunctor p => Profunctor (Codensity p) | |
Defined in Data.Profunctor.Ran Methods dimap :: (a -> b) -> (c -> d) -> Codensity p b c -> Codensity p a d # lmap :: (a -> b) -> Codensity p b c -> Codensity p a c # rmap :: (b -> c) -> Codensity p a b -> Codensity p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Codensity p a b -> Codensity p a c # (.#) :: forall a b c q. Coercible b a => Codensity p b c -> q a b -> Codensity p a c # | |
Arrow p => Profunctor (WrappedArrow p) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d # lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c # rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c # (#.) :: forall a b c q. Coercible c b => q b c -> WrappedArrow p a b -> WrappedArrow p a c # (.#) :: forall a b c q. Coercible b a => WrappedArrow p b c -> q a b -> WrappedArrow p a c # | |
(Profunctor p, Profunctor q) => Profunctor (Product p q) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Product p q b c -> Product p q a d # lmap :: (a -> b) -> Product p q b c -> Product p q a c # rmap :: (b -> c) -> Product p q a b -> Product p q a c # (#.) :: forall a b c q0. Coercible c b => q0 b c -> Product p q a b -> Product p q a c # (.#) :: forall a b c q0. Coercible b a => Product p q b c -> q0 a b -> Product p q a c # | |
(Profunctor p, Profunctor q) => Profunctor (Sum p q) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Sum p q b c -> Sum p q a d # lmap :: (a -> b) -> Sum p q b c -> Sum p q a c # rmap :: (b -> c) -> Sum p q a b -> Sum p q a c # (#.) :: forall a b c q0. Coercible c b => q0 b c -> Sum p q a b -> Sum p q a c # (.#) :: forall a b c q0. Coercible b a => Sum p q b c -> q0 a b -> Sum p q a c # | |
(Functor f, Profunctor p) => Profunctor (Tannen f p) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Tannen f p b c -> Tannen f p a d # lmap :: (a -> b) -> Tannen f p b c -> Tannen f p a c # rmap :: (b -> c) -> Tannen f p a b -> Tannen f p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Tannen f p a b -> Tannen f p a c # (.#) :: forall a b c q. Coercible b a => Tannen f p b c -> q a b -> Tannen f p a c # | |
(Functor f, Profunctor p) => Profunctor (Cayley f p) | |
Defined in Data.Profunctor.Cayley Methods dimap :: (a -> b) -> (c -> d) -> Cayley f p b c -> Cayley f p a d # lmap :: (a -> b) -> Cayley f p b c -> Cayley f p a c # rmap :: (b -> c) -> Cayley f p a b -> Cayley f p a c # (#.) :: forall a b c q. Coercible c b => q b c -> Cayley f p a b -> Cayley f p a c # (.#) :: forall a b c q. Coercible b a => Cayley f p b c -> q a b -> Cayley f p a c # | |
(Profunctor p, Profunctor q) => Profunctor (Procompose p q) | |
Defined in Data.Profunctor.Composition Methods dimap :: (a -> b) -> (c -> d) -> Procompose p q b c -> Procompose p q a d # lmap :: (a -> b) -> Procompose p q b c -> Procompose p q a c # rmap :: (b -> c) -> Procompose p q a b -> Procompose p q a c # (#.) :: forall a b c q0. Coercible c b => q0 b c -> Procompose p q a b -> Procompose p q a c # (.#) :: forall a b c q0. Coercible b a => Procompose p q b c -> q0 a b -> Procompose p q a c # | |
(Profunctor p, Profunctor q) => Profunctor (Rift p q) | |
Defined in Data.Profunctor.Composition Methods dimap :: (a -> b) -> (c -> d) -> Rift p q b c -> Rift p q a d # lmap :: (a -> b) -> Rift p q b c -> Rift p q a c # rmap :: (b -> c) -> Rift p q a b -> Rift p q a c # (#.) :: forall a b c q0. Coercible c b => q0 b c -> Rift p q a b -> Rift p q a c # (.#) :: forall a b c q0. Coercible b a => Rift p q b c -> q0 a b -> Rift p q a c # | |
(Profunctor p, Profunctor q) => Profunctor (Ran p q) | |
Defined in Data.Profunctor.Ran Methods dimap :: (a -> b) -> (c -> d) -> Ran p q b c -> Ran p q a d # lmap :: (a -> b) -> Ran p q b c -> Ran p q a c # rmap :: (b -> c) -> Ran p q a b -> Ran p q a c # (#.) :: forall a b c q0. Coercible c b => q0 b c -> Ran p q a b -> Ran p q a c # (.#) :: forall a b c q0. Coercible b a => Ran p q b c -> q0 a b -> Ran p q a c # | |
(Profunctor p, Functor f, Functor g) => Profunctor (Biff p f g) | |
Defined in Data.Profunctor.Unsafe Methods dimap :: (a -> b) -> (c -> d) -> Biff p f g b c -> Biff p f g a d # lmap :: (a -> b) -> Biff p f g b c -> Biff p f g a c # rmap :: (b -> c) -> Biff p f g a b -> Biff p f g a c # (#.) :: forall a b c q. Coercible c b => q b c -> Biff p f g a b -> Biff p f g a c # (.#) :: forall a b c q. Coercible b a => Biff p f g b c -> q a b -> Biff p f g a c # |
Forget
has a polymorphic kind since 5.6
.
Instances
Monoid r => Choice (Forget r :: Type -> Type -> Type) | |
Cochoice (Forget r :: Type -> Type -> Type) | |
Representable (Forget r :: Type -> Type -> Type) | |
Strong (Forget r :: Type -> Type -> Type) | |
Monoid m => Traversing (Forget m :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Traversing | |
Profunctor (Forget r :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d # lmap :: (a -> b) -> Forget r b c -> Forget r a c # rmap :: (b -> c) -> Forget r a b -> Forget r a c # (#.) :: forall a b c q. Coercible c b => q b c -> Forget r a b -> Forget r a c # (.#) :: forall a b c q. Coercible b a => Forget r b c -> q a b -> Forget r a c # | |
Sieve (Forget r :: Type -> Type -> Type) (Const r :: Type -> Type) | |
Defined in Data.Profunctor.Sieve | |
Contravariant (Forget r a :: Type -> Type) | |
Functor (Forget r a :: Type -> Type) | |
Foldable (Forget r a :: Type -> Type) | |
Defined in Data.Profunctor.Types Methods fold :: Monoid m => Forget r a m -> m # foldMap :: Monoid m => (a0 -> m) -> Forget r a a0 -> m # foldMap' :: Monoid m => (a0 -> m) -> Forget r a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Forget r a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Forget r a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Forget r a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Forget r a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 # toList :: Forget r a a0 -> [a0] # null :: Forget r a a0 -> Bool # length :: Forget r a a0 -> Int # elem :: Eq a0 => a0 -> Forget r a a0 -> Bool # maximum :: Ord a0 => Forget r a a0 -> a0 # minimum :: Ord a0 => Forget r a a0 -> a0 # | |
Traversable (Forget r a :: Type -> Type) | |
Defined in Data.Profunctor.Types | |
Monoid r => Monoid (Forget r a b) | Via Since: profunctors-5.6.2 |
Semigroup r => Semigroup (Forget r a b) | Via Since: profunctors-5.6.2 |
type Rep (Forget r :: Type -> Type -> Type) | |
newtype Costar (f :: k -> Type) (d :: k) c #
Lift a Functor
into a Profunctor
(backwards).
Costar
has a polymorphic kind since 5.6
.
Instances
newtype Star (f :: k -> Type) d (c :: k) #
Lift a Functor
into a Profunctor
(forwards).
Star
has a polymorphic kind since 5.6
.
Instances
Monad f => Category (Star f :: Type -> Type -> Type) | |
Applicative f => Choice (Star f) | |
Traversable f => Cochoice (Star f) | |
Distributive f => Closed (Star f) | |
Defined in Data.Profunctor.Closed | |
(Applicative m, Distributive m) => Mapping (Star m) | |
Functor f => Representable (Star f) | |
Functor m => Strong (Star m) | |
Applicative m => Traversing (Star m) | |
Defined in Data.Profunctor.Traversing | |
Functor f => Profunctor (Star f) | |
Defined in Data.Profunctor.Types Methods dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d # lmap :: (a -> b) -> Star f b c -> Star f a c # rmap :: (b -> c) -> Star f a b -> Star f a c # (#.) :: forall a b c q. Coercible c b => q b c -> Star f a b -> Star f a c # (.#) :: forall a b c q. Coercible b a => Star f b c -> q a b -> Star f a c # | |
Functor f => Sieve (Star f) f | |
Defined in Data.Profunctor.Sieve | |
Contravariant f => Contravariant (Star f a) | |
Distributive f => Distributive (Star f a) | |
Defined in Data.Profunctor.Types | |
Alternative f => Alternative (Star f a) | |
Applicative f => Applicative (Star f a) | |
Functor f => Functor (Star f a) | |
Monad f => Monad (Star f a) | |
MonadPlus f => MonadPlus (Star f a) | |
type Rep (Star f) | |
Defined in Data.Profunctor.Rep |
class Profunctor p => Closed (p :: Type -> Type -> Type) where #
A strong profunctor allows the monoidal structure to pass through.
A closed profunctor allows the closed structure to pass through.
Methods
Instances
(Distributive f, Monad f) => Closed (Kleisli f) | |
Defined in Data.Profunctor.Closed | |
Profunctor p => Closed (Closure p) | |
Defined in Data.Profunctor.Closed | |
Closed (Environment p) | |
Defined in Data.Profunctor.Closed Methods closed :: Environment p a b -> Environment p (x -> a) (x -> b) # | |
Profunctor p => Closed (CofreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods closed :: CofreeMapping p a b -> CofreeMapping p (x -> a) (x -> b) # | |
Closed (FreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods closed :: FreeMapping p a b -> FreeMapping p (x -> a) (x -> b) # | |
Closed p => Closed (Coyoneda p) | |
Defined in Data.Profunctor.Yoneda | |
Closed p => Closed (Yoneda p) | |
Defined in Data.Profunctor.Yoneda | |
Closed (Tagged :: Type -> Type -> Type) | |
Defined in Data.Profunctor.Closed | |
Functor f => Closed (Cokleisli f) | |
Defined in Data.Profunctor.Closed | |
Functor f => Closed (Costar f) | |
Defined in Data.Profunctor.Closed | |
Distributive f => Closed (Star f) | |
Defined in Data.Profunctor.Closed | |
Closed (->) | |
Defined in Data.Profunctor.Closed | |
(Closed p, Closed q) => Closed (Product p q) | |
Defined in Data.Profunctor.Closed | |
(Closed p, Closed q) => Closed (Sum p q) | |
Defined in Data.Profunctor.Closed | |
(Functor f, Closed p) => Closed (Tannen f p) | |
Defined in Data.Profunctor.Closed | |
(Functor f, Closed p) => Closed (Cayley f p) | |
Defined in Data.Profunctor.Cayley | |
(Closed p, Closed q) => Closed (Procompose p q) | |
Defined in Data.Profunctor.Composition Methods closed :: Procompose p q a b -> Procompose p q (x -> a) (x -> b) # |
class Profunctor p => Cochoice (p :: Type -> Type -> Type) where #
Methods
unleft :: p (Either a d) (Either b d) -> p a b #
Laws:
unleft
≡unright
.
dimap
swapE swapE where swapE ::Either
a b ->Either
b a swapE =either
Right
Left
rmap
(either
id
absurd
) ≡unleft
.
lmap
(either
id
absurd
)unfirst
.
rmap
(second
f) ≡unfirst
.
lmap
(second
f)unleft
.
unleft
≡unleft
.
dimap
assocE unassocE where assocE ::Either
(Either
a b) c ->Either
a (Either
b c) assocE (Left
(Left
a)) =Left
a assocE (Left
(Right
b)) =Right
(Left
b) assocE (Right
c) =Right
(Right
c) unassocE ::Either
a (Either
b c) ->Either
(Either
a b) c unassocE (Left
a) =Left
(Left
a) unassocE (Right
(Left
b)) =Left
(Right
b) unassocE (Right
(Right
c)) =Right
c
unright :: p (Either d a) (Either d b) -> p a b #
Laws:
unright
≡unleft
.
dimap
swapE swapE where swapE ::Either
a b ->Either
b a swapE =either
Right
Left
rmap
(either
absurd
id
) ≡unright
.
lmap
(either
absurd
id
)unsecond
.
rmap
(first
f) ≡unsecond
.
lmap
(first
f)unright
.
unright
≡unright
.
dimap
unassocE assocE where assocE ::Either
(Either
a b) c ->Either
a (Either
b c) assocE (Left
(Left
a)) =Left
a assocE (Left
(Right
b)) =Right
(Left
b) assocE (Right
c) =Right
(Right
c) unassocE ::Either
a (Either
b c) ->Either
(Either
a b) c unassocE (Left
a) =Left
(Left
a) unassocE (Right
(Left
b)) =Left
(Right
b) unassocE (Right
(Right
c)) =Right
c
Instances
Cochoice (CopastroSum p) | |
Defined in Data.Profunctor.Choice Methods unleft :: CopastroSum p (Either a d) (Either b d) -> CopastroSum p a b # unright :: CopastroSum p (Either d a) (Either d b) -> CopastroSum p a b # | |
Cochoice (CotambaraSum p) | |
Defined in Data.Profunctor.Choice Methods unleft :: CotambaraSum p (Either a d) (Either b d) -> CotambaraSum p a b # unright :: CotambaraSum p (Either d a) (Either d b) -> CotambaraSum p a b # | |
Cochoice p => Cochoice (Coyoneda p) | |
Cochoice p => Cochoice (Yoneda p) | |
Applicative f => Cochoice (Costar f) | |
Cochoice (Forget r :: Type -> Type -> Type) | |
Traversable f => Cochoice (Star f) | |
Cochoice (->) | |
(Cochoice p, Cochoice q) => Cochoice (Product p q) | |
(Cochoice p, Cochoice q) => Cochoice (Sum p q) | |
(Functor f, Cochoice p) => Cochoice (Tannen f p) | |
(Functor f, Cochoice p) => Cochoice (Cayley f p) | |
left' :: Choice p => p a b -> p (Either a c) (Either b c) #
Laws:
left'
≡dimap
swapE swapE.
right'
where swapE ::Either
a b ->Either
b a swapE =either
Right
Left
rmap
Left
≡lmap
Left
.
left'
lmap
(right
f).
left'
≡rmap
(right
f).
left'
left'
.
left'
≡dimap
assocE unassocE.
left'
where assocE ::Either
(Either
a b) c ->Either
a (Either
b c) assocE (Left
(Left
a)) =Left
a assocE (Left
(Right
b)) =Right
(Left
b) assocE (Right
c) =Right
(Right
c) unassocE ::Either
a (Either
b c) ->Either
(Either
a b) c unassocE (Left
a) =Left
(Left
a) unassocE (Right
(Left
b)) =Left
(Right
b) unassocE (Right
(Right
c)) =Right
c
right' :: Choice p => p a b -> p (Either c a) (Either c b) #
Laws:
right'
≡dimap
swapE swapE.
left'
where swapE ::Either
a b ->Either
b a swapE =either
Right
Left
rmap
Right
≡lmap
Right
.
right'
lmap
(left
f).
right'
≡rmap
(left
f).
right'
right'
.
right'
≡dimap
unassocE assocE.
right'
where assocE ::Either
(Either
a b) c ->Either
a (Either
b c) assocE (Left
(Left
a)) =Left
a assocE (Left
(Right
b)) =Right
(Left
b) assocE (Right
c) =Right
(Right
c) unassocE ::Either
a (Either
b c) ->Either
(Either
a b) c unassocE (Left
a) =Left
(Left
a) unassocE (Right
(Left
b)) =Left
(Right
b) unassocE (Right
(Right
c)) =Right
c
class (Traversing p, Closed p) => Mapping (p :: Type -> Type -> Type) where #
Minimal complete definition
Nothing
Methods
Instances
(Monad m, Distributive m) => Mapping (Kleisli m) | |
Profunctor p => Mapping (CofreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods map' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) # roam :: ((a -> b) -> s -> t) -> CofreeMapping p a b -> CofreeMapping p s t # | |
Mapping (FreeMapping p) | |
Defined in Data.Profunctor.Mapping Methods map' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) # roam :: ((a -> b) -> s -> t) -> FreeMapping p a b -> FreeMapping p s t # | |
Mapping p => Mapping (Coyoneda p) | |
Mapping p => Mapping (Yoneda p) | |
(Applicative m, Distributive m) => Mapping (Star m) | |
Mapping (->) | |
(Functor f, Mapping p) => Mapping (Tannen f p) | |
(Functor f, Mapping p) => Mapping (Cayley f p) | |
(Mapping p, Mapping q) => Mapping (Procompose p q) | |
Defined in Data.Profunctor.Composition Methods map' :: Functor f => Procompose p q a b -> Procompose p q (f a) (f b) # roam :: ((a -> b) -> s -> t) -> Procompose p q a b -> Procompose p q s t # |
data HandlingState (m :: Type -> Type) Source #
Hold a map of registered handle keys and destructors
Constructors
HandlingState | |
Fields
|
Instances
(Typeable m, Launchable m) => Launchable (HandlingStateT m) Source # | |
Defined in LiveCoding.RuntimeIO.Launch Methods runIO :: LiveProgram (HandlingStateT m) -> LiveProgram IO Source # | |
Typeable m => Data (HandlingState m) Source # | |
Defined in LiveCoding.HandlingState Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> HandlingState m -> c (HandlingState m) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (HandlingState m) # toConstr :: HandlingState m -> Constr # dataTypeOf :: HandlingState m -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (HandlingState m)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (HandlingState m)) # gmapT :: (forall b. Data b => b -> b) -> HandlingState m -> HandlingState m # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> HandlingState m -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> HandlingState m -> r # gmapQ :: (forall d. Data d => d -> u) -> HandlingState m -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> HandlingState m -> u # gmapM :: Monad m0 => (forall d. Data d => d -> m0 d) -> HandlingState m -> m0 (HandlingState m) # gmapMp :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> HandlingState m -> m0 (HandlingState m) # gmapMo :: MonadPlus m0 => (forall d. Data d => d -> m0 d) -> HandlingState m -> m0 (HandlingState m) # |
type HandlingStateT (m :: Type -> Type) = StateT (HandlingState m) m Source #
In this monad, handles can be registered, and their destructors automatically executed. It is basically a monad in which handles are automatically garbage collected.
isRegistered :: Destructor m -> Bool Source #
runHandlingState :: forall (m :: Type -> Type). (Monad m, Typeable m) => LiveProgram (HandlingStateT m) -> LiveProgram m Source #
Like runHandlingStateC
, but for whole live programs.
runHandlingStateC :: forall (m :: Type -> Type) a b. (Monad m, Typeable m) => Cell (HandlingStateT m) a b -> Cell m a b Source #
Apply this to your main live cell before passing it to the runtime.
On the first tick, it initialises the HandlingState
at "no handles".
On every step, it does:
- Unregister all handles
- Register currently present handles
- Destroy all still unregistered handles (i.e. those that were removed in the last tick)
runHandlingStateT :: Monad m => HandlingStateT m a -> m a Source #
Handle the HandlingStateT
effect _without_ garbage collection.
Apply this to your main loop after calling foreground
.
Since there is no garbage collection, don't use this function for live coding.
data NoMigration a Source #
Isomorphic to
but has a different Maybe
aData
instance. The Data
instance for
doesn't require a NoMigration
aData
instance for a
.
If a data type is wrapped in NoMigration
then it can be used as the state of a Cell
without requiring it to have a Data
instance. The consequence is that if the type has changed
in between a livereload, then the previous saved value will be discarded, and no migration attempt
will happen.
Constructors
Initialized a | |
Uninitialized |
Instances
Functor NoMigration Source # | |
Defined in LiveCoding.Migrate.NoMigration Methods fmap :: (a -> b) -> NoMigration a -> NoMigration b # (<$) :: a -> NoMigration b -> NoMigration a # | |
Foldable NoMigration Source # | |
Defined in LiveCoding.Migrate.NoMigration Methods fold :: Monoid m => NoMigration m -> m # foldMap :: Monoid m => (a -> m) -> NoMigration a -> m # foldMap' :: Monoid m => (a -> m) -> NoMigration a -> m # foldr :: (a -> b -> b) -> b -> NoMigration a -> b # foldr' :: (a -> b -> b) -> b -> NoMigration a -> b # foldl :: (b -> a -> b) -> b -> NoMigration a -> b # foldl' :: (b -> a -> b) -> b -> NoMigration a -> b # foldr1 :: (a -> a -> a) -> NoMigration a -> a # foldl1 :: (a -> a -> a) -> NoMigration a -> a # toList :: NoMigration a -> [a] # null :: NoMigration a -> Bool # length :: NoMigration a -> Int # elem :: Eq a => a -> NoMigration a -> Bool # maximum :: Ord a => NoMigration a -> a # minimum :: Ord a => NoMigration a -> a # sum :: Num a => NoMigration a -> a # product :: Num a => NoMigration a -> a # | |
Traversable NoMigration Source # | |
Defined in LiveCoding.Migrate.NoMigration Methods traverse :: Applicative f => (a -> f b) -> NoMigration a -> f (NoMigration b) # sequenceA :: Applicative f => NoMigration (f a) -> f (NoMigration a) # mapM :: Monad m => (a -> m b) -> NoMigration a -> m (NoMigration b) # sequence :: Monad m => NoMigration (m a) -> m (NoMigration a) # | |
Typeable a => Data (NoMigration a) Source # | The Data instance for |
Defined in LiveCoding.Migrate.NoMigration Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> NoMigration a -> c (NoMigration a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (NoMigration a) # toConstr :: NoMigration a -> Constr # dataTypeOf :: NoMigration a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (NoMigration a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (NoMigration a)) # gmapT :: (forall b. Data b => b -> b) -> NoMigration a -> NoMigration a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> NoMigration a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> NoMigration a -> r # gmapQ :: (forall d. Data d => d -> u) -> NoMigration a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> NoMigration a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> NoMigration a -> m (NoMigration a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> NoMigration a -> m (NoMigration a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> NoMigration a -> m (NoMigration a) # | |
Show a => Show (NoMigration a) Source # | |
Defined in LiveCoding.Migrate.NoMigration Methods showsPrec :: Int -> NoMigration a -> ShowS # show :: NoMigration a -> String # showList :: [NoMigration a] -> ShowS # | |
Eq a => Eq (NoMigration a) Source # | |
Defined in LiveCoding.Migrate.NoMigration Methods (==) :: NoMigration a -> NoMigration a -> Bool # (/=) :: NoMigration a -> NoMigration a -> Bool # |
foreground :: Monad m => LiveProgram m -> m () Source #
Arguments
:: forall stateT (m :: Type -> Type) a b. (Data stateT, Monad m) | |
=> Cell (StateT stateT m) a b | A cell with a state effect |
-> stateT | The initial state |
-> Cell m a (b, stateT) | The cell, returning its current state |
Push effectful state into the internal state of a cell
Arguments
:: forall stateT (m :: Type -> Type) a b. (Data stateT, Monad m) | |
=> Cell (StateT stateT m) a b | A cell with a state effect |
-> stateT | The initial state |
-> Cell m a b |
Like runStateC
, but does not return the current state.
runReaderC :: forall r (m :: Type -> Type) a b. r -> Cell (ReaderT r m) a b -> Cell m a b Source #
Supply a ReaderT
environment before running the cell
runReaderC' :: forall (m :: Type -> Type) r a b. Monad m => Cell (ReaderT r m) a b -> Cell m (r, a) b Source #
Supply a ReaderT
environment live
readerC' :: forall (m :: Type -> Type) r a b. Monad m => Cell m (r, a) b -> Cell (ReaderT r m) a b Source #
Inverse to runReaderC'
runWriterC :: forall w (m :: Type -> Type) a b. (Monoid w, Monad m) => Cell (WriterT w m) a b -> Cell m a (w, b) Source #
Run the effects of the WriterT
monad,
collecting all its output in the second element of the tuple.
stop :: forall (m :: Type -> Type). Launchable m => LaunchedProgram m -> IO () Source #
Stops a thread where a LiveProgram
is being executed.
Before the thread is killed, an empty program (in the monad m
) is first inserted and stepped.
This can be used to call cleanup actions encoded in the monad,
such as HandlingStateT
.
fromNoMigration :: a -> NoMigration a -> a Source #
data LaunchedProgram (m :: Type -> Type) Source #
A launched LiveProgram
and the thread in which it is running.
Constructors
LaunchedProgram | |
Fields
|
stepProgram :: Monad m => LiveProgram m -> m (LiveProgram m) Source #
Advance a LiveProgram
by a single step.
launch :: forall (m :: Type -> Type). Launchable m => LiveProgram m -> IO (LaunchedProgram m) Source #
Launch a LiveProgram
in a separate thread.
The MVar
can be used to update
the program while automatically migrating it.
The ThreadId
represents the thread where the program runs in.
You're advised not to kill it directly, but to run stop
instead.
liveMain :: forall (m :: Type -> Type). Launchable m => LiveProgram m -> IO () Source #
The standard top level main
for a live program.
Typically, you will define a top level LiveProgram
in some monad like
,
and then add these two lines of boiler plate:HandlingStateT
IO
main :: IO () main = liveMain liveProgram
background :: MVar (LiveProgram IO) -> IO () Source #
This is the background task executed by launch
.
stepLaunchedProgram :: forall (m :: Type -> Type). (Monad m, Launchable m) => LaunchedProgram m -> IO () Source #
Advance a launched LiveProgram
by a single step and store the result.
launchWithDebugger :: forall (m :: Type -> Type). (Monad m, Launchable m) => LiveProgram m -> Debugger m -> IO (LaunchedProgram m) Source #
Launch a LiveProgram
, but first attach a debugger to it.