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

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

#include "exp_imp.inc"

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

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

type Triple a = StrictTriple a

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

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

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

#include "sequence.inc"

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