{-# LANGUAGE GADTs, NoImplicitPrelude #-} ----------------------------------------------------------------------------- -- | -- Module : Data.Category.Unit -- License : BSD-style (see the file LICENSE) -- -- Maintainer : sjoerd@w3future.com -- Stability : experimental -- Portability : non-portable ----------------------------------------------------------------------------- module Data.Category.Unit where import Data.Category data Unit a b where Unit :: Unit () () -- | `Unit` is the category with one object. instance Category Unit where src :: forall a b. Unit a b -> Obj Unit a src Unit a b Unit = Unit () () Unit tgt :: forall a b. Unit a b -> Obj Unit b tgt Unit a b Unit = Unit () () Unit Unit b c Unit . :: forall b c a. Unit b c -> Unit a b -> Unit a c . Unit a b Unit = Unit () () Unit