module CRDT.Cv.GSet
    ( GSet
    , add
    , initial
    , lookup
    ) where

import           Prelude hiding (lookup)

import           Data.Set (Set)
import qualified Data.Set as Set

-- | Grow-only set
type GSet = Set

-- | update
add :: Ord a => a -> GSet a -> GSet a
add :: a -> GSet a -> GSet a
add = a -> GSet a -> GSet a
forall a. Ord a => a -> Set a -> Set a
Set.insert

-- | initialization
initial :: GSet a
initial :: GSet a
initial = GSet a
forall a. Set a
Set.empty

-- | lookup query
lookup :: Ord a => a -> GSet a -> Bool
lookup :: a -> GSet a -> Bool
lookup = a -> GSet a -> Bool
forall a. Ord a => a -> Set a -> Bool
Set.member