[Haskell-cafe] Assignment of grayCode

Anonymous Anonymous temp.public at gmail.com
Mon Mar 2 06:42:42 EST 2009


I'm working on a project for my university. But I do not understand the
assignment. It asks me to write a function that does the following:

grayCode :: Int -> ([Char] -> Int, Int -> [Char])

well in my opinion this assignment tells me to write some function that gets
one input (an integer) and result two functions in one tuple. One function
goes from [Char] to Int and the other one goes from Int to [Char].

But in my opinion this function will stay the same forever... am I mistaken?

The assignment should be:

Write an efficient code

grayCode :: Int -> ([Char] -> Int, Int -> [Char])

that, for values between 2 and 36 (included), creates a Gray Code. That is,
a tuple of two functions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090302/63935f78/attachment.htm

More information about the Haskell-Cafe mailing list