[Haskell-cafe] Optimization help needed

Bulat Ziganshin bulatz at HotPOP.com
Fri Dec 23 06:58:25 EST 2005


Hello Joel,

Thursday, December 22, 2005, 7:27:17 PM, you wrote:
JR> #ifdef BIG_ENDIAN
JR> swap16 v = (v `shiftR` 8) .|. (v  `shiftL` 8)
JR> #else
JR> swap16 v = v
JR> #endif

afaik, your code anyway will not work on non-x86 architectures,
because your `storable` definition use unaligned reads which are not
supported outside x86 world


and about ":+:" - read "Derivable type classes
[http://research.microsoft.com/~simonpj/Papers/derive.ps.gz]" and
"7.11. Generic classes" of ghc manual

-- 
Best regards,
 Bulat                            mailto:bulatz at HotPOP.com





More information about the Haskell-Cafe mailing list