-- | Strict quaternary random-access lists.
--
-- This module is intended to be imported qualified.
--

{-# LANGUAGE CPP, BangPatterns, PatternSynonyms, PatternGuards #-}
module Data.Nested.Seq.Quaternary.Strict 

#include "exp_imp.inc"

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

data StrictQuad a = StrictQuad !a !a !a !a deriving (Eq,Show)

type Quad a = StrictQuad a

-- | The strict sequence type. See "Data.Nested.Seq.Quaternary.Lazy" for more information.
data Seq a 
  = Nil                
  | ZZ         !(Seq (Quad a)) 
  | O       !a !(Seq (Quad a)) 
  | T    !a !a !(Seq (Quad a)) 
  | D !a !a !a !(Seq (Quad a)) 
#ifdef TESTING
  deriving Show
#endif

-- so that we can use the same source code for the strict and the lazy versions
pattern Quad :: a -> a -> a -> a -> Quad a
pattern Quad x y z w = StrictQuad x y z w

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

#include "sequence.inc"

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