úÎmvgËM      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL MNOPQRSTUVMRSTUVMRSTUVportable experimentaltamar@zhox.com portable  experimental tamar@zhox.com List containing mapping to C/ C++ Types #Contains a list of mapping types. 8 This is the first list to be extended by the pragmas 7 We need to preserve the Haskell type name for later  transformations and for FFI List of type conversion from C/C++ to C# types List containing mapping to C# Types #List containing mapping to CSizes    portable experimentaltamar@zhox.com \Annotated type, basically a 4-tuple that holds all possible information on a datatype field FThe field name, if this is a record the name will be the record name. #The preprocessed type of the field %The type annotations for the antType !The original unpreprocessed type HAnnotation on functions, This allows more complex types to be expressed KOffsets into the type list to indicate which fields are counters for lists -Indicates if the field type is a List type. Indices/COffsets to indicate whether this function has any StablePtr values BCopy of the definition list for the Haskell translation functions <Copy of the definition list for the C translation functions BCopy of the definition list for the C sizes translation functions %Copy of the definition list for the C# translation functions  !"#$Generic empty annotation %8Find any Names embedded within any arbitraty structures   !"#$%#"!  $%    !"#$%portable experimentaltamar@zhox.com*&0A class that manages the conversion between the normal and type supported by ffi. C Minimal implementation requires atleast one of the pair toNativetoFFI and fromNative fromFFI. f The implementation will almost always call fromNative and toNative because all exported functions m are in IO since they all might have side-effects. The only exception to this is for the defaults provided  in this module. '()*+,-`Typeclase to allow Left LoaD transform. It is basically to allow a transformation to take place  at the last argument/Nreturn type of the function. This is because most of the functions are in IO. ./(Tuples are not FFI compatible, As such i'/ll translate them to a build in tuple datatype  . W This function translates the embedded types of a Ty to the correct forms using the  function translate' (see below) 0GTranslate everything but applied types. e.g. Foo Token -> FooPtr Token : And lists, since lists are implicitly an applied type:  e.g [Token] -->> [] Token -->> Ptr Token 1FCheck to see if the next type is a Simple type. e.g. A TyVar or TyCon 2IContrary to translate translatePrimitive will only transform the defined  primitive types in the convList +below. This is because while a transformed X signature should only be partially transformed till the first application (Since that'll be e the main pointer) we should pre-transform the primitive types into their well known static forms. 3OHelper function to define translatePrimitive. It attemps to lookup the type in convList but  in the case where it'*s not found the search query is returned. 4PTranslate Partial Form, This is basically translatePrimitive . translatePartial 5[Look up the FFI type representation of the given type. Moreover when the type is not found N it is assumed to be a new structure and it is assumed to be a pointer value. 6"Remove all spaces from a sentence 7>A function to split a list of elements by the given seperator WInstance for Functor classes X=Convertion instance for Integer types to CLLongs (long long) Y*Simplistic instance of Storable for list. " untested but (new [(1::Int)..10]. >>=return.castPtr >>= peekArray 10 :: IO [Int] ) works ZGOne way instance for returning lists as the result of a function call. K We assume to have an int* as an argument and then fill that in with the  length [@Cover lists to array convertion IF the type is also an FFI type \RAny class implementing Storable has implemented enough to be considered a FFIType ]CInstance for unboxed integers, which are first boxed then returned % instance FFIType FastInt CInt where  toFFI = toFFI . iBox  fromFFI = iUnbox . fromFFI Fix float instances ^EFix integers from the machine dependend values to fixed 32bit values _(Convert between FastString and CWString `SAnother simple identityy instance, I really need to get that overlapping instances  looked at. aSAnother simple identityy instance, I really need to get that overlapping instances  looked at. bSAnother simple identityy instance, I really need to get that overlapping instances  looked at. cSAnother simple identityy instance, I really need to get that overlapping instances  looked at. dSAnother simple identityy instance, I really need to get that overlapping instances  looked at. e>Intermediate conversion instance for storing values of arrays fQI decided to use a CAString because on windows this gives me a constant 16 value g1Tranform functions to and from the correct types hA FunPtr instance iA StorablePtr instance j[Convert booleans to Int8 to save space for use when using the ccall or stdcall conventions k\Convert booleans to Word8 to save space for use when using the ccall or stdcall conventions lNConvert booleans to Cints for use when using the ccall or stdcall conventions m4Numeral values are all also already FFI values, If I'%ve read the documentation correctly @ Due to GHC matching only the instance heads this instance can'(t unfortunately be used. (Booo bad GHC) % instance Num a => FFIType a a where  toFFI = id  fromFFI = id -Booleans are by default already an FFI value nPDefault values needed to satisfy .NET marshaller when having unused structures. 2 class FFIType phi ix => FFIDefaults phi ix where  class Default phi where  nDefault :: phi +Wrapper functions for dealing with FunPtrs R wrapFn :: (FFIType (IO a) ca, FFIType b (IO cb)) => (a -> IO b) -> (ca -> IO cb) & wrapFn fn = fromFFI >=> fn >=> toFFI Dedicated instance for () &'()*+,-./01234567-.&'()*+,/01234567&'()*+,'()*+,-../01234567portable experimentaltamar@zhox.com89:;<=>?@ABCDEFGHIJKL89:;<=>?@ABCDEFGHIJKLKLIJGHEFCDAB?@>=<;:9889:;<=>?@@ABBCDDEFFGHHIJJKLLportable experimentaltamar@zhox.como      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEEFFGGHHIIJJKKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmn Hs2lib-0.4.8WinDll.Lib.InstancesTypesWinDll.Lib.NativeWinDll.Structs.TypesWinDll.Lib.NativeMappingWinDll.Lib.Tuples Paths_Hs2libWinDll.Lib.Converter EitherPtrMaybePtr maybenothing maybejust eitherleft eitherrightDefsnativeLisths2cnativeConvListnativeC2cslist nativeCslist nativeC_sizesAnnTypeantNameantTypeantAnn antOrigTypeAnnannArrayIndicesannArrayIsListannStableIndices annWorkingSetannWorkingSetCannWorkingSetCSizeannWorkingSetCsTypes AnnNamedTypes NamedTypes TypeNamesTypeNameType ExportNameImportNamenoAnn findStrings'FFITypetoFFIfromFFIfromList fromNativetoNativefreeFFILLDlld translatetranslatePartial isSimpleTypetranslatePrimitive translatePtranslatePForm translate'trimsplit Tuple8Ptr Tuple7Ptr Tuple6Ptr Tuple5Ptr Tuple4Ptr Tuple3Ptr Tuple2PtrTuple8Tuple7Tuple6Tuple5Tuple4Tuple3Tuple2versionbindirlibdirdatadir libexecdir getBinDir getLibDir getDataDir getLibexecDirgetDataFileName $fFFITypeff$fFFITypeIntegera $fStorable[]$fFFIType[](->)$fFFIType[]Ptr $fFFITypeaPtr$fFFITypeFloatCFloat$fFFITypeIntCInt$fFFITypeFastStringPtr$fFFITypeCLLongCLLong$fFFITypeCDoubleCDouble$fFFITypeCIntCInt$fFFITypePtrPtr$fFFITypeCWcharCWchar$fFFIType[]Ptr0$fFFIType[]Ptr1$fFFIType(->)(->)$fFFITypeFunPtrFunPtr$fFFITypeStablePtrStablePtr$fFFITypeBoolInt8$fFFITypeBoolWord8$fFFITypeBoolCInt$fFFITypeBoolBool $fFFIType()()