{-# LANGUAGE BlockArguments #-}{-# LANGUAGE DataKinds #-}{-# LANGUAGE FlexibleInstances #-}{-# LANGUAGE MultiParamTypeClasses #-}{-# OPTIONS_GHC -Wno-orphans #-}module Geomancy.Swizzle.Vec.Extend () whereimport GHC.Records (HasField(..))import Geomancy.Vec2 (Vec2, withVec2)import Geomancy.Vec3 (Vec3, vec3, withVec3)import Geomancy.Vec4 (Vec4, vec4)instance HasField "xy0" Vec2 Vec3 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec3 x y 0instance HasField "xy1" Vec2 Vec3 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec3 x y 1instance HasField "xy00" Vec2 Vec4 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec4 x y 0 0instance HasField "xy01" Vec2 Vec4 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec4 x y 0 1instance HasField "xy10" Vec2 Vec4 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec4 x y 1 0instance HasField "xy11" Vec2 Vec4 where {-# INLINE getField #-} getField v = withVec2 v \x y -> vec4 x y 1 1instance HasField "xyz0" Vec3 Vec4 where {-# INLINE getField #-} getField v = withVec3 v \x y z -> vec4 x y z 0instance HasField "xyz1" Vec3 Vec4 where {-# INLINE getField #-} getField v = withVec3 v \x y z -> vec4 x y z 1