Tags

abstract Kleisli category

A thunk-force category consists of

satisfying the following criteria:

class Functor cat l => AbstractKleisli cat l where
  thunk :: cat a (l a)
  force :: cat (l a) a

It turns out that, for any monad , the Kleisli category of is an abstract Kleisli category. The functor is the monad itself.

instance Subhask.Monad cat m => AbstractKleisli (Subhask.Kleisli cat m) m where
  -- ignoring the Kleisli newtype wrapper:
  -- thunk :: cat a (m (m a))
  -- force :: cat (m a) (m a)
  thunk = Kleisli (return . return)
  force = id

Author: Nicholas Coltharp (mail@heraplem.xyz)

Last modified: 2026-09-24 Thu 16:12

Emacs 30.2 (Org mode 9.7.11)

Validate