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 Source #

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

Ord Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Show Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Generic Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Associated Types

type Rep Pick :: Type -> Type Source #

Methods

from :: Pick -> Rep Pick x Source #

to :: Rep Pick x -> Pick Source #

NFData Pick Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

rnf :: Pick -> () 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 #

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-Iii9y28UYw8NDw10YgrA9" 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 Source #

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

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

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

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

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

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

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

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

null :: Choice One a -> Bool Source #

length :: Choice One a -> Int Source #

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

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

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

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

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

Foldable (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

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

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

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

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

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

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

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

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

null :: Choice AtleastOne a -> Bool Source #

length :: Choice AtleastOne a -> Int Source #

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

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

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

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

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

Foldable (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

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

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

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

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

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

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

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

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

null :: Choice Many a -> Bool Source #

length :: Choice Many a -> Int Source #

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

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

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

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

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

Eq1 (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

Eq1 (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

Eq1 (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

Ord1 (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

Ord1 (Choice AtleastOne) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Ord1 (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

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

Compactable (Choice One) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Compactable (Choice Many) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

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 Source #

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

(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 Source #

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

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

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

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

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

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

(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 Source #

show :: Choice p a -> String Source #

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

Generic (Choice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.Choice

Associated Types

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

Methods

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

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

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

Defined in Shpadoinkle.Widgets.Types.Choice

(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

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

Defined in Shpadoinkle.Widgets.Types.Choice

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

Defined in Shpadoinkle.Widgets.Types.Choice

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

Defined in Shpadoinkle.Widgets.Types.Choice

Methods

rnf :: Choice p a -> () Source #

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

Defined in Shpadoinkle.Widgets.Types.Choice

(FromJSON (Selected p a), FromJSON a, Ord a) => FromJSON (Choice p 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]

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-Iii9y28UYw8NDw10YgrA9" 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 Source #

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

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

Defined in Shpadoinkle.Widgets.Types.Choice

(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 #