{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE Rank2Types #-}
module Data.Connection.Yoneda where
import Data.Int
import Data.Word
import Data.Prd
import Data.Prd.Nan
import Data.Prd.Lattice
import Data.Bifunctor
import Data.Dioid.Interval
import Data.Function
import Data.Functor.Identity
import Data.Functor.Product
import Data.Functor.Sum
import Data.Connection
import Data.Connection.Int
import Data.Connection.Word
import Data.Connection.Float
import Data.Foldable
import Data.List (unfoldr)
import GHC.Num (subtract)
import Numeric.Natural
import Data.Bool
import Prelude hiding (Enum(..), Ord(..), until)
import qualified Control.Category as C
type family Rep a :: *
class (Prd a, Lattice (Rep a)) => Yoneda a where
ideal :: Conn (Rep a) a
lower :: Rep a -> a -> Bool
filter :: Conn a (Rep a)
upper :: Rep a -> a -> Bool
type instance Rep (Down a) = Down (Rep a)
type instance Rep Bool = Bool
instance Yoneda Bool where
ideal = C.id
lower = (>~)
filter = C.id
upper = (<~)