linear 1.11.3 → 1.12.1
raw patch · 7 files changed
+244/−32 lines, 7 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
+ Linear.Matrix: transpose :: (Distributive g, Functor f) => f (g a) -> g (f a)
+ Linear.Matrix: type M23 a = V2 (V3 a)
+ Linear.Matrix: type M24 a = V2 (V4 a)
+ Linear.Matrix: type M32 a = V3 (V2 a)
+ Linear.Matrix: type M34 a = V3 (V4 a)
+ Linear.Matrix: type M42 a = V4 (V2 a)
+ Linear.V2: _yx :: R2 t => Lens' (t a) (V2 a)
+ Linear.V3: _xz :: R3 t => Lens' (t a) (V2 a)
+ Linear.V3: _xzy :: R3 t => Lens' (t a) (V3 a)
+ Linear.V3: _yx :: R2 t => Lens' (t a) (V2 a)
+ Linear.V3: _yxz :: R3 t => Lens' (t a) (V3 a)
+ Linear.V3: _yz :: R3 t => Lens' (t a) (V2 a)
+ Linear.V3: _yzx :: R3 t => Lens' (t a) (V3 a)
+ Linear.V3: _zx :: R3 t => Lens' (t a) (V2 a)
+ Linear.V3: _zxy :: R3 t => Lens' (t a) (V3 a)
+ Linear.V3: _zy :: R3 t => Lens' (t a) (V2 a)
+ Linear.V3: _zyx :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _wx :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _wxy :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wxyz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _wxz :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wxzy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _wy :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _wyx :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wyxz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _wyz :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wyzx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _wz :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _wzx :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wzxy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _wzy :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _wzyx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _xw :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _xwy :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _xwyz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _xwz :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _xwzy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _xyw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _xywz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _xz :: R3 t => Lens' (t a) (V2 a)
+ Linear.V4: _xzw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _xzwy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _xzy :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _xzyw :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _yw :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _ywx :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _ywxz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _ywz :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _ywzx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _yx :: R2 t => Lens' (t a) (V2 a)
+ Linear.V4: _yxw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _yxwz :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _yxz :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _yxzw :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _yz :: R3 t => Lens' (t a) (V2 a)
+ Linear.V4: _yzw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _yzwx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _yzx :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _yzxw :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zw :: R4 t => Lens' (t a) (V2 a)
+ Linear.V4: _zwx :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _zwxy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zwy :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _zwyx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zx :: R3 t => Lens' (t a) (V2 a)
+ Linear.V4: _zxw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _zxwy :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zxy :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _zxyw :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zy :: R3 t => Lens' (t a) (V2 a)
+ Linear.V4: _zyw :: R4 t => Lens' (t a) (V3 a)
+ Linear.V4: _zywx :: R4 t => Lens' (t a) (V4 a)
+ Linear.V4: _zyx :: R3 t => Lens' (t a) (V3 a)
+ Linear.V4: _zyxw :: R4 t => Lens' (t a) (V4 a)
- Linear.V2: _xy :: (R2 t, Functor f) => (V2 a -> f (V2 a)) -> t a -> f (t a)
+ Linear.V2: _xy :: R2 t => Lens' (t a) (V2 a)
- Linear.V2: _y :: (R2 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V2: _y :: R2 t => Lens' (t a) a
- Linear.V3: _xy :: (R2 t, Functor f) => (V2 a -> f (V2 a)) -> t a -> f (t a)
+ Linear.V3: _xy :: R2 t => Lens' (t a) (V2 a)
- Linear.V3: _xyz :: (R3 t, Functor f) => (V3 a -> f (V3 a)) -> t a -> f (t a)
+ Linear.V3: _xyz :: R3 t => Lens' (t a) (V3 a)
- Linear.V3: _y :: (R2 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V3: _y :: R2 t => Lens' (t a) a
- Linear.V3: _z :: (R3 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V3: _z :: R3 t => Lens' (t a) a
- Linear.V4: _w :: (R4 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V4: _w :: R4 t => Lens' (t a) a
- Linear.V4: _xy :: (R2 t, Functor f) => (V2 a -> f (V2 a)) -> t a -> f (t a)
+ Linear.V4: _xy :: R2 t => Lens' (t a) (V2 a)
- Linear.V4: _xyz :: (R3 t, Functor f) => (V3 a -> f (V3 a)) -> t a -> f (t a)
+ Linear.V4: _xyz :: R3 t => Lens' (t a) (V3 a)
- Linear.V4: _xyzw :: (R4 t, Functor f) => (V4 a -> f (V4 a)) -> t a -> f (t a)
+ Linear.V4: _xyzw :: R4 t => Lens' (t a) (V4 a)
- Linear.V4: _y :: (R2 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V4: _y :: R2 t => Lens' (t a) a
- Linear.V4: _z :: (R3 t, Functor f) => (a -> f a) -> t a -> f (t a)
+ Linear.V4: _z :: R3 t => Lens' (t a) a
Files
- CHANGELOG.markdown +9/−0
- linear.cabal +1/−1
- src/Linear/Matrix.hs +22/−3
- src/Linear/Perspective.hs +1/−1
- src/Linear/V2.hs +11/−9
- src/Linear/V3.hs +40/−9
- src/Linear/V4.hs +160/−9
CHANGELOG.markdown view
@@ -1,3 +1,12 @@+1.12.1+------+* Added "swizzle" lenses **e.g.** `_yzx`, which are useful for working with libraries like `gl`.++1.12+------+* Added 'transpose'+* Added missing 'Mxy' matrices up to 4 dimensions -- they were commonly reimplemented by users.+ 1.11.3 ------ * Fixed an issue with `UndecidableInstances` on GHC 7.6.3
linear.cabal view
@@ -1,6 +1,6 @@ name: linear category: Math, Algebra-version: 1.11.3+version: 1.12.1 license: BSD3 cabal-version: >= 1.8 license-file: LICENSE
src/Linear/Matrix.hs view
@@ -18,11 +18,13 @@ ( (!*!), (!+!), (!-!), (!*) , (*!), (!!*), (*!!) , column , adjoint- , M22, M33, M44, M43, m33_to_m44, m43_to_m44+ , M22, M23, M24, M32, M33, M34, M42, M43, M44+ , m33_to_m44, m43_to_m44 , det22, det33, inv22, inv33 , eye2, eye3, eye4 , Trace(..) , translation+ , transpose , fromQuaternion , mkTransformation , mkTransformationMat@@ -146,12 +148,22 @@ -- | A 2x2 matrix with row-major representation type M22 a = V2 (V2 a)+-- | A 2x3 matrix with row-major representation+type M23 a = V2 (V3 a)+-- | A 2x3 matrix with row-major representation+type M24 a = V2 (V4 a)+-- | A 3x2 matrix with row-major representation+type M32 a = V3 (V2 a) -- | A 3x3 matrix with row-major representation type M33 a = V3 (V3 a)--- | A 4x4 matrix with row-major representation-type M44 a = V4 (V4 a)+-- | A 3x4 matrix with row-major representation+type M34 a = V3 (V4 a)+-- | A 4x2 matrix with row-major representation+type M42 a = V4 (V2 a) -- | A 4x3 matrix with row-major representation type M43 a = V4 (V3 a)+-- | A 4x4 matrix with row-major representation+type M44 a = V4 (V4 a) -- | Build a rotation matrix from a unit 'Quaternion'. fromQuaternion :: Num a => Quaternion a -> M33 a@@ -287,3 +299,10 @@ det = det33 m {-# INLINE inv33 #-} ++-- | 'transpose' is just an alias for 'distribute'+--+-- > transpose (V3 (V2 1 2) (V2 3 4) (V2 5 6))+-- V2 (V3 1 3 5) (V3 2 4 6)+transpose :: (Distributive g, Functor f) => f (g a) -> g (f a)+transpose = distribute
src/Linear/Perspective.hs view
@@ -73,7 +73,7 @@ (V4 0 y 0 0) (V4 0 0 (-1) w) (V4 0 0 (-1) 0)- where range = (tan (fovy / 2)) * near+ where range = tan (fovy / 2) * near left = -range * aspect right = range * aspect bottom = -range
src/Linear/V2.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE MultiParamTypeClasses #-} -- {-# OPTIONS_GHC -fno-warn-name-shadowing #-} {-# LANGUAGE CPP #-}@@ -24,6 +25,7 @@ ( V2(..) , R1(..) , R2(..)+ , _yx , ex, ey , perp , angle@@ -182,18 +184,18 @@ -- >>> V2 1 2 & _y .~ 3 -- V2 1 3 --- -- @- -- '_y' :: 'Lens'' (t a) a- -- @- _y :: Functor f => (a -> f a) -> t a -> f (t a)+ _y :: Lens' (t a) a _y = _xy._y {-# INLINE _y #-} - -- |- -- @- -- '_xy' :: 'Lens'' (t a) ('V2' a)- -- @- _xy :: Functor f => (V2 a -> f (V2 a)) -> t a -> f (t a)+ _xy :: Lens' (t a) (V2 a)++-- |+-- >>> V2 1 2 ^. _yx+-- V2 2 1+_yx :: R2 t => Lens' (t a) (V2 a)+_yx f = _xy $ \(V2 a b) -> f (V2 b a) <&> \(V2 b' a') -> V2 a' b'+{-# INLINE _yx #-} ey :: R2 t => E t ey = E _y
src/Linear/V3.hs view
@@ -2,6 +2,7 @@ {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-}+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE CPP #-} #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702@@ -24,7 +25,10 @@ , cross, triple , R1(..) , R2(..)+ , _yx , R3(..)+ , _xz, _yz, _zx, _zy+ , _xzy, _yxz, _yzx, _zxy, _zyx , ex, ey, ez ) where @@ -166,15 +170,42 @@ -- | A space that distinguishes 3 orthogonal basis vectors: '_x', '_y', and '_z'. (It may have more) class R2 t => R3 t where -- |- -- @- -- '_z' :: 'Lens'' (t a) a- -- @- _z :: Functor f => (a -> f a) -> t a -> f (t a)- -- |- -- @- -- '_xyz' :: 'Lens'' (t a) ('V3' a)- -- @- _xyz :: Functor f => (V3 a -> f (V3 a)) -> t a -> f (t a)+ -- >>> V3 1 2 3 ^. _z+ -- 3+ _z :: Lens' (t a) a++ _xyz :: Lens' (t a) (V3 a)++_xz, _yz, _zx, _zy :: R3 t => Lens' (t a) (V2 a)++_xz f = _xyz $ \(V3 a b c) -> f (V2 a c) <&> \(V2 a' c') -> V3 a' b c'+{-# INLINE _xz #-}++_yz f = _xyz $ \(V3 a b c) -> f (V2 b c) <&> \(V2 b' c') -> V3 a b' c'+{-# INLINE _yz #-}++_zx f = _xyz $ \(V3 a b c) -> f (V2 c a) <&> \(V2 c' a') -> V3 a' b c'+{-# INLINE _zx #-}++_zy f = _xyz $ \(V3 a b c) -> f (V2 c b) <&> \(V2 c' b') -> V3 a b' c'+{-# INLINE _zy #-}++_xzy, _yxz, _yzx, _zxy, _zyx :: R3 t => Lens' (t a) (V3 a)++_xzy f = _xyz $ \(V3 a b c) -> f (V3 a c b) <&> \(V3 a' c' b') -> V3 a' b' c'+{-# INLINE _xzy #-}++_yxz f = _xyz $ \(V3 a b c) -> f (V3 b a c) <&> \(V3 b' a' c') -> V3 a' b' c'+{-# INLINE _yxz #-}++_yzx f = _xyz $ \(V3 a b c) -> f (V3 b c a) <&> \(V3 b' c' a') -> V3 a' b' c'+{-# INLINE _yzx #-}++_zxy f = _xyz $ \(V3 a b c) -> f (V3 c a b) <&> \(V3 c' a' b') -> V3 a' b' c'+{-# INLINE _zxy #-}++_zyx f = _xyz $ \(V3 a b c) -> f (V3 c b a) <&> \(V3 c' b' a') -> V3 a' b' c'+{-# INLINE _zyx #-} ez :: R3 t => E t ez = E _z
src/Linear/V4.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE FlexibleInstances #-}+{-# LANGUAGE RankNTypes #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE CPP #-}@@ -24,8 +25,17 @@ , vector, point, normalizePoint , R1(..) , R2(..)+ , _yx , R3(..)+ , _xz, _yz, _zx, _zy+ , _xzy, _yxz, _yzx, _zxy, _zyx , R4(..)+ , _xw, _yw, _zw, _wx, _wy, _wz+ , _xyw, _xzw, _xwy, _xwz, _yxw, _yzw, _ywx, _ywz, _zxw, _zyw, _zwx, _zwy+ , _wxy, _wxz, _wyx, _wyz, _wzx, _wzy+ , _xywz, _xzyw, _xzwy, _xwyz, _xwzy, _yxzw , _yxwz, _yzxw, _yzwx, _ywxz+ , _ywzx, _zxyw, _zxwy, _zyxw, _zywx, _zwxy, _zwyx, _wxyz, _wxzy, _wyxz+ , _wyzx, _wzxy, _wzyx , ex, ey, ez, ew ) where @@ -172,15 +182,156 @@ -- | A space that distinguishes orthogonal basis vectors '_x', '_y', '_z', '_w'. (It may have more.) class R3 t => R4 t where -- |- -- @- -- '_w' :: 'Lens'' (t a) a- -- @- _w :: Functor f => (a -> f a) -> t a -> f (t a)- -- |- -- @- -- '_xyzw' :: 'Lens'' (t a) ('V4' a)- -- @- _xyzw :: Functor f => (V4 a -> f (V4 a)) -> t a -> f (t a)+ -- >>> V4 1 2 3 4 ^._w+ -- 4+ _w :: Lens' (t a) a+ _xyzw :: Lens' (t a) (V4 a)++_xw, _yw, _zw, _wx, _wy, _wz :: R4 t => Lens' (t a) (V2 a)+_xw f = _xyzw $ \(V4 a b c d) -> f (V2 a d) <&> \(V2 a' d') -> V4 a' b c d'+{-# INLINE _xw #-}++_yw f = _xyzw $ \(V4 a b c d) -> f (V2 b d) <&> \(V2 b' d') -> V4 a b' c d'+{-# INLINE _yw #-}++_zw f = _xyzw $ \(V4 a b c d) -> f (V2 c d) <&> \(V2 c' d') -> V4 a b c' d'+{-# INLINE _zw #-}++_wx f = _xyzw $ \(V4 a b c d) -> f (V2 d a) <&> \(V2 d' a') -> V4 a' b c d'+{-# INLINE _wx #-}++_wy f = _xyzw $ \(V4 a b c d) -> f (V2 d b) <&> \(V2 d' b') -> V4 a b' c d'+{-# INLINE _wy #-}++_wz f = _xyzw $ \(V4 a b c d) -> f (V2 d c) <&> \(V2 d' c') -> V4 a b c' d'+{-# INLINE _wz #-}++_xyw, _xzw, _xwy, _xwz, _yxw, _yzw, _ywx, _ywz, _zxw, _zyw, _zwx, _zwy, _wxy, _wxz, _wyx, _wyz, _wzx, _wzy :: R4 t => Lens' (t a) (V3 a)+_xyw f = _xyzw $ \(V4 a b c d) -> f (V3 a b d) <&> \(V3 a' b' d') -> V4 a' b' c d'+{-# INLINE _xyw #-}++_xzw f = _xyzw $ \(V4 a b c d) -> f (V3 a c d) <&> \(V3 a' c' d') -> V4 a' b c' d'+{-# INLINE _xzw #-}++_xwy f = _xyzw $ \(V4 a b c d) -> f (V3 a d b) <&> \(V3 a' d' b') -> V4 a' b' c d'+{-# INLINE _xwy #-}++_xwz f = _xyzw $ \(V4 a b c d) -> f (V3 a d c) <&> \(V3 a' d' c') -> V4 a' b c' d'+{-# INLINE _xwz #-}++_yxw f = _xyzw $ \(V4 a b c d) -> f (V3 b a d) <&> \(V3 b' a' d') -> V4 a' b' c d'+{-# INLINE _yxw #-}++_yzw f = _xyzw $ \(V4 a b c d) -> f (V3 b c d) <&> \(V3 b' c' d') -> V4 a b' c' d'+{-# INLINE _yzw #-}++_ywx f = _xyzw $ \(V4 a b c d) -> f (V3 b d a) <&> \(V3 b' d' a') -> V4 a' b' c d'+{-# INLINE _ywx #-}++_ywz f = _xyzw $ \(V4 a b c d) -> f (V3 b d c) <&> \(V3 b' d' c') -> V4 a b' c' d'+{-# INLINE _ywz #-}++_zxw f = _xyzw $ \(V4 a b c d) -> f (V3 c a d) <&> \(V3 c' a' d') -> V4 a' b c' d'+{-# INLINE _zxw #-}++_zyw f = _xyzw $ \(V4 a b c d) -> f (V3 c b d) <&> \(V3 c' b' d') -> V4 a b' c' d'+{-# INLINE _zyw #-}++_zwx f = _xyzw $ \(V4 a b c d) -> f (V3 c d a) <&> \(V3 c' d' a') -> V4 a' b c' d'+{-# INLINE _zwx #-}++_zwy f = _xyzw $ \(V4 a b c d) -> f (V3 c d b) <&> \(V3 c' d' b') -> V4 a b' c' d'+{-# INLINE _zwy #-}++_wxy f = _xyzw $ \(V4 a b c d) -> f (V3 d a b) <&> \(V3 d' a' b') -> V4 a' b' c d'+{-# INLINE _wxy #-}++_wxz f = _xyzw $ \(V4 a b c d) -> f (V3 d a c) <&> \(V3 d' a' c') -> V4 a' b c' d'+{-# INLINE _wxz #-}++_wyx f = _xyzw $ \(V4 a b c d) -> f (V3 d b a) <&> \(V3 d' b' a') -> V4 a' b' c d'+{-# INLINE _wyx #-}++_wyz f = _xyzw $ \(V4 a b c d) -> f (V3 d b c) <&> \(V3 d' b' c') -> V4 a b' c' d'+{-# INLINE _wyz #-}++_wzx f = _xyzw $ \(V4 a b c d) -> f (V3 d c a) <&> \(V3 d' c' a') -> V4 a' b c' d'+{-# INLINE _wzx #-}++_wzy f = _xyzw $ \(V4 a b c d) -> f (V3 d c b) <&> \(V3 d' c' b') -> V4 a b' c' d'+{-# INLINE _wzy #-}++_xywz, _xzyw, _xzwy, _xwyz, _xwzy, _yxzw , _yxwz, _yzxw, _yzwx, _ywxz+ , _ywzx, _zxyw, _zxwy, _zyxw, _zywx, _zwxy, _zwyx, _wxyz, _wxzy, _wyxz+ , _wyzx, _wzxy, _wzyx :: R4 t => Lens' (t a) (V4 a)+_xywz f = _xyzw $ \(V4 a b c d) -> f (V4 a b d c) <&> \(V4 a' b' d' c') -> V4 a' b' c' d'+{-# INLINE _xywz #-}++_xzyw f = _xyzw $ \(V4 a b c d) -> f (V4 a c b d) <&> \(V4 a' c' b' d') -> V4 a' b' c' d'+{-# INLINE _xzyw #-}++_xzwy f = _xyzw $ \(V4 a b c d) -> f (V4 a c d b) <&> \(V4 a' c' d' b') -> V4 a' b' c' d'+{-# INLINE _xzwy #-}++_xwyz f = _xyzw $ \(V4 a b c d) -> f (V4 a d b c) <&> \(V4 a' d' b' c') -> V4 a' b' c' d'+{-# INLINE _xwyz #-}++_xwzy f = _xyzw $ \(V4 a b c d) -> f (V4 a d c b) <&> \(V4 a' d' c' b') -> V4 a' b' c' d'+{-# INLINE _xwzy #-}++_yxzw f = _xyzw $ \(V4 a b c d) -> f (V4 b a c d) <&> \(V4 b' a' c' d') -> V4 a' b' c' d'+{-# INLINE _yxzw #-}++_yxwz f = _xyzw $ \(V4 a b c d) -> f (V4 b a d c) <&> \(V4 b' a' d' c') -> V4 a' b' c' d'+{-# INLINE _yxwz #-}++_yzxw f = _xyzw $ \(V4 a b c d) -> f (V4 b c a d) <&> \(V4 b' c' a' d') -> V4 a' b' c' d'+{-# INLINE _yzxw #-}++_yzwx f = _xyzw $ \(V4 a b c d) -> f (V4 b c d a) <&> \(V4 b' c' d' a') -> V4 a' b' c' d'+{-# INLINE _yzwx #-}++_ywxz f = _xyzw $ \(V4 a b c d) -> f (V4 b d a c) <&> \(V4 b' d' a' c') -> V4 a' b' c' d'+{-# INLINE _ywxz #-}++_ywzx f = _xyzw $ \(V4 a b c d) -> f (V4 b d c a) <&> \(V4 b' d' c' a') -> V4 a' b' c' d'+{-# INLINE _ywzx #-}++_zxyw f = _xyzw $ \(V4 a b c d) -> f (V4 c a b d) <&> \(V4 c' a' b' d') -> V4 a' b' c' d'+{-# INLINE _zxyw #-}++_zxwy f = _xyzw $ \(V4 a b c d) -> f (V4 c a d b) <&> \(V4 c' a' d' b') -> V4 a' b' c' d'+{-# INLINE _zxwy #-}++_zyxw f = _xyzw $ \(V4 a b c d) -> f (V4 c b a d) <&> \(V4 c' b' a' d') -> V4 a' b' c' d'+{-# INLINE _zyxw #-}++_zywx f = _xyzw $ \(V4 a b c d) -> f (V4 c b d a) <&> \(V4 c' b' d' a') -> V4 a' b' c' d'+{-# INLINE _zywx #-}++_zwxy f = _xyzw $ \(V4 a b c d) -> f (V4 c d a b) <&> \(V4 c' d' a' b') -> V4 a' b' c' d'+{-# INLINE _zwxy #-}++_zwyx f = _xyzw $ \(V4 a b c d) -> f (V4 c d b a) <&> \(V4 c' d' b' a') -> V4 a' b' c' d'+{-# INLINE _zwyx #-}++_wxyz f = _xyzw $ \(V4 a b c d) -> f (V4 d a b c) <&> \(V4 d' a' b' c') -> V4 a' b' c' d'+{-# INLINE _wxyz #-}++_wxzy f = _xyzw $ \(V4 a b c d) -> f (V4 d a c b) <&> \(V4 d' a' c' b') -> V4 a' b' c' d'+{-# INLINE _wxzy #-}++_wyxz f = _xyzw $ \(V4 a b c d) -> f (V4 d b a c) <&> \(V4 d' b' a' c') -> V4 a' b' c' d'+{-# INLINE _wyxz #-}++_wyzx f = _xyzw $ \(V4 a b c d) -> f (V4 d b c a) <&> \(V4 d' b' c' a') -> V4 a' b' c' d'+{-# INLINE _wyzx #-}++_wzxy f = _xyzw $ \(V4 a b c d) -> f (V4 d c a b) <&> \(V4 d' c' a' b') -> V4 a' b' c' d'+{-# INLINE _wzxy #-}++_wzyx f = _xyzw $ \(V4 a b c d) -> f (V4 d c b a) <&> \(V4 d' c' b' a') -> V4 a' b' c' d'+{-# INLINE _wzyx #-} ew :: R4 t => E t ew = E _w