{-# LANGUAGE ForeignFunctionInterface, TypeFamilies, MultiParamTypeClasses, 
             FlexibleInstances, TypeSynonymInstances, 
             EmptyDataDecls, ExistentialQuantification, ScopedTypeVariables #-}

-- module HROOT.Class.Interface where

module HROOT.Class.TH2S.Interface where


import Data.Word
import Foreign.ForeignPtr
import HROOT.TypeCast

import HROOT.Class.TH2S.RawType

import HROOT.Class.TH2.Interface
import HROOT.Class.TArrayS.Interface


class (ITH2 a,ITArrayS a) => ITH2S a where

instance Existable TH2S where
  data Exist TH2S = forall a. (FPtr a, ITH2S a) => ETH2S a

upcastTH2S :: (FPtr a, ITH2S a) => a -> TH2S
upcastTH2S h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH2S = castForeignPtr fh
               in cast_fptr_to_obj fh2