Skip to content

Commit 7c87593

Browse files
authored
Merge pull request #331 from rbasso/custom-set-move-hints
custom-set: Move hints to HINTS.md
2 parents 69c8b90 + f2b4fdf commit 7c87593

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

exercises/custom-set/HINTS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Hints
2+
3+
To complete this exercise, you need to create the data type `CustomSet`,
4+
with `Eq` and `Show` instances, and implement the following functions:
5+
6+
- `delete`
7+
- `difference`
8+
- `empty`
9+
- `fromList`
10+
- `insert`
11+
- `intersection`
12+
- `isDisjointFrom`
13+
- `isSubsetOf`
14+
- `member`
15+
- `null`
16+
- `size`
17+
- `toList`
18+
- `union`
19+
20+
You will find the type signatures already in place, but it is up to you
21+
to define the functions.
22+
23+
If you're interested in writing an efficient implementation but don't quite
24+
know where to start, the best primer I know of is Chris Okasaki's
25+
"Purely Functional Data Structures", which you can read a version of here:
26+
https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf

exercises/custom-set/src/CustomSet.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ module CustomSet
1717

1818
import Prelude hiding (null)
1919

20-
-- The task is to create the data type `CustomSet`, with `Eq`
21-
-- and `Show` instances, and implement the functions below.
22-
2320
delete :: a -> CustomSet a -> CustomSet a
2421
delete = undefined
2522

exercises/custom-set/test/Tests.hs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ import CustomSet
2121
, union
2222
)
2323

24-
-- If you're interested in writing an efficient implementation but don't quite
25-
-- know where to start, the best primer I know of is Chris Okasaki's
26-
-- "Purely Functional Data Structures", which you can read a version of here:
27-
-- https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
28-
2924
main :: IO ()
3025
main = hspecWith defaultConfig {configFastFail = True} specs
3126

0 commit comments

Comments
 (0)