Re: [Haskell-cafe] Known Unknowns

2006-01-26 Thread Chris Kuklewicz
Donald Bruce Stewart wrote:
 haskell:
 There is a new combined benchmark, partial sums that subsumes several 
 earlier
 benchmarks and runs 9 different numerical calculations:

 http://haskell.org/hawiki/PartialSumsEntry
 
 Ah! I had an entry too. I've posted it on the wiki.  I was careful to
 watch that all loops are compiled into nice unboxed ones in the Core. It
 seems to run a little bit faster than your more abstracted code.
 
 Timings on the page.
 
 Also, -fasm seems to only be a benefit on the Mac, as you've pointed out
 previously. Maybe you could check the times on the Mac too?
 
 -- Don
 

Yeah. I had not tried all the compiler options. Using -fasm is slower on this
for me as well.  I suspect that since your code will beat the entries that have
been posted so far, so I thin you should submit it.

Also, could you explain how to check the Core (un)boxing in a note on the (new?)
wiki?  I would be interested in learning that trick.

-- 
Chris
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Known Unknowns

2006-01-26 Thread Donald Bruce Stewart
haskell:
 Donald Bruce Stewart wrote:
  haskell:
  There is a new combined benchmark, partial sums that subsumes several 
  earlier
  benchmarks and runs 9 different numerical calculations:
 
  http://haskell.org/hawiki/PartialSumsEntry
  
  Ah! I had an entry too. I've posted it on the wiki.  I was careful to
  watch that all loops are compiled into nice unboxed ones in the Core. It
  seems to run a little bit faster than your more abstracted code.
  
  Timings on the page.
  
  Also, -fasm seems to only be a benefit on the Mac, as you've pointed out
  previously. Maybe you could check the times on the Mac too?
  
  -- Don
  
 
 Yeah. I had not tried all the compiler options. Using -fasm is slower on this
 for me as well.  I suspect that since your code will beat the entries that 
 have
 been posted so far, so I thin you should submit it.

ok, I'll submit it.
 
 Also, could you explain how to check the Core (un)boxing in a note on the 
 (new?)
 wiki?  I would be interested in learning that trick.

Ah, i just do: ghc A.hs -O2 -ddump-simpl | less
and then read the Core, keeping an eye on the functions I'm interested
in, and checking they're compiling to the kind of loops I'd write by
hand. This is particularly useful for the kinds of tight numeric loops
used in some of the shootout entries.

Cheers,
  Don
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] graphics Windows Programming

2006-01-26 Thread Andrew U. Frank
 
There are several graphics packages to select from... But which one is
the easiest to work  with for students for a ghci - windows environment.


I sense that cairo / gtk2hs does not support ghci. 
From the HOpenGL home page I cannot find out what I would need to
download for a windows environment (can somebody point me to the right
direction?).

We have used SOE under hugs but I sense it is not working with ghci? We
found it also somewhat deficient for graphics beyond the content of the
book - has it been extended and improved?

Any advice greatly appreciated!

Andrew Frank 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] graphics Windows Programming

2006-01-26 Thread Duncan Coutts
On Thu, 2006-01-26 at 14:25 +0100, Andrew U. Frank wrote:
  There are several graphics packages to select from... But which one is
 the easiest to work  with for students for a ghci - windows environment.
 
 
 I sense that cairo / gtk2hs does not support ghci. 

At the moment we can make it work with GHC or with GHCi but not both at
the same time.

The details of the exact problem were described here:
http://sourceforge.net/mailarchive/message.php?msg_id=11297970

If you only want to use it in GHCi and not GHC then you'd be ok. I can
show you what to do.

If it helps, we hope to have this problem solved in GHC 6.4.2 by
allowing Gtk2Hs to use a slightly different list of DLLs with GHCi than
with GHC.

 From the HOpenGL home page I cannot find out what I would need to
 download for a windows environment (can somebody point me to the right
 direction?).

HOpenGL comes with GHC. I've had programs that use Gtk2Hs with HOpenGL
working on windows.

 We have used SOE under hugs but I sense it is not working with ghci? We
 found it also somewhat deficient for graphics beyond the content of the
 book - has it been extended and improved?

The current development version of Gtk2Hs comes with an implementation
of SOE. This has already been used for teaching a university course.

For a more sophisticated graphics API you can use the cairo library that
comes with Gtk2Hs. This provides a monadic API rather than SOE's
expression style API. On the other hand it is far more powerful and can
produce stunning results.

Do get back to me if any of this is of interest to you.

Duncan

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] unary pattern matching

2006-01-26 Thread John Meacham
I have often wanted a shorthand syntax for testing if a value matches a
given pattern. I want to implement such an extension for jhc but can't
decide an appropriate syntax so I thought I'd ask the group. basically I
want something like

/Left (Just _)/   expands to 

\x - case x of
Left (Just _) - True
_ - False

so you can do things like

when (/Just _/ x) $ putStrLn x is something

or 
map /Left (Foo _ 'x')/ xs

to get a list of booleans saying whether the xs match or not.

however, the '/' syntax clearly doesn't work, nor would anything that
conflicts with normal haskell syntax. does anyone have any better ideas?

John



-- 
John Meacham - ⑆repetae.net⑆john⑈ 
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] unary pattern matching

2006-01-26 Thread Taral
On 1/26/06, Donald Bruce Stewart [EMAIL PROTECTED] wrote:
 Something like pattern guards?

 f x | Just _ - x = putStrLn something

These subsume pattern guards...

--
Taral [EMAIL PROTECTED]
Computer science is no more about computers than astronomy is about
telescopes.
-- Edsger Dijkstra
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe