[GHC] #2806: Require bang-patterns for unlifted bindings
GHC
trac at galois.com
Tue Apr 21 21:08:36 EDT 2009
#2806: Require bang-patterns for unlifted bindings
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.12.1
Component: Compiler | Version: 6.8.3
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Comment (by guest):
darn, I (Isaac) realized that what I said was really ambiguous. I'll try
with simpler examples:
Perhaps
{{{
f (I# z) = ...
}}}
ought not to require a bang on the "z", because the data-type is
inherently strict.
And to make it clear, another example of this logic is that this would be
okay (but needs that bang) :
{{{
g (x, !(I# z)) = ...
}}}
But, I forget the semantics of bang-patterns... would this also be
equivalent and permissible?:
{{{
g (x, (I# !z))
}}}
Anyway, if we allow "f" above (or even if not?), I would be more
comfortable with -- by analogy -- requiring a bang in any data-type
definition where an unlifted type is contained, rather than leaving that
form of strictness implied. (In the presence of type-synonyms, it may not
always be obviously visible to the reader whether a member type is
unlifted.) This makes a difference in currently-allowed expressions like
`I# ( 1# +# 1# )` or `I# ( 1# `quot#` 0# )` which would "normally" be lazy
as long as there isn't a bang in the data definition of Int (but is strict
because of unlifted semantic magic).
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2806#comment:7>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list