Hoogle Search
Within Stackage Nightly 2025-10-09 (ghc-9.12.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
fromSet :: (k -> a) -> Set k -> Map k acontainers Data.Map.Strict.Internal Build a map from a set of keys and a function which for each key computes its value.
fromSet (\k -> replicate k 'a') (Data.Set.fromList [3, 5]) == fromList [(5,"aaaaa"), (3,"aaa")] fromSet undefined Data.Set.empty == empty
-
containers Data.Map.Strict.Internal The set of all keys of the map.
keysSet (fromList [(5,"a"), (3,"b")]) == Data.Set.fromList [3,5] keysSet empty == Data.Set.empty
isProperSubsetOf :: Ord a => Set a -> Set a -> Boolcontainers Data.Set (s1 `isProperSubsetOf` s2) indicates whether s1 is a proper subset of s2.
s1 `isProperSubsetOf` s2 = s1 `isSubsetOf` s2 && s1 /= s2
isSubsetOf :: Ord a => Set a -> Set a -> Boolcontainers Data.Set (s1 `isSubsetOf` s2) indicates whether s1 is a subset of s2.
s1 `isSubsetOf` s2 = all (`member` s2) s1 s1 `isSubsetOf` s2 = null (s1 `difference` s2) s1 `isSubsetOf` s2 = s1 `union` s2 == s2 s1 `isSubsetOf` s2 = s1 `intersection` s2 == s1
powerSet :: Set a -> Set (Set a)containers Data.Set Calculate the power set of a set: the set of all its subsets.
t `member` powerSet s == t `isSubsetOf` s
Example:powerSet (fromList [1,2,3]) = fromList $ map fromList [[],[1],[1,2],[1,2,3],[1,3],[2],[2,3],[3]]
isProperSubsetOf :: Ord a => Set a -> Set a -> Boolcontainers Data.Set.Internal (s1 `isProperSubsetOf` s2) indicates whether s1 is a proper subset of s2.
s1 `isProperSubsetOf` s2 = s1 `isSubsetOf` s2 && s1 /= s2
isSubsetOf :: Ord a => Set a -> Set a -> Boolcontainers Data.Set.Internal (s1 `isSubsetOf` s2) indicates whether s1 is a subset of s2.
s1 `isSubsetOf` s2 = all (`member` s2) s1 s1 `isSubsetOf` s2 = null (s1 `difference` s2) s1 `isSubsetOf` s2 = s1 `union` s2 == s2 s1 `isSubsetOf` s2 = s1 `intersection` s2 == s1
powerSet :: Set a -> Set (Set a)containers Data.Set.Internal Calculate the power set of a set: the set of all its subsets.
t `member` powerSet s == t `isSubsetOf` s
Example:powerSet (fromList [1,2,3]) = fromList $ map fromList [[],[1],[1,2],[1,2,3],[1,3],[2],[2,3],[3]]
-
time Data.Time.Format The class of types which can be parsed given a UNIX-style time format string.
parseTimeM :: (MonadFail m, ParseTime t) => Bool -> TimeLocale -> String -> String -> m ttime Data.Time.Format Parses a time value given a format string. Missing information will be derived from 1970-01-01 00:00 UTC (which was a Thursday). Supports the same %-codes as formatTime, including %-, %_ and %0 modifiers, however padding widths are not supported. Case is not significant in the input string. Some variations in the input are accepted:
- %z %Ez accepts any of ±HHMM or ±HH:MM.
- %Z %EZ accepts any string of letters, or any of the formats accepted by %z.
- %0Y accepts exactly four digits.
- %0G accepts exactly four digits.
- %0C accepts exactly two digits.
- %0f accepts exactly two digits.
Prelude Data.Time> parseTimeM True defaultTimeLocale "%Y-%-m-%-d" "2010-3-04" :: Maybe Day Just 2010-03-04