Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
ghc-internal GHC.Internal.Data.Maybe The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Examples
Basic usage:>>> maybeToList (Just 7) [7]
>>> maybeToList Nothing []
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:>>> import GHC.Internal.Text.Read ( readMaybe ) >>> sum $ maybeToList (readMaybe "3") 3 >>> sum $ maybeToList (readMaybe "") 0
module GHC.Internal.Data.
OldList Operations on lists.
type
ColorList = [WeightedColor]graphviz Data.GraphViz.Attributes.Colors The sum of the optional weightings must sum to at most 1.
toColorList :: [Color] -> ColorListgraphviz Data.GraphViz.Attributes.Colors For a list of colors without weightings.
-
graphviz Data.GraphViz.Attributes.Complete A list of layer names. The names should all be unique LRName values, and when printed will use an arbitrary character from defLayerSep. The values in the list are implicitly numbered 1, 2, ....
LayerListSep :: LayerListSep -> Attributegraphviz Data.GraphViz.Attributes.Complete Valid for: G; Default: LLSep ","; Notes: requires Graphviz >= 2.30.0
-
graphviz Data.GraphViz.Attributes.Complete No documentation available.
-
graphviz Data.GraphViz.Parsing Lists, but with an Applicative functor based on zipping.
Examples
In contrast to the Applicative for List:>>> (+) <$> [1, 2, 3] <*> [4, 5, 6] [5,6,7,6,7,8,7,8,9]
The Applicative instance of ZipList applies the operation by pairing up the elements, analogous to zipWithN>>> (+) <$> ZipList [1, 2, 3] <*> ZipList [4, 5, 6] ZipList {getZipList = [5,7,9]}
>>> (,,,) <$> ZipList [1, 2] <*> ZipList [3, 4] <*> ZipList [5, 6] <*> ZipList [7, 8] ZipList {getZipList = [(1,3,5,7),(2,4,6,8)]}
>>> ZipList [(+1), (^2), (/ 2)] <*> ZipList [5, 5, 5] ZipList {getZipList = [6.0,25.0,2.5]}
-
graphviz Data.GraphViz.Parsing No documentation available.
getZipList :: ZipList a -> [a]graphviz Data.GraphViz.Parsing No documentation available.