commercialhaskell / commercialhaskell/haskelldocumentation

content/covariance-contravariance.md: Positive/negative position, Exercise 3

Open
#13 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
208
Forks
30
PR merge metrics
No merged PRs in 30d

Description

Are the types supposed to be `IO ()` rather than `()` here?

```
newtype E1 a = E1 (a -> ())
newtype E2 a = E2 (a -> () -> ())
newtype E3 a = E3 ((a -> ()) -> ())
newtype E4 a = E4 ((a -> () -> ()) -> ())
newtype E5 a = E5 ((() -> () -> a) -> ())

-- trickier:
newtype E6 a = E6 ((() -> a -> a) -> ())
newtype E7 a = E7 ((() -> () -> a) -> a)
newtype E8 a = E8 ((() -> a -> ()) -> a)
newtype E9 a = E8 ((() -> () -> ()) -> ())
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.