|
Unboxed integers: msg#00040lang.haskell.glasgow.bugs
Hello, There is something strange that is going on with unboxed types in GHC (6.2). I think it is a bug, but perhaps I am missing something. If so, I am quite curious as to what is going on. Here is the example: > import GHC.Exts First we define a function that will give us the bottom element of the unboxed integers. > bot :: () -> Int# > bot () = bot () Now we can define a function that will "check" if we have bottom or not, by terminating or not. > stops :: Int# -> Bool > stops _ = True > > test1 :: Bool > test1 = stops (bot ()) As expected (by me), 'test1' does not terminate --- to unbox values we have to be strict in them. So far everything makes sense. However if we simply make 'stops' into a local function, it starts terminating: > test2 :: Bool > test2 = stops (bot ()) > where > stops :: Int# -> Bool > stops _ = True -Iavor
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [ ghc-Bugs-1122207 ] EVACUATED object entered!, SourceForge.net |
|---|---|
| Next by Date: | RE: Unboxed integers, Simon Marlow |
| Previous by Thread: | [ ghc-Bugs-1122207 ] EVACUATED object entered!, SourceForge.net |
| Next by Thread: | RE: Unboxed integers, Simon Marlow |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |