File tree 3 files changed +26
-8
lines changed 3 files changed +26
-8
lines changed Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ module CustomSet
17
17
18
18
import Prelude hiding (null )
19
19
20
- -- The task is to create the data type `CustomSet`, with `Eq`
21
- -- and `Show` instances, and implement the functions below.
22
-
23
20
delete :: a -> CustomSet a -> CustomSet a
24
21
delete = undefined
25
22
Original file line number Diff line number Diff line change @@ -21,11 +21,6 @@ import CustomSet
21
21
, union
22
22
)
23
23
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
-
29
24
main :: IO ()
30
25
main = hspecWith defaultConfig {configFastFail = True } specs
31
26
You can’t perform that action at this time.
0 commit comments