#1349: Generalise the ! and UNPACK mechanism for data types, to unpack function
arguments
---------------------------------+------------------------------------------
Reporter: simonpj | Owner:
Type: task | Status: new
Priority: low | Milestone: 7.2.1
Component: Compiler | Version: 6.6.1
Keywords: | Testcase:
Blockedby: | Difficulty: Unknown
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: None/Unknown
---------------------------------+------------------------------------------
Comment(by ezyang):
Some answers for spj's questions:
- Yes, this should be allowed, by analogy to data constructors: if I
write a function `\c x -> c x`, we don't mind if the constructor `c` is
strict or lazy in x. Now, if we want to be able to give assertions about
strictness, this is less clear, but right now these sorts of bang-patterns
change semantics, so that's a different tree to bark up.
- I don't know how feasible this is, but one way to work around the
sharing issue is to use the arity analyzer to figure out if we need to
insert intermediate lambdas in the case that `f x` of `f x y` does work.
It's kind of hacky though...
- Yes, definitely. It doesn't make too much sense for a polymorphic
variable, but `!() -> ()` does in fact give more information than `() ->
()`.
- If we think the current design for bang patterns in data constructors
is right, we use HsBangTy, erase it for any typechecking, and make sure it
gets added to the right operational places. So they probably should be
treated as different.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1349#comment:32>
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