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

Safe HaskellNone
LanguageHaskell2010

Shpadoinkle.Widgets.Types.ConsideredChoice

Documentation

data ConsideredChoice p a Source #

Constructors

ConsideredChoice 

Fields

Instances
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

(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 One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Consideration ConsideredChoice AtleastOne Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

(Foldable (Choice p), Foldable (Considered p)) => Foldable (ConsideredChoice p) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Methods

fold :: Monoid m => ConsideredChoice p m -> m Source #

foldMap :: Monoid m => (a -> m) -> ConsideredChoice p a -> m Source #

foldr :: (a -> b -> b) -> b -> ConsideredChoice p a -> b Source #

foldr' :: (a -> b -> b) -> b -> ConsideredChoice p a -> b Source #

foldl :: (b -> a -> b) -> b -> ConsideredChoice p a -> b Source #

foldl' :: (b -> a -> b) -> b -> ConsideredChoice p a -> b Source #

foldr1 :: (a -> a -> a) -> ConsideredChoice p a -> a Source #

foldl1 :: (a -> a -> a) -> ConsideredChoice p a -> a Source #

toList :: ConsideredChoice p a -> [a] Source #

null :: ConsideredChoice p a -> Bool Source #

length :: ConsideredChoice p a -> Int Source #

elem :: Eq a => a -> ConsideredChoice p a -> Bool Source #

maximum :: Ord a => ConsideredChoice p a -> a Source #

minimum :: Ord a => ConsideredChoice p a -> a Source #

sum :: Num a => ConsideredChoice p a -> a Source #

product :: Num a => ConsideredChoice p a -> a Source #

(Compactable (Choice p), Compactable (Considered p)) => Compactable (ConsideredChoice p) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Methods

compact :: ConsideredChoice p (Maybe a) -> ConsideredChoice p a Source #

separate :: ConsideredChoice p (Either l r) -> (ConsideredChoice p l, ConsideredChoice p r) Source #

filter :: (a -> Bool) -> ConsideredChoice p a -> ConsideredChoice p a Source #

partition :: (a -> Bool) -> ConsideredChoice p a -> (ConsideredChoice p a, ConsideredChoice p a) Source #

fmapMaybe :: Functor (ConsideredChoice p) => (a -> Maybe b) -> ConsideredChoice p a -> ConsideredChoice p b Source #

fmapEither :: Functor (ConsideredChoice p) => (a -> Either l r) -> ConsideredChoice p a -> (ConsideredChoice p l, ConsideredChoice p r) Source #

applyMaybe :: Applicative (ConsideredChoice p) => ConsideredChoice p (a -> Maybe b) -> ConsideredChoice p a -> ConsideredChoice p b Source #

applyEither :: Applicative (ConsideredChoice p) => ConsideredChoice p (a -> Either l r) -> ConsideredChoice p a -> (ConsideredChoice p l, ConsideredChoice p r) Source #

bindMaybe :: Monad (ConsideredChoice p) => ConsideredChoice p a -> (a -> ConsideredChoice p (Maybe b)) -> ConsideredChoice p b Source #

bindEither :: Monad (ConsideredChoice p) => ConsideredChoice p a -> (a -> ConsideredChoice p (Either l r)) -> (ConsideredChoice p l, ConsideredChoice p r) Source #

traverseMaybe :: (Applicative g, Traversable (ConsideredChoice p)) => (a -> g (Maybe b)) -> ConsideredChoice p a -> g (ConsideredChoice p b) Source #

traverseEither :: (Applicative g, Traversable (ConsideredChoice p)) => (a -> g (Either l r)) -> ConsideredChoice p a -> g (ConsideredChoice p l, ConsideredChoice p r) 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

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Generic (ConsideredChoice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Associated Types

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

(Ord a, Considered p ~ Maybe, Semigroup (Choice p a)) => Semigroup (ConsideredChoice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

(Ord a, Considered p ~ Maybe, Monoid (Choice p a)) => Monoid (ConsideredChoice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Methods

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

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

type Rep (ConsideredChoice p a) Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

type Rep (ConsideredChoice p a) = D1 (MetaData "ConsideredChoice" "Shpadoinkle.Widgets.Types.ConsideredChoice" "Shpadoinkle-widgets-0.2.0.1-HaWUIlNGtuO41rdsllvehE" False) (C1 (MetaCons "ConsideredChoice" PrefixI True) (S1 (MetaSel (Just "_consideration") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Considered p a)) :*: S1 (MetaSel (Just "_choice") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (Choice p a))))

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

pickToConsidered :: forall (p :: Pick) a. PickToConsidered p => a -> Considered p a Source #

class (Selection f p, PickToConsidered p) => Consideration f (p :: Pick) where Source #

Methods

consider :: Ord a => Considered p a -> f p a -> f p a Source #

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

choice :: Ord a => f p a -> Choice p a Source #

considered :: Ord a => f p a -> Considered p a Source #

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

Instances
Consideration ConsideredChoice One Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

Consideration ConsideredChoice AtleastOne Source # 
Instance details

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Types.ConsideredChoice

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

Defined in Shpadoinkle.Widgets.Form.Dropdown

Methods

consider :: Ord a => Considered p a -> Dropdown p a -> Dropdown p a Source #

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

choice :: Ord a => Dropdown p a -> Choice p a Source #

considered :: Ord a => Dropdown p a -> Considered p a Source #

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

consider' :: forall (f :: Pick -> Type -> Type) p a. (Ord a, Consideration f p) => a -> f p a -> f p a Source #

unsafeConsiderFirst :: (Consideration f p, Ord a) => f p a -> f p a Source #

unsafeConsiderLast :: (Consideration f p, Ord a) => f p a -> f p a Source #

considerNext :: (Considered p a ~ Maybe a, Consideration f p, Ord a) => f p a -> f p a Source #

considerPrev :: (Considered p a ~ Maybe a, Consideration f p, Ord a) => f p a -> f p a Source #