{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StandaloneDeriving #-}
module Generics.MRSOP.Opaque where
import Data.Function (on)
import Data.Proxy
import Generics.MRSOP.Util
data Kon
= KInt
| KInteger
| KFloat
| KDouble
| KBool
| KChar
| KString
deriving (Eq , Show)
data Singl (kon :: Kon) :: * where
SInt :: Int -> Singl KInt
SInteger :: Integer -> Singl KInteger
SFloat :: Float -> Singl KFloat
SDouble :: Double -> Singl KDouble
SBool :: Bool -> Singl KBool
SChar :: Char -> Singl KChar
SString :: String -> Singl KString
deriving instance Show (Singl k)
deriving instance Eq (Singl k)
instance Eq1 Singl where
eq1 = (==)
instance Show1 Singl where
show1 = show
eqSingl :: Singl k -> Singl k -> Bool
eqSingl = (==)