{-# OPTIONS_GHC -fno-warn-orphans #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeOperators #-}
module Data.Functor.ProductIsomorphic.GenericInstances () where
import GHC.Generics
(U1 (U1), K1 (K1), M1 (M1), (:*:) ((:*:)), )
import Data.Functor.ProductIsomorphic.Unsafe (ProductConstructor (..))
instance ProductConstructor (U1 p) where
productConstructor = U1
{-# INLINEABLE productConstructor #-}
instance ProductConstructor (c -> K1 i c p) where
productConstructor = K1
{-# INLINEABLE productConstructor #-}
instance ProductConstructor (f p -> M1 i c f p) where
productConstructor = M1
{-# INLINEABLE productConstructor #-}
instance ProductConstructor (f x -> g x -> (f :*: g) x) where
productConstructor = (:*:)
{-# INLINEABLE productConstructor #-}