It looks like you're new here. If you want to get involved, click one of these buttons!

- All Categories 2.4K
- Chat 502
- Study Groups 21
- Petri Nets 9
- Epidemiology 4
- Leaf Modeling 2
- Review Sections 9
- MIT 2020: Programming with Categories 51
- MIT 2020: Lectures 20
- MIT 2020: Exercises 25
- Baez ACT 2019: Online Course 339
- Baez ACT 2019: Lectures 79
- Baez ACT 2019: Exercises 149
- Baez ACT 2019: Chat 50
- UCR ACT Seminar 4
- General 73
- Azimuth Code Project 110
- Statistical methods 4
- Drafts 10
- Math Syntax Demos 15
- Wiki - Latest Changes 3
- Strategy 113
- Azimuth Project 1.1K
- - Spam 1
- News and Information 148
- Azimuth Blog 149
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 718

Options

*Bifunctors.*

A bifunctor is a polymorphic type constructor F that takes two variables together with an implementation of a function:

bimap :: (a -> b) -> (c -> d) -> F a c -> F b d

Using the universal property of the coproduct, provide an implementation of bimap for the sum type constructor Either a b.

## Comments

`> bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d > bimap f g (Left x) = Left (f x) > bimap f g (Right y) = Right (g y)`