Hoogle Search
Within LTS Haskell 24.40 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
data-diverse Data.Diverse.Many Converts from a Many to a value (eg a tuple), via a Tagged wrapper
snocMany :: forall (xs :: [Type]) y . Many xs -> y -> Many (Append xs '[y])data-diverse Data.Diverse.Many Add an element to the right of a Many Not named snoc to avoid conflict with snoc
-
data-diverse Data.Diverse.Many Add an element to the right of a Many iff the field doesn't already exist.
toMany :: IsMany t xs a => t xs a -> Many xsdata-diverse Data.Diverse.Many No documentation available.
toMany' :: forall (xs :: [Type]) a . IsMany (Tagged :: [Type] -> Type -> Type) xs a => a -> Many xsdata-diverse Data.Diverse.Many Converts from a value (eg a tuple) to a Many, via a Tagged wrapper
class
IsMany (t :: [Type] -> k -> Type) (xs :: [Type]) (a :: k)data-diverse Data.Diverse.Many.Internal This instance allows converting to and from Many There are instances for converting tuples of up to size 15.
-
data-diverse Data.Diverse.Many.Internal A Many is an anonymous product type (also know as polymorphic record), with no limit on the number of fields. The following functions are available can be used to manipulate unique fields
- getter/setter for single field: grab and replace
- getter/setter for multiple fields: select and amend
- folds: forMany or collect
- getter/setter for single field: grabN and replaceN
- getter/setter for multiple fields: selectN and amendN
- folds: forManyN or collectN
Key = Index of type in typelist + Offset
The constructor will guarantee the correct number and types of the elements. The constructor is only exported in the Data.Diverse.Many.Internal module Many :: Seq (Any :: Type) -> Many (xs :: [Type])data-diverse Data.Diverse.Many.Internal No documentation available.
consMany :: forall x (xs :: [Type]) . x -> Many xs -> Many (x ': xs)data-diverse Data.Diverse.Many.Internal Add an element to the left of a Many. Not named cons to avoid conflict with cons
forMany :: forall c r (xs :: [Type]) . Collect c r xs => c r xs -> Many xs -> Collector c xs rdata-diverse Data.Diverse.Many.Internal Folds any Many, even with indistinct types. Given distinct handlers for the fields in Many, create AFoldable of the results of running the handlers over the fields in Many.
let x = (5 :: Int) ./ False ./ 'X' ./ Just 'O' ./ (6 :: Int) ./ Just 'A' ./ nil y = show @Int ./ show @Char ./ show @(Maybe Char) ./ show @Bool ./ nil afoldr (:) [] (forMany (cases y) x) `shouldBe` ["5", "False", "'X'", "Just 'O'", "6", "Just 'A'"]