mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-12-24 04:09:10 +03:00
14 lines
404 B
Idris
14 lines
404 B
Idris
|
module Data.Linear.Bifunctor
|
||
|
|
||
|
import Data.Linear.Notation
|
||
|
|
||
|
%default total
|
||
|
|
||
|
||| A linear bimap on linear pairs.
|
||
|
||| There is no general Bifunctor interface because it would not be implementable with
|
||
|
||| The same type signature consistently, for example LEither does not consume both
|
||
|
||| `f` and `g` linearly.
|
||
|
export
|
||
|
bimap : (a -@ x) -@ (b -@ y) -@ (LPair a b) -@ (LPair x y)
|
||
|
bimap f g (a # b) = f a # g b
|