Safe Haskell | None |
---|---|
Language | Haskell2010 |
- newtype WizardT m a = WizardT {
- wand :: m (m a)
- egg :: (Applicative f, Monoid a) => WizardT f a
- tadpole :: Applicative f => a -> WizardT f a
- transform :: Functor f => (a -> b) -> WizardT f a -> WizardT f b
- essence :: Monad m => WizardT m a -> m a
- leviosa :: Monad m => m a -> WizardT m a
- summon :: Monad m => (a -> WizardT m b) -> m a -> WizardT m b
- sageMode :: forall m t a b. (Monad m, Foldable t, Monoid a, Monoid b) => (a -> WizardT m b) -> t a -> m b
- empty :: (Applicative f, Monoid a) => WizardT f a
- singleton :: Applicative f => a -> WizardT f a
- mapWizard :: Functor f => (a -> b) -> WizardT f a -> WizardT f b
- foldWizard :: forall m t a b. (Monad m, Foldable t, Monoid a, Monoid b) => (a -> WizardT m b) -> t a -> m b
- type Wizard a = WizardT Identity a
- type WizardAlt f a = WizardT (Alt f) a
- type WizardComplex a = WizardT Complex a
- type WizardDown a = WizardT Down a
- type WizardDual a = WizardT Dual a
- type WizardEither a e = WizardT (Either e) a
- type WizardEndo a = WizardT ((->) a) a
- type WizardF a b = WizardT ((->) b) a
- type WizardFirst a = WizardT First a
- type WizardGProd f g a = WizardT (f :*: g) a
- type WizardIO a = WizardT IO a
- type WizardLast a = WizardT Last a
- type WizardList a = WizardT [] a
- type WizardM1 i c f a = WizardT (M1 i c f) a
- type WizardMax a = WizardT Max a
- type WizardMaybe a = WizardT Maybe a
- type WizardMin a = WizardT Min a
- type WizardNonEmpty a = WizardT NonEmpty a
- type WizardOption a = WizardT Option a
- type WizardPar1 a = WizardT Par1 a
- type WizardProduct a = WizardT Product a
- type WizardProxy a = WizardT Proxy a
- type WizardReadP a = WizardT ReadP a
- type WizardReadPrec a = WizardT ReadPrec a
- type WizardRec1 f a = WizardT (Rec1 f) a
- type WizardST s a = WizardT (ST s) a
- type WizardSTM a = WizardT STM a
- type WizardSum a = WizardT Sum a
- type WizardTuple a = WizardT ((,) a) a
- type WizardU1 a = WizardT U1 a
Documentation
newtype WizardT m a infixr 9 Source #
A Wizard
Monoid, based on ideas expressed by Gabriel Gonzalez
at http://www.haskellforall.com/2018/02/the-wizard-monoid.html.
One can view this as Compose
, specialised
to a single functor.
MonadTrans WizardT Source # | |
Monad m => Monad (WizardT m) Source # | |
Functor f => Functor (WizardT f) Source # | |
MonadFix m => MonadFix (WizardT m) Source # | |
(Alternative m, Monad m) => MonadFail (WizardT m) Source # | |
Applicative f => Applicative (WizardT f) Source # | |
Foldable f => Foldable (WizardT f) Source # | |
Traversable t => Traversable (WizardT t) Source # | |
MonadIO m => MonadIO (WizardT m) Source # | |
Alternative f => Alternative (WizardT f) Source # | |
(Alternative m, Monad m) => MonadPlus (WizardT m) Source # | |
Functor m => Generic1 * (WizardT m) Source # | |
Generic (WizardT m a) Source # | |
(Applicative f, Semigroup a) => Semigroup (WizardT f a) Source # | |
(Applicative f, Monoid a) => Monoid (WizardT f a) Source # | |
type Rep1 * (WizardT m) Source # | |
type Rep (WizardT m a) Source # | |
Fantastical use of a Wizard
egg :: (Applicative f, Monoid a) => WizardT f a Source #
O(1) fantastical - construct an empty Wizard.
tadpole :: Applicative f => a -> WizardT f a Source #
O(1) fantastical - construct a singleton Wizard.
transform :: Functor f => (a -> b) -> WizardT f a -> WizardT f b Source #
Map over a Wizard in a fantastical manner.
sageMode :: forall m t a b. (Monad m, Foldable t, Monoid a, Monoid b) => (a -> WizardT m b) -> t a -> m b Source #
Run an action over a collection of inputs fantastically.
This is like 'Beast Mode', but specialised
to Wizard
s.
Boring use of a Wizard
singleton :: Applicative f => a -> WizardT f a Source #
O(1) boring - construct a singleton Wizard.
mapWizard :: Functor f => (a -> b) -> WizardT f a -> WizardT f b Source #
Map over a Wizard in a boring manner.
foldWizard :: forall m t a b. (Monad m, Foldable t, Monoid a, Monoid b) => (a -> WizardT m b) -> t a -> m b Source #
Run an action over a collection of inputs.
Monomophised Wizards
type WizardComplex a = WizardT Complex a Source #
type WizardDown a = WizardT Down a Source #
type WizardDual a = WizardT Dual a Source #
type WizardEither a e = WizardT (Either e) a Source #
type WizardEndo a = WizardT ((->) a) a Source #
type WizardFirst a = WizardT First a Source #
type WizardGProd f g a = WizardT (f :*: g) a Source #
type WizardLast a = WizardT Last a Source #
type WizardList a = WizardT [] a Source #
type WizardMaybe a = WizardT Maybe a Source #
type WizardNonEmpty a = WizardT NonEmpty a Source #
type WizardOption a = WizardT Option a Source #
type WizardPar1 a = WizardT Par1 a Source #
type WizardProduct a = WizardT Product a Source #
type WizardProxy a = WizardT Proxy a Source #
type WizardReadP a = WizardT ReadP a Source #
type WizardReadPrec a = WizardT ReadPrec a Source #
type WizardRec1 f a = WizardT (Rec1 f) a Source #
type WizardTuple a = WizardT ((,) a) a Source #