Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GADTs and Kind #28

Closed
shnarazk opened this issue Nov 10, 2016 · 0 comments
Closed

GADTs and Kind #28

shnarazk opened this issue Nov 10, 2016 · 0 comments
Labels

Comments

@shnarazk
Copy link
Owner

shnarazk commented Nov 10, 2016

{-# LANGUAGE TypeFamilies, DataKinds, GADTs, StandaloneDeriving, FlexibleInstances #-}
module Clause where
-- import Unsafe.Coerce

data ClauseKind = OfNormal | NullCaluse | BinaryClause

data Clause (a :: ClauseKind) where
  MkClause :: [Int] -> Clause 'OfNormal
  MkBinaryClause :: Int -> Clause 'BinaryClause

instance Eq (Clause a) where
  (MkBinaryClause a) == (MkBinaryClause b) = a == b
  _ == _ = undefined

instance Show (Clause a) where
  show (MkBinaryClause l) = "B{" ++ show l ++ "}"
  show (MkClause _) = show "Clause"
  
-- data Clause (a :: ClauseKind) = Clause [Int] deriving (Eq, Show)

c :: [Clause 'OfNormal]
c = []
@shnarazk shnarazk mentioned this issue Aug 24, 2017
This was referenced Oct 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant