[Haskell] How to define gunfold on List?

2009-01-18 Thread haihualin
Hi, Does some one know how to define gunfold on recursive data struction like List? The ghc doc only give the example for non-recursive data like below. data T a b = C1 a b | C2 deriving (Typeable, Data) GHC will generate an instance that is equivalent to instance (Data a, Data b) => Data (T

[Haskell] Does GHC support the standard CPP functionalities?

2008-11-22 Thread haihualin
Hi, I tried to compile the following program by GHC {-# LANGUAGE CPP #-} module Packer where #define FLASH_APP_START 1 #define FLASH_APP_END2 #define INSERT_SECTION(x) (#x, (FLASH_##x##_START, FLASH_##x##_END)) import qualified Data.Map as M import Data.Tuple import System.IO as Sys

[Haskell] How to get the binary respentation of the Int/Double.

2008-10-28 Thread haihualin
Hi, I am wondering how to get the binary respentation of the Int/Double. So I can save the integer as the binary data so that the C program can read it from the file. Thanks for your help. Haihua ___ Haskell mailing list Haskell@haskell.org http://