module Language.Parser.Ptera.Data.Alignable.Set (
    T,
    Set,
    empty,
    singleton,
    insert,
    delete,
    fromList,
    toList,
    null,
    intersection,
    union,
    difference,
    length,
    member,
) where

import           Language.Parser.Ptera.Prelude        hiding (empty, length,
                                                       null, toList)

import qualified Data.IntSet                          as IntSet
import qualified Language.Parser.Ptera.Data.Alignable as Alignable


type T = Set

newtype Set n = Set IntSet.IntSet
    deriving (Set n -> Set n -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall k (n :: k). Set n -> Set n -> Bool
/= :: Set n -> Set n -> Bool
$c/= :: forall k (n :: k). Set n -> Set n -> Bool
== :: Set n -> Set n -> Bool
$c== :: forall k (n :: k). Set n -> Set n -> Bool
Eq, Int -> Set n -> ShowS
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall k (n :: k). Int -> Set n -> ShowS
forall k (n :: k). [Set n] -> ShowS
forall k (n :: k). Set n -> String
showList :: [Set n] -> ShowS
$cshowList :: forall k (n :: k). [Set n] -> ShowS
show :: Set n -> String
$cshow :: forall k (n :: k). Set n -> String
showsPrec :: Int -> Set n -> ShowS
$cshowsPrec :: forall k (n :: k). Int -> Set n -> ShowS
Show)
    deriving NonEmpty (Set n) -> Set n
Set n -> Set n -> Set n
forall b. Integral b => b -> Set n -> Set n
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall k (n :: k). NonEmpty (Set n) -> Set n
forall k (n :: k). Set n -> Set n -> Set n
forall k (n :: k) b. Integral b => b -> Set n -> Set n
stimes :: forall b. Integral b => b -> Set n -> Set n
$cstimes :: forall k (n :: k) b. Integral b => b -> Set n -> Set n
sconcat :: NonEmpty (Set n) -> Set n
$csconcat :: forall k (n :: k). NonEmpty (Set n) -> Set n
<> :: Set n -> Set n -> Set n
$c<> :: forall k (n :: k). Set n -> Set n -> Set n
Semigroup via IntSet.IntSet

empty :: Set n
empty :: forall {k} (n :: k). Set n
empty = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet
IntSet.empty

singleton :: Alignable.T n => n -> Set n
singleton :: forall n. T n => n -> Set n
singleton = coerce :: forall a b. Coercible a b => a -> b
coerce Int -> IntSet
IntSet.singleton

insert :: Alignable.T n => n -> Set n -> Set n
insert :: forall n. T n => n -> Set n -> Set n
insert = coerce :: forall a b. Coercible a b => a -> b
coerce Int -> IntSet -> IntSet
IntSet.insert

delete :: Alignable.T n => n -> Set n -> Set n
delete :: forall n. T n => n -> Set n -> Set n
delete = coerce :: forall a b. Coercible a b => a -> b
coerce Int -> IntSet -> IntSet
IntSet.delete

fromList :: Alignable.T n => [n] -> Set n
fromList :: forall n. T n => [n] -> Set n
fromList = coerce :: forall a b. Coercible a b => a -> b
coerce [Int] -> IntSet
IntSet.fromList

toList :: Alignable.T n => Set n -> [n]
toList :: forall n. T n => Set n -> [n]
toList = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> [Int]
IntSet.toList

null :: Set n -> Bool
null :: forall {k} (n :: k). Set n -> Bool
null = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> Bool
IntSet.null

intersection :: Set n -> Set n -> Set n
intersection :: forall k (n :: k). Set n -> Set n -> Set n
intersection = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> IntSet -> IntSet
IntSet.intersection

difference :: Set n -> Set n -> Set n
difference :: forall k (n :: k). Set n -> Set n -> Set n
difference = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> IntSet -> IntSet
IntSet.difference

union :: Set n -> Set n -> Set n
union :: forall k (n :: k). Set n -> Set n -> Set n
union = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> IntSet -> IntSet
IntSet.union

length :: Set n -> Int
length :: forall {k} (n :: k). Set n -> Int
length = coerce :: forall a b. Coercible a b => a -> b
coerce IntSet -> Int
IntSet.size

member :: Alignable.T n => n -> Set n -> Bool
member :: forall n. T n => n -> Set n -> Bool
member = coerce :: forall a b. Coercible a b => a -> b
coerce Int -> IntSet -> Bool
IntSet.member