#1405: Make ghc (stage1) be compilable by non-GHC
-----------------------------+----------------------------------------------
Reporter: Isaac Dupree | Owner:
Type: task | Status: new
Priority: normal | Milestone: _|_
Component: Compiler | Version: 6.6.1
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Os: Unknown | Testcase:
Architecture: Unknown |
-----------------------------+----------------------------------------------
Comment (by Isaac Dupree):
I made `FiniteMap` use `{-# UNPACK #-} !Int` instead of `Int#`. Probably
it would be better to change to `FastInt` (which is good for when GHC
compiles itself without optimizations).
Thoughts about `FastInt` and unboxing:
A compiler that doesn't have unboxed types could represent them like
`newtype !FastInt = I__ Int`. That `!` somewhere indicates to the
compiler that wherever this type is used, it is used strictly: with the
same restrictions as unboxed types, as if it were `!Int` everywhere: in
data declarations, in function arguments as if the `!Int -> x` syntax were
implemented (only, clearer, because there is a clear source-type-level
distinction between the strict and non-strict versions). This has a
semantic effect in `FastInt -> x` but no effect in `x -> FastInt`, I
believe. (And many constructions, like `(FastInt, x)` are not allowed for
unboxed types, and `FastInt` sometimes _is_ unboxed...)
For now, changing to `Int` or `FastInt` as appropriate, seems the best
course. But I'm busy with school soon so I might not get to it for a
while (and I'm sure someone else could do as good a job as me, if they
want).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1405>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs