[Haskell-cafe] Just for a laugh...
Andrew Coppin
andrewcoppin at btinternet.com
Thu May 31 15:47:28 EDT 2007
If you're bored... can you come up with a solution to this?
http://warp.povusers.org/ProgrammingChallenge.html
(Obviously a pretty silly challenge, but hey.)
My first instinct was to use Data.Bits - but I see no instance for
Double. (Presumably because performing bitwise operations on a Double is
a pretty odd thing to want to do.) So my next guess is to do some
bizzare type system hackery that allows you to transform a Double
into... whichever integer type is the same size, and proceed from there.
Does anybody know how to do that?
(Otherwise... wasn't there some library somewhere for serialising values
in binary?)
More information about the Haskell-Cafe
mailing list