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

-- module HROOT.Class.Interface where

module HROOT.Class.TH1C.Interface where


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

import HROOT.Class.TH1C.RawType

import HROOT.Class.TH1.Interface
import HROOT.Class.TArrayC.Interface


class (ITH1 a,ITArrayC a) => ITH1C a where

instance Existable TH1C where
  data Exist TH1C = forall a. (FPtr a, ITH1C a) => ETH1C a

upcastTH1C :: (FPtr a, ITH1C a) => a -> TH1C
upcastTH1C h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH1C = castForeignPtr fh
               in cast_fptr_to_obj fh2