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

-- module HROOT.Class.Interface where

module HROOT.Class.TList.Interface where


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

import HROOT.Class.TList.RawType

import HROOT.Class.TSeqCollection.Interface


class (ITSeqCollection a) => ITList a where

instance Existable TList where
  data Exist TList = forall a. (FPtr a, ITList a) => ETList a

upcastTList :: (FPtr a, ITList a) => a -> TList
upcastTList h = let fh = get_fptr h
                    fh2 :: ForeignPtr RawTList = castForeignPtr fh
                in cast_fptr_to_obj fh2