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

more types #27

Closed
shnarazk opened this issue Oct 17, 2016 · 2 comments
Closed

more types #27

shnarazk opened this issue Oct 17, 2016 · 2 comments
Labels

Comments

@shnarazk
Copy link
Owner

shnarazk commented Oct 17, 2016

Some thought on types and kinds to use recent ghc features.

@shnarazk
Copy link
Owner Author

{-# 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
Copy link
Owner Author

This is completely same with #28

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