{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE Trustworthy #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveLift #-}

#ifndef MIN_VERSION_hashable
#define MIN_VERSION_hashable(x,y,z) 1
#endif

#ifndef MIN_VERSION_vector
#define MIN_VERSION_vector(x,y,z) 1
#endif

#ifndef MIN_VERSION_transformers
#define MIN_VERSION_transformers(x,y,z) 1
#endif

#ifndef MIN_VERSION_base
#define MIN_VERSION_base(x,y,z) 1
#endif

-----------------------------------------------------------------------------

-- |

-- Copyright   :  (C) 2012-2015 Edward Kmett

-- License     :  BSD-style (see the file LICENSE)

--

-- Maintainer  :  Edward Kmett <ekmett@gmail.com>

-- Stability   :  experimental

-- Portability :  non-portable

--

-- 0-D Vectors

----------------------------------------------------------------------------

module Linear.V0
  ( V0(..)
  ) where

import Control.Applicative
import Control.DeepSeq (NFData(rnf))
import Control.Lens as Lens
import Control.Monad.Fix
import Control.Monad.Zip
import Data.Binary -- binary

import Data.Bytes.Serial -- bytes

import Data.Data
import Data.Distributive
import Data.Foldable
import qualified Data.Foldable.WithIndex as WithIndex
import Data.Functor.Bind
import Data.Functor.Classes
import Data.Functor.Rep
import qualified Data.Functor.WithIndex as WithIndex
import Data.Hashable
import Data.Hashable.Lifted
import Data.Ix
#if !(MIN_VERSION_base(4,11,0))
import Data.Semigroup
#endif
import Data.Serialize -- cereal

import qualified Data.Traversable.WithIndex as WithIndex
import qualified Data.Vector as V
import Foreign.Storable (Storable(..))
import GHC.Generics (Generic, Generic1)
#if defined(MIN_VERSION_template_haskell)
import Language.Haskell.TH.Syntax (Lift)
#endif
import qualified Data.Vector.Generic.Mutable as M
import qualified Data.Vector.Generic as G
import qualified Data.Vector.Unboxed.Base as U
import Linear.Metric
import Linear.Epsilon
import Linear.Vector
import Linear.V
import System.Random (Random(..))
import Prelude hiding (sum)

-- $setup

-- >>> import Control.Applicative

-- >>> import Control.Lens

-- >>> import qualified Data.Foldable as F

-- >>> let sum xs = F.sum xs


-- | A 0-dimensional vector

--

-- >>> pure 1 :: V0 Int

-- V0

--

-- >>> V0 + V0

-- V0

--

data V0 a = V0 deriving (V0 a -> V0 a -> Bool
forall a. V0 a -> V0 a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: V0 a -> V0 a -> Bool
$c/= :: forall a. V0 a -> V0 a -> Bool
== :: V0 a -> V0 a -> Bool
$c== :: forall a. V0 a -> V0 a -> Bool
Eq,V0 a -> V0 a -> Bool
V0 a -> V0 a -> Ordering
forall a. Eq (V0 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 a. V0 a -> V0 a -> Bool
forall a. V0 a -> V0 a -> Ordering
forall a. V0 a -> V0 a -> V0 a
min :: V0 a -> V0 a -> V0 a
$cmin :: forall a. V0 a -> V0 a -> V0 a
max :: V0 a -> V0 a -> V0 a
$cmax :: forall a. V0 a -> V0 a -> V0 a
>= :: V0 a -> V0 a -> Bool
$c>= :: forall a. V0 a -> V0 a -> Bool
> :: V0 a -> V0 a -> Bool
$c> :: forall a. V0 a -> V0 a -> Bool
<= :: V0 a -> V0 a -> Bool
$c<= :: forall a. V0 a -> V0 a -> Bool
< :: V0 a -> V0 a -> Bool
$c< :: forall a. V0 a -> V0 a -> Bool
compare :: V0 a -> V0 a -> Ordering
$ccompare :: forall a. V0 a -> V0 a -> Ordering
Ord,Int -> V0 a -> ShowS
forall a. Int -> V0 a -> ShowS
forall a. [V0 a] -> ShowS
forall a. V0 a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [V0 a] -> ShowS
$cshowList :: forall a. [V0 a] -> ShowS
show :: V0 a -> String
$cshow :: forall a. V0 a -> String
showsPrec :: Int -> V0 a -> ShowS
$cshowsPrec :: forall a. Int -> V0 a -> ShowS
Show,ReadPrec [V0 a]
ReadPrec (V0 a)
ReadS [V0 a]
forall a. ReadPrec [V0 a]
forall a. ReadPrec (V0 a)
forall a. Int -> ReadS (V0 a)
forall a. ReadS [V0 a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [V0 a]
$creadListPrec :: forall a. ReadPrec [V0 a]
readPrec :: ReadPrec (V0 a)
$creadPrec :: forall a. ReadPrec (V0 a)
readList :: ReadS [V0 a]
$creadList :: forall a. ReadS [V0 a]
readsPrec :: Int -> ReadS (V0 a)
$creadsPrec :: forall a. Int -> ReadS (V0 a)
Read,(V0 a, V0 a) -> [V0 a]
(V0 a, V0 a) -> V0 a -> Bool
(V0 a, V0 a) -> V0 a -> Int
forall a. Ord (V0 a)
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 a. (V0 a, V0 a) -> Int
forall a. (V0 a, V0 a) -> [V0 a]
forall a. (V0 a, V0 a) -> V0 a -> Bool
forall a. (V0 a, V0 a) -> V0 a -> Int
unsafeRangeSize :: (V0 a, V0 a) -> Int
$cunsafeRangeSize :: forall a. (V0 a, V0 a) -> Int
rangeSize :: (V0 a, V0 a) -> Int
$crangeSize :: forall a. (V0 a, V0 a) -> Int
inRange :: (V0 a, V0 a) -> V0 a -> Bool
$cinRange :: forall a. (V0 a, V0 a) -> V0 a -> Bool
unsafeIndex :: (V0 a, V0 a) -> V0 a -> Int
$cunsafeIndex :: forall a. (V0 a, V0 a) -> V0 a -> Int
index :: (V0 a, V0 a) -> V0 a -> Int
$cindex :: forall a. (V0 a, V0 a) -> V0 a -> Int
range :: (V0 a, V0 a) -> [V0 a]
$crange :: forall a. (V0 a, V0 a) -> [V0 a]
Ix,Int -> V0 a
V0 a -> Int
V0 a -> [V0 a]
V0 a -> V0 a
V0 a -> V0 a -> [V0 a]
forall a. Int -> V0 a
forall a. V0 a -> Int
forall a. V0 a -> [V0 a]
forall a. V0 a -> V0 a
forall a. V0 a -> V0 a -> [V0 a]
forall a. V0 a -> V0 a -> V0 a -> [V0 a]
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: V0 a -> V0 a -> V0 a -> [V0 a]
$cenumFromThenTo :: forall a. V0 a -> V0 a -> V0 a -> [V0 a]
enumFromTo :: V0 a -> V0 a -> [V0 a]
$cenumFromTo :: forall a. V0 a -> V0 a -> [V0 a]
enumFromThen :: V0 a -> V0 a -> [V0 a]
$cenumFromThen :: forall a. V0 a -> V0 a -> [V0 a]
enumFrom :: V0 a -> [V0 a]
$cenumFrom :: forall a. V0 a -> [V0 a]
fromEnum :: V0 a -> Int
$cfromEnum :: forall a. V0 a -> Int
toEnum :: Int -> V0 a
$ctoEnum :: forall a. Int -> V0 a
pred :: V0 a -> V0 a
$cpred :: forall a. V0 a -> V0 a
succ :: V0 a -> V0 a
$csucc :: forall a. V0 a -> V0 a
Enum,V0 a -> DataType
V0 a -> Constr
forall {a}. Data a => Typeable (V0 a)
forall a. Data a => V0 a -> DataType
forall a. Data a => V0 a -> Constr
forall a. Data a => (forall b. Data b => b -> b) -> V0 a -> V0 a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> V0 a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> V0 a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (V0 a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> V0 a -> c (V0 a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (V0 a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V0 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 (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (V0 a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> V0 a -> c (V0 a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (V0 a))
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> V0 a -> m (V0 a)
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> V0 a -> u
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> V0 a -> u
gmapQ :: forall u. (forall d. Data d => d -> u) -> V0 a -> [u]
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> V0 a -> [u]
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> V0 a -> r
gmapT :: (forall b. Data b => b -> b) -> V0 a -> V0 a
$cgmapT :: forall a. Data a => (forall b. Data b => b -> b) -> V0 a -> V0 a
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V0 a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (V0 a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (V0 a))
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (V0 a))
dataTypeOf :: V0 a -> DataType
$cdataTypeOf :: forall a. Data a => V0 a -> DataType
toConstr :: V0 a -> Constr
$ctoConstr :: forall a. Data a => V0 a -> Constr
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (V0 a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (V0 a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> V0 a -> c (V0 a)
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> V0 a -> c (V0 a)
Data
                        ,forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (V0 a) x -> V0 a
forall a x. V0 a -> Rep (V0 a) x
$cto :: forall a x. Rep (V0 a) x -> V0 a
$cfrom :: forall a x. V0 a -> Rep (V0 a) x
Generic,forall a. Rep1 V0 a -> V0 a
forall a. V0 a -> Rep1 V0 a
forall k (f :: k -> *).
(forall (a :: k). f a -> Rep1 f a)
-> (forall (a :: k). Rep1 f a -> f a) -> Generic1 f
$cto1 :: forall a. Rep1 V0 a -> V0 a
$cfrom1 :: forall a. V0 a -> Rep1 V0 a
Generic1
#if defined(MIN_VERSION_template_haskell)
                        ,forall a (m :: * -> *). Quote m => V0 a -> m Exp
forall a (m :: * -> *). Quote m => V0 a -> Code m (V0 a)
forall t.
(forall (m :: * -> *). Quote m => t -> m Exp)
-> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
forall (m :: * -> *). Quote m => V0 a -> m Exp
forall (m :: * -> *). Quote m => V0 a -> Code m (V0 a)
liftTyped :: forall (m :: * -> *). Quote m => V0 a -> Code m (V0 a)
$cliftTyped :: forall a (m :: * -> *). Quote m => V0 a -> Code m (V0 a)
lift :: forall (m :: * -> *). Quote m => V0 a -> m Exp
$clift :: forall a (m :: * -> *). Quote m => V0 a -> m Exp
Lift
#endif
                        )

instance Finite V0 where
  type Size V0 = 0
  toV :: forall a. V0 a -> V (Size V0) a
toV V0 a
_ = forall {k} (n :: k) a. Vector a -> V n a
V forall a. Vector a
V.empty
  fromV :: forall a. V (Size V0) a -> V0 a
fromV V (Size V0) a
_ = forall a. V0 a
V0

instance Random (V0 a) where
  random :: forall g. RandomGen g => g -> (V0 a, g)
random g
g = (forall a. V0 a
V0, g
g)
  randomR :: forall g. RandomGen g => (V0 a, V0 a) -> g -> (V0 a, g)
randomR (V0 a, V0 a)
_ g
g = (forall a. V0 a
V0, g
g)
  randomRs :: forall g. RandomGen g => (V0 a, V0 a) -> g -> [V0 a]
randomRs (V0 a, V0 a)
_ g
_ = forall a. a -> [a]
repeat forall a. V0 a
V0
  randoms :: forall g. RandomGen g => g -> [V0 a]
randoms g
_ = forall a. a -> [a]
repeat forall a. V0 a
V0

instance Serial1 V0 where
  serializeWith :: forall (m :: * -> *) a. MonadPut m => (a -> m ()) -> V0 a -> m ()
serializeWith a -> m ()
_ = forall a (m :: * -> *). (Serial a, MonadPut m) => a -> m ()
serialize
  deserializeWith :: forall (m :: * -> *) a. MonadGet m => m a -> m (V0 a)
deserializeWith m a
_ = forall a (m :: * -> *). (Serial a, MonadGet m) => m a
deserialize

instance Serial (V0 a) where
  serialize :: forall (m :: * -> *). MonadPut m => V0 a -> m ()
serialize V0 a
V0 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  deserialize :: forall (m :: * -> *). MonadGet m => m (V0 a)
deserialize = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0

instance Binary (V0 a) where
  put :: V0 a -> Put
put V0 a
V0 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  get :: Get (V0 a)
get = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0

instance Serialize (V0 a) where
  put :: Putter (V0 a)
put V0 a
V0 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  get :: Get (V0 a)
get = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0

instance Functor V0 where
  fmap :: forall a b. (a -> b) -> V0 a -> V0 b
fmap a -> b
_ V0 a
V0 = forall a. V0 a
V0
  {-# INLINE fmap #-}
  a
_ <$ :: forall a b. a -> V0 b -> V0 a
<$ V0 b
_ = forall a. V0 a
V0
  {-# INLINE (<$) #-}

instance Foldable V0 where
  foldMap :: forall m a. Monoid m => (a -> m) -> V0 a -> m
foldMap a -> m
_ V0 a
V0 = forall a. Monoid a => a
mempty
  {-# INLINE foldMap #-}
  null :: forall a. V0 a -> Bool
null V0 a
_ = Bool
True
  length :: forall a. V0 a -> Int
length V0 a
_ = Int
0

instance Traversable V0 where
  traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> V0 a -> f (V0 b)
traverse a -> f b
_ V0 a
V0 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. V0 a
V0
  {-# INLINE traverse #-}

instance Apply V0 where
  V0 (a -> b)
V0 <.> :: forall a b. V0 (a -> b) -> V0 a -> V0 b
<.> V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (<.>) #-}

instance Applicative V0 where
  pure :: forall a. a -> V0 a
pure a
_ = forall a. V0 a
V0
  {-# INLINE pure #-}
  V0 (a -> b)
V0 <*> :: forall a b. V0 (a -> b) -> V0 a -> V0 b
<*> V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (<*>) #-}

instance Semigroup (V0 a) where
  V0 a
_ <> :: V0 a -> V0 a -> V0 a
<> V0 a
_ = forall a. V0 a
V0

instance Monoid (V0 a) where
  mempty :: V0 a
mempty = forall a. V0 a
V0
#if !(MIN_VERSION_base(4,11,0))
  mappend _ _ = V0
#endif

instance Additive V0 where
  zero :: forall a. Num a => V0 a
zero = forall a. V0 a
V0
  {-# INLINE zero #-}
  liftU2 :: forall a. (a -> a -> a) -> V0 a -> V0 a -> V0 a
liftU2 a -> a -> a
_ V0 a
V0 V0 a
V0 = forall a. V0 a
V0
  {-# INLINE liftU2 #-}
  liftI2 :: forall a b c. (a -> b -> c) -> V0 a -> V0 b -> V0 c
liftI2 a -> b -> c
_ V0 a
V0 V0 b
V0 = forall a. V0 a
V0
  {-# INLINE liftI2 #-}

instance Bind V0 where
  V0 a
V0 >>- :: forall a b. V0 a -> (a -> V0 b) -> V0 b
>>- a -> V0 b
_ = forall a. V0 a
V0
  {-# INLINE (>>-) #-}

instance Monad V0 where
#if !(MIN_VERSION_base(4,11,0))
  return _ = V0
  {-# INLINE return #-}
#endif
  V0 a
V0 >>= :: forall a b. V0 a -> (a -> V0 b) -> V0 b
>>= a -> V0 b
_ = forall a. V0 a
V0
  {-# INLINE (>>=) #-}

instance Num (V0 a) where
  V0 a
V0 + :: V0 a -> V0 a -> V0 a
+ V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (+) #-}
  V0 a
V0 - :: V0 a -> V0 a -> V0 a
- V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (-) #-}
  V0 a
V0 * :: V0 a -> V0 a -> V0 a
* V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (*) #-}
  negate :: V0 a -> V0 a
negate V0 a
V0 = forall a. V0 a
V0
  {-# INLINE negate #-}
  abs :: V0 a -> V0 a
abs V0 a
V0 = forall a. V0 a
V0
  {-# INLINE abs #-}
  signum :: V0 a -> V0 a
signum V0 a
V0 = forall a. V0 a
V0
  {-# INLINE signum #-}
  fromInteger :: Integer -> V0 a
fromInteger Integer
_ = forall a. V0 a
V0
  {-# INLINE fromInteger #-}

instance Fractional (V0 a) where
  recip :: V0 a -> V0 a
recip V0 a
_ = forall a. V0 a
V0
  {-# INLINE recip #-}
  V0 a
V0 / :: V0 a -> V0 a -> V0 a
/ V0 a
V0 = forall a. V0 a
V0
  {-# INLINE (/) #-}
  fromRational :: Rational -> V0 a
fromRational Rational
_ = forall a. V0 a
V0
  {-# INLINE fromRational #-}

instance Floating (V0 a) where
    pi :: V0 a
pi = forall a. V0 a
V0
    {-# INLINE pi #-}
    exp :: V0 a -> V0 a
exp V0 a
V0 = forall a. V0 a
V0
    {-# INLINE exp #-}
    sqrt :: V0 a -> V0 a
sqrt V0 a
V0 = forall a. V0 a
V0
    {-# INLINE sqrt #-}
    log :: V0 a -> V0 a
log V0 a
V0 = forall a. V0 a
V0
    {-# INLINE log #-}
    V0 a
V0 ** :: V0 a -> V0 a -> V0 a
** V0 a
V0 = forall a. V0 a
V0
    {-# INLINE (**) #-}
    logBase :: V0 a -> V0 a -> V0 a
logBase V0 a
V0 V0 a
V0 = forall a. V0 a
V0
    {-# INLINE logBase #-}
    sin :: V0 a -> V0 a
sin V0 a
V0 = forall a. V0 a
V0
    {-# INLINE sin #-}
    tan :: V0 a -> V0 a
tan V0 a
V0 = forall a. V0 a
V0
    {-# INLINE tan #-}
    cos :: V0 a -> V0 a
cos V0 a
V0 = forall a. V0 a
V0
    {-# INLINE cos #-}
    asin :: V0 a -> V0 a
asin V0 a
V0 = forall a. V0 a
V0
    {-# INLINE asin #-}
    atan :: V0 a -> V0 a
atan V0 a
V0 = forall a. V0 a
V0
    {-# INLINE atan #-}
    acos :: V0 a -> V0 a
acos V0 a
V0 = forall a. V0 a
V0
    {-# INLINE acos #-}
    sinh :: V0 a -> V0 a
sinh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE sinh #-}
    tanh :: V0 a -> V0 a
tanh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE tanh #-}
    cosh :: V0 a -> V0 a
cosh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE cosh #-}
    asinh :: V0 a -> V0 a
asinh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE asinh #-}
    atanh :: V0 a -> V0 a
atanh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE atanh #-}
    acosh :: V0 a -> V0 a
acosh V0 a
V0 = forall a. V0 a
V0
    {-# INLINE acosh #-}

instance Metric V0 where
  dot :: forall a. Num a => V0 a -> V0 a -> a
dot V0 a
V0 V0 a
V0 = a
0
  {-# INLINE dot #-}

instance Distributive V0 where
  distribute :: forall (f :: * -> *) a. Functor f => f (V0 a) -> V0 (f a)
distribute f (V0 a)
_ = forall a. V0 a
V0
  {-# INLINE distribute #-}

instance Hashable (V0 a) where
  hash :: V0 a -> Int
hash V0 a
V0 = Int
0
  {-# INLINE hash #-}
  hashWithSalt :: Int -> V0 a -> Int
hashWithSalt Int
s V0 a
V0 = Int
s
  {-# INLINE hashWithSalt #-}

instance Hashable1 V0 where
  liftHashWithSalt :: forall a. (Int -> a -> Int) -> Int -> V0 a -> Int
liftHashWithSalt Int -> a -> Int
_ Int
s V0 a
V0 = Int
s
  {-# INLINE liftHashWithSalt #-}

instance Epsilon (V0 a) where
  nearZero :: V0 a -> Bool
nearZero V0 a
_ = Bool
True
  {-# INLINE nearZero #-}

instance Storable (V0 a) where
  sizeOf :: V0 a -> Int
sizeOf V0 a
_ = Int
0
  {-# INLINE sizeOf #-}
  alignment :: V0 a -> Int
alignment V0 a
_ = Int
1
  {-# INLINE alignment #-}
  poke :: Ptr (V0 a) -> V0 a -> IO ()
poke Ptr (V0 a)
_ V0 a
V0 = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  {-# INLINE poke #-}
  peek :: Ptr (V0 a) -> IO (V0 a)
peek Ptr (V0 a)
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0
  {-# INLINE peek #-}

instance WithIndex.FunctorWithIndex (E V0) V0 where
  imap :: forall a b. (E V0 -> a -> b) -> V0 a -> V0 b
imap E V0 -> a -> b
_ V0 a
V0 = forall a. V0 a
V0
  {-# INLINE imap #-}

instance WithIndex.FoldableWithIndex (E V0) V0 where
  ifoldMap :: forall m a. Monoid m => (E V0 -> a -> m) -> V0 a -> m
ifoldMap E V0 -> a -> m
_ V0 a
V0 = forall a. Monoid a => a
mempty
  {-# INLINE ifoldMap #-}

instance WithIndex.TraversableWithIndex (E V0) V0 where
  itraverse :: forall (f :: * -> *) a b.
Applicative f =>
(E V0 -> a -> f b) -> V0 a -> f (V0 b)
itraverse E V0 -> a -> f b
_ V0 a
V0 = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a. V0 a
V0
  {-# INLINE itraverse #-}

#if !MIN_VERSION_lens(5,0,0)
instance Lens.FunctorWithIndex     (E V0) V0 where imap      = WithIndex.imap
instance Lens.FoldableWithIndex    (E V0) V0 where ifoldMap  = WithIndex.ifoldMap
instance Lens.TraversableWithIndex (E V0) V0 where itraverse = WithIndex.itraverse
#endif

instance Representable V0 where
  type Rep V0 = E V0
  tabulate :: forall a. (Rep V0 -> a) -> V0 a
tabulate Rep V0 -> a
_ = forall a. V0 a
V0
  {-# INLINE tabulate #-}
  index :: forall a. V0 a -> Rep V0 -> a
index V0 a
xs (E forall x. Lens' (V0 x) x
l) = forall s (m :: * -> *) a. MonadReader s m => Getting a s a -> m a
view forall x. Lens' (V0 x) x
l V0 a
xs
  {-# INLINE index #-}

type instance Index (V0 a) = E V0
type instance IxValue (V0 a) = a

instance Ixed (V0 a) where
  ix :: Index (V0 a) -> Traversal' (V0 a) (IxValue (V0 a))
ix Index (V0 a)
i = forall (t :: * -> *). E t -> forall x. Lens' (t x) x
el Index (V0 a)
i
  {-# INLINE ix #-}

instance Each (V0 a) (V0 b) a b where
  each :: Traversal (V0 a) (V0 b) a b
each = forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
(a -> f b) -> t a -> f (t b)
traverse
  {-# INLINE each #-}

newtype instance U.Vector    (V0 a) = V_V0 Int
newtype instance U.MVector s (V0 a) = MV_V0 Int
instance U.Unbox (V0 a)

instance M.MVector U.MVector (V0 a) where
  {-# INLINE basicLength #-}
  {-# INLINE basicUnsafeSlice #-}
  {-# INLINE basicOverlaps #-}
  {-# INLINE basicUnsafeNew #-}
  {-# INLINE basicUnsafeRead #-}
  {-# INLINE basicUnsafeWrite #-}
  basicLength :: forall s. MVector s (V0 a) -> Int
basicLength (MV_V0 Int
n) = Int
n
  basicUnsafeSlice :: forall s. Int -> Int -> MVector s (V0 a) -> MVector s (V0 a)
basicUnsafeSlice Int
_ Int
n MVector s (V0 a)
_ = forall s a. Int -> MVector s (V0 a)
MV_V0 Int
n
  basicOverlaps :: forall s. MVector s (V0 a) -> MVector s (V0 a) -> Bool
basicOverlaps MVector s (V0 a)
_ MVector s (V0 a)
_ = Bool
False
  basicUnsafeNew :: forall s. Int -> ST s (MVector s (V0 a))
basicUnsafeNew Int
n = forall (m :: * -> *) a. Monad m => a -> m a
return (forall s a. Int -> MVector s (V0 a)
MV_V0 Int
n)
  basicUnsafeRead :: forall s. MVector s (V0 a) -> Int -> ST s (V0 a)
basicUnsafeRead MVector s (V0 a)
_ Int
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0
  basicUnsafeWrite :: forall s. MVector s (V0 a) -> Int -> V0 a -> ST s ()
basicUnsafeWrite MVector s (V0 a)
_ Int
_ V0 a
_ = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  basicInitialize :: forall s. MVector s (V0 a) -> ST s ()
basicInitialize MVector s (V0 a)
_ = forall (m :: * -> *) a. Monad m => a -> m a
return ()
  {-# INLINE basicInitialize #-}

instance G.Vector U.Vector (V0 a) where
  {-# INLINE basicUnsafeFreeze #-}
  {-# INLINE basicUnsafeThaw   #-}
  {-# INLINE basicLength       #-}
  {-# INLINE basicUnsafeSlice  #-}
  {-# INLINE basicUnsafeIndexM #-}
  basicUnsafeFreeze :: forall s. Mutable Vector s (V0 a) -> ST s (Vector (V0 a))
basicUnsafeFreeze (MV_V0 Int
n) = forall (m :: * -> *) a. Monad m => a -> m a
return (forall a. Int -> Vector (V0 a)
V_V0 Int
n)
  basicUnsafeThaw :: forall s. Vector (V0 a) -> ST s (Mutable Vector s (V0 a))
basicUnsafeThaw (V_V0 Int
n) = forall (m :: * -> *) a. Monad m => a -> m a
return (forall s a. Int -> MVector s (V0 a)
MV_V0 Int
n)
  basicLength :: Vector (V0 a) -> Int
basicLength (V_V0 Int
n) = Int
n
  basicUnsafeSlice :: Int -> Int -> Vector (V0 a) -> Vector (V0 a)
basicUnsafeSlice Int
_ Int
n Vector (V0 a)
_ = forall a. Int -> Vector (V0 a)
V_V0 Int
n
  basicUnsafeIndexM :: Vector (V0 a) -> Int -> Box (V0 a)
basicUnsafeIndexM Vector (V0 a)
_ Int
_ = forall (m :: * -> *) a. Monad m => a -> m a
return forall a. V0 a
V0

instance MonadZip V0 where
  mzip :: forall a b. V0 a -> V0 b -> V0 (a, b)
mzip V0 a
V0 V0 b
V0 = forall a. V0 a
V0
  mzipWith :: forall a b c. (a -> b -> c) -> V0 a -> V0 b -> V0 c
mzipWith a -> b -> c
_ V0 a
V0 V0 b
V0 = forall a. V0 a
V0
  munzip :: forall a b. V0 (a, b) -> (V0 a, V0 b)
munzip V0 (a, b)
V0 = (forall a. V0 a
V0, forall a. V0 a
V0)

instance MonadFix V0 where
  mfix :: forall a. (a -> V0 a) -> V0 a
mfix a -> V0 a
_ = forall a. V0 a
V0

instance Bounded (V0 a) where
  minBound :: V0 a
minBound = forall a. V0 a
V0
  {-# INLINE minBound #-}
  maxBound :: V0 a
maxBound = forall a. V0 a
V0
  {-# INLINE maxBound #-}

instance NFData (V0 a) where
  rnf :: V0 a -> ()
rnf V0 a
V0 = ()

instance Eq1 V0   where
  liftEq :: forall a b. (a -> b -> Bool) -> V0 a -> V0 b -> Bool
liftEq a -> b -> Bool
_ V0 a
_ V0 b
_ = Bool
True
instance Ord1 V0  where
  liftCompare :: forall a b. (a -> b -> Ordering) -> V0 a -> V0 b -> Ordering
liftCompare a -> b -> Ordering
_ V0 a
_ V0 b
_ = Ordering
EQ
instance Show1 V0 where
  liftShowsPrec :: forall a.
(Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> V0 a -> ShowS
liftShowsPrec Int -> a -> ShowS
_ [a] -> ShowS
_ = forall a. Show a => Int -> a -> ShowS
showsPrec
instance Read1 V0 where
  liftReadsPrec :: forall a. (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (V0 a)
liftReadsPrec Int -> ReadS a
_ ReadS [a]
_ = forall a. Read a => Int -> ReadS a
readsPrec