blob: a02f8ad67e074b57b761544a165eb2f17a0c0368 (
plain)
1
2
3
4
5
6
7
8
9
10
|
module Vivant.Common (vectorSize, uncurry3) where
import qualified Data.Vector.Storable as V
import Foreign.Storable (sizeOf)
vectorSize :: (Num b, V.Storable a) => V.Vector a -> b
vectorSize array = fromIntegral $ V.length array * sizeOf (1.0 :: Float)
uncurry3 :: (t1 -> t2 -> t3 -> t4) -> (t1, t2, t3) -> t4
uncurry3 f (a, b, c) = f a b c
|