Aggressive inlining
Simon PeytonJones
simonpj at microsoft.com
Thu Nov 20 08:55:23 EST 2003
Sounds as if you might need Template Haskell
http://research.microsoft.com/~simonpj/papers/metahaskell/
Simon
 Original Message
 From: haskellcafebounces at haskell.org
[mailto:haskellcafebounces at haskell.org] On Behalf Of Blue
 Steel
 Sent: 19 November 2003 22:43
 To: haskellcafe at haskell.org
 Subject: Aggressive inlining

 I'm working on a parlor trick.

 I would like to solve a 3SAT problem at compile time,
 so that the executable is super fast.

 Consider
 
 formula (x1,x2,x3) = (x1  x2) && x3

 tf = [True, False]

 assignments = [(x1,x2,x3)x1<tf,x2<tf,x3<tf]

 solutions = filter formula assignments

 main = do print solutions
 

 Theoretically, a compiler could optimize this to
 
 main = do print [(True,True,True),...]
 

 Is this actually possible in GHC? I've played with
 inline pragmas and looked at ddump..., but I haven't
 made much progress.

 Of course, the goal is to replace "formula" with a
 formula that takes a 30tuple instead of a triple and
 really let GHC crank.

 Thanks for any help.


 __________________________________
 Do you Yahoo!?
 Protect your identity with Yahoo! Mail AddressGuard
 http://antispam.yahoo.com/whatsnewfree
 _______________________________________________
 HaskellCafe mailing list
 HaskellCafe at haskell.org
 http://www.haskell.org/mailman/listinfo/haskellcafe
More information about the HaskellCafe
mailing list