dependingOn in 6.6

Simon Peyton-Jones simonpj at microsoft.com
Wed Aug 9 03:40:06 EDT 2006


Hmm.  It's pretty late in the day.

What's the implementation you have in mind?  It's sure to get in the way of some optimisations; e.g.	
	((\x.e) `dependingOn` y) arg
Maybe that doesn’t matter.  I'm reluctant to build in optimisation rules for dependingOn.

Is the argument order right?  dependingOn is very like "seq" except that it's lazy.  Shouldn't it have the same type?

When is it ok to inline the function, to reveal its (lack of) implementation?  Can you just implement it in a library of your own?

Can you list the "all sorts of applications" you have in mind?

It might be good to collect this stuff in a Trac feature request.

Simon

| -----Original Message-----
| From: glasgow-haskell-users-bounces at haskell.org [mailto:glasgow-haskell-users-
| bounces at haskell.org] On Behalf Of John Meacham
| Sent: 09 August 2006 00:59
| To: glasgow-haskell-users at haskell.org
| Subject: dependingOn in 6.6
| 
| I was wondering if we could be sure to get
| 
| dependingOn :: a -> b -> a
| dependingOn = ....
| 
| in ghc 6.6? this has been discussed before, it is implemented in jhc and
| I have found all sorts of use for it as it can be used to control let
| floating and inlining in a nice general way and is trivial to implement.
| (one for ghc was posted before based on primitives it already
| implements)
| 
| we just need to decide on a module to export it.
| 
| the meaning is that
| 
| x = ... `dependingOn` y
| 
| returns x with an artificial dependency on y. so things using x cannot
| be floated out above where y is defined.
| 
| 
|         John
| 
| 
| --
| John Meacham - ⑆repetae.net⑆john⑈
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at haskell.org
| http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


More information about the Glasgow-haskell-users mailing list