Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell: Sets

Name: Anonymous 2015-08-17 18:24

Given a finite Set type (not Data.Set), find a map Set -> Int that is bijective! (Let's try injective first, how would you do that?)

The definition of Set I have in mind is this:
data Set = Empty | Set [Set]
But if you want to use some other equivalent definition go ahead.

Name: Anonymous 2015-08-17 19:15

did you mean something like:

data Nil :: *
data Cons :: * -> * -> *

data Set :: * -> * where
Nil :: Set Nil
Cons :: h -> Set t -> Set (Cons h t)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List