Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions exercises/custom-set/HINTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## Hints

To complete this exercise, you need to create the data type `CustomSet`,
with `Eq` and `Show` instances, and implement the following functions:

- `delete`
- `difference`
- `empty`
- `fromList`
- `insert`
- `intersection`
- `isDisjointFrom`
- `isSubsetOf`
- `member`
- `null`
- `size`
- `toList`
- `union`

You will find the type signatures already in place, but it is up to you
to define the functions.

If you're interested in writing an efficient implementation but don't quite
know where to start, the best primer I know of is Chris Okasaki's
"Purely Functional Data Structures", which you can read a version of here:
https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
3 changes: 0 additions & 3 deletions exercises/custom-set/src/CustomSet.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ module CustomSet

import Prelude hiding (null)

-- The task is to create the data type `CustomSet`, with `Eq`
-- and `Show` instances, and implement the functions below.

delete :: a -> CustomSet a -> CustomSet a
delete = undefined

Expand Down
5 changes: 0 additions & 5 deletions exercises/custom-set/test/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ import CustomSet
, union
)

-- If you're interested in writing an efficient implementation but don't quite
-- know where to start, the best primer I know of is Chris Okasaki's
-- "Purely Functional Data Structures", which you can read a version of here:
-- https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf

main :: IO ()
main = hspecWith defaultConfig {configFastFail = True} specs

Expand Down