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

-- module HROOT.Class.Interface where

module HROOT.Class.TH1D.Interface where


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

import HROOT.Class.TH1D.RawType

import HROOT.Class.TH1.Interface
import HROOT.Class.TArrayD.Interface


class (ITH1 a,ITArrayD a) => ITH1D a where

instance Existable TH1D where
  data Exist TH1D = forall a. (FPtr a, ITH1D a) => ETH1D a

upcastTH1D :: (FPtr a, ITH1D a) => a -> TH1D
upcastTH1D h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH1D = castForeignPtr fh
               in cast_fptr_to_obj fh2