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

-- module HROOT.Class.Interface where

module HROOT.Class.TH1F.Interface where


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

import HROOT.Class.TH1F.RawType

import HROOT.Class.TH1.Interface
import HROOT.Class.TArrayF.Interface


class (ITH1 a,ITArrayF a) => ITH1F a where

instance Existable TH1F where
  data Exist TH1F = forall a. (FPtr a, ITH1F a) => ETH1F a

upcastTH1F :: (FPtr a, ITH1F a) => a -> TH1F
upcastTH1F h = let fh = get_fptr h
                   fh2 :: ForeignPtr RawTH1F = castForeignPtr fh
               in cast_fptr_to_obj fh2