linear-base-0.1.0: Standard library for linear types.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Bifunctor.Linear.Internal.Bifunctor

Synopsis
  • class Bifunctor p where
    • bimap :: (a %1 -> b) -> (c %1 -> d) -> (a `p` c) %1 -> b `p` d
    • first :: (a %1 -> b) -> (a `p` c) %1 -> b `p` c
    • second :: (b %1 -> c) -> (a `p` b) %1 -> a `p` c

Documentation

class Bifunctor p where Source #

The Bifunctor class

Laws

If bimap is supplied, then bimap id id = id

Minimal complete definition

bimap | first, second

Methods

bimap :: (a %1 -> b) -> (c %1 -> d) -> (a `p` c) %1 -> b `p` d Source #

first :: (a %1 -> b) -> (a `p` c) %1 -> b `p` c Source #

second :: (b %1 -> c) -> (a `p` b) %1 -> a `p` c Source #

Instances

Instances details
Bifunctor Either Source # 
Instance details

Defined in Data.Bifunctor.Linear.Internal.Bifunctor

Methods

bimap :: (a %1 -> b) -> (c %1 -> d) -> Either a c %1 -> Either b d Source #

first :: (a %1 -> b) -> Either a c %1 -> Either b c Source #

second :: (b %1 -> c) -> Either a b %1 -> Either a c Source #

Bifunctor (,) Source # 
Instance details

Defined in Data.Bifunctor.Linear.Internal.Bifunctor

Methods

bimap :: (a %1 -> b) -> (c %1 -> d) -> (a, c) %1 -> (b, d) Source #

first :: (a %1 -> b) -> (a, c) %1 -> (b, c) Source #

second :: (b %1 -> c) -> (a, b) %1 -> (a, c) Source #