monus-weighted-search-0.2.0.0: Efficient search weighted by an ordered monoid with monus.
Copyright(c) Donnacha Oisín Kidney 2021
Maintainermail@doisinkidney.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

MonusWeightedSearch.Internal.CoerceOperators

Description

Some utility operators for writing coercions. Taken from the profunctors package.

Synopsis

Documentation

>>> import Data.Functor.Identity

(#.) :: Coercible b c => (b -> c) -> (a -> b) -> a -> c infixr 9 Source #

Compose a function with a no-op on the left.

(.#) :: Coercible a b => (b -> c) -> (a -> b) -> a -> c infixr 9 Source #

Compose a function with a no-op on the right.

(<#$>) :: Coercible (f a) (f b) => (a -> b) -> f a -> f b infixl 4 Source #

fmap with a no-op.

under :: Coercible a b => (b -> b -> b) -> (a -> b) -> a -> a -> a Source #

Coerce a binary operator to work "under" a newtype.

>>> ((+) `under` runIdentity) (Identity 3) (Identity 5)
Identity 8