module Data.Empty where

import qualified Data.NonEmpty.Class as C

import qualified Data.Traversable as Trav
import qualified Data.Foldable as Fold
import Control.Applicative (pure, )
import Control.DeepSeq (NFData, rnf, )

import qualified Test.QuickCheck as QC


data T a = Cons
   deriving (T a -> T a -> Bool
(T a -> T a -> Bool) -> (T a -> T a -> Bool) -> Eq (T a)
forall a. T a -> T a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: T a -> T a -> Bool
$c/= :: forall a. T a -> T a -> Bool
== :: T a -> T a -> Bool
$c== :: forall a. T a -> T a -> Bool
Eq, Eq (T a)
Eq (T a)
-> (T a -> T a -> Ordering)
-> (T a -> T a -> Bool)
-> (T a -> T a -> Bool)
-> (T a -> T a -> Bool)
-> (T a -> T a -> Bool)
-> (T a -> T a -> T a)
-> (T a -> T a -> T a)
-> Ord (T a)
T a -> T a -> Bool
T a -> T a -> Ordering
T a -> T a -> T a
forall a. Eq (T 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. T a -> T a -> Bool
forall a. T a -> T a -> Ordering
forall a. T a -> T a -> T a
min :: T a -> T a -> T a
$cmin :: forall a. T a -> T a -> T a
max :: T a -> T a -> T a
$cmax :: forall a. T a -> T a -> T a
>= :: T a -> T a -> Bool
$c>= :: forall a. T a -> T a -> Bool
> :: T a -> T a -> Bool
$c> :: forall a. T a -> T a -> Bool
<= :: T a -> T a -> Bool
$c<= :: forall a. T a -> T a -> Bool
< :: T a -> T a -> Bool
$c< :: forall a. T a -> T a -> Bool
compare :: T a -> T a -> Ordering
$ccompare :: forall a. T a -> T a -> Ordering
$cp1Ord :: forall a. Eq (T a)
Ord)

instance Show (T a) where
   show :: T a -> String
show T a
Cons = String
"Empty.Cons"

instance C.Show T where
   showsPrec :: Int -> T a -> ShowS
showsPrec Int
_p T a
Cons = String -> ShowS
showString String
"Empty.Cons"

instance Functor T where
   fmap :: (a -> b) -> T a -> T b
fmap a -> b
_ T a
Cons = T b
forall a. T a
Cons

instance Fold.Foldable T where
   foldr :: (a -> b -> b) -> b -> T a -> b
foldr a -> b -> b
_ b
y T a
Cons = b
y

instance Trav.Traversable T where
   sequenceA :: T (f a) -> f (T a)
sequenceA T (f a)
Cons = T a -> f (T a)
forall (f :: * -> *) a. Applicative f => a -> f a
pure T a
forall a. T a
Cons

instance C.ViewL T where
   viewL :: T a -> Maybe (a, T a)
viewL T a
_ = Maybe (a, T a)
forall a. Maybe a
Nothing

instance C.ViewR T where
   viewR :: T a -> Maybe (T a, a)
viewR T a
_ = Maybe (T a, a)
forall a. Maybe a
Nothing

instance C.View T where


instance QC.Arbitrary (T a) where
   arbitrary :: Gen (T a)
arbitrary = T a -> Gen (T a)
forall (m :: * -> *) a. Monad m => a -> m a
return T a
forall a. T a
Cons
   shrink :: T a -> [T a]
shrink T a
_ = []

instance C.Arbitrary T where
   arbitrary :: Gen (T a)
arbitrary = T a -> Gen (T a)
forall (m :: * -> *) a. Monad m => a -> m a
return T a
forall a. T a
Cons
   shrink :: T a -> [T a]
shrink T a
_ = []

instance C.Gen T where
   genOf :: Gen a -> Gen (T a)
genOf Gen a
_gen = T a -> Gen (T a)
forall (m :: * -> *) a. Monad m => a -> m a
return T a
forall a. T a
Cons


instance C.Empty T where
   empty :: T a
empty = T a
forall a. T a
Cons

instance C.Zip T where
   zipWith :: (a -> b -> c) -> T a -> T b -> T c
zipWith a -> b -> c
_f T a
Cons T b
Cons = T c
forall a. T a
Cons

instance C.Reverse T where reverse :: T a -> T a
reverse = T a -> T a
forall a. a -> a
id

instance C.Sort T where
   sort :: T a -> T a
sort T a
Cons = T a
forall a. T a
Cons

instance C.SortBy T where
   sortBy :: (a -> a -> Ordering) -> T a -> T a
sortBy a -> a -> Ordering
_ T a
Cons = T a
forall a. T a
Cons

{-
This instance allows us to use @transposeClip@ on fixed sized containers.
-}
instance C.Repeat T where
   repeat :: a -> T a
repeat a
_ = T a
forall a. T a
Cons

{-
This instance allows us to iterate on fixed length lists.
-}
instance C.Iterate T where
   iterate :: (a -> a) -> a -> T a
iterate a -> a
_ a
_ = T a
forall a. T a
Cons

instance C.NFData T where
   rnf :: T a -> ()
rnf T a
Cons = ()

instance NFData (T a) where
   rnf :: T a -> ()
rnf T a
Cons = ()