xacid: (Default)
[personal profile] xacid
https://gist.github.com/Lysxia/beb6f9df9777bbf56fe5b42de04e6c64

newtype (<-:) a b = Co { unCo :: b -> a }

-- The composition of adjoint functors is a monad or a comonad (depending on which way it goes)
newtype Compose f g a = Compose { unCompose :: f (g a) }

-- The continuation monad as an adjunction:
type Cont r = Compose ((<-:) r) ((<-:) r)

runCont :: Cont r r -> r
runCont (Compose (Co f)) = f (Co id)

Profile

xacid: (Default)
xacid

April 2021

S M T W T F S
    123
45678910
11121314151617
18192021222324
252627282930 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 17th, 2025 10:10 am
Powered by Dreamwidth Studios