aboutsummaryrefslogtreecommitdiffstats
path: root/src/Vivant/Common.hs
blob: cf017caa1d0c91f2e2a67781114ee69917d36e38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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