{-# 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 :: Unit a b -> Obj Unit a
src Unit a b
Unit = Obj Unit a
Unit () ()
Unit
  tgt :: Unit a b -> Obj Unit b
tgt Unit a b
Unit = Obj Unit b
Unit () ()
Unit

  Unit b c
Unit . :: Unit b c -> Unit a b -> Unit a c
. Unit a b
Unit = Unit a c
Unit () ()
Unit