Shpadoinkle-widgets-0.2.0.0: A collection of common reusable types and components.

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Widgets.Types.Choice

Synopsis

Documentation

data Pick Source #

Constructors

One 
AtleastOne 
Many 
Instances
Eq Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

(==) :: Pick -> Pick -> Bool #

(/=) :: Pick -> Pick -> Bool #

Ord Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

compare :: Pick -> Pick -> Ordering #

(<) :: Pick -> Pick -> Bool #

(<=) :: Pick -> Pick -> Bool #

(>) :: Pick -> Pick -> Bool #

(>=) :: Pick -> Pick -> Bool #

max :: Pick -> Pick -> Pick #

min :: Pick -> Pick -> Pick #

Show Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

showsPrec :: Int -> Pick -> ShowS #

show :: Pick -> String #

showList :: [Pick] -> ShowS #

Generic Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Associated Types

type Rep Pick :: Type -> Type #

Methods

from :: Pick -> Rep Pick x #

to :: Rep Pick x -> Pick #

Legal (Deselection f :: Pick -> Constraint) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

legal' :: (Deselection f a, Justice (Deselection f) a) => Proxy (Deselection f) -> Proxy a -> Laws Source #

Legal (Selection f :: Pick -> Constraint) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

legal' :: (Selection f a, Justice (Selection f) a) => Proxy (Selection f) -> Proxy a -> Laws Source #

type Rep Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Rep Pick = D1 (MetaData "Pick" "Shpadoinkle.Widgets.Types.Choice" "Shpadoinkle-widgets-0.2.0.0-inplace" False) (C1 (MetaCons "One" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "AtleastOne" PrefixI False) (U1 :: Type -> Type) :+: C1 (MetaCons "Many" PrefixI False) (U1 :: Type -> Type)))
type Justice (Deselection f :: Pick -> Constraint) (p :: Pick) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Justice (Selection f :: Pick -> Constraint) (p :: Pick) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Justice (Selection f :: Pick -> Constraint) (p :: Pick) = PropableChoice f p

type family Selected (p :: Pick) (a :: Type) :: Type where ... Source #

Equations

Selected One a = Maybe a 
Selected AtleastOne a = a 
Selected Many a = Set a 

data Choice (p :: Pick) a Source #

Constructors

Choice 

Fields

Instances
Deselection Choice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

noselection :: (Foldable g, Ord a) => g a -> Choice One a Source #

deselect :: Ord a => Choice One a -> Choice One a Source #

Deselection Choice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

noselection :: (Foldable g, Ord a) => g a -> Choice Many a Source #

deselect :: Ord a => Choice Many a -> Choice Many a Source #

Selection Choice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

select :: Ord a => Choice One a -> Selected One a -> Choice One a Source #

unselected :: Ord a => Choice One a -> Set a Source #

selected :: Ord a => Choice One a -> Selected One a Source #

withOptions :: (Foldable g, Ord a) => Selected One a -> g a -> Choice One a Source #

retain :: Ord a => Choice One a -> Choice One a -> Choice One a Source #

