{-# LANGUAGE ScopedTypeVariables #-}-- These are replacements for the broken equivalents in Foreign.*.-- The functions in Foreign.* do not obey the required alignment.moduleLLVM.Util.ForeignwhereimportForeign.Ptr(alignPtr,Ptr)importForeign.Storable(Storable(poke,sizeOf,alignment))importForeign.Marshal.Alloc(allocaBytes)importForeign.Marshal.Array(allocaArray,pokeArray)with::Storablea=>a->(Ptra->IOb)->IObwithxact=alloca$\p->dopokepxactpalloca::forallab.Storablea=>(Ptra->IOb)->IOballocaact=allocaBytes(2*sizeOf(undefined::a))$\p->act$alignPtrp(alignment(undefined::a))withArrayLen::(Storablea)=>[a]->(Int->Ptra->IOb)->IObwithArrayLenxsact=letl=lengthxsinallocaArray(l+1)$\p->doletp'=alignPtrp(alignment(headxs))pokeArrayp'xsactlp'