Remove RenderType datatype

This commit is contained in:
jgk
2021-07-30 11:53:51 +02:00
parent c67feb485f
commit 834464db51
31 changed files with 164 additions and 227 deletions
+4
View File
@@ -21,10 +21,14 @@ type Point2 = V2 Float
type Point3 = V3 Float
type Point4 = V4 Float
toV2 :: (a,a) -> V2 a
toV2 (a,b) = V2 a b
toV3 :: (a,a,a) -> V3 a
toV3 (a,b,c) = V3 a b c
toV4 :: (a,a,a,a) -> V4 a
toV4 (a,b,c,d) = V4 a b c d
fromV3 :: V3 a -> (a,a,a)
fromV3 (V3 a b c) = (a,b,c)
uncurryV :: (a -> a -> b) -> V2 a -> b
+6 -6
View File
@@ -13,12 +13,12 @@ infixl 7 *.*
{- | 2D coordinate-wise addition. -}
(+.+) :: Point2 -> Point2 -> Point2
{-# INLINE (+.+) #-}
(+.+) = (+)
--(x1, y1) +.+ (x2, y2) =
-- let
-- !x = x1 + x2
-- !y = y1 + y2
-- in (x, y)
--(+.+) = -- (+)
V2 x1 y1 +.+ V2 x2 y2 =
let
!x = x1 + x2
!y = y1 + y2
in V2 x y
{- | 2D coordinate-wise subtraction. -}
(-.-) :: Point2 -> Point2 -> Point2
{-# INLINE (-.-) #-}