module Linear.V0
( V0(..)
) where
import Control.Applicative
import Data.Data
import Data.Distributive
import Data.Foldable
import Data.Ix
import Data.Traversable
import Data.Semigroup
import Data.Functor.Bind
import Foreign.Storable (Storable(..))
import Linear.Core
import Linear.Metric
import Linear.Epsilon
import Linear.Vector
import Prelude hiding (sum)
data V0 a = V0 deriving (Eq,Ord,Show,Read,Ix,Enum,Data,Typeable)
instance Functor V0 where
fmap _ V0 = V0
_ <$ _ = V0
instance Foldable V0 where
foldMap _ V0 = mempty
instance Traversable V0 where
traverse _ V0 = pure V0
instance Apply V0 where
V0 <.> V0 = V0
instance Applicative V0 where
pure _ = V0
V0 <*> V0 = V0
instance Additive V0
instance Bind V0 where
V0 >>- _ = V0
instance Monad V0 where
return _ = V0
V0 >>= _ = V0
instance Num (V0 a) where
V0 + V0 = V0
V0 V0 = V0
V0 * V0 = V0
negate V0 = V0
abs V0 = V0
signum V0 = V0
fromInteger _ = V0
instance Fractional (V0 a) where
recip _ = V0
V0 / V0 = V0
fromRational _ = V0
instance Metric V0 where
dot V0 V0 = 0
instance Core V0 where
core _ = V0
instance Distributive V0 where
distribute _ = V0
instance Epsilon a => Epsilon (V0 a) where
nearZero _ = True
instance Storable a => Storable (V0 a) where
sizeOf _ = 0
alignment _ = 1
poke _ V0 = return ()
peek _ = return V0