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

-- module HROOT.Class.Interface where

module HROOT.Class.TH1S.Interface where


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

import HROOT.Class.TH1S.RawType

import HROOT.Class.TH1.Interface
import HROOT.Class.TArrayS.Interface


class (ITH1 a,ITArrayS a) => ITH1S a where

instance Existable TH1S where
  data Exist TH1S = forall a. (FPtr a, ITH1S a) => ETH1S a

upcastTH1S :: (FPtr a, ITH1S a) => a -> TH1S
upcastTH1S h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH1S = castForeignPtr fh
               in cast_fptr_to_obj fh2