Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Pick
- = One
- | AtleastOne
- | Many
- type family Selected (p :: Pick) (a :: Type) :: Type where ...
- data Choice (p :: Pick) a = Choice {}
- class SetLike f where
- ftoSet :: (Ord a, Foldable g) => g a -> Set a
- class SetLike (f p) => Selection f (p :: Pick) where
- class Selection f p => Deselection f (p :: Pick) where
- noselection :: (Foldable g, Ord a) => g a -> f p a
- deselect :: Ord a => f p a -> f p a
- next :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a
- nextLoop :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a
- prev :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a
- prevLoop :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a
- selectAll :: Choice Many a -> Choice Many a
- unsafeSelectFirst :: (Selection f p, Ord a) => f p a -> f p a
- unsafeSelectLast :: (Selection f p, Ord a) => f p a -> f p a
- selectFirst :: (Selection f p, Ord a) => f p a -> Maybe (f p a)
- selectLast :: (Selection f p, Ord a) => f p a -> Maybe (f p a)
- fullset :: (Bounded a, Enum a) => Set a
- fullOptions :: (Deselection f p, Bounded a, Enum a, Ord a) => f p a
- fullOptionsMin :: (Selection f p, Bounded a, Enum a, Ord a) => f p a
- fullOptionsMax :: (Selection f p, Bounded a, Enum a, Ord a) => f p a
- fromNonEmpty :: (Selection f p, Ord a) => NonEmpty a -> f p a
- selectWhen :: (SetLike g, Selection f Many, Ord a) => (a -> Bool) -> g a -> Maybe (f Many a)
- selectFirstWhen :: (SetLike g, Deselection f p, Ord a) => (a -> Bool) -> g a -> Maybe (f p a)
- selectLastWhen :: (SetLike g, Deselection f p, Ord a) => (a -> Bool) -> g a -> Maybe (f p a)
- toList :: (SetLike f, Ord a) => f a -> [a]
- singleton :: (Selection f p, Ord a) => a -> f p a
- before :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Set a
- unsafeSelectAt :: (SetLike g, Selection f AtleastOne, Ord a) => Int -> g a -> f AtleastOne a
- getIndex :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Int
- after :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Set a
- size :: (SetLike g, Ord a) => g a -> Int
- insert :: (Selection f p, Ord a) => a -> f p a -> f p a
- delete :: (Compactable (f p), Ord a) => a -> f p a -> f p a
- addSelection :: (Selection f Many, Ord a) => a -> f Many a -> f Many a
- deselectMany :: (Compactable (f p), Ord a) => Set a -> f p a -> f p a
- data ConsideredChoice p a = ConsideredChoice {
- _consideration :: Considered p a
- _choice :: Choice p a
- type family Considered (p :: Pick) :: Type -> Type where ...
- class Selection f p => Consideration f (p :: Pick) where
- consider :: Ord a => Considered p a -> f p a -> f p a
- consider' :: Ord a => a -> f p a -> f p a
- choose :: Ord a => f p a -> f p a
- choice :: Ord a => f p a -> Choice p a
- considered :: Ord a => f p a -> Considered p a
- shrug :: Ord a => f p a -> f p a
- unsafeConsiderFirst :: (Consideration f p, Ord a) => f p a -> f p a
- unsafeConsiderLast :: (Consideration f p, Ord a) => f p a -> f p a
- considerNext :: (Considered p a ~ Maybe a, Consideration f p, Ord a) => f p a -> f p a
- considerPrev :: (Considered p a ~ Maybe a, Consideration f p, Ord a) => f p a -> f p a
Documentation
data Choice (p :: Pick) a Source #
Instances
class SetLike f where Source #
Laws:
if toSet a == toSet b then a == b -- toSet is injective
toSet (smap f s) == fmap f (toSet s)
if valid s then Set.valid (toSet s)
Instances
SetLike Maybe Source # | |
SetLike Set Source # | |
(Considered p ~ Maybe, SetLike (Choice p)) => SetLike (ConsideredChoice p) Source # | |
Defined in Shpadoinkle.Widgets.Types.Choice toSet :: Ord a => ConsideredChoice p a -> Set a Source # smap :: Ord b => (a -> b) -> ConsideredChoice p a -> ConsideredChoice p b Source # | |
SetLike (ConsideredChoice Many) Source # | |
Defined in Shpadoinkle.Widgets.Types.Choice | |
SetLike (Choice One) Source # | |
SetLike (Choice AtleastOne) Source # | |
Defined in Shpadoinkle.Widgets.Types.Choice | |
SetLike (Choice Many) Source # | |
SetLike (ConsideredChoice p) => SetLike (Dropdown p) Source # | |
class SetLike (f p) => Selection f (p :: Pick) where Source #
select :: Ord a => f p a -> Selected p a -> f p a Source #
select' :: Ord a => f p a -> 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 #
withOptions' :: (Foldable g, Ord a) => a -> g a -> f p a Source #
Instances
class Selection f p => Deselection f (p :: Pick) where Source #
noselection :: (Foldable g, Ord a) => g a -> f p a Source #
Instances
Selection ConsideredChoice One => Deselection ConsideredChoice One Source # | |
Defined in Shpadoinkle.Widgets.Types.Choice noselection :: (Foldable g, Ord a) => g a -> ConsideredChoice One a Source # deselect :: Ord a => ConsideredChoice One a -> ConsideredChoice One a Source # | |
Selection ConsideredChoice Many => Deselection ConsideredChoice Many Source # | |
Defined in Shpadoinkle.Widgets.Types.Choice noselection :: (Foldable g, Ord a) => g a -> ConsideredChoice Many a Source # deselect :: Ord a => ConsideredChoice Many a -> ConsideredChoice Many a Source # | |
Deselection Choice One Source # | |
Deselection Choice Many Source # | |
(Consideration ConsideredChoice p, Deselection ConsideredChoice p) => Deselection Dropdown p Source # | |
next :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a Source #
nextLoop :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a Source #
prev :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a Source #
prevLoop :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> f AtleastOne a 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 #
fullOptions :: (Deselection f p, Bounded a, Enum a, Ord 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 #
before :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Set a Source #
unsafeSelectAt :: (SetLike g, Selection f AtleastOne, Ord a) => Int -> g a -> f AtleastOne a Source #
getIndex :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Int Source #
after :: (Selection f AtleastOne, Ord a) => f AtleastOne a -> Set a Source #
delete :: (Compactable (f p), Ord a) => a -> f p a -> f p a Source #
deselectMany :: (Compactable (f p), Ord a) => Set a -> f p a -> f p a Source #
data ConsideredChoice p a Source #
ConsideredChoice | |
|
Instances
class Selection f p => Consideration f (p :: Pick) where Source #
consider :: Ord a => Considered p a -> f p a -> f p a Source #
consider' :: Ord a => 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 #
Instances
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 #