Open chris-martin opened 4 years ago
I'd be happy to write an example sometime this week
beyond demonstrating what happens if you try to use a type without Eq
or Ord
, - do you have any other goals for this section?
should we discuss time-space complexity? compare Map
with, say IntMap
? what knowledge would you like someone to take away from this section?
As a jumping-off point for an example involving the
Map
type from containers here is a fairly direct translation from Go By Example:Since
Set
is closely related toMap
, it might be nice to discuss sets at the same time.We might also want to show using a custom datatype as the key in a map, to demonstrate how you need to derive
Eq
andOrd
.