diff --git a/fficxx-runtime.cabal b/fficxx-runtime.cabal
--- a/fficxx-runtime.cabal
+++ b/fficxx-runtime.cabal
@@ -1,5 +1,5 @@
 Name:		fficxx-runtime
-Version:	0.1
+Version:	0.2
 Synopsis:	Runtime for fficxx-generated library
 Description: 	Runtime for fficxx-generated library
 License:        BSD3
diff --git a/lib/FFICXX/Runtime/Cast.hs b/lib/FFICXX/Runtime/Cast.hs
--- a/lib/FFICXX/Runtime/Cast.hs
+++ b/lib/FFICXX/Runtime/Cast.hs
@@ -3,6 +3,7 @@
              EmptyDataDecls, ExistentialQuantification, ScopedTypeVariables, 
              GADTs #-}
 
+
 -----------------------------------------------------------------------------
 -- |
 -- Module      : FFICXX.Runtime.Cast
@@ -25,6 +26,8 @@
 
 import System.IO.Unsafe
 
+class IsRawType a 
+
 class Castable a b where
   cast :: a -> b 
   uncast :: b -> a 
@@ -34,6 +37,14 @@
   get_fptr :: a -> ForeignPtr (Raw a) 
   cast_fptr_to_obj :: ForeignPtr (Raw a) -> a
 
+
+class FunPtrWrappable a where
+  type FunPtrHsType a :: *
+  type FunPtrType a :: *
+  data FunPtrWrapped a :: *  
+  fptrWrap :: FunPtrWrapped a -> IO (FunPtr (FunPtrType a)) 
+  wrap :: FunPtrHsType a -> FunPtrWrapped a 
+
 class Existable a where
   data Exist a :: *  
 
@@ -43,11 +54,18 @@
   data GADTType a :: * -> *
   data EGADTType a :: *
 
+class IsCType a where 
 
 
+instance IsCType CChar
+instance IsCType CInt
+instance IsCType CUInt 
+instance IsCType CString 
+instance IsCType CULong 
+instance IsCType CLong
 
+-- cause incoherent instances but cannot avoid it now
 {-
--- eliminate this for the time being to have a solution with Repl
 instance Castable a a where
   cast = id
   uncast = id
@@ -57,6 +75,58 @@
   cast = id 
   uncast = id 
 
+
+instance Castable CDouble CDouble where
+  cast = id
+  uncast = id
+
+
+
+instance Castable CUInt CUInt where
+  cast = id 
+  uncast = id 
+
+instance Castable CInt CInt where 
+  cast = id 
+  uncast = id 
+
+instance Castable CLong CLong where
+  cast = id
+  uncast = id
+
+instance Castable CULong CULong where 
+  cast = id 
+  uncast = id 
+
+
+instance Castable (Ptr CInt) (Ptr CInt) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CChar) (Ptr CChar) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CUInt) (Ptr CUInt) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CULong) (Ptr CULong) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CLong) (Ptr CLong) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CDouble) (Ptr CDouble) where 
+  cast = id 
+  uncast = id 
+
+instance Castable (Ptr CString) (Ptr CString) where 
+  cast = id 
+  uncast = id 
+
 instance Castable Int CInt where
   cast = fromIntegral 
   uncast = fromIntegral
@@ -64,6 +134,10 @@
 instance Castable Word CUInt where
   cast = fromIntegral
   uncast = fromIntegral
+
+instance Castable Word8 CChar where
+  cast = fromIntegral 
+  uncast = fromIntegral
   
 instance Castable Double CDouble where
   cast = realToFrac
@@ -84,6 +158,7 @@
 instance Castable [String] (Ptr CString) where
   cast xs = unsafePerformIO (mapM  newCString xs >>= newArray)
   uncast _c_xs = undefined
+
 
 instance (Castable a a', Castable b b') => Castable (a->b) (a'->b') where
   cast f = cast . f . uncast
