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

- All Categories 2.3K
- Chat 495
- Study Groups 6
- Biological Models 1
- Categorical Network Theory 1
- Programming with Categories 4
- Review Sections 6
- MIT 2020: Programming with Categories 53
- MIT 2020: Lectures 21
- MIT 2020: Exercises 25
- MIT 2019: Applied Category Theory 339
- MIT 2019: Lectures 79
- MIT 2019: Exercises 149
- MIT 2019: Chat 50
- UCR ACT Seminar 4
- General 64
- Azimuth Code Project 110
- Statistical methods 2
- Drafts 1
- Math Syntax Demos 15
- Wiki - Latest Changes 0
- Strategy 111
- Azimuth Project 1.1K
- - Spam 1
- News and Information 147
- Azimuth Blog 149
- - Conventions and Policies 21
- - Questions 43
- Azimuth Wiki 708

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)`