{-| Module : Control.Flower.Functor.Strict Description : Strict functor combinators (requires a monad instance) -} module Control.Flower.Functor.Strict ( lift', over', () ) where import Control.Flower.Apply (()) -- $setup -- >>> import Flow ((<|)) {- | A strict version of `lift` >>> lift' (+1) <| Just 0 Just 1 >>> lift' (lift' (+1)) [[1,2,3],[4,5,6]] [[2,3,4],[5,6,7]] -} lift' :: Monad m => (a -> b) -> m a -> m b lift' = (<$!>) {- | Alias for `apply'`, for readability (especially when teaching) >>> lift' (+1) `over'` Just 0 Just 1 -} over' :: (a -> b) -> a -> b over' = (>> (+1) (a -> b) -> f a -> f b (>> Just 0 $!> (+1) Just 1 -} infixl 4 $!> ($!>) :: Monad f => f a -> (a -> b) -> f b ($!>) = flip lift'