{-# OPTIONS_GHC -Wall #-}
{-# Language StandaloneDeriving #-}
{-# Language DeriveDataTypeable #-}
{-# LANGUAGE CPP #-}
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
{-# Language DeriveGeneric #-}
#endif
{-# Language DeriveFunctor #-}
{-# Language DeriveFoldable #-}
{-# Language DeriveTraversable #-}

module Types ( Euler(..) ) where

import Control.Applicative ( Applicative(..) )
import Data.Data ( Data )
import Data.Foldable ( Foldable )
import Data.Traversable ( Traversable )
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
import GHC.Generics ( Generic )
import Data.Serialize ( Serialize )
import Data.Binary ( Binary )
#endif
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
import GHC.Generics ( Generic1 )
#endif
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
import Data.Typeable ( Typeable )
#else
import Data.Typeable ( Typeable1 )
#endif

-- | 3-2-1 Euler angle rotation sequence
data Euler a = Euler { forall a. Euler a -> a
eYaw :: a
                     , forall a. Euler a -> a
ePitch :: a
                     , forall a. Euler a -> a
eRoll :: a
                     } deriving (Euler a -> Euler a -> Bool
forall a. Eq a => Euler a -> Euler a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Euler a -> Euler a -> Bool
$c/= :: forall a. Eq a => Euler a -> Euler a -> Bool
== :: Euler a -> Euler a -> Bool
$c== :: forall a. Eq a => Euler a -> Euler a -> Bool
Eq, Int -> Euler a -> ShowS
forall a. Show a => Int -> Euler a -> ShowS
forall a. Show a => [Euler a] -> ShowS
forall a. Show a => Euler a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Euler a] -> ShowS
$cshowList :: forall a. Show a => [Euler a] -> ShowS
show :: Euler a -> String
$cshow :: forall a. Show a => Euler a -> String
showsPrec :: Int -> Euler a -> ShowS
$cshowsPrec :: forall a. Show a => Int -> Euler a -> ShowS
Show, forall a b. a -> Euler b -> Euler a
forall a b. (a -> b) -> Euler a -> Euler b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> Euler b -> Euler a
$c<$ :: forall a b. a -> Euler b -> Euler a
fmap :: forall a b. (a -> b) -> Euler a -> Euler b
$cfmap :: forall a b. (a -> b) -> Euler a -> Euler b
Functor, forall a. Eq a => a -> Euler a -> Bool
forall a. Num a => Euler a -> a
forall a. Ord a => Euler a -> a
forall m. Monoid m => Euler m -> m
forall a. Euler a -> Bool
forall a. Euler a -> Int
forall a. Euler a -> [a]
forall a. (a -> a -> a) -> Euler a -> a
forall m a. Monoid m => (a -> m) -> Euler a -> m
forall b a. (b -> a -> b) -> b -> Euler a -> b
forall a b. (a -> b -> b) -> b -> Euler 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
product :: forall a. Num a => Euler a -> a
$cproduct :: forall a. Num a => Euler a -> a
sum :: forall a. Num a => Euler a -> a
$csum :: forall a. Num a => Euler a -> a
minimum :: forall a. Ord a => Euler a -> a
$cminimum :: forall a. Ord a => Euler a -> a
maximum :: forall a. Ord a => Euler a -> a
$cmaximum :: forall a. Ord a => Euler a -> a
elem :: forall a. Eq a => a -> Euler a -> Bool
$celem :: forall a. Eq a => a -> Euler a -> Bool
length :: forall a. Euler a -> Int
$clength :: forall a. Euler a -> Int
null :: forall a. Euler a -> Bool
$cnull :: forall a. Euler a -> Bool
toList :: forall a. Euler a -> [a]
$ctoList :: forall a. Euler a -> [a]
foldl1 :: forall a. (a -> a -> a) -> Euler a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Euler a -> a
foldr1 :: forall a. (a -> a -> a) -> Euler a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> Euler a -> a
foldl' :: forall b a. (b -> a -> b) -> b -> Euler a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Euler a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Euler a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Euler a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Euler a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Euler a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Euler a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> Euler a -> b
foldMap' :: forall m a. Monoid m => (a -> m) -> Euler a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Euler a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Euler a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Euler a -> m
fold :: forall m. Monoid m => Euler m -> m
$cfold :: forall m. Monoid m => Euler m -> m
Foldable, Functor Euler
Foldable Euler
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 (m :: * -> *) a. Monad m => Euler (m a) -> m (Euler a)
forall (f :: * -> *) a. Applicative f => Euler (f a) -> f (Euler a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Euler a -> m (Euler b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Euler a -> f (Euler b)
sequence :: forall (m :: * -> *) a. Monad m => Euler (m a) -> m (Euler a)
$csequence :: forall (m :: * -> *) a. Monad m => Euler (m a) -> m (Euler a)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Euler a -> m (Euler b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Euler a -> m (Euler b)
sequenceA :: forall (f :: * -> *) a. Applicative f => Euler (f a) -> f (Euler a)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Euler (f a) -> f (Euler a)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Euler a -> f (Euler b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Euler a -> f (Euler b)
Traversable, Euler a -> Euler a -> Bool
Euler a -> Euler a -> Ordering
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}. Ord a => Eq (Euler a)
forall a. Ord a => Euler a -> Euler a -> Bool
forall a. Ord a => Euler a -> Euler a -> Ordering
forall a. Ord a => Euler a -> Euler a -> Euler a
min :: Euler a -> Euler a -> Euler a
$cmin :: forall a. Ord a => Euler a -> Euler a -> Euler a
max :: Euler a -> Euler a -> Euler a
$cmax :: forall a. Ord a => Euler a -> Euler a -> Euler a
>= :: Euler a -> Euler a -> Bool
$c>= :: forall a. Ord a => Euler a -> Euler a -> Bool
> :: Euler a -> Euler a -> Bool
$c> :: forall a. Ord a => Euler a -> Euler a -> Bool
<= :: Euler a -> Euler a -> Bool
$c<= :: forall a. Ord a => Euler a -> Euler a -> Bool
< :: Euler a -> Euler a -> Bool
$c< :: forall a. Ord a => Euler a -> Euler a -> Bool
compare :: Euler a -> Euler a -> Ordering
$ccompare :: forall a. Ord a => Euler a -> Euler a -> Ordering
Ord
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
                                , forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Euler a) x -> Euler a
forall a x. Euler a -> Rep (Euler a) x
$cto :: forall a x. Rep (Euler a) x -> Euler a
$cfrom :: forall a x. Euler a -> Rep (Euler a) x
Generic
#endif
#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 706
                                , forall a. Rep1 Euler a -> Euler a
forall a. Euler a -> Rep1 Euler 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 Euler a -> Euler a
$cfrom1 :: forall a. Euler a -> Rep1 Euler a
Generic1
#endif
                                )

deriving instance Data a => Data (Euler a)

#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 708
deriving instance Typeable Euler
#else
deriving instance Typeable1 Euler
#endif


#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702
instance Serialize a => Serialize (Euler a)
instance Binary a => Binary (Euler a)
#endif

instance Applicative Euler where
  pure :: forall a. a -> Euler a
pure a
x = forall a. a -> a -> a -> Euler a
Euler a
x a
x a
x
  Euler a -> b
f0 a -> b
f1 a -> b
f2 <*> :: forall a b. Euler (a -> b) -> Euler a -> Euler b
<*> Euler a
x0 a
x1 a
x2 = forall a. a -> a -> a -> Euler a
Euler (a -> b
f0 a
x0) (a -> b
f1 a
x1) (a -> b
f2 a
x2)