packages feed

geomancy-0.4.0.0: src/Geomancy/Swizzle/U64Vec/Extend.hs

{-# LANGUAGE BlockArguments #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# OPTIONS_GHC -Wno-orphans #-}

module Geomancy.Swizzle.U64Vec.Extend () where

import GHC.Records (HasField(..))

import Geomancy.U64Vec2 (U64Vec2, withU64Vec2)
import Geomancy.U64Vec3 (U64Vec3, u64vec3, withU64Vec3)
import Geomancy.U64Vec4 (U64Vec4, u64vec4)

instance HasField "xy0" U64Vec2 U64Vec3 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec3 x y 0

instance HasField "xy1" U64Vec2 U64Vec3 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec3 x y 1

instance HasField "xy00" U64Vec2 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec4 x y 0 0

instance HasField "xy01" U64Vec2 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec4 x y 0 1

instance HasField "xy10" U64Vec2 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec4 x y 1 0

instance HasField "xy11" U64Vec2 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec2 v \x y -> u64vec4 x y 1 1

instance HasField "xyz0" U64Vec3 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec3 v \x y z -> u64vec4 x y z 0

instance HasField "xyz1" U64Vec3 U64Vec4 where
  {-# INLINE getField #-}
  getField v = withU64Vec3 v \x y z -> u64vec4 x y z 1