packages feed

geomancy-0.4.1.0 / src / Geomancy / Swizzle / UVec / Extend.hs

{-# LANGUAGE BlockArguments #-}{-# LANGUAGE DataKinds #-}{-# LANGUAGE FlexibleInstances #-}{-# LANGUAGE MultiParamTypeClasses #-}{-# OPTIONS_GHC -Wno-orphans #-}module Geomancy.Swizzle.UVec.Extend () whereimport GHC.Records (HasField(..))import Geomancy.UVec2 (UVec2, withUVec2)import Geomancy.UVec3 (UVec3, uvec3, withUVec3)import Geomancy.UVec4 (UVec4, uvec4)instance HasField "xy0" UVec2 UVec3 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec3 x y 0instance HasField "xy1" UVec2 UVec3 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec3 x y 1instance HasField "xy00" UVec2 UVec4 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec4 x y 0 0instance HasField "xy01" UVec2 UVec4 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec4 x y 0 1instance HasField "xy10" UVec2 UVec4 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec4 x y 1 0instance HasField "xy11" UVec2 UVec4 where  {-# INLINE getField #-}  getField v = withUVec2 v \x y -> uvec4 x y 1 1instance HasField "xyz0" UVec3 UVec4 where  {-# INLINE getField #-}  getField v = withUVec3 v \x y z -> uvec4 x y z 0instance HasField "xyz1" UVec3 UVec4 where  {-# INLINE getField #-}  getField v = withUVec3 v \x y z -> uvec4 x y z 1