-- | Finite context atoms and their free compositional product. module Foundational.Context ( Context (..) , emptyContext , composeContexts , genContext ) where import Test.QuickCheck (Gen, elements, listOf) -- | A finite ordered context assembled from atom labels. newtype Context = Context [String] deriving (Eq, Show) -- | The empty context, the identity for 'composeContexts'. emptyContext :: Context emptyContext = Context [] -- | Compose contexts by preserving the order of both finite atom lists. composeContexts :: Context -> Context -> Context composeContexts (Context left) (Context right) = Context (left <> right) -- | Generate a finite context for property-based examples. genContext :: Gen Context genContext = Context <$> listOf (elements ["a", "b", "c", "d"])