HashSet package:dhall

Decode a HashSet from a List with distinct elements.
>>> input (hashSetFromDistinctList natural) "[1, 2, 3]"
fromList [1,2,3]
An error is thrown if the list contains duplicates.
>>> input (hashSetFromDistinctList natural) "[1, 1, 3]"
*** Exception: Error: Failed extraction

The expression type-checked successfully but the transformation to the target
type failed with the following error:

One duplicate element in the list: 1
>>> input (hashSetFromDistinctList natural) "[1, 1, 3, 3]"
*** Exception: Error: Failed extraction

The expression type-checked successfully but the transformation to the target
type failed with the following error:

2 duplicates were found in the list, including 1
Decode a HashSet from a List.
>>> input (hashSetIgnoringDuplicates natural) "[1, 2, 3]"
fromList [1,2,3]
Duplicate elements are ignored.
>>> input (hashSetIgnoringDuplicates natural) "[1, 1, 3]"
fromList [1,3]