License + GADT
This commit is contained in:
parent
cc83c07086
commit
547187e428
2 changed files with 10 additions and 24 deletions
|
@ -5,6 +5,7 @@
|
|||
{-# LANGUAGE DataKinds #-}
|
||||
{-# LANGUAGE StandaloneKindSignatures #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
module Language.Java.Classfile.Magic (Magic(..)) where
|
||||
import Data.Word (Word32)
|
||||
import Language.Java.Classfile.Extractable (Extractable, extract, expectConstant)
|
||||
|
@ -16,13 +17,9 @@ import Data.Kind (Type)
|
|||
-- | 'Stage'-indexed Magic type. The 'Resolve' stage is only a unit type.
|
||||
|
||||
type Magic :: Stage -> Type
|
||||
data family Magic stage
|
||||
|
||||
newtype instance Magic Parse = Magic (Hex Word32)
|
||||
deriving Show
|
||||
|
||||
data instance Magic Resolve = Cafebabe
|
||||
deriving Show
|
||||
data Magic stage where
|
||||
Magic :: Hex Word32 -> Magic Parse
|
||||
Cafebabe :: Magic Resolve
|
||||
|
||||
instance Extractable (Magic Parse) where
|
||||
extract :: Extract (Magic Parse)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue