Hoogle Search

Within LTS Haskell 24.6 (ghc-9.10.2)

Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.

  1. (%=) :: forall (m :: Type -> Type) w s a r . (Monad m, Monoid w) => T s a -> a -> RWST r w s m ()

    data-accessor-transformers Data.Accessor.Monad.Trans.RWS

    Infix variant of set.

  2. (%:) :: forall (m :: Type -> Type) r a . Monad m => T r a -> (a -> a) -> StateT r m ()

    data-accessor-transformers Data.Accessor.Monad.Trans.State

    Infix variant of modify.

  3. (%=) :: forall (m :: Type -> Type) r a . Monad m => T r a -> a -> StateT r m ()

    data-accessor-transformers Data.Accessor.Monad.Trans.State

    Infix variant of set.

  4. type (%~) = OnField

    generic-data Generic.Data.Internal.Microsurgery

    Infix name for OnField. To be used with Surgeries or Cat.

    Examples

    Transform one Int field into Sum Int for deriving Monoid:
    data Vec a = Vec
    { len :: Int
    , contents :: [a] }
    deriving Generic
    deriving (Eq, Show) via Generically (Vec a)
    deriving (Semigroup, Monoid) via ProductSurgeries '["len" %~ Sum] (Vec a)
    
    Wrap unshowable fields in Opaque for deriving Show:
    data Unshowable = Unshowable
    { fun :: Int -> Int
    , io :: IO Bool
    , int :: Int }
    deriving Generic
    deriving Show via Surgeries '["fun" %~ Opaque, "io" %~ Opaque] Unshowable
    
    -- show (Unshowable id (pure True) 42) = "Unshowable _ _ 42"
    

  5. type (%~) = OnField

    generic-data Generic.Data.Microsurgery

    Infix name for OnField. To be used with Surgeries or Cat.

    Examples

    Transform one Int field into Sum Int for deriving Monoid:
    data Vec a = Vec
    { len :: Int
    , contents :: [a] }
    deriving Generic
    deriving (Eq, Show) via Generically (Vec a)
    deriving (Semigroup, Monoid) via ProductSurgeries '["len" %~ Sum] (Vec a)
    
    Wrap unshowable fields in Opaque for deriving Show:
    data Unshowable = Unshowable
    { fun :: Int -> Int
    , io :: IO Bool
    , int :: Int }
    deriving Generic
    deriving Show via Surgeries '["fun" %~ Opaque, "io" %~ Opaque] Unshowable
    
    -- show (Unshowable id (pure True) 42) = "Unshowable _ _ 42"
    

  6. (%~) :: ASetter s t a b -> (a -> b) -> s -> t

    lens-family-core Lens.Family

    Modify all referenced fields.

  7. (%!=) :: forall (m :: Type -> Type) s a b . Monad m => ASetter s s a b -> (a -> b) -> StateT s m ()

    lens-family-core Lens.Family.State.Lazy

    Strictly modify a field of the state.

  8. (%%=) :: forall (m :: Type -> Type) c s a b . Monad m => LensLike (Writer c) s s a b -> (a -> (c, b)) -> StateT s m c

    lens-family-core Lens.Family.State.Lazy

    (%%=) :: Monad m => Lens s s a b -> (a -> (c, b)) -> StateT s m c
    
    Modify a field of the state while returning another value.
    (%%=) :: (Monad m, Monoid c) => Traversal s s a b -> (a -> (c, b)) -> StateT s m c
    
    Modify each field of the state and return the mconcat of the other values.

  9. (%=) :: forall (m :: Type -> Type) s a b . Monad m => ASetter s s a b -> (a -> b) -> StateT s m ()

    lens-family-core Lens.Family.State.Lazy

    Modify a field of the state.

  10. (%!=) :: forall (m :: Type -> Type) s a b . Monad m => ASetter s s a b -> (a -> b) -> StateT s m ()

    lens-family-core Lens.Family.State.Strict

    Strictly modify a field of the state.

Page 18 of many | Previous | Next