Apologies, you need the RankNTypes language extension, which I neglected to include in the post. Apart from that, there was a change in type inference between GHC 8 and 9 that stops the code from type checking.
You can paste the code into the Haskell Playground and choose the compiler version. It will compile with GHC 8.
To satisfy GHC 9, we need the more involved:
{-# LANGUAGE RankNTypes, ScopedTypeVariables #-}
type Dist a = forall r. Cone r => (a -> r) -> r
bind :: forall a b. (a -> Dist b) -> Dist a -> Dist b
bind k m = let
flipk :: forall r. Cone r => (b -> r) -> a -> r
flipk b a = k a b
in m . flipk