#1683: strange MVar / UnsafePerformIO (and type checker...) behaviour
---------------------------------------------------+------------------------
Reporter: [EMAIL PROTECTED] | Owner:
Type: bug | Status: closed
Priority: normal | Milestone:
Component: Compiler | Version: 6.6.1
Severity: normal | Resolution: invalid
Keywords: MVar, UnsafePerformIO, typechecker | Difficulty: Unknown
Os: Unknown | Testcase:
Architecture: Unknown |
---------------------------------------------------+------------------------
Comment (by igloo):
GHC implements Word8 with a 32 or 64 bit word (depending on the word size
of your machine):
{{{
data Word8 = W8# Word#
}}}
All the primitive functions are careful to make sure that only 8-bit
values are stored in the word, with a narrow8Word# primitive, e.g.:
{{{
(W8# x#) + (W8# y#) = W8# (narrow8Word# (x# `plusWord#` y#))
}}}
The show function for Word8 works by showing the internal word as an Int,
which is fine as long as the Word8 is valid.
I hope that clears it up for you!
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1683>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs