-{-# OPTIONS_GHC -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -XNoImplicitPrelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : Foreign.Marshal.Array
advancePtr, -- :: Storable a => Ptr a -> Int -> Ptr a
) where
-import Control.Monad
-import Foreign.Ptr (Ptr, plusPtr)
-import Foreign.Storable (Storable(sizeOf,peekElemOff,pokeElemOff))
+import Foreign.Ptr (Ptr, plusPtr)
+import Foreign.Storable (Storable(sizeOf,peekElemOff,pokeElemOff))
import Foreign.Marshal.Alloc (mallocBytes, allocaBytes, reallocBytes)
import Foreign.Marshal.Utils (copyBytes, moveBytes)
#else
pokeArray ptr vals = go vals 0#
where go [] n# = return ()
- go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)
+ go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)
#endif
-- |Write the list elements consecutive into memory and terminate them with the
#else
pokeArray0 marker ptr vals = go vals 0#
where go [] n# = pokeElemOff ptr (I# n#) marker
- go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)
+ go (val:vals) n# = do pokeElemOff ptr (I# n#) val; go vals (n# +# 1#)
#endif