
2 Jan
2011
2 Jan
'11
7:45 a.m.
Hi guys! I'm working on a random generator package and want to ask, whether it's possible to generate a type like Int, that can have different sizes at runtime. Motivation: The package ships to generators, one for 32 (lets name it MyGen32) and one for 64 bits (MyGen64). As it is not good for performance to use the wrong one, I also want to provide a type MyGen, that is either a type synonym for MyGen32 or MyGen64, depending on the platform. Any ideas how to do this at compile time? I want this to compile with Cabal so that anybody can download it as a package. I guess the easiest way would be to use CPP, but is there any flag for the wordsize? Yours, Robert Clausecker