{-# LANGUAGE CPP #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE UndecidableInstances #-}
{-# OPTIONS_GHC -Wall #-}
module ConCat.Shaped (module ConCat.Shaped, module ConCat.Pair) where
import Data.Void (Void)
import GHC.Generics hiding (S)
import ConCat.Misc ((:+))
import ConCat.Nat
import ConCat.Pair
type family LVec n where
LVec Z = U1
LVec (S n) = LVec n :*: Par1
type family RVec n where
RVec Z = U1
RVec (S n) = Par1 :*: RVec n
type family LPow h n where
LPow h Z = Par1
LPow h (S n) = LPow h n :.: h
type family RPow h n where
RPow h Z = Par1
RPow h (S n) = h :.: RPow h n
type LBin n = LPow Pair n
type RBin n = RPow Pair n
type family Bush n where
Bush Z = Pair
Bush (S n) = Bush n :.: Bush n
type family Bush' n where
Bush' Z = U1
Bush' (S n) = Par1 :*: (Bush' n :.: Bush' n)
type family LFin n where
LFin Z = Void
LFin (S n) = LFin n :+ ()
type family RFin n where
RFin Z = Void
RFin (S n) = () :+ RFin n
#if 0
type family LFin' n where
LFin' Z = V1
LFin' (S n) = LFin' n :+: U1
type family RFin' n where
RFin' Z = V1
RFin' (S n) = U1 :+: RFin' n
#endif