feat: show Magic
This commit is contained in:
parent
547187e428
commit
831d7a5787
1 changed files with 3 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
|||
{-# LANGUAGE StandaloneKindSignatures #-}
|
||||
{-# LANGUAGE FlexibleInstances #-}
|
||||
{-# LANGUAGE GADTs #-}
|
||||
{-# LANGUAGE StandaloneDeriving #-}
|
||||
module Language.Java.Classfile.Magic (Magic(..)) where
|
||||
import Data.Word (Word32)
|
||||
import Language.Java.Classfile.Extractable (Extractable, extract, expectConstant)
|
||||
|
@ -21,6 +22,8 @@ data Magic stage where
|
|||
Magic :: Hex Word32 -> Magic Parse
|
||||
Cafebabe :: Magic Resolve
|
||||
|
||||
deriving instance Show (Magic stage)
|
||||
|
||||
instance Extractable (Magic Parse) where
|
||||
extract :: Extract (Magic Parse)
|
||||
extract = Magic . Hex <$> expectConstant 0xCAFEBABE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue