{-# LANGUAGE CPP, DataKinds, PolyKinds, TypeFamilies, TypeOperators #-}
module Frames.TypeLevel where
#if __GLASGOW_HASKELL__ < 800
import GHC.Prim (Constraint)
#else
import Data.Kind (Constraint)
#endif
type family AllAre a ts :: Constraint where
AllAre a '[] = ()
AllAre a (t ': ts) = (t ~ a, AllAre a ts)
type family ReplaceAll a xs where
ReplaceAll a '[] = '[]
ReplaceAll a (x ': xs) = a ': ReplaceAll a xs
type family ReplaceAllSnd a (xs :: [(k1,k2)]) where
ReplaceAllSnd a '[] = '[]
ReplaceAllSnd a ('(s,x) ': xs) = '(s,a) ': ReplaceAllSnd a xs