module Main where

import Lib
import Foreign

-- This loop makes no reference to Vec4D. However if the Storable Vec4D
-- instance in Lib.hs is uncommented, the Storable dictionary will linger in
-- this loop.
--
-- Without that instance, the loop optimizes neatly.

loop :: Int -> Ptr (Vec4 Double) -> Ptr (Vec4 Double) -> IO ()
loop n a b =
  mapM_ (\i -> peekElemOff a i >>= pokeElemOff b i) [0..n-1]

main = return ()