Selection Choice AtleastOne Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Selection Choice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Foldable (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

fold :: Monoid m => Choice One m -> m #

foldMap :: Monoid m => (a -> m) -> Choice One a -> m #

foldr :: (a -> b -> b) -> b -> Choice One a -> b #

foldr' :: (a -> b -> b) -> b -> Choice One a -> b #

foldl :: (b -> a -> b) -> b -> Choice One a -> b #

foldl' :: (b -> a -> b) -> b -> Choice One a -> b #

foldr1 :: (a -> a -> a) -> Choice One a -> a #

foldl1 :: (a -> a -> a) -> Choice One a -> a #

toList :: Choice One a -> [a] #

null :: Choice One a -> Bool #

length :: Choice One a -> Int #

elem :: Eq a => a -> Choice One a -> Bool #

maximum :: Ord a => Choice One a -> a #

minimum :: Ord a => Choice One a -> a #

sum :: Num a => Choice One a -> a #

product :: Num a => Choice One a -> a #

Foldable (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

fold :: Monoid m => Choice AtleastOne m -> m #

foldMap :: Monoid m => (a -> m) -> Choice AtleastOne a -> m #

foldr :: (a -> b -> b) -> b -> Choice AtleastOne a -> b #

foldr' :: (a -> b -> b) -> b -> Choice AtleastOne a -> b #

foldl :: (b -> a -> b) -> b -> Choice AtleastOne a -> b #

foldl' :: (b -> a -> b) -> b -> Choice AtleastOne a -> b #

foldr1 :: (a -> a -> a) -> Choice AtleastOne a -> a #

foldl1 :: (a -> a -> a) -> Choice AtleastOne a -> a #

toList :: Choice AtleastOne a -> [a] #

null :: Choice AtleastOne a -> Bool #

length :: Choice AtleastOne a -> Int #

elem :: Eq a => a -> Choice AtleastOne a -> Bool #

maximum :: Ord a => Choice AtleastOne a -> a #

minimum :: Ord a => Choice AtleastOne a -> a #

sum :: Num a => Choice AtleastOne a -> a #

product :: Num a => Choice AtleastOne a -> a #

Foldable (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

fold :: Monoid m => Choice Many m -> m #

foldMap :: Monoid m => (a -> m) -> Choice Many a -> m #

foldr :: (a -> b -> b) -> b -> Choice Many a -> b #

foldr' :: (a -> b -> b) -> b -> Choice Many a -> b #

foldl :: (b -> a -> b) -> b -> Choice Many a -> b #

foldl' :: (b -> a -> b) -> b -> Choice Many a -> b #

foldr1 :: (a -> a -> a) -> Choice Many a -> a #

foldl1 :: (a -> a -> a) -> Choice Many a -> a #

toList :: Choice Many a -> [a] #

null :: Choice Many a -> Bool #

length :: Choice Many a -> Int #

elem :: Eq a => a -> Choice Many a -> Bool #

maximum :: Ord a => Choice Many a -> a #

minimum :: Ord a => Choice Many a -> a #

sum :: Num a => Choice Many a -> a #

product :: Num a => Choice Many a -> a #

Eq1 (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftEq :: (a -> b -> Bool) -> Choice One a -> Choice One b -> Bool #

Eq1 (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftEq :: (a -> b -> Bool) -> Choice AtleastOne a -> Choice AtleastOne b -> Bool #

Eq1 (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftEq :: (a -> b -> Bool) -> Choice Many a -> Choice Many b -> Bool #

Ord1 (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftCompare :: (a -> b -> Ordering) -> Choice One a -> Choice One b -> Ordering #

Ord1 (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftCompare :: (a -> b -> Ordering) -> Choice AtleastOne a -> Choice AtleastOne b -> Ordering #

Ord1 (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

liftCompare :: (a -> b -> Ordering) -> Choice Many a -> Choice Many b -> Ordering #

Compactable (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

compact :: Choice One (Maybe a) -> Choice One a #

separate :: Choice One (Either l r) -> (Choice One l, Choice One r) #

filter :: (a -> Bool) -> Choice One a -> Choice One a #

partition :: (a -> Bool) -> Choice One a -> (Choice One a, Choice One a) #

fmapMaybe :: Functor (Choice One) => (a -> Maybe b) -> Choice One a -> Choice One b #

fmapEither :: Functor (Choice One) => (a -> Either l r) -> Choice One a -> (Choice One l, Choice One r) #

applyMaybe :: Applicative (Choice One) => Choice One (a -> Maybe b) -> Choice One a -> Choice One b #

applyEither :: Applicative (Choice One) => Choice One (a -> Either l r) -> Choice One a -> (Choice One l, Choice One r) #

bindMaybe :: Monad (Choice One) => Choice One a -> (a -> Choice One (Maybe b)) -> Choice One b #

bindEither :: Monad (Choice One) => Choice One a -> (a -> Choice One (Either l r)) -> (Choice One l, Choice One r) #

traverseMaybe :: (Applicative g, Traversable (Choice One)) => (a -> g (Maybe b)) -> Choice One a -> g (Choice One b) #

traverseEither :: (Applicative g, Traversable (Choice One)) => (a -> g (Either l r)) -> Choice One a -> g (Choice One l, Choice One r) #

Compactable (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

compact :: Choice Many (Maybe a) -> Choice Many a #

separate :: Choice Many (Either l r) -> (Choice Many l, Choice Many r) #

filter :: (a -> Bool) -> Choice Many a -> Choice Many a #

partition :: (a -> Bool) -> Choice Many a -> (Choice Many a, Choice Many a) #

fmapMaybe :: Functor (Choice Many) => (a -> Maybe b) -> Choice Many a -> Choice Many b #

fmapEither :: Functor (Choice Many) => (a -> Either l r) -> Choice Many a -> (Choice Many l, Choice Many r) #

applyMaybe :: Applicative (Choice Many) => Choice Many (a -> Maybe b) -> Choice Many a -> Choice Many b #

applyEither :: Applicative (Choice Many) => Choice Many (a -> Either l r) -> Choice Many a -> (Choice Many l, Choice Many r) #

bindMaybe :: Monad (Choice Many) => Choice Many a -> (a -> Choice Many (Maybe b)) -> Choice Many b #

bindEither :: Monad (Choice Many) => Choice Many a -> (a -> Choice Many (Either l r)) -> (Choice Many l, Choice Many r) #

traverseMaybe :: (Applicative g, Traversable (Choice Many)) => (a -> g (Maybe b)) -> Choice Many a -> g (Choice Many b) #

traverseEither :: (Applicative g, Traversable (Choice Many)) => (a -> g (Either l r)) -> Choice Many a -> g (Choice Many l, Choice Many r) #

SetLike (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice One a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice One a -> Choice One b Source #

valid :: Ord a => Choice One a -> Bool Source #

SetLike (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice AtleastOne a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice AtleastOne a -> Choice AtleastOne b Source #

valid :: Ord a => Choice AtleastOne a -> Bool Source #

SetLike (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice Many a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice Many a -> Choice Many b Source #

valid :: Ord a => Choice Many a -> Bool Source #

(Bounded a, Enum a) => Bounded (Choice AtleastOne a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(Bounded a, Enum a) => Enum (Choice AtleastOne a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(Eq (Selected p a), Eq a) => Eq (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

(==) :: Choice p a -> Choice p a -> Bool #

(/=) :: Choice p a -> Choice p a -> Bool #

(Ord (Selected p a), Ord a) => Ord (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

compare :: Choice p a -> Choice p a -> Ordering #

(<) :: Choice p a -> Choice p a -> Bool #

(<=) :: Choice p a -> Choice p a -> Bool #

(>) :: Choice p a -> Choice p a -> Bool #

(>=) :: Choice p a -> Choice p a -> Bool #

max :: Choice p a -> Choice p a -> Choice p a #

min :: Choice p a -> Choice p a -> Choice p a #

(Read (Selected p a), Read a, Ord a) => Read (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(Show (Selected p a), Show a) => Show (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

showsPrec :: Int -> Choice p a -> ShowS #

show :: Choice p a -> String #

showList :: [Choice p a] -> ShowS #

Generic (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Associated Types

type Rep (Choice p a) :: Type -> Type #

Methods

from :: Choice p a -> Rep (Choice p a) x #

to :: Rep (Choice p a) x -> Choice p a #

(Semigroup a, Ord a) => Semigroup (Choice One a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

(<>) :: Choice One a -> Choice One a -> Choice One a #

sconcat :: NonEmpty (Choice One a) -> Choice One a #

stimes :: Integral b => b -> Choice One a -> Choice One a #

(Semigroup a, Ord a) => Semigroup (Choice AtleastOne a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(Semigroup a, Ord a) => Semigroup (Choice Many a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

(<>) :: Choice Many a -> Choice Many a -> Choice Many a #

sconcat :: NonEmpty (Choice Many a) -> Choice Many a #

stimes :: Integral b => b -> Choice Many a -> Choice Many a #

(Semigroup a, Ord a) => Monoid (Choice One a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

mempty :: Choice One a #

mappend :: Choice One a -> Choice One a -> Choice One a #

mconcat :: [Choice One a] -> Choice One a #

(Semigroup a, Ord a) => Monoid (Choice Many a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(Ord a, Arbitrary a, Arbitrary (Selected p a)) => Arbitrary (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

arbitrary :: Gen (Choice p a) #

shrink :: Choice p a -> [Choice p a] #

(ToJSON (Selected p a), ToJSON a) => ToJSON (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toJSON :: Choice p a -> Value #

toEncoding :: Choice p a -> Encoding #

toJSONList :: [Choice p a] -> Value #

toEncodingList :: [Choice p a] -> Encoding #

(FromJSON (Selected p a), FromJSON a, Ord a) => FromJSON (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

parseJSON :: Value -> Parser (Choice p a) #

parseJSONList :: Value -> Parser [Choice p a] #

type Rep (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Rep (Choice p a) = D1 (MetaData "Choice" "Shpadoinkle.Widgets.Types.Choice" "Shpadoinkle-widgets-0.2.0.0-inplace" False) (C1 (MetaCons "Choice" PrefixI True) (S1 (MetaSel (Just "_selected") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Selected p a)) :*: S1 (MetaSel (Just "_options") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Set a))))

class DemotePick (p :: Pick) where Source #

class SetLike f where Source #

Laws: a == b ==> toSet a == toSet b -- toSet is injective toSet (smap f s) == fmap f (toSet s) if valid s then Set.valid (toSet s)

Methods

toSet :: Ord a => f a -> Set a Source #

smap :: Ord b => (a -> b) -> f a -> f b Source #

valid :: Ord a => f a -> Bool Source #

Instances
SetLike Maybe Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Maybe a -> Set a Source #

smap :: Ord b => (a -> b) -> Maybe a -> Maybe b Source #

valid :: Ord a => Maybe a -> Bool Source #

SetLike Set Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Set a -> Set a Source #

smap :: Ord b => (a -> b) -> Set a -> Set b Source #

valid :: Ord a => Set a -> Bool Source #

SetLike (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice One a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice One a -> Choice One b Source #

valid :: Ord a => Choice One a -> Bool Source #

SetLike (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice AtleastOne a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice AtleastOne a -> Choice AtleastOne b Source #

valid :: Ord a => Choice AtleastOne a -> Bool Source #

SetLike (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

toSet :: Ord a => Choice Many a -> Set a Source #

smap :: Ord b => (a -> b) -> Choice Many a -> Choice Many b Source #

valid :: Ord a => Choice Many a -> Bool Source #

(Considered p ~ Maybe, SetLike (Choice p)) => SetLike (ConsideredChoice p) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Methods

toSet :: Ord a => ConsideredChoice p a -> Set a Source #

smap :: Ord b => (a -> b) -> ConsideredChoice p a -> ConsideredChoice p b Source #

valid :: Ord a => ConsideredChoice p a -> Bool Source #

SetLike (ConsideredChoice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

SetLike (ConsideredChoice p) => SetLike (Dropdown p) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Form.Dropdown

Methods

toSet :: Ord a => Dropdown p a -> Set a Source #

smap :: Ord b => (a -> b) -> Dropdown p a -> Dropdown p b Source #

valid :: Ord a => Dropdown p a -> Bool Source #

Legal SetLike Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

legal' :: (SetLike a, Justice SetLike a) => Proxy SetLike -> Proxy a -> Laws Source #

type Justice SetLike (f :: Type -> Type) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Justice SetLike (f :: Type -> Type) = Propable1Set f

class (forall v. Eq v => Eq (f v), forall w. Show w => Show (f w), forall x. Ord x => Ord (f x), forall y. (Ord y, Semigroup y) => Semigroup (f y), forall z. (Ord z, Arbitrary z) => Arbitrary (f z)) => Propable1Set f Source #

Instances
(forall v. Eq v => Eq (f v), forall w. Show w => Show (f w), forall x. Ord x => Ord (f x), forall y. (Ord y, Semigroup y) => Semigroup (f y), forall z. (Ord z, Arbitrary z) => Arbitrary (f z)) => Propable1Set f Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

newtype ApplyOrd f a Source #

Constructors

ApplyOrd 

Fields

Instances
(forall x. Eq x => Eq (f x), Eq a) => Eq (ApplyOrd f a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

(==) :: ApplyOrd f a -> ApplyOrd f a -> Bool #

(/=) :: ApplyOrd f a -> ApplyOrd f a -> Bool #

(forall x. Show x => Show (f x), Show a) => Show (ApplyOrd f a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

showsPrec :: Int -> ApplyOrd f a -> ShowS #

show :: ApplyOrd f a -> String #

showList :: [ApplyOrd f a] -> ShowS #

(forall x. (Ord x, Arbitrary x) => Arbitrary (f x), Ord a, Arbitrary a) => Arbitrary (ApplyOrd f a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

arbitrary :: Gen (ApplyOrd f a) #

shrink :: ApplyOrd f a -> [ApplyOrd f a] #

setLikeLaws :: (SetLike f, forall c. Eq c => Eq (f c), forall d. Show d => Show (f d), forall e. (Arbitrary e, Ord e) => Arbitrary (f e)) => proxy f -> Laws Source #

setFunctorComposition :: forall proxy f. (SetLike f, forall a. Eq a => Eq (f a), forall a. Show a => Show (f a), forall a. (Arbitrary a, Ord a) => Arbitrary (f a)) => proxy f -> Property Source #

setFunctorIdentity :: forall proxy f. (SetLike f, forall a. Eq a => Eq (f a), forall a. Show a => Show (f a), forall a. (Arbitrary a, Ord a) => Arbitrary (f a)) => proxy f -> Property Source #

setFunctorConst :: forall proxy f. (SetLike f, forall a. Eq a => Eq (f a), forall a. Show a => Show (f a), forall a. (Arbitrary a, Ord a) => Arbitrary (f a)) => proxy f -> Property Source #

selectionLaws :: forall proxy f (p :: Pick). (Selection f p, PickToSet p, Propable1Ord (f p), Propable0 (Selected p Integer)) => proxy (f p) -> Laws Source #

selectionIsAnOption :: forall proxy f (p :: Pick). (Selection f p, PickToSet p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

selectedAndUnselectedAreExclusive :: forall proxy f (p :: Pick). (Selection f p, PickToSet p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

selectIsAnOption :: forall proxy f (p :: Pick). (Selection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

selectIdempotence :: forall proxy f (p :: Pick). (Selection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

selectIsNotUnselected :: forall proxy f (p :: Pick). (Selection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

selectSelectedIdentity :: forall proxy f (p :: Pick). (Selection f p, Propable0 (Selected p Integer)) => proxy (f p) -> Property Source #

unSelectedWithOptionsIdentity :: forall proxy f (p :: Pick). (Selection f p, Propable0 (Selected p Integer)) => proxy (f p) -> Property Source #

retainPreserves :: forall proxy f (p :: Pick). (Selection f p, PickToSet p) => proxy (f p) -> Property Source #

retainSets :: forall proxy f (p :: Pick). (Selection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

ftoSet :: (Ord a, Foldable g) => g a -> Set a Source #

class PickToSet (p :: Pick) where Source #

Methods

pickToSet :: Ord a => Selected p a -> Set a Source #

Instances
PickToSet One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

pickToSet :: Ord a => Selected One a -> Set a Source #

PickToSet AtleastOne Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

pickToSet :: Ord a => Selected AtleastOne a -> Set a Source #

PickToSet Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

pickToSet :: Ord a => Selected Many a -> Set a Source #

class PickToSelected (p :: Pick) where Source #

Methods

pickToSelected' :: Ord a => Proxy p -> a -> Selected p a Source #

pickToSelected :: forall (p :: Pick) a. (Ord a, PickToSelected p) => a -> Selected p a Source #

class (SetLike (f p), PickToSelected p) => Selection f (p :: Pick) where Source #

Methods

select :: Ord a => f p a -> Selected p a -> f p a Source #

unselected :: Ord a => f p a -> Set a Source #

selected :: Ord a => f p a -> Selected p a Source #

withOptions :: (Foldable g, Ord a) => Selected p a -> g a -> f p a Source #

retain :: Ord a => f p a -> f p a -> f p a Source #

Instances
Selection Choice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

select :: Ord a => Choice One a -> Selected One a -> Choice One a Source #

unselected :: Ord a => Choice One a -> Set a Source #

selected :: Ord a => Choice One a -> Selected One a Source #

withOptions :: (Foldable g, Ord a) => Selected One a -> g a -> Choice One a Source #

retain :: Ord a => Choice One a -> Choice One a -> Choice One a Source #

Selection Choice AtleastOne Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Selection Choice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

(PickToSelected p, Considered p ~ Maybe, SetLike (ConsideredChoice p), Selection Choice p) => Selection ConsideredChoice p Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

SetLike (ConsideredChoice Many) => Selection ConsideredChoice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

(Consideration ConsideredChoice p, PickToSelected p) => Selection Dropdown p Source # 
Instance details

Defined in Shpadoinkle.Widgets.Form.Dropdown

Methods

select :: Ord a => Dropdown p a -> Selected p a -> Dropdown p a Source #

unselected :: Ord a => Dropdown p a -> Set a Source #

selected :: Ord a => Dropdown p a -> Selected p a Source #

withOptions :: (Foldable g, Ord a) => Selected p a -> g a -> Dropdown p a Source #

retain :: Ord a => Dropdown p a -> Dropdown p a -> Dropdown p a Source #

Legal (Selection f :: Pick -> Constraint) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

legal' :: (Selection f a, Justice (Selection f) a) => Proxy (Selection f) -> Proxy a -> Laws Source #

type Justice (Selection f :: Pick -> Constraint) (p :: Pick) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

type Justice (Selection f :: Pick -> Constraint) (p :: Pick) = PropableChoice f p

select' :: forall f (p :: Pick) a. (Selection f p, Ord a) => f p a -> a -> f p a Source #

withOptions' :: forall f (p :: Pick) a g. (Selection f p, Ord a, Foldable g) => a -> g a -> f p a Source #

retain' :: (Ord a, Deselection f p, Foldable g) => f p a -> g a -> f p a Source #

type family ToS (p :: Pick) :: Type -> Type where ... Source #

Equations

ToS One = Maybe 
ToS Many = Set 

class Selection f p => Deselection f (p :: Pick) where Source #

Methods

noselection :: (Foldable g, Ord a) => g a -> f p a Source #

deselect :: Ord a => f p a -> f p a Source #

Instances
Deselection Choice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

noselection :: (Foldable g, Ord a) => g a -> Choice One a Source #

deselect :: Ord a => Choice One a -> Choice One a Source #

Deselection Choice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

noselection :: (Foldable g, Ord a) => g a -> Choice Many a Source #

deselect :: Ord a => Choice Many a -> Choice Many a Source #

Selection ConsideredChoice One => Deselection ConsideredChoice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Selection ConsideredChoice Many => Deselection ConsideredChoice Many Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

(Consideration ConsideredChoice p, Deselection ConsideredChoice p) => Deselection Dropdown p Source # 
Instance details

Defined in Shpadoinkle.Widgets.Form.Dropdown

Methods

noselection :: (Foldable g, Ord a) => g a -> Dropdown p a Source #

deselect :: Ord a => Dropdown p a -> Dropdown p a Source #

Legal (Deselection f :: Pick -> Constraint) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

legal' :: (Deselection f a, Justice (Deselection f) a) => Proxy (Deselection f) -> Proxy a -> Laws Source #

type Justice (Deselection f :: Pick -> Constraint) (p :: Pick) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

deselectionLaws :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p), Propable0 (Selected p (Sum Int)), Monoid (Selected p (Sum Int)), Selected p (Sum Int) ~ ToS p (Sum Int), SetLike (ToS p), DemotePick p) => proxy (f p) -> Laws Source #

idempotenceSelect :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

deselectFullSet :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p)) => proxy (f p) -> Property Source #

dselectSelectSelectedIdentity :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p), Propable0 (Selected p (Sum Int))) => proxy (f p) -> Property Source #

selectedDeselectAnnihliation :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p), Propable0 (Selected p (Sum Int)), Monoid (Selected p (Sum Int))) => proxy (f p) -> Property Source #

deselectKeeps :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p), Propable0 (Selected p (Sum Int)), Selected p (Sum Int) ~ ToS p (Sum Int), SetLike (ToS p)) => proxy (f p) -> Property Source #

unselectedPasses :: forall proxy f (p :: Pick). (Deselection f p, Propable1Ord (f p), Propable0 (Selected p (Sum Int)), Selected p (Sum Int) ~ ToS p (Sum Int), SetLike (ToS p)) => proxy (f p) -> Property Source #

unsafeSelectFirst :: (Selection f p, Ord a) => f p a -> f p a Source #

unsafeSelectLast :: (Selection f p, Ord a) => f p a -> f p a Source #

selectFirst :: (Selection f p, Ord a) => f p a -> Maybe (f p a) Source #

selectLast :: (Selection f p, Ord a) => f p a -> Maybe (f p a) Source #

fullset :: (Bounded a, Enum a) => Set a Source #

fullOptions :: (Deselection f p, Bounded a, Enum a, Ord a) => f p a Source #

fullOptionsMin :: (Selection f p, Bounded a, Enum a, Ord a) => f p a Source #

fullOptionsMax :: (Selection f p, Bounded a, Enum a, Ord a) => f p a Source #

fromNonEmpty :: (Selection f p, Ord a) => NonEmpty a -> f p a Source #

selectWhen :: (SetLike g, Selection f Many, Ord a) => (a -> Bool) -> g a -> Maybe (f Many a) Source #

selectFirstWhen :: (SetLike g, Deselection f p, Ord a) => (a -> Bool) -> g a -> Maybe (f p a) Source #

selectLastWhen :: (SetLike g, Deselection f p, Ord a) => (a -> Bool) -> g a -> Maybe (f p a) Source #

toList :: (SetLike f, Ord a) => f a -> [a] Source #

singleton :: (Selection f p, Ord a) => a -> f p a Source #

size :: (SetLike g, Ord a) => g a -> Int Source #

insert :: (Selection f p, Ord a) => a -> f p a -> f p a Source #

delete :: (Compactable (f p), Ord a) => a -> f p a -> f p a Source #

addSelection :: (Selection f Many, Ord a) => a -> f Many a -> f Many a Source #

deselectMany :: (Compactable (f p), Ord a) => Set a -> f p a -> f p a Source #