HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduledhall-1.42.3Haskell2010

Dhall.Set

This module only exports ways of constructing a Set, retrieving List, Set, and Seq representations of the same data, as well as a novel "difference" function. Any other Set-like or List-like functionality should be obtained through toSet and toList, respectively.

  • 1 type
  • 13 values
  • Packagedhall-1.42.3
  • Exports14
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSet.hs
datadata Set a
#

This is a variation on Data.Set.Set that remembers the original order of elements. This ensures that ordering is not lost when formatting Dhall code

Constructors

Instances9Foldable, Lift, Eq, Data, Ord, Show, …
valuetoList :: Set a -> [a]
#

Convert a Set to a list, preserving the original order of the elements

valuetoAscList :: Set a -> [a]
#

Convert a Set to a list of ascending elements

valuefromList :: Ord a => [a] -> Set a
#

Convert a list to a Set, remembering the element order

valuedifference :: Ord a => Set a -> Set a -> [a]
#

Returns, in order, all elements of the first Set not present in the second. (It doesn't matter in what order the elements appear in the second Set.)

valuesort :: Ord a => Set a -> Set a
#

Sort the set elements, forgetting their original ordering.

Example1 expression
sort (fromList [2, 1]) == fromList [1, 2]True
valueisSorted :: Ord a => Set a -> Bool
#
Example2 expressions
isSorted (fromList [2, 1])FalseisSorted (fromList [1, 2])True
valuenull :: Set a -> Bool
#
Example2 expressions
null (fromList [1])Falsenull (fromList [])True
valuesize :: Set a -> Int
#
Example1 expression
size (fromList [1])1