Assume I have
- a comonad
D
- a monad
T
- a distributive law
l : D T -> T D
of the comonadD
over the monadT
.
How can I define the comonad D T
?
Assume I have
D
T
l : D T -> T D
of the comonad D
over the monad T
.How can I define the comonad D T
?
Copyright © 2021 Jogjafile Inc.
You can't. Suppose
D
is the identity comonad andT
isCont Void
, i.e. the continuation monad at the empty type.Then distributivity holds trivially. But
extract :: D (T a) -> a
is not definable as a total computable program. It would be double negation eliminationforall a. ((a -> Void) -> Void) -> a
, which is not definable in constructive languages.