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

-- module HROOT.Class.Interface where

module HROOT.Class.TArrow.Interface where


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

import HROOT.Class.TArrow.RawType

import HROOT.Class.TLine.Interface
import HROOT.Class.TAttFill.Interface


class (ITLine a,ITAttFill a) => ITArrow a where

instance Existable TArrow where
  data Exist TArrow = forall a. (FPtr a, ITArrow a) => ETArrow a

upcastTArrow :: (FPtr a, ITArrow a) => a -> TArrow
upcastTArrow h = let fh = get_fptr h
                     fh2 :: ForeignPtr RawTArrow = castForeignPtr fh
                 in cast_fptr_to_obj fh2