bind :: FM x -> (x -> FM y) -> FM y

bind phi k = unFM phi k

It uses the fact that FM has a Monoid instance, so phi can be applied to the Kleisli map k. This looks quite different from the Continuation monad’s bind.

]]>[...]Most of us have been there.[...]…

]]>[...]They’re instead deductible as enterprise bills by the employer, topic to any limitations on the deduction of the particular kind of expense.[...]…

]]>“An (oo,1)-category is, under an appropriate setup (and the question of which setup is appropriate falls under the name “homotopy hypothesis” [15]) the same thing as a topological space!”

The homotopy hypothesis says that certain (oo,1)-categories can be thought of as spaces, namely, the ones with all morphisms invertible, which is to say the (oo,0)-categories or oo-groupoids. (This is explained in the reference [15] you provided.)

]]>(\s -> peek (k (peek m s)) s)

m s produces another monoidal value so, in principle, it could be used instead (either alone or mappended to s). Would that violate the laws?

]]>(p \/ q) :- r given p :- r and q :- r

But because of the thinness of the category, the ‘r’ dictionary that results will be the same result given either path.

e.g. (Ord [a]\/ Eq a) :- Eq [[[a]]]

would let you produce Eq [[[a]]] given either Eq a or an Ord [a]

Giving you the ability to do true general ‘Either’ constraints would compromise the thinness of the category and the safety of global instance resolution. (Mind you, incoherent instances also do that.)

]]>{-# LANGUAGE RankNTypes, PolyKinds, TupleSections, TypeFamilies, TypeFamilyDependencies #-}

import Data.Kind (Type)

type LensFamily (outer :: t -> Type) (inner :: t -> Type) =

forall a b f. Functor f => (inner a -> f (inner b)) -> (outer a -> f (outer b))

type family Snd b a :: Type where

Snd b a = (a, b)

type family Fst a b :: Type where

Fst a b = (a, b)

type family Id t = r | r -> t where

Id x = x

fstLens :: LensFamily (Snd b) Id

fstLens f (a, b) = (, b) f a

sndLens :: LensFamily (Fst a) Id

sndLens f (a, b) = (a, ) f b