{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveAnyClass #-}
module Language.JVM.Attribute.Exceptions
( Exceptions (..)
) where
import Language.JVM.Attribute.Base
import Language.JVM.Staged
import Language.JVM.Constant
import Language.JVM.Utils
instance IsAttribute (Exceptions Low) where
attrName = Const "Exceptions"
newtype Exceptions r = Exceptions
{ exceptions :: SizedList16 (Ref ClassName r)
}
instance Staged Exceptions where
evolve (Exceptions t) = Exceptions <$> mapM link t
devolve (Exceptions t) = Exceptions <$> mapM unlink t
$(deriveBaseWithBinary ''Exceptions)