{-# LANGUAGE EmptyCase, LambdaCase, TypeOperators, GADTs, TypeFamilies, NoImplicitPrelude #-}
module Data.Category.Void where
import Data.Category
import Data.Category.Functor
import Data.Category.NaturalTransformation
data Void a b
magic :: Void a b -> x
magic = \case { }
instance Category Void where
src = magic
tgt = magic
(.) = magic
voidNat :: (Functor f, Functor g, Dom f ~ Void, Dom g ~ Void, Cod f ~ d, Cod g ~ d)
=> f -> g -> Nat Void d f g
voidNat f g = Nat f g magic
data Magic (k :: * -> * -> *) = Magic
instance Category k => Functor (Magic k) where
type Dom (Magic k) = Void
type Cod (Magic k) = k
Magic % f = magic f