{-# LANGUAGE EmptyDataDecls, ExistentialQuantification, FlexibleContexts, FlexibleInstances, ForeignFunctionInterface, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, TypeSynonymInstances #-} module STD.Ostream.Interface where import Data.Word import Data.Int import Foreign.C import Foreign.Ptr import FFICXX.Runtime.Cast import STD.Ostream.RawType class () => IOstream a where upcastOstream :: forall a . (FPtr a, IOstream a) => a -> Ostream upcastOstream :: forall a. (FPtr a, IOstream a) => a -> Ostream upcastOstream a h = let fh :: Ptr (Raw a) fh = a -> Ptr (Raw a) forall a. FPtr a => a -> Ptr (Raw a) get_fptr a h Ptr RawOstream fh2 :: Ptr RawOstream = Ptr (Raw a) -> Ptr RawOstream forall a b. Ptr a -> Ptr b castPtr Ptr (Raw a) fh in Ptr (Raw Ostream) -> Ostream forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw Ostream) Ptr RawOstream fh2 downcastOstream :: forall a . (FPtr a, IOstream a) => Ostream -> a downcastOstream :: forall a. (FPtr a, IOstream a) => Ostream -> a downcastOstream Ostream h = let fh :: Ptr (Raw Ostream) fh = Ostream -> Ptr (Raw Ostream) forall a. FPtr a => a -> Ptr (Raw a) get_fptr Ostream h fh2 :: Ptr (Raw a) fh2 = Ptr RawOstream -> Ptr (Raw a) forall a b. Ptr a -> Ptr b castPtr Ptr (Raw Ostream) Ptr RawOstream fh in Ptr (Raw a) -> a forall a. FPtr a => Ptr (Raw a) -> a cast_fptr_to_obj Ptr (Raw a) fh2