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 qualified Test.QuickCheck as QC


data T a = Cons
   deriving (Eq, Ord)

instance Show (T a) where
   show Cons = "Empty.Cons"

instance C.Show T where
   showsPrec _p Cons = showString "Empty.Cons"

instance Functor T where
   fmap _ Cons = Cons

instance Fold.Foldable T where
   foldr _ y Cons = y

instance Trav.Traversable T where
   sequenceA Cons = pure Cons

instance C.View T where
   viewL _ = Nothing

instance QC.Arbitrary (T a) where
   arbitrary = return Cons
   shrink _ = []

instance C.Empty T where
   empty = Cons

instance C.Zip T where
   zipWith _f Cons Cons = Cons

instance C.Reverse T where reverse = id

instance C.Sort T where
   sortBy _ Cons = Cons