----------------------------------------------------------------------------- -- | -- Module : Windll -- Copyright : (c) Tamar Christina 2009 - 2010 -- License : BSD3 -- -- Maintainer : tamar@zhox.com -- Stability : experimental -- Portability : portable -- -- This modules contains the list of known primitive types. This is one of the -- the lists that needs expanding in order to add new native types. -- ----------------------------------------------------------------------------- module WinDll.Utils.KnownTypes where import WinDll.Structs.Types -- | A list of the most frequently used types, It's much faster to do list lookup than query GHC, -- so we first look up in this list and then make a call to GHC knownPrimitives :: TypeNames knownPrimitives = [ "Int" , "Integer", "Float" , "Double" , "String" , "Char" ,"Word64" , "Int8" , "Int16" , "Int32" , "Int64" , "Word8" , "Word16" ,"Word32" , "Int#" , "Float#" , "Double#" , "CWString" , "Bool" , "IO" , "()" , "CInt" ] ++ knownPointerTypes -- | A list of known pointer types, if we find these we should not trace their dependencies. -- because they matter not. knownPointerTypes :: TypeNames knownPointerTypes = ["StablePtr", "Ptr"] -- | Types that the dependency tracer should ignore. And in the case that they are an applied type -- everything on the right hand side should be ignored. knownIgnorableTypes :: TypeNames knownIgnorableTypes = ["StablePtr"] -- | The first lookup venue to GHC is looking up based on the type classes that we've already covered by the FFI class. -- So if the type is an instance of the following classes it's safe to ignore them. knownClasses :: TypeNames knownClasses = ["Storable" , "IO" , "Num" , "FFIType" ]