{-# LANGUAGE CPP #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE ScopedTypeVariables #-}
#ifndef MIN_VERSION_hashable
#define MIN_VERSION_hashable(x,y,z) 1
#endif
module Linear.Affine where
import Control.Applicative
import Control.DeepSeq
import Control.Monad (liftM)
import Control.Lens
import Data.Binary as Binary
import Data.Bytes.Serial
import Data.Coerce
import Data.Complex (Complex)
import Data.Data
import Data.Distributive
import Data.Foldable as Foldable
import Data.Functor.Bind
import Data.Functor.Classes
import Data.Functor.Product
import Data.Functor.Rep as Rep
import Data.HashMap.Lazy (HashMap)
import Data.Hashable
import Data.Hashable.Lifted
import Data.IntMap (IntMap)
import Data.Ix
import Data.Kind
import Data.Map (Map)
#if !(MIN_VERSION_base(4,11,0))
import Data.Semigroup (Semigroup)
#endif
import Data.Serialize as Cereal
import Data.Vector (Vector)
import qualified Data.Vector.Generic.Mutable as M
import qualified Data.Vector.Generic as G
import qualified Data.Vector.Unboxed.Base as U
import Foreign.Storable
import GHC.Generics (Generic, Generic1)
import Linear.Epsilon
import Linear.Metric
import Linear.Plucker
import Linear.Quaternion
import Linear.V
import Linear.V0
import Linear.V1
import Linear.V2
import Linear.V3
import Linear.V4
import Linear.Vector
import System.Random (Random(..))
class Additive (Diff p) => Affine p where
type Diff p :: Type -> Type
infixl 6 .-.
(.-.) :: Num a => p a -> p a -> Diff p a
infixl 6 .+^
(.+^) :: Num a => p a -> Diff p a -> p a
infixl 6 .-^
(.-^) :: Num a => p a -> Diff p a -> p a
p a
p .-^ Diff p a
v = p a
p p a -> Diff p a -> p a
forall a. Num a => p a -> Diff p a -> p a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^ Diff p a -> Diff p a
forall (f :: * -> *) a. (Functor f, Num a) => f a -> f a
negated Diff p a
v
{-# INLINE (.-^) #-}
instance (Affine f, Affine g) => Affine (Product f g) where
type Diff (Product f g) = Product (Diff f) (Diff g)
Pair f a
a g a
b .-. :: forall a.
Num a =>
Product f g a -> Product f g a -> Diff (Product f g) a
.-. Pair f a
c g a
d = Diff f a -> Diff g a -> Product (Diff f) (Diff g) a
forall {k} (f :: k -> *) (g :: k -> *) (a :: k).
f a -> g a -> Product f g a
Pair (f a
a f a -> f a -> Diff f a
forall a. Num a => f a -> f a -> Diff f a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> p a -> Diff p a
.-. f a
c) (g a
b g a -> g a -> Diff g a
forall a. Num a => g a -> g a -> Diff g a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> p a -> Diff p a
.-. g a
d)
Pair f a
a g a
b .+^ :: forall a.
Num a =>
Product f g a -> Diff (Product f g) a -> Product f g a
.+^ Pair Diff f a
c Diff g a
d = f a -> g a -> Product f g a
forall {k} (f :: k -> *) (g :: k -> *) (a :: k).
f a -> g a -> Product f g a
Pair (f a
a f a -> Diff f a -> f a
forall a. Num a => f a -> Diff f a -> f a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^ Diff f a
c) (g a
b g a -> Diff g a -> g a
forall a. Num a => g a -> Diff g a -> g a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^ Diff g a
d)
Pair f a
a g a
b .-^ :: forall a.
Num a =>
Product f g a -> Diff (Product f g) a -> Product f g a
.-^ Pair Diff f a
c Diff g a
d = f a -> g a -> Product f g a
forall {k} (f :: k -> *) (g :: k -> *) (a :: k).
f a -> g a -> Product f g a
Pair (f a
a f a -> Diff f a -> f a
forall a. Num a => f a -> Diff f a -> f a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^ Diff f a
c) (g a
b g a -> Diff g a -> g a
forall a. Num a => g a -> Diff g a -> g a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^ Diff g a
d)
qdA :: (Affine p, Foldable (Diff p), Num a) => p a -> p a -> a
qdA :: forall (p :: * -> *) a.
(Affine p, Foldable (Diff p), Num a) =>
p a -> p a -> a
qdA p a
a p a
b = Diff p a -> a
forall a. Num a => Diff p a -> a
forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
Foldable.sum ((a -> a) -> Diff p a -> Diff p a
forall a b. (a -> b) -> Diff p a -> Diff p b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ((a -> a -> a) -> a -> a
forall a. (a -> a -> a) -> a -> a
forall (m :: * -> *) a. Bind m => m (m a) -> m a
join a -> a -> a
forall a. Num a => a -> a -> a
(*)) (p a
a p a -> p a -> Diff p a
forall a. Num a => p a -> p a -> Diff p a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> p a -> Diff p a
.-. p a
b))
{-# INLINE qdA #-}
distanceA :: (Floating a, Foldable (Diff p), Affine p) => p a -> p a -> a
distanceA :: forall a (p :: * -> *).
(Floating a, Foldable (Diff p), Affine p) =>
p a -> p a -> a
distanceA p a
a p a
b = a -> a
forall a. Floating a => a -> a
sqrt (p a -> p a -> a
forall (p :: * -> *) a.
(Affine p, Foldable (Diff p), Num a) =>
p a -> p a -> a
qdA p a
a p a
b)
{-# INLINE distanceA #-}
#define ADDITIVEC(CTX,T) instance CTX => Affine T where type Diff T = T ; \
(.-.) = (^-^) ; {-# INLINE (.-.) #-} ; (.+^) = (^+^) ; {-# INLINE (.+^) #-} ; \
(.-^) = (^-^) ; {-# INLINE (.-^) #-}
#define ADDITIVE(T) ADDITIVEC((), T)
ADDITIVE([])
ADDITIVE(Complex)
ADDITIVE(ZipList)
ADDITIVE(Maybe)
ADDITIVE(IntMap)
ADDITIVE(Identity)
ADDITIVE(Vector)
ADDITIVE(V0)
ADDITIVE(V1)
ADDITIVE(V2)
ADDITIVE(V3)
ADDITIVE(V4)
ADDITIVE(Plucker)
ADDITIVE(Quaternion)
ADDITIVE(((->) b))
ADDITIVEC(Ord k, (Map k))
ADDITIVEC((Eq k, Hashable k), (HashMap k))
ADDITIVEC(Dim n, (V n))
newtype Point f a = P (f a)
deriving ( Point f a -> Point f a -> Bool
(Point f a -> Point f a -> Bool)
-> (Point f a -> Point f a -> Bool) -> Eq (Point f a)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (f :: * -> *) a. Eq (f a) => Point f a -> Point f a -> Bool
$c== :: forall (f :: * -> *) a. Eq (f a) => Point f a -> Point f a -> Bool
== :: Point f a -> Point f a -> Bool
$c/= :: forall (f :: * -> *) a. Eq (f a) => Point f a -> Point f a -> Bool
/= :: Point f a -> Point f a -> Bool
Eq, Eq (Point f a)
Eq (Point f a) =>
(Point f a -> Point f a -> Ordering)
-> (Point f a -> Point f a -> Bool)
-> (Point f a -> Point f a -> Bool)
-> (Point f a -> Point f a -> Bool)
-> (Point f a -> Point f a -> Bool)
-> (Point f a -> Point f a -> Point f a)
-> (Point f a -> Point f a -> Point f a)
-> Ord (Point f a)
Point f a -> Point f a -> Bool
Point f a -> Point f a -> Ordering
Point f a -> Point f a -> Point f a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall (f :: * -> *) a. Ord (f a) => Eq (Point f a)
forall (f :: * -> *) a. Ord (f a) => Point f a -> Point f a -> Bool
forall (f :: * -> *) a.
Ord (f a) =>
Point f a -> Point f a -> Ordering
forall (f :: * -> *) a.
Ord (f a) =>
Point f a -> Point f a -> Point f a
$ccompare :: forall (f :: * -> *) a.
Ord (f a) =>
Point f a -> Point f a -> Ordering
compare :: Point f a -> Point f a -> Ordering
$c< :: forall (f :: * -> *) a. Ord (f a) => Point f a -> Point f a -> Bool
< :: Point f a -> Point f a -> Bool
$c<= :: forall (f :: * -> *) a. Ord (f a) => Point f a -> Point f a -> Bool
<= :: Point f a -> Point f a -> Bool
$c> :: forall (f :: * -> *) a. Ord (f a) => Point f a -> Point f a -> Bool
> :: Point f a -> Point f a -> Bool
$c>= :: forall (f :: * -> *) a. Ord (f a) => Point f a -> Point f a -> Bool
>= :: Point f a -> Point f a -> Bool
$cmax :: forall (f :: * -> *) a.
Ord (f a) =>
Point f a -> Point f a -> Point f a
max :: Point f a -> Point f a -> Point f a
$cmin :: forall (f :: * -> *) a.
Ord (f a) =>
Point f a -> Point f a -> Point f a
min :: Point f a -> Point f a -> Point f a
Ord, Int -> Point f a -> ShowS
[Point f a] -> ShowS
Point f a -> String
(Int -> Point f a -> ShowS)
-> (Point f a -> String)
-> ([Point f a] -> ShowS)
-> Show (Point f a)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (f :: * -> *) a. Show (f a) => Int -> Point f a -> ShowS
forall (f :: * -> *) a. Show (f a) => [Point f a] -> ShowS
forall (f :: * -> *) a. Show (f a) => Point f a -> String
$cshowsPrec :: forall (f :: * -> *) a. Show (f a) => Int -> Point f a -> ShowS
showsPrec :: Int -> Point f a -> ShowS
$cshow :: forall (f :: * -> *) a. Show (f a) => Point f a -> String
show :: Point f a -> String
$cshowList :: forall (f :: * -> *) a. Show (f a) => [Point f a] -> ShowS
showList :: [Point f a] -> ShowS
Show, ReadPrec [Point f a]
ReadPrec (Point f a)
Int -> ReadS (Point f a)
ReadS [Point f a]
(Int -> ReadS (Point f a))
-> ReadS [Point f a]
-> ReadPrec (Point f a)
-> ReadPrec [Point f a]
-> Read (Point f a)
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
forall (f :: * -> *) a. Read (f a) => ReadPrec [Point f a]
forall (f :: * -> *) a. Read (f a) => ReadPrec (Point f a)
forall (f :: * -> *) a. Read (f a) => Int -> ReadS (Point f a)
forall (f :: * -> *) a. Read (f a) => ReadS [Point f a]
$creadsPrec :: forall (f :: * -> *) a. Read (f a) => Int -> ReadS (Point f a)
readsPrec :: Int -> ReadS (Point f a)
$creadList :: forall (f :: * -> *) a. Read (f a) => ReadS [Point f a]
readList :: ReadS [Point f a]
$creadPrec :: forall (f :: * -> *) a. Read (f a) => ReadPrec (Point f a)
readPrec :: ReadPrec (Point f a)
$creadListPrec :: forall (f :: * -> *) a. Read (f a) => ReadPrec [Point f a]
readListPrec :: ReadPrec [Point f a]
Read, Applicative (Point f)
Applicative (Point f) =>
(forall a b. Point f a -> (a -> Point f b) -> Point f b)
-> (forall a b. Point f a -> Point f b -> Point f b)
-> (forall a. a -> Point f a)
-> Monad (Point f)
forall a. a -> Point f a
forall a b. Point f a -> Point f b -> Point f b
forall a b. Point f a -> (a -> Point f b) -> Point f b
forall (f :: * -> *). Monad f => Applicative (Point f)
forall (f :: * -> *) a. Monad f => a -> Point f a
forall (f :: * -> *) a b.
Monad f =>
Point f a -> Point f b -> Point f b
forall (f :: * -> *) a b.
Monad f =>
Point f a -> (a -> Point f b) -> Point f b
forall (m :: * -> *).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
$c>>= :: forall (f :: * -> *) a b.
Monad f =>
Point f a -> (a -> Point f b) -> Point f b
>>= :: forall a b. Point f a -> (a -> Point f b) -> Point f b
$c>> :: forall (f :: * -> *) a b.
Monad f =>
Point f a -> Point f b -> Point f b
>> :: forall a b. Point f a -> Point f b -> Point f b
$creturn :: forall (f :: * -> *) a. Monad f => a -> Point f a
return :: forall a. a -> Point f a
Monad, (forall a b. (a -> b) -> Point f a -> Point f b)
-> (forall a b. a -> Point f b -> Point f a) -> Functor (Point f)
forall a b. a -> Point f b -> Point f a
forall a b. (a -> b) -> Point f a -> Point f b
forall (f :: * -> *) a b. Functor f => a -> Point f b -> Point f a
forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> Point f a -> Point f b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (f :: * -> *) a b.
Functor f =>
(a -> b) -> Point f a -> Point f b
fmap :: forall a b. (a -> b) -> Point f a -> Point f b
$c<$ :: forall (f :: * -> *) a b. Functor f => a -> Point f b -> Point f a
<$ :: forall a b. a -> Point f b -> Point f a
Functor, Functor (Point f)
Functor (Point f) =>
(forall a. a -> Point f a)
-> (forall a b. Point f (a -> b) -> Point f a -> Point f b)
-> (forall a b c.
(a -> b -> c) -> Point f a -> Point f b -> Point f c)
-> (forall a b. Point f a -> Point f b -> Point f b)
-> (forall a b. Point f a -> Point f b -> Point f a)
-> Applicative (Point f)
forall a. a -> Point f a
forall a b. Point f a -> Point f b -> Point f a
forall a b. Point f a -> Point f b -> Point f b
forall a b. Point f (a -> b) -> Point f a -> Point f b
forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
forall (f :: * -> *).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
forall (f :: * -> *). Applicative f => Functor (Point f)
forall (f :: * -> *) a. Applicative f => a -> Point f a
forall (f :: * -> *) a b.
Applicative f =>
Point f a -> Point f b -> Point f a
forall (f :: * -> *) a b.
Applicative f =>
Point f a -> Point f b -> Point f b
forall (f :: * -> *) a b.
Applicative f =>
Point f (a -> b) -> Point f a -> Point f b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
$cpure :: forall (f :: * -> *) a. Applicative f => a -> Point f a
pure :: forall a. a -> Point f a
$c<*> :: forall (f :: * -> *) a b.
Applicative f =>
Point f (a -> b) -> Point f a -> Point f b
<*> :: forall a b. Point f (a -> b) -> Point f a -> Point f b
$cliftA2 :: forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
liftA2 :: forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
$c*> :: forall (f :: * -> *) a b.
Applicative f =>
Point f a -> Point f b -> Point f b
*> :: forall a b. Point f a -> Point f b -> Point f b
$c<* :: forall (f :: * -> *) a b.
Applicative f =>
Point f a -> Point f b -> Point f a
<* :: forall a b. Point f a -> Point f b -> Point f a
Applicative, (forall m. Monoid m => Point f m -> m)
-> (forall m a. Monoid m => (a -> m) -> Point f a -> m)
-> (forall m a. Monoid m => (a -> m) -> Point f a -> m)
-> (forall a b. (a -> b -> b) -> b -> Point f a -> b)
-> (forall a b. (a -> b -> b) -> b -> Point f a -> b)
-> (forall b a. (b -> a -> b) -> b -> Point f a -> b)
-> (forall b a. (b -> a -> b) -> b -> Point f a -> b)
-> (forall a. (a -> a -> a) -> Point f a -> a)
-> (forall a. (a -> a -> a) -> Point f a -> a)
-> (forall a. Point f a -> [a])
-> (forall a. Point f a -> Bool)
-> (forall a. Point f a -> Int)
-> (forall a. Eq a => a -> Point f a -> Bool)
-> (forall a. Ord a => Point f a -> a)
-> (forall a. Ord a => Point f a -> a)
-> (forall a. Num a => Point f a -> a)
-> (forall a. Num a => Point f a -> a)
-> Foldable (Point f)
forall a. Eq a => a -> Point f a -> Bool
forall a. Num a => Point f a -> a
forall a. Ord a => Point f a -> a
forall m. Monoid m => Point f m -> m
forall a. Point f a -> Bool
forall a. Point f a -> Int
forall a. Point f a -> [a]
forall a. (a -> a -> a) -> Point f a -> a
forall m a. Monoid m => (a -> m) -> Point f a -> m
forall b a. (b -> a -> b) -> b -> Point f a -> b
forall a b. (a -> b -> b) -> b -> Point f a -> b
forall (f :: * -> *) a.
(Foldable f, Eq a) =>
a -> Point f a -> Bool
forall (f :: * -> *) a. (Foldable f, Num a) => Point f a -> a
forall (f :: * -> *) a. (Foldable f, Ord a) => Point f a -> a
forall (f :: * -> *) m. (Foldable f, Monoid m) => Point f m -> m
forall (f :: * -> *) a. Foldable f => Point f a -> Bool
forall (f :: * -> *) a. Foldable f => Point f a -> Int
forall (f :: * -> *) a. Foldable f => Point f a -> [a]
forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Point f a -> a
forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Point f a -> m
forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Point f a -> b
forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Point f a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (f :: * -> *) m. (Foldable f, Monoid m) => Point f m -> m
fold :: forall m. Monoid m => Point f m -> m
$cfoldMap :: forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Point f a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Point f a -> m
$cfoldMap' :: forall (f :: * -> *) m a.
(Foldable f, Monoid m) =>
(a -> m) -> Point f a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Point f a -> m
$cfoldr :: forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Point f a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Point f a -> b
$cfoldr' :: forall (f :: * -> *) a b.
Foldable f =>
(a -> b -> b) -> b -> Point f a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Point f a -> b
$cfoldl :: forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Point f a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Point f a -> b
$cfoldl' :: forall (f :: * -> *) b a.
Foldable f =>
(b -> a -> b) -> b -> Point f a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Point f a -> b
$cfoldr1 :: forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Point f a -> a
foldr1 :: forall a. (a -> a -> a) -> Point f a -> a
$cfoldl1 :: forall (f :: * -> *) a.
Foldable f =>
(a -> a -> a) -> Point f a -> a
foldl1 :: forall a. (a -> a -> a) -> Point f a -> a
$ctoList :: forall (f :: * -> *) a. Foldable f => Point f a -> [a]
toList :: forall a. Point f a -> [a]
$cnull :: forall (f :: * -> *) a. Foldable f => Point f a -> Bool
null :: forall a. Point f a -> Bool
$clength :: forall (f :: * -> *) a. Foldable f => Point f a -> Int
length :: forall a. Point f a -> Int
$celem :: forall (f :: * -> *) a.
(Foldable f, Eq a) =>
a -> Point f a -> Bool
elem :: forall a. Eq a => a -> Point f a -> Bool
$cmaximum :: forall (f :: * -> *) a. (Foldable f, Ord a) => Point f a -> a
maximum :: forall a. Ord a => Point f a -> a
$cminimum :: forall (f :: * -> *) a. (Foldable f, Ord a) => Point f a -> a
minimum :: forall a. Ord a => Point f a -> a
$csum :: forall (f :: * -> *) a. (Foldable f, Num a) => Point f a -> a
sum :: forall a. Num a => Point f a -> a
$cproduct :: forall (f :: * -> *) a. (Foldable f, Num a) => Point f a -> a
product :: forall a. Num a => Point f a -> a
Foldable
, (forall a. Eq a => Eq (Point f a)) =>
(forall a b. (a -> b -> Bool) -> Point f a -> Point f b -> Bool)
-> Eq1 (Point f)
forall a. Eq a => Eq (Point f a)
forall a b. (a -> b -> Bool) -> Point f a -> Point f b -> Bool
forall (f :: * -> *) a. (Eq1 f, Eq a) => Eq (Point f a)
forall (f :: * -> *) a b.
Eq1 f =>
(a -> b -> Bool) -> Point f a -> Point f b -> Bool
forall (f :: * -> *).
(forall a. Eq a => Eq (f a)) =>
(forall a b. (a -> b -> Bool) -> f a -> f b -> Bool) -> Eq1 f
$cliftEq :: forall (f :: * -> *) a b.
Eq1 f =>
(a -> b -> Bool) -> Point f a -> Point f b -> Bool
liftEq :: forall a b. (a -> b -> Bool) -> Point f a -> Point f b -> Bool
Eq1, Eq1 (Point f)
(Eq1 (Point f), forall a. Ord a => Ord (Point f a)) =>
(forall a b.
(a -> b -> Ordering) -> Point f a -> Point f b -> Ordering)
-> Ord1 (Point f)
forall a. Ord a => Ord (Point f a)
forall a b.
(a -> b -> Ordering) -> Point f a -> Point f b -> Ordering
forall (f :: * -> *). Ord1 f => Eq1 (Point f)
forall (f :: * -> *) a. (Ord1 f, Ord a) => Ord (Point f a)
forall (f :: * -> *) a b.
Ord1 f =>
(a -> b -> Ordering) -> Point f a -> Point f b -> Ordering
forall (f :: * -> *).
(Eq1 f, forall a. Ord a => Ord (f a)) =>
(forall a b. (a -> b -> Ordering) -> f a -> f b -> Ordering)
-> Ord1 f
$cliftCompare :: forall (f :: * -> *) a b.
Ord1 f =>
(a -> b -> Ordering) -> Point f a -> Point f b -> Ordering
liftCompare :: forall a b.
(a -> b -> Ordering) -> Point f a -> Point f b -> Ordering
Ord1, (forall a. Show a => Show (Point f a)) =>
(forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS)
-> (forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS)
-> Show1 (Point f)
forall a. Show a => Show (Point f a)
forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS
forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS
forall (f :: * -> *) a. (Show1 f, Show a) => Show (Point f a)
forall (f :: * -> *) a.
Show1 f =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS
forall (f :: * -> *) a.
Show1 f =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS
forall (f :: * -> *).
(forall a. Show a => Show (f a)) =>
(forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> f a -> ShowS)
-> (forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [f a] -> ShowS)
-> Show1 f
$cliftShowsPrec :: forall (f :: * -> *) a.
Show1 f =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS
liftShowsPrec :: forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Point f a -> ShowS
$cliftShowList :: forall (f :: * -> *) a.
Show1 f =>
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS
liftShowList :: forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> [Point f a] -> ShowS
Show1, (forall a. Read a => Read (Point f a)) =>
(forall a.
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a))
-> (forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a])
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a))
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a])
-> Read1 (Point f)
forall a. Read a => Read (Point f a)
forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a]
forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a)
forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a)
forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a]
forall (f :: * -> *) a. (Read1 f, Read a) => Read (Point f a)
forall (f :: * -> *) a.
Read1 f =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a]
forall (f :: * -> *) a.
Read1 f =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a)
forall (f :: * -> *) a.
Read1 f =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a)
forall (f :: * -> *) a.
Read1 f =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a]
forall (f :: * -> *).
(forall a. Read a => Read (f a)) =>
(forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (f a))
-> (forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [f a])
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (f a))
-> (forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [f a])
-> Read1 f
$cliftReadsPrec :: forall (f :: * -> *) a.
Read1 f =>
(Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a)
liftReadsPrec :: forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Point f a)
$cliftReadList :: forall (f :: * -> *) a.
Read1 f =>
(Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a]
liftReadList :: forall a. (Int -> ReadS a) -> ReadS [a] -> ReadS [Point f a]
$cliftReadPrec :: forall (f :: * -> *) a.
Read1 f =>
ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a)
liftReadPrec :: forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec (Point f a)
$cliftReadListPrec :: forall (f :: * -> *) a.
Read1 f =>
ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a]
liftReadListPrec :: forall a. ReadPrec a -> ReadPrec [a] -> ReadPrec [Point f a]
Read1
, Functor (Point f)
Foldable (Point f)
(Functor (Point f), Foldable (Point f)) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Point f a -> f (Point f b))
-> (forall (f :: * -> *) a.
Applicative f =>
Point f (f a) -> f (Point f a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Point f a -> m (Point f b))
-> (forall (m :: * -> *) a.
Monad m =>
Point f (m a) -> m (Point f a))
-> Traversable (Point f)
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (f :: * -> *). Traversable f => Functor (Point f)
forall (f :: * -> *). Traversable f => Foldable (Point f)
forall (f :: * -> *) (m :: * -> *) a.
(Traversable f, Monad m) =>
Point f (m a) -> m (Point f a)
forall (f :: * -> *) (f :: * -> *) a.
(Traversable f, Applicative f) =>
Point f (f a) -> f (Point f a)
forall (f :: * -> *) (m :: * -> *) a b.
(Traversable f, Monad m) =>
(a -> m b) -> Point f a -> m (Point f b)
forall (f :: * -> *) (f :: * -> *) a b.
(Traversable f, Applicative f) =>
(a -> f b) -> Point f a -> f (Point f b)
forall (m :: * -> *) a. Monad m => Point f (m a) -> m (Point f a)
forall (f :: * -> *) a.
Applicative f =>
Point f (f a) -> f (Point f a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Point f a -> m (Point f b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Point f a -> f (Point f b)
$ctraverse :: forall (f :: * -> *) (f :: * -> *) a b.
(Traversable f, Applicative f) =>
(a -> f b) -> Point f a -> f (Point f b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Point f a -> f (Point f b)
$csequenceA :: forall (f :: * -> *) (f :: * -> *) a.
(Traversable f, Applicative f) =>
Point f (f a) -> f (Point f a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Point f (f a) -> f (Point f a)
$cmapM :: forall (f :: * -> *) (m :: * -> *) a b.
(Traversable f, Monad m) =>
(a -> m b) -> Point f a -> m (Point f b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Point f a -> m (Point f b)
$csequence :: forall (f :: * -> *) (m :: * -> *) a.
(Traversable f, Monad m) =>
Point f (m a) -> m (Point f a)
sequence :: forall (m :: * -> *) a. Monad m => Point f (m a) -> m (Point f a)
Traversable, Functor (Point f)
Functor (Point f) =>
(forall a b. Point f (a -> b) -> Point f a -> Point f b)
-> (forall a b. Point f a -> Point f b -> Point f b)
-> (forall a b. Point f a -> Point f b -> Point f a)
-> (forall a b c.
(a -> b -> c) -> Point f a -> Point f b -> Point f c)
-> Apply (Point f)
forall a b. Point f a -> Point f b -> Point f a
forall a b. Point f a -> Point f b -> Point f b
forall a b. Point f (a -> b) -> Point f a -> Point f b
forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
forall (f :: * -> *).
Functor f =>
(forall a b. f (a -> b) -> f a -> f b)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> Apply f
forall (f :: * -> *). Apply f => Functor (Point f)
forall (f :: * -> *) a b.
Apply f =>
Point f a -> Point f b -> Point f a
forall (f :: * -> *) a b.
Apply f =>
Point f a -> Point f b -> Point f b
forall (f :: * -> *) a b.
Apply f =>
Point f (a -> b) -> Point f a -> Point f b
forall (f :: * -> *) a b c.
Apply f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
$c<.> :: forall (f :: * -> *) a b.
Apply f =>
Point f (a -> b) -> Point f a -> Point f b
<.> :: forall a b. Point f (a -> b) -> Point f a -> Point f b
$c.> :: forall (f :: * -> *) a b.
Apply f =>
Point f a -> Point f b -> Point f b
.> :: forall a b. Point f a -> Point f b -> Point f b
$c<. :: forall (f :: * -> *) a b.
Apply f =>
Point f a -> Point f b -> Point f a
<. :: forall a b. Point f a -> Point f b -> Point f a
$cliftF2 :: forall (f :: * -> *) a b c.
Apply f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
liftF2 :: forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
Apply, Functor (Point f)
Functor (Point f) =>
(forall a. Num a => Point f a)
-> (forall a. Num a => Point f a -> Point f a -> Point f a)
-> (forall a. Num a => Point f a -> Point f a -> Point f a)
-> (forall a. Num a => a -> Point f a -> Point f a -> Point f a)
-> (forall a. (a -> a -> a) -> Point f a -> Point f a -> Point f a)
-> (forall a b c.
(a -> b -> c) -> Point f a -> Point f b -> Point f c)
-> Additive (Point f)
forall a. Num a => Point f a
forall a. Num a => a -> Point f a -> Point f a -> Point f a
forall a. Num a => Point f a -> Point f a -> Point f a
forall a. (a -> a -> a) -> Point f a -> Point f a -> Point f a
forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
forall (f :: * -> *).
Functor f =>
(forall a. Num a => f a)
-> (forall a. Num a => f a -> f a -> f a)
-> (forall a. Num a => f a -> f a -> f a)
-> (forall a. Num a => a -> f a -> f a -> f a)
-> (forall a. (a -> a -> a) -> f a -> f a -> f a)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> Additive f
forall (f :: * -> *). Additive f => Functor (Point f)
forall (f :: * -> *) a. (Additive f, Num a) => Point f a
forall (f :: * -> *) a.
(Additive f, Num a) =>
a -> Point f a -> Point f a -> Point f a
forall (f :: * -> *) a.
(Additive f, Num a) =>
Point f a -> Point f a -> Point f a
forall (f :: * -> *) a.
Additive f =>
(a -> a -> a) -> Point f a -> Point f a -> Point f a
forall (f :: * -> *) a b c.
Additive f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
$czero :: forall (f :: * -> *) a. (Additive f, Num a) => Point f a
zero :: forall a. Num a => Point f a
$c^+^ :: forall (f :: * -> *) a.
(Additive f, Num a) =>
Point f a -> Point f a -> Point f a
^+^ :: forall a. Num a => Point f a -> Point f a -> Point f a
$c^-^ :: forall (f :: * -> *) a.
(Additive f, Num a) =>
Point f a -> Point f a -> Point f a
^-^ :: forall a. Num a => Point f a -> Point f a -> Point f a
$clerp :: forall (f :: * -> *) a.
(Additive f, Num a) =>
a -> Point f a -> Point f a -> Point f a
lerp :: forall a. Num a => a -> Point f a -> Point f a -> Point f a
$cliftU2 :: forall (f :: * -> *) a.
Additive f =>
(a -> a -> a) -> Point f a -> Point f a -> Point f a
liftU2 :: forall a. (a -> a -> a) -> Point f a -> Point f a -> Point f a
$cliftI2 :: forall (f :: * -> *) a b c.
Additive f =>
(a -> b -> c) -> Point f a -> Point f b -> Point f c
liftI2 :: forall a b c. (a -> b -> c) -> Point f a -> Point f b -> Point f c
Additive, Additive (Point f)
Additive (Point f) =>
(forall a. Num a => Point f a -> Point f a -> a)
-> (forall a. Num a => Point f a -> a)
-> (forall a. Num a => Point f a -> Point f a -> a)
-> (forall a. Floating a => Point f a -> Point f a -> a)
-> (forall a. Floating a => Point f a -> a)
-> (forall a. Floating a => Point f a -> Point f a)
-> Metric (Point f)
forall a. Floating a => Point f a -> a
forall a. Floating a => Point f a -> Point f a
forall a. Floating a => Point f a -> Point f a -> a
forall a. Num a => Point f a -> a
forall a. Num a => Point f a -> Point f a -> a
forall (f :: * -> *).
Additive f =>
(forall a. Num a => f a -> f a -> a)
-> (forall a. Num a => f a -> a)
-> (forall a. Num a => f a -> f a -> a)
-> (forall a. Floating a => f a -> f a -> a)
-> (forall a. Floating a => f a -> a)
-> (forall a. Floating a => f a -> f a)
-> Metric f
forall (f :: * -> *). Metric f => Additive (Point f)
forall (f :: * -> *) a. (Metric f, Floating a) => Point f a -> a
forall (f :: * -> *) a.
(Metric f, Floating a) =>
Point f a -> Point f a
forall (f :: * -> *) a.
(Metric f, Floating a) =>
Point f a -> Point f a -> a
forall (f :: * -> *) a. (Metric f, Num a) => Point f a -> a
forall (f :: * -> *) a.
(Metric f, Num a) =>
Point f a -> Point f a -> a
$cdot :: forall (f :: * -> *) a.
(Metric f, Num a) =>
Point f a -> Point f a -> a
dot :: forall a. Num a => Point f a -> Point f a -> a
$cquadrance :: forall (f :: * -> *) a. (Metric f, Num a) => Point f a -> a
quadrance :: forall a. Num a => Point f a -> a
$cqd :: forall (f :: * -> *) a.
(Metric f, Num a) =>
Point f a -> Point f a -> a
qd :: forall a. Num a => Point f a -> Point f a -> a
$cdistance :: forall (f :: * -> *) a.
(Metric f, Floating a) =>
Point f a -> Point f a -> a
distance :: forall a. Floating a => Point f a -> Point f a -> a
$cnorm :: forall (f :: * -> *) a. (Metric f, Floating a) => Point f a -> a
norm :: forall a. Floating a => Point f a -> a
$csignorm :: forall (f :: * -> *) a.
(Metric f, Floating a) =>
Point f a -> Point f a
signorm :: forall a. Floating a => Point f a -> Point f a
Metric
, Num (Point f a)
Num (Point f a) =>
(Point f a -> Point f a -> Point f a)
-> (Point f a -> Point f a)
-> (Rational -> Point f a)
-> Fractional (Point f a)
Rational -> Point f a
Point f a -> Point f a
Point f a -> Point f a -> Point f a
forall a.
Num a =>
(a -> a -> a) -> (a -> a) -> (Rational -> a) -> Fractional a
forall (f :: * -> *) a. Fractional (f a) => Num (Point f a)
forall (f :: * -> *) a. Fractional (f a) => Rational -> Point f a
forall (f :: * -> *) a. Fractional (f a) => Point f a -> Point f a
forall (f :: * -> *) a.
Fractional (f a) =>
Point f a -> Point f a -> Point f a
$c/ :: forall (f :: * -> *) a.
Fractional (f a) =>
Point f a -> Point f a -> Point f a
/ :: Point f a -> Point f a -> Point f a
$crecip :: forall (f :: * -> *) a. Fractional (f a) => Point f a -> Point f a
recip :: Point f a -> Point f a
$cfromRational :: forall (f :: * -> *) a. Fractional (f a) => Rational -> Point f a
fromRational :: Rational -> Point f a
Fractional , Integer -> Point f a
Point f a -> Point f a
Point f a -> Point f a -> Point f a
(Point f a -> Point f a -> Point f a)
-> (Point f a -> Point f a -> Point f a)
-> (Point f a -> Point f a -> Point f a)
-> (Point f a -> Point f a)
-> (Point f a -> Point f a)
-> (Point f a -> Point f a)
-> (Integer -> Point f a)
-> Num (Point f a)
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
forall (f :: * -> *) a. Num (f a) => Integer -> Point f a
forall (f :: * -> *) a. Num (f a) => Point f a -> Point f a
forall (f :: * -> *) a.
Num (f a) =>
Point f a -> Point f a -> Point f a
$c+ :: forall (f :: * -> *) a.
Num (f a) =>
Point f a -> Point f a -> Point f a
+ :: Point f a -> Point f a -> Point f a
$c- :: forall (f :: * -> *) a.
Num (f a) =>
Point f a -> Point f a -> Point f a
- :: Point f a -> Point f a -> Point f a
$c* :: forall (f :: * -> *) a.
Num (f a) =>
Point f a -> Point f a -> Point f a
* :: Point f a -> Point f a -> Point f a
$cnegate :: forall (f :: * -> *) a. Num (f a) => Point f a -> Point f a
negate :: Point f a -> Point f a
$cabs :: forall (f :: * -> *) a. Num (f a) => Point f a -> Point f a
abs :: Point f a -> Point f a
$csignum :: forall (f :: * -> *) a. Num (f a) => Point f a -> Point f a
signum :: Point f a -> Point f a
$cfromInteger :: forall (f :: * -> *) a. Num (f a) => Integer -> Point f a
fromInteger :: Integer -> Point f a
Num, Ord (Point f a)
Ord (Point f a) =>
((Point f a, Point f a) -> [Point f a])
-> ((Point f a, Point f a) -> Point f a -> Int)
-> ((Point f a, Point f a) -> Point f a -> Int)
-> ((Point f a, Point f a) -> Point f a -> Bool)
-> ((Point f a, Point f a) -> Int)
-> ((Point f a, Point f a) -> Int)
-> Ix (Point f a)
(Point f a, Point f a) -> Int
(Point f a, Point f a) -> [Point f a]
(Point f a, Point f a) -> Point f a -> Bool
(Point f a, Point f a) -> Point f a -> Int
forall a.
Ord a =>
((a, a) -> [a])
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Int)
-> ((a, a) -> a -> Bool)
-> ((a, a) -> Int)
-> ((a, a) -> Int)
-> Ix a
forall (f :: * -> *) a. Ix (f a) => Ord (Point f a)
forall (f :: * -> *) a. Ix (f a) => (Point f a, Point f a) -> Int
forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> [Point f a]
forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> Point f a -> Bool
forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> Point f a -> Int
$crange :: forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> [Point f a]
range :: (Point f a, Point f a) -> [Point f a]
$cindex :: forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> Point f a -> Int
index :: (Point f a, Point f a) -> Point f a -> Int
$cunsafeIndex :: forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> Point f a -> Int
unsafeIndex :: (Point f a, Point f a) -> Point f a -> Int
$cinRange :: forall (f :: * -> *) a.
Ix (f a) =>
(Point f a, Point f a) -> Point f a -> Bool
inRange :: (Point f a, Point f a) -> Point f a -> Bool
$crangeSize :: forall (f :: * -> *) a. Ix (f a) => (Point f a, Point f a) -> Int
rangeSize :: (Point f a, Point f a) -> Int
$cunsafeRangeSize :: forall (f :: * -> *) a. Ix (f a) => (Point f a, Point f a) -> Int
unsafeRangeSize :: (Point f a, Point f a) -> Int
Ix, Ptr (Point f a) -> IO (Point f a)
Ptr (Point f a) -> Int -> IO (Point f a)
Ptr (Point f a) -> Int -> Point f a -> IO ()
Ptr (Point f a) -> Point f a -> IO ()
Point f a -> Int
(Point f a -> Int)
-> (Point f a -> Int)
-> (Ptr (Point f a) -> Int -> IO (Point f a))
-> (Ptr (Point f a) -> Int -> Point f a -> IO ())
-> (forall b. Ptr b -> Int -> IO (Point f a))
-> (forall b. Ptr b -> Int -> Point f a -> IO ())
-> (Ptr (Point f a) -> IO (Point f a))
-> (Ptr (Point f a) -> Point f a -> IO ())
-> Storable (Point f a)
forall b. Ptr b -> Int -> IO (Point f a)
forall b. Ptr b -> Int -> Point f a -> IO ()
forall a.
(a -> Int)
-> (a -> Int)
-> (Ptr a -> Int -> IO a)
-> (Ptr a -> Int -> a -> IO ())
-> (forall b. Ptr b -> Int -> IO a)
-> (forall b. Ptr b -> Int -> a -> IO ())
-> (Ptr a -> IO a)
-> (Ptr a -> a -> IO ())
-> Storable a
forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> IO (Point f a)
forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Int -> IO (Point f a)
forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Int -> Point f a -> IO ()
forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Point f a -> IO ()
forall (f :: * -> *) a. Storable (f a) => Point f a -> Int
forall (f :: * -> *) a b.
Storable (f a) =>
Ptr b -> Int -> IO (Point f a)
forall (f :: * -> *) a b.
Storable (f a) =>
Ptr b -> Int -> Point f a -> IO ()
$csizeOf :: forall (f :: * -> *) a. Storable (f a) => Point f a -> Int
sizeOf :: Point f a -> Int
$calignment :: forall (f :: * -> *) a. Storable (f a) => Point f a -> Int
alignment :: Point f a -> Int
$cpeekElemOff :: forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Int -> IO (Point f a)
peekElemOff :: Ptr (Point f a) -> Int -> IO (Point f a)
$cpokeElemOff :: forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Int -> Point f a -> IO ()
pokeElemOff :: Ptr (Point f a) -> Int -> Point f a -> IO ()
$cpeekByteOff :: forall (f :: * -> *) a b.
Storable (f a) =>
Ptr b -> Int -> IO (Point f a)
peekByteOff :: forall b. Ptr b -> Int -> IO (Point f a)
$cpokeByteOff :: forall (f :: * -> *) a b.
Storable (f a) =>
Ptr b -> Int -> Point f a -> IO ()
pokeByteOff :: forall b. Ptr b -> Int -> Point f a -> IO ()
$cpeek :: forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> IO (Point f a)
peek :: Ptr (Point f a) -> IO (Point f a)
$cpoke :: forall (f :: * -> *) a.
Storable (f a) =>
Ptr (Point f a) -> Point f a -> IO ()
poke :: Ptr (Point f a) -> Point f a -> IO ()
Storable, Num (Point f a)
Num (Point f a) => (Point f a -> Bool) -> Epsilon (Point f a)
Point f a -> Bool
forall a. Num a => (a -> Bool) -> Epsilon a
forall (f :: * -> *) a. Epsilon (f a) => Num (Point f a)
forall (f :: * -> *) a. Epsilon (f a) => Point f a -> Bool
$cnearZero :: forall (f :: * -> *) a. Epsilon (f a) => Point f a -> Bool
nearZero :: Point f a -> Bool
Epsilon
, NonEmpty (Point f a) -> Point f a
Point f a -> Point f a -> Point f a
(Point f a -> Point f a -> Point f a)
-> (NonEmpty (Point f a) -> Point f a)
-> (forall b. Integral b => b -> Point f a -> Point f a)
-> Semigroup (Point f a)
forall b. Integral b => b -> Point f a -> Point f a
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall (f :: * -> *) a.
Semigroup (f a) =>
NonEmpty (Point f a) -> Point f a
forall (f :: * -> *) a.
Semigroup (f a) =>
Point f a -> Point f a -> Point f a
forall (f :: * -> *) a b.
(Semigroup (f a), Integral b) =>
b -> Point f a -> Point f a
$c<> :: forall (f :: * -> *) a.
Semigroup (f a) =>
Point f a -> Point f a -> Point f a
<> :: Point f a -> Point f a -> Point f a
$csconcat :: forall (f :: * -> *) a.
Semigroup (f a) =>
NonEmpty (Point f a) -> Point f a
sconcat :: NonEmpty (Point f a) -> Point f a
$cstimes :: forall (f :: * -> *) a b.
(Semigroup (f a), Integral b) =>
b -> Point f a -> Point f a
stimes :: forall b. Integral b => b -> Point f a -> Point f a
Semigroup, Semigroup (Point f a)
Point f a
Semigroup (Point f a) =>
Point f a
-> (Point f a -> Point f a -> Point f a)
-> ([Point f a] -> Point f a)
-> Monoid (Point f a)
[Point f a] -> Point f a
Point f a -> Point f a -> Point f a
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall (f :: * -> *) a. Monoid (f a) => Semigroup (Point f a)
forall (f :: * -> *) a. Monoid (f a) => Point f a
forall (f :: * -> *) a. Monoid (f a) => [Point f a] -> Point f a
forall (f :: * -> *) a.
Monoid (f a) =>
Point f a -> Point f a -> Point f a
$cmempty :: forall (f :: * -> *) a. Monoid (f a) => Point f a
mempty :: Point f a
$cmappend :: forall (f :: * -> *) a.
Monoid (f a) =>
Point f a -> Point f a -> Point f a
mappend :: Point f a -> Point f a -> Point f a
$cmconcat :: forall (f :: * -> *) a. Monoid (f a) => [Point f a] -> Point f a
mconcat :: [Point f a] -> Point f a
Monoid
, (forall g.
RandomGen g =>
(Point f a, Point f a) -> g -> (Point f a, g))
-> (forall g. RandomGen g => g -> (Point f a, g))
-> (forall g.
RandomGen g =>
(Point f a, Point f a) -> g -> [Point f a])
-> (forall g. RandomGen g => g -> [Point f a])
-> Random (Point f a)
forall g. RandomGen g => g -> [Point f a]
forall g. RandomGen g => g -> (Point f a, g)
forall g. RandomGen g => (Point f a, Point f a) -> g -> [Point f a]
forall g.
RandomGen g =>
(Point f a, Point f a) -> g -> (Point f a, g)
forall a.
(forall g. RandomGen g => (a, a) -> g -> (a, g))
-> (forall g. RandomGen g => g -> (a, g))
-> (forall g. RandomGen g => (a, a) -> g -> [a])
-> (forall g. RandomGen g => g -> [a])
-> Random a
forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
g -> [Point f a]
forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
g -> (Point f a, g)
forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
(Point f a, Point f a) -> g -> [Point f a]
forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
(Point f a, Point f a) -> g -> (Point f a, g)
$crandomR :: forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
(Point f a, Point f a) -> g -> (Point f a, g)
randomR :: forall g.
RandomGen g =>
(Point f a, Point f a) -> g -> (Point f a, g)
$crandom :: forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
g -> (Point f a, g)
random :: forall g. RandomGen g => g -> (Point f a, g)
$crandomRs :: forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
(Point f a, Point f a) -> g -> [Point f a]
randomRs :: forall g. RandomGen g => (Point f a, Point f a) -> g -> [Point f a]
$crandoms :: forall (f :: * -> *) a g.
(Random (f a), RandomGen g) =>
g -> [Point f a]
randoms :: forall g. RandomGen g => g -> [Point f a]
Random, Eq (Point f a)
Eq (Point f a) =>
(Int -> Point f a -> Int)
-> (Point f a -> Int) -> Hashable (Point f a)
Int -> Point f a -> Int
Point f a -> Int
forall a. Eq a => (Int -> a -> Int) -> (a -> Int) -> Hashable a
forall (f :: * -> *) a. Hashable (f a) => Eq (Point f a)
forall (f :: * -> *) a. Hashable (f a) => Int -> Point f a -> Int
forall (f :: * -> *) a. Hashable (f a) => Point f a -> Int
$chashWithSalt :: forall (f :: * -> *) a. Hashable (f a) => Int -> Point f a -> Int
hashWithSalt :: Int -> Point f a -> Int
$chash :: forall (f :: * -> *) a. Hashable (f a) => Point f a -> Int
hash :: Point f a -> Int
Hashable
, (forall x. Point f a -> Rep (Point f a) x)
-> (forall x. Rep (Point f a) x -> Point f a)
-> Generic (Point f a)
forall x. Rep (Point f a) x -> Point f a
forall x. Point f a -> Rep (Point f a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (f :: * -> *) a x. Rep (Point f a) x -> Point f a
forall (f :: * -> *) a x. Point f a -> Rep (Point f a) x
$cfrom :: forall (f :: * -> *) a x. Point f a -> Rep (Point f a) x
from :: forall x. Point f a -> Rep (Point f a) x
$cto :: forall (f :: * -> *) a x. Rep (Point f a) x -> Point f a
to :: forall x. Rep (Point f a) x -> Point f a
Generic, (forall a. Point f a -> Rep1 (Point f) a)
-> (forall a. Rep1 (Point f) a -> Point f a) -> Generic1 (Point f)
forall a. Rep1 (Point f) a -> Point f a
forall a. Point f a -> Rep1 (Point f) a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
forall (f :: * -> *) a. Rep1 (Point f) a -> Point f a
forall (f :: * -> *) a. Point f a -> Rep1 (Point f) a
$cfrom1 :: forall (f :: * -> *) a. Point f a -> Rep1 (Point f) a
from1 :: forall a. Point f a -> Rep1 (Point f) a
$cto1 :: forall (f :: * -> *) a. Rep1 (Point f) a -> Point f a
to1 :: forall a. Rep1 (Point f) a -> Point f a
Generic1, Typeable (Point f a)
Typeable (Point f a) =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Point f a -> c (Point f a))
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Point f a))
-> (Point f a -> Constr)
-> (Point f a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Point f a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Point f a)))
-> ((forall b. Data b => b -> b) -> Point f a -> Point f a)
-> (forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r)
-> (forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Point f a -> [u])
-> (forall u.
Int -> (forall d. Data d => d -> u) -> Point f a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a))
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a))
-> Data (Point f a)
Point f a -> Constr
Point f a -> DataType
(forall b. Data b => b -> b) -> Point f a -> Point f a
forall a.
Typeable a =>
(forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Point f a -> u
forall u. (forall d. Data d => d -> u) -> Point f a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Point f a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Point f a -> c (Point f a)
forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
Typeable (Point f a)
forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
Point f a -> Constr
forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
Point f a -> DataType
forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
(forall b. Data b => b -> b) -> Point f a -> Point f a
forall (f :: * -> *) a u.
(Typeable f, Typeable a, Data (f a)) =>
Int -> (forall d. Data d => d -> u) -> Point f a -> u
forall (f :: * -> *) a u.
(Typeable f, Typeable a, Data (f a)) =>
(forall d. Data d => d -> u) -> Point f a -> [u]
forall (f :: * -> *) a r r'.
(Typeable f, Typeable a, Data (f a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
forall (f :: * -> *) a r r'.
(Typeable f, Typeable a, Data (f a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
forall (f :: * -> *) a (m :: * -> *).
(Typeable f, Typeable a, Data (f a), Monad m) =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
forall (f :: * -> *) a (m :: * -> *).
(Typeable f, Typeable a, Data (f a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
forall (f :: * -> *) a (c :: * -> *).
(Typeable f, Typeable a, Data (f a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Point f a)
forall (f :: * -> *) a (c :: * -> *).
(Typeable f, Typeable a, Data (f a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Point f a -> c (Point f a)
forall (f :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable f, Typeable a, Data (f a), Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Point f a))
forall (f :: * -> *) a (t :: * -> * -> *) (c :: * -> *).
(Typeable f, Typeable a, Data (f a), Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Point f a))
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Point f a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Point f a))
$cgfoldl :: forall (f :: * -> *) a (c :: * -> *).
(Typeable f, Typeable a, Data (f a)) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Point f a -> c (Point f a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Point f a -> c (Point f a)
$cgunfold :: forall (f :: * -> *) a (c :: * -> *).
(Typeable f, Typeable a, Data (f a)) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Point f a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Point f a)
$ctoConstr :: forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
Point f a -> Constr
toConstr :: Point f a -> Constr
$cdataTypeOf :: forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
Point f a -> DataType
dataTypeOf :: Point f a -> DataType
$cdataCast1 :: forall (f :: * -> *) a (t :: * -> *) (c :: * -> *).
(Typeable f, Typeable a, Data (f a), Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Point f a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Point f a))
$cdataCast2 :: forall (f :: * -> *) a (t :: * -> * -> *) (c :: * -> *).
(Typeable f, Typeable a, Data (f a), Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Point f a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Point f a))
$cgmapT :: forall (f :: * -> *) a.
(Typeable f, Typeable a, Data (f a)) =>
(forall b. Data b => b -> b) -> Point f a -> Point f a
gmapT :: (forall b. Data b => b -> b) -> Point f a -> Point f a
$cgmapQl :: forall (f :: * -> *) a r r'.
(Typeable f, Typeable a, Data (f a)) =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
$cgmapQr :: forall (f :: * -> *) a r r'.
(Typeable f, Typeable a, Data (f a)) =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Point f a -> r
$cgmapQ :: forall (f :: * -> *) a u.
(Typeable f, Typeable a, Data (f a)) =>
(forall d. Data d => d -> u) -> Point f a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Point f a -> [u]
$cgmapQi :: forall (f :: * -> *) a u.
(Typeable f, Typeable a, Data (f a)) =>
Int -> (forall d. Data d => d -> u) -> Point f a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Point f a -> u
$cgmapM :: forall (f :: * -> *) a (m :: * -> *).
(Typeable f, Typeable a, Data (f a), Monad m) =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
$cgmapMp :: forall (f :: * -> *) a (m :: * -> *).
(Typeable f, Typeable a, Data (f a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
$cgmapMo :: forall (f :: * -> *) a (m :: * -> *).
(Typeable f, Typeable a, Data (f a), MonadPlus m) =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Point f a -> m (Point f a)
Data
)
instance Finite f => Finite (Point f) where
type Size (Point f) = Size f
toV :: forall a. Point f a -> V (Size (Point f)) a
toV (P f a
v) = f a -> V (Size f) a
forall a. f a -> V (Size f) a
forall (v :: * -> *) a. Finite v => v a -> V (Size v) a
toV f a
v
fromV :: forall a. V (Size (Point f)) a -> Point f a
fromV V (Size (Point f)) a
v = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (V (Size f) a -> f a
forall a. V (Size f) a -> f a
forall (v :: * -> *) a. Finite v => V (Size v) a -> v a
fromV V (Size f) a
V (Size (Point f)) a
v)
instance NFData (f a) => NFData (Point f a) where
rnf :: Point f a -> ()
rnf (P f a
x) = f a -> ()
forall a. NFData a => a -> ()
rnf f a
x
instance Serial1 f => Serial1 (Point f) where
serializeWith :: forall (m :: * -> *) a.
MonadPut m =>
(a -> m ()) -> Point f a -> m ()
serializeWith a -> m ()
f (P f a
p) = (a -> m ()) -> f a -> m ()
forall (f :: * -> *) (m :: * -> *) a.
(Serial1 f, MonadPut m) =>
(a -> m ()) -> f a -> m ()
forall (m :: * -> *) a. MonadPut m => (a -> m ()) -> f a -> m ()
serializeWith a -> m ()
f f a
p
deserializeWith :: forall (m :: * -> *) a. MonadGet m => m a -> m (Point f a)
deserializeWith m a
m = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> m (f a) -> m (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` m a -> m (f a)
forall (f :: * -> *) (m :: * -> *) a.
(Serial1 f, MonadGet m) =>
m a -> m (f a)
forall (m :: * -> *) a. MonadGet m => m a -> m (f a)
deserializeWith m a
m
instance Serial (f a) => Serial (Point f a) where
serialize :: forall (m :: * -> *). MonadPut m => Point f a -> m ()
serialize (P f a
p) = f a -> m ()
forall a (m :: * -> *). (Serial a, MonadPut m) => a -> m ()
forall (m :: * -> *). MonadPut m => f a -> m ()
serialize f a
p
deserialize :: forall (m :: * -> *). MonadGet m => m (Point f a)
deserialize = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> m (f a) -> m (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` m (f a)
forall a (m :: * -> *). (Serial a, MonadGet m) => m a
forall (m :: * -> *). MonadGet m => m (f a)
deserialize
instance Binary (f a) => Binary (Point f a) where
put :: Point f a -> Put
put (P f a
p) = f a -> Put
forall t. Binary t => t -> Put
Binary.put f a
p
get :: Get (Point f a)
get = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> Get (f a) -> Get (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Get (f a)
forall t. Binary t => Get t
Binary.get
instance Serialize (f a) => Serialize (Point f a) where
put :: Putter (Point f a)
put (P f a
p) = Putter (f a)
forall t. Serialize t => Putter t
Cereal.put f a
p
get :: Get (Point f a)
get = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> Get (f a) -> Get (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Get (f a)
forall t. Serialize t => Get t
Cereal.get
instance Hashable1 f => Hashable1 (Point f) where
liftHashWithSalt :: forall a. (Int -> a -> Int) -> Int -> Point f a -> Int
liftHashWithSalt Int -> a -> Int
h Int
s (P f a
f) = (Int -> a -> Int) -> Int -> f a -> Int
forall a. (Int -> a -> Int) -> Int -> f a -> Int
forall (t :: * -> *) a.
Hashable1 t =>
(Int -> a -> Int) -> Int -> t a -> Int
liftHashWithSalt Int -> a -> Int
h Int
s f a
f
{-# INLINE liftHashWithSalt #-}
lensP :: Lens (Point f a) (Point g b) (f a) (g b)
lensP :: forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP f a -> f (g b)
afb (P f a
a) = g b -> Point g b
forall (f :: * -> *) a. f a -> Point f a
P (g b -> Point g b) -> f (g b) -> f (Point g b)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> f a -> f (g b)
afb f a
a
{-# INLINE lensP #-}
_Point :: Iso (Point f a) (Point g b) (f a) (g b)
_Point :: forall (f :: * -> *) a (g :: * -> *) b (p :: * -> * -> *)
(f :: * -> *).
(Profunctor p, Functor f) =>
p (f a) (f (g b)) -> p (Point f a) (f (Point g b))
_Point = (Point f a -> f a)
-> (g b -> Point g b) -> Iso (Point f a) (Point g b) (f a) (g b)
forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso (\(P f a
a) -> f a
a) g b -> Point g b
forall (f :: * -> *) a. f a -> Point f a
P
{-# INLINE _Point #-}
instance (t ~ Point g b) => Rewrapped (Point f a) t
instance Wrapped (Point f a) where
type Unwrapped (Point f a) = f a
_Wrapped' :: Iso' (Point f a) (Unwrapped (Point f a))
_Wrapped' = p (f a) (f (f a)) -> p (Point f a) (f (Point f a))
p (Unwrapped (Point f a)) (f (Unwrapped (Point f a)))
-> p (Point f a) (f (Point f a))
forall (f :: * -> *) a (g :: * -> *) b (p :: * -> * -> *)
(f :: * -> *).
(Profunctor p, Functor f) =>
p (f a) (f (g b)) -> p (Point f a) (f (Point g b))
_Point
{-# INLINE _Wrapped' #-}
(.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c
b -> c
f .# :: forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# a -> b
_ = (b -> c) -> a -> c
forall a b. Coercible a b => a -> b
coerce b -> c
f
{-# INLINE (.#) #-}
(#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. :: forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
(#.) b -> c
_ = (b -> b) -> a -> b
forall a b. Coercible a b => a -> b
coerce (\b
x -> b
x :: b) :: forall a b. Coercible b a => a -> b
{-# INLINE (#.) #-}
unP :: Point f a -> f a
unP :: forall (f :: * -> *) a. Point f a -> f a
unP (P f a
x) = f a
x
{-# INLINE unP #-}
instance Bind f => Bind (Point f) where
>>- :: forall a b. Point f a -> (a -> Point f b) -> Point f b
(>>-) = ((f b -> Point f b
forall (f :: * -> *) a. f a -> Point f a
P (f b -> Point f b)
-> ((a -> Point f b) -> f b) -> (a -> Point f b) -> Point f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) (((a -> Point f b) -> f b) -> (a -> Point f b) -> Point f b)
-> (((a -> f b) -> f b) -> (a -> Point f b) -> f b)
-> ((a -> f b) -> f b)
-> (a -> Point f b)
-> Point f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (((a -> f b) -> f b)
-> ((a -> Point f b) -> a -> f b) -> (a -> Point f b) -> f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Point f b -> f b
forall (f :: * -> *) a. Point f a -> f a
unP (Point f b -> f b) -> (a -> Point f b) -> a -> f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.))) (((a -> f b) -> f b) -> (a -> Point f b) -> Point f b)
-> (f a -> (a -> f b) -> f b)
-> f a
-> (a -> Point f b)
-> Point f b
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. f a -> (a -> f b) -> f b
forall a b. f a -> (a -> f b) -> f b
forall (m :: * -> *) a b. Bind m => m a -> (a -> m b) -> m b
(>>-) (f a -> (a -> Point f b) -> Point f b)
-> (Point f a -> f a) -> Point f a -> (a -> Point f b) -> Point f b
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP
join :: forall a. Point f (Point f a) -> Point f a
join (P f (Point f a)
m) = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> f a -> Point f a
forall a b. (a -> b) -> a -> b
$ f (Point f a)
m f (Point f a) -> (Point f a -> f a) -> f a
forall a b. f a -> (a -> f b) -> f b
forall (m :: * -> *) a b. Bind m => m a -> (a -> m b) -> m b
>>- \(P f a
m') -> f a
m'
instance Distributive f => Distributive (Point f) where
distribute :: forall (f :: * -> *) a. Functor f => f (Point f a) -> Point f (f a)
distribute = f (f a) -> Point f (f a)
forall (f :: * -> *) a. f a -> Point f a
P (f (f a) -> Point f (f a))
-> (f (Point f a) -> f (f a)) -> f (Point f a) -> Point f (f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Point f a -> f a) -> f (Point f a) -> f (f a)
forall (g :: * -> *) (f :: * -> *) a b.
(Distributive g, Functor f) =>
(a -> g b) -> f a -> g (f b)
forall (f :: * -> *) a b. Functor f => (a -> f b) -> f a -> f (f b)
collect (\(P f a
p) -> f a
p)
collect :: forall (f :: * -> *) a b.
Functor f =>
(a -> Point f b) -> f a -> Point f (f b)
collect = (f (f b) -> Point f (f b)
forall (f :: * -> *) a. f a -> Point f a
P (f (f b) -> Point f (f b))
-> (f a -> f (f b)) -> f a -> Point f (f b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((f a -> f (f b)) -> f a -> Point f (f b))
-> ((a -> f b) -> f a -> f (f b))
-> (a -> f b)
-> f a
-> Point f (f b)
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. (a -> f b) -> f a -> f (f b)
forall (g :: * -> *) (f :: * -> *) a b.
(Distributive g, Functor f) =>
(a -> g b) -> f a -> g (f b)
forall (f :: * -> *) a b. Functor f => (a -> f b) -> f a -> f (f b)
collect ((a -> f b) -> f a -> Point f (f b))
-> ((a -> Point f b) -> a -> f b)
-> (a -> Point f b)
-> f a
-> Point f (f b)
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# (Point f b -> f b
forall (f :: * -> *) a. Point f a -> f a
unP (Point f b -> f b) -> (a -> Point f b) -> a -> f b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.)
instance Representable f => Representable (Point f) where
type Rep (Point f) = Rep f
tabulate :: forall a. (Rep (Point f) -> a) -> Point f a
tabulate = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a)
-> ((Rep f -> a) -> f a) -> (Rep f -> a) -> Point f a
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. (Rep f -> a) -> f a
forall a. (Rep f -> a) -> f a
forall (f :: * -> *) a. Representable f => (Rep f -> a) -> f a
tabulate
{-# INLINE tabulate #-}
index :: forall a. Point f a -> Rep (Point f) -> a
index = f a -> Rep f -> a
forall a. f a -> Rep f -> a
forall (f :: * -> *) a. Representable f => f a -> Rep f -> a
Rep.index (f a -> Rep f -> a)
-> (Point f a -> f a) -> Point f a -> Rep f -> a
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP
{-# INLINE index #-}
type instance Index (Point f a) = Index (f a)
type instance IxValue (Point f a) = IxValue (f a)
instance Ixed (f a) => Ixed (Point f a) where
ix :: Index (Point f a) -> Traversal' (Point f a) (IxValue (Point f a))
ix Index (Point f a)
l = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((IxValue (f a) -> f (IxValue (f a))) -> f a -> f (f a))
-> (IxValue (f a) -> f (IxValue (f a)))
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Index (f a) -> Traversal' (f a) (IxValue (f a))
forall m. Ixed m => Index m -> Traversal' m (IxValue m)
ix Index (f a)
Index (Point f a)
l
{-# INLINE ix #-}
instance Traversable f => Each (Point f a) (Point f b) a b where
each :: Traversal (Point f a) (Point f b) a b
each = (a -> f b) -> Point f a -> f (Point f b)
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Point f a -> f (Point f b)
traverse
{-# INLINE each #-}
instance R1 f => R1 (Point f) where
_x :: forall a. Lens' (Point f a) a
_x = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((a -> f a) -> f a -> f (f a))
-> (a -> f a)
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f a) -> f a -> f (f a)
forall a. Lens' (f a) a
forall (t :: * -> *) a. R1 t => Lens' (t a) a
_x
{-# INLINE _x #-}
instance R2 f => R2 (Point f) where
_y :: forall a. Lens' (Point f a) a
_y = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((a -> f a) -> f a -> f (f a))
-> (a -> f a)
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f a) -> f a -> f (f a)
forall a. Lens' (f a) a
forall (t :: * -> *) a. R2 t => Lens' (t a) a
_y
{-# INLINE _y #-}
_xy :: forall a. Lens' (Point f a) (V2 a)
_xy = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((V2 a -> f (V2 a)) -> f a -> f (f a))
-> (V2 a -> f (V2 a))
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (V2 a -> f (V2 a)) -> f a -> f (f a)
forall a. Lens' (f a) (V2 a)
forall (t :: * -> *) a. R2 t => Lens' (t a) (V2 a)
_xy
{-# INLINE _xy #-}
instance R3 f => R3 (Point f) where
_z :: forall a. Lens' (Point f a) a
_z = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((a -> f a) -> f a -> f (f a))
-> (a -> f a)
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f a) -> f a -> f (f a)
forall a. Lens' (f a) a
forall (t :: * -> *) a. R3 t => Lens' (t a) a
_z
{-# INLINE _z #-}
_xyz :: forall a. Lens' (Point f a) (V3 a)
_xyz = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((V3 a -> f (V3 a)) -> f a -> f (f a))
-> (V3 a -> f (V3 a))
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (V3 a -> f (V3 a)) -> f a -> f (f a)
forall a. Lens' (f a) (V3 a)
forall (t :: * -> *) a. R3 t => Lens' (t a) (V3 a)
_xyz
{-# INLINE _xyz #-}
instance R4 f => R4 (Point f) where
_w :: forall a. Lens' (Point f a) a
_w = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((a -> f a) -> f a -> f (f a))
-> (a -> f a)
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> f a) -> f a -> f (f a)
forall a. Lens' (f a) a
forall (t :: * -> *) a. R4 t => Lens' (t a) a
_w
{-# INLINE _w #-}
_xyzw :: forall a. Lens' (Point f a) (V4 a)
_xyzw = (f a -> f (f a)) -> Point f a -> f (Point f a)
forall (f :: * -> *) a (g :: * -> *) b (f :: * -> *).
Functor f =>
(f a -> f (g b)) -> Point f a -> f (Point g b)
lensP ((f a -> f (f a)) -> Point f a -> f (Point f a))
-> ((V4 a -> f (V4 a)) -> f a -> f (f a))
-> (V4 a -> f (V4 a))
-> Point f a
-> f (Point f a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (V4 a -> f (V4 a)) -> f a -> f (f a)
forall a. Lens' (f a) (V4 a)
forall (t :: * -> *) a. R4 t => Lens' (t a) (V4 a)
_xyzw
{-# INLINE _xyzw #-}
instance Additive f => Affine (Point f) where
type Diff (Point f) = f
.-. :: forall a. Num a => Point f a -> Point f a -> Diff (Point f) a
(.-.) = ((f a -> f a) -> (Point f a -> f a) -> Point f a -> f a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP) ((f a -> f a) -> Point f a -> f a)
-> (f a -> f a -> f a) -> f a -> Point f a -> f a
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. f a -> f a -> f a
forall a. Num a => f a -> f a -> f a
forall (f :: * -> *) a. (Additive f, Num a) => f a -> f a -> f a
(^-^) (f a -> Point f a -> f a)
-> (Point f a -> f a) -> Point f a -> Point f a -> f a
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP
{-# INLINE (.-.) #-}
.+^ :: forall a. Num a => Point f a -> Diff (Point f) a -> Point f a
(.+^) = (f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> (f a -> f a) -> f a -> Point f a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((f a -> f a) -> f a -> Point f a)
-> (f a -> f a -> f a) -> f a -> f a -> Point f a
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. f a -> f a -> f a
forall a. Num a => f a -> f a -> f a
forall (f :: * -> *) a. (Additive f, Num a) => f a -> f a -> f a
(^+^) (f a -> f a -> Point f a)
-> (Point f a -> f a) -> Point f a -> f a -> Point f a
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP
{-# INLINE (.+^) #-}
.-^ :: forall a. Num a => Point f a -> Diff (Point f) a -> Point f a
(.-^) = (f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> (f a -> f a) -> f a -> Point f a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.) ((f a -> f a) -> f a -> Point f a)
-> (f a -> f a -> f a) -> f a -> f a -> Point f a
forall c b a. Coercible c b => (b -> c) -> (a -> b) -> a -> c
#. f a -> f a -> f a
forall a. Num a => f a -> f a -> f a
forall (f :: * -> *) a. (Additive f, Num a) => f a -> f a -> f a
(^-^) (f a -> f a -> Point f a)
-> (Point f a -> f a) -> Point f a -> f a -> Point f a
forall b a c. Coercible b a => (b -> c) -> (a -> b) -> a -> c
.# Point f a -> f a
forall (f :: * -> *) a. Point f a -> f a
unP
{-# INLINE (.-^) #-}
origin :: (Additive f, Num a) => Point f a
origin :: forall (f :: * -> *) a. (Additive f, Num a) => Point f a
origin = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P f a
forall a. Num a => f a
forall (f :: * -> *) a. (Additive f, Num a) => f a
zero
relative :: (Additive f, Num a) => Point f a -> Iso' (Point f a) (f a)
relative :: forall (f :: * -> *) a.
(Additive f, Num a) =>
Point f a -> Iso' (Point f a) (f a)
relative Point f a
p0 = (Point f a -> f a)
-> (f a -> Point f a) -> Iso (Point f a) (Point f a) (f a) (f a)
forall s a b t. (s -> a) -> (b -> t) -> Iso s t a b
iso (Point f a -> Point f a -> Diff (Point f) a
forall a. Num a => Point f a -> Point f a -> Diff (Point f) a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> p a -> Diff p a
.-. Point f a
p0) (Point f a
p0 Point f a -> Diff (Point f) a -> Point f a
forall a. Num a => Point f a -> Diff (Point f) a -> Point f a
forall (p :: * -> *) a. (Affine p, Num a) => p a -> Diff p a -> p a
.+^)
{-# INLINE relative #-}
newtype instance U.Vector (Point f a) = V_P (U.Vector (f a))
newtype instance U.MVector s (Point f a) = MV_P (U.MVector s (f a))
instance U.Unbox (f a) => U.Unbox (Point f a)
instance U.Unbox (f a) => M.MVector U.MVector (Point f a) where
{-# INLINE basicLength #-}
{-# INLINE basicUnsafeSlice #-}
{-# INLINE basicOverlaps #-}
{-# INLINE basicUnsafeNew #-}
{-# INLINE basicUnsafeRead #-}
{-# INLINE basicUnsafeWrite #-}
basicLength :: forall s. MVector s (Point f a) -> Int
basicLength (MV_P MVector s (f a)
v) = MVector s (f a) -> Int
forall s. MVector s (f a) -> Int
forall (v :: * -> * -> *) a s. MVector v a => v s a -> Int
M.basicLength MVector s (f a)
v
basicUnsafeSlice :: forall s.
Int -> Int -> MVector s (Point f a) -> MVector s (Point f a)
basicUnsafeSlice Int
m Int
n (MV_P MVector s (f a)
v) = MVector s (f a) -> MVector s (Point f a)
forall s (f :: * -> *) a. MVector s (f a) -> MVector s (Point f a)
MV_P (Int -> Int -> MVector s (f a) -> MVector s (f a)
forall s. Int -> Int -> MVector s (f a) -> MVector s (f a)
forall (v :: * -> * -> *) a s.
MVector v a =>
Int -> Int -> v s a -> v s a
M.basicUnsafeSlice Int
m Int
n MVector s (f a)
v)
basicOverlaps :: forall s. MVector s (Point f a) -> MVector s (Point f a) -> Bool
basicOverlaps (MV_P MVector s (f a)
v) (MV_P MVector s (f a)
u) = MVector s (f a) -> MVector s (f a) -> Bool
forall s. MVector s (f a) -> MVector s (f a) -> Bool
forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> v s a -> Bool
M.basicOverlaps MVector s (f a)
v MVector s (f a)
u
basicUnsafeNew :: forall s. Int -> ST s (MVector s (Point f a))
basicUnsafeNew Int
n = MVector s (f a) -> MVector s (Point f a)
forall s (f :: * -> *) a. MVector s (f a) -> MVector s (Point f a)
MV_P (MVector s (f a) -> MVector s (Point f a))
-> ST s (MVector s (f a)) -> ST s (MVector s (Point f a))
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Int -> ST s (MVector s (f a))
forall s. Int -> ST s (MVector s (f a))
forall (v :: * -> * -> *) a s. MVector v a => Int -> ST s (v s a)
M.basicUnsafeNew Int
n
basicUnsafeRead :: forall s. MVector s (Point f a) -> Int -> ST s (Point f a)
basicUnsafeRead (MV_P MVector s (f a)
v) Int
i = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> ST s (f a) -> ST s (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` MVector s (f a) -> Int -> ST s (f a)
forall s. MVector s (f a) -> Int -> ST s (f a)
forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> ST s a
M.basicUnsafeRead MVector s (f a)
v Int
i
basicUnsafeWrite :: forall s. MVector s (Point f a) -> Int -> Point f a -> ST s ()
basicUnsafeWrite (MV_P MVector s (f a)
v) Int
i (P f a
x) = MVector s (f a) -> Int -> f a -> ST s ()
forall s. MVector s (f a) -> Int -> f a -> ST s ()
forall (v :: * -> * -> *) a s.
MVector v a =>
v s a -> Int -> a -> ST s ()
M.basicUnsafeWrite MVector s (f a)
v Int
i f a
x
basicInitialize :: forall s. MVector s (Point f a) -> ST s ()
basicInitialize (MV_P MVector s (f a)
v) = MVector s (f a) -> ST s ()
forall s. MVector s (f a) -> ST s ()
forall (v :: * -> * -> *) a s. MVector v a => v s a -> ST s ()
M.basicInitialize MVector s (f a)
v
{-# INLINE basicInitialize #-}
instance U.Unbox (f a) => G.Vector U.Vector (Point f a) where
{-# INLINE basicUnsafeFreeze #-}
{-# INLINE basicUnsafeThaw #-}
{-# INLINE basicLength #-}
{-# INLINE basicUnsafeSlice #-}
{-# INLINE basicUnsafeIndexM #-}
basicUnsafeFreeze :: forall s. Mutable Vector s (Point f a) -> ST s (Vector (Point f a))
basicUnsafeFreeze (MV_P MVector s (f a)
v) = Vector (f a) -> Vector (Point f a)
forall (f :: * -> *) a. Vector (f a) -> Vector (Point f a)
V_P (Vector (f a) -> Vector (Point f a))
-> ST s (Vector (f a)) -> ST s (Vector (Point f a))
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Mutable Vector s (f a) -> ST s (Vector (f a))
forall s. Mutable Vector s (f a) -> ST s (Vector (f a))
forall (v :: * -> *) a s. Vector v a => Mutable v s a -> ST s (v a)
G.basicUnsafeFreeze Mutable Vector s (f a)
MVector s (f a)
v
basicUnsafeThaw :: forall s. Vector (Point f a) -> ST s (Mutable Vector s (Point f a))
basicUnsafeThaw ( V_P Vector (f a)
v) = MVector s (f a) -> MVector s (Point f a)
forall s (f :: * -> *) a. MVector s (f a) -> MVector s (Point f a)
MV_P (MVector s (f a) -> MVector s (Point f a))
-> ST s (MVector s (f a)) -> ST s (MVector s (Point f a))
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Vector (f a) -> ST s (Mutable Vector s (f a))
forall s. Vector (f a) -> ST s (Mutable Vector s (f a))
forall (v :: * -> *) a s. Vector v a => v a -> ST s (Mutable v s a)
G.basicUnsafeThaw Vector (f a)
v
basicLength :: Vector (Point f a) -> Int
basicLength ( V_P Vector (f a)
v) = Vector (f a) -> Int
forall (v :: * -> *) a. Vector v a => v a -> Int
G.basicLength Vector (f a)
v
basicUnsafeSlice :: Int -> Int -> Vector (Point f a) -> Vector (Point f a)
basicUnsafeSlice Int
m Int
n (V_P Vector (f a)
v) = Vector (f a) -> Vector (Point f a)
forall (f :: * -> *) a. Vector (f a) -> Vector (Point f a)
V_P (Int -> Int -> Vector (f a) -> Vector (f a)
forall (v :: * -> *) a. Vector v a => Int -> Int -> v a -> v a
G.basicUnsafeSlice Int
m Int
n Vector (f a)
v)
basicUnsafeIndexM :: Vector (Point f a) -> Int -> Box (Point f a)
basicUnsafeIndexM (V_P Vector (f a)
v) Int
i = f a -> Point f a
forall (f :: * -> *) a. f a -> Point f a
P (f a -> Point f a) -> Box (f a) -> Box (Point f a)
forall (m :: * -> *) a1 r. Monad m => (a1 -> r) -> m a1 -> m r
`liftM` Vector (f a) -> Int -> Box (f a)
forall (v :: * -> *) a. Vector v a => v a -> Int -> Box a
G.basicUnsafeIndexM Vector (f a)
v Int
i