Logo

Programming-Idioms

History of Idiom 118 > diff from v37 to v38

Edit summary for version 38 by sorki:
[Haskell] better to use qualified import as stated in docs

Version 37

2019-09-26, 15:55:32

Version 38

2019-09-26, 16:56:45

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration

Idiom #118 List to set

Create set y from list x.
x may contain duplicates. y is unordered and has no repeated values.

Illustration
Imports
import Data.Set as Set
Imports
import qualified Data.Set as Set
Code
y = Set.fromList x
Code
y = Set.fromList x
Doc URL
https://hackage.haskell.org/package/containers-0.6.2.1/docs/Data-Set.html