prosidy-1.5.0.1: A simple language for writing documents.
Copyright©2020 James Alexander Feldman-Crough
LicenseMPL-2.0
Maintaineralex@fldcr.com
Safe HaskellNone
LanguageHaskell2010

Prosidy.Types.Set

Description

 
Synopsis

Documentation

newtype Set a Source #

A newtype wrapper around an unordered collection of unique elements.

Currently, this is implemented as a wrapper around a HashSet.

Constructors

Set (HashSet a) 

Instances

Instances details
Foldable Set Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldMap' :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Eq a => Eq (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

(==) :: Set a -> Set a -> Bool #

(/=) :: Set a -> Set a -> Bool #

Show a => Show (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

showsPrec :: Int -> Set a -> ShowS #

show :: Set a -> String #

showList :: [Set a] -> ShowS #

Generic (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Associated Types

type Rep (Set a) :: Type -> Type #

Methods

from :: Set a -> Rep (Set a) x #

to :: Rep (Set a) x -> Set a #

(Hashable a, Eq a) => Semigroup (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

(<>) :: Set a -> Set a -> Set a #

sconcat :: NonEmpty (Set a) -> Set a #

stimes :: Integral b => b -> Set a -> Set a #

(Hashable a, Eq a) => Monoid (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

Hashable a => Hashable (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

hashWithSalt :: Int -> Set a -> Int #

hash :: Set a -> Int #

(Hashable a, Eq a, ToJSONKey a) => ToJSON (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

toJSON :: Set a -> Value #

toEncoding :: Set a -> Encoding #

toJSONList :: [Set a] -> Value #

toEncodingList :: [Set a] -> Encoding #

(Hashable a, Eq a, FromJSONKey a) => FromJSON (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

parseJSON :: Value -> Parser (Set a) #

parseJSONList :: Value -> Parser [Set a] #

(Eq a, Hashable a, Binary a) => Binary (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

put :: Set a -> Put #

get :: Get (Set a) #

putList :: [Set a] -> Put #

NFData a => NFData (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

Methods

rnf :: Set a -> () #

type Rep (Set a) Source # 
Instance details

Defined in Prosidy.Types.Set

type Rep (Set a) = D1 ('MetaData "Set" "Prosidy.Types.Set" "prosidy-1.5.0.1-inplace" 'True) (C1 ('MetaCons "Set" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashSet a))))

asHashSet :: Functor f => (HashSet a -> f (HashSet b)) -> Set a -> f (Set b) Source #

Given a function which operates on HashSets, return a function which performs the same operation on a Set.

fromHashSet :: HashSet a -> Set a Source #

Convert a HashSet to a Set.

toHashSet :: Set a -> HashSet a Source #

Convert a Set to a HashSet.