Re: optimization question

2004-02-23 Thread Max Kirillov
On Sun, Feb 22, 2004 at 12:20:35AM -0800, John Meacham wrote:
 case x of 
 foo - Foo
 bar - Bar
 fuzz - Fuzz
 fuzo - Fuzo
 x - other .. thing

 The reason I ask is I am writing someting which will generate large case
 statements like the first form and want to know if I should bother
 pre-optimizing it to the second.
 John

I suppose such things should be made by flex-style generators. Haskell
has one (called Happy); I wonder how efficient it is compared to
hand-written case .. of or if .. = .. scanners. I've heard flex is
at least not worse than hand-written C code.

-- 
Max
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


package name mismatch

2002-07-13 Thread Max Kirillov

Hello!

Building htk, I've got an error:

TestGetPut.hs:6:
Module `GetPut' is located in package `Main'
but its interface file claims it is part of package
`uni-events-test'

It happened (as far as I got) when ghc saw in current path
the *.hi file built for installation. There are some ways to
work around it, but, there was a lot of such places, so can
I just skip the 'package name' check and go as it is?

In

http://www.haskell.org/pipermail/glasgow-haskell-users/2002-January/002849.html

Simon Marlow said that it is a warning. That wold be nice,
but I see an error.

that's ghc-5.02

Max.
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: What isn't possible with Finite Maps, and should be.

2001-11-08 Thread Max Kirillov

On Thu, Nov 08, 2001 at 11:48:44PM +0100, George Russell wrote:
 In any case it looks fairly simple to write.  If only I were set up to be able
 to compile GHC I could write the necessary code myself . . .

There's no need to rebuild the entire ghc system to hack the
data package. You onky need to update HSdata*.{o,a} from
{prefix}/lib/ghc-${VERSION} and *.hi files from import
directory. Just go to ${SOURCES}/hslibs/data and say
make HC=ghc.

I didn't try it to the end, but at least it compiles. You
can also just take all the '*.{,l}hs' files from
hslibs/data.

Max.

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: IO concurrency

2001-10-17 Thread Max Kirillov

 I didn't try ghc-5.02 since I haven't installed it yet.

 Could you do that?  The IO library in 5.00.2 had a bug in fdToHandle
 which meant that it didn't put the file descriptor into non-blocking
 mode, and I suspect this is the cause of your problem.

It works. Thank you.

Max.

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users



Re: IO concurrency

2001-10-15 Thread Max Kirillov

On Mon, Oct 15, 2001 at 04:47:25PM +0100, Simon Marlow wrote:
 I tried this here on Linux/x86 with 5.02 and it seems to work fine.
 Instead of the tcl/tk script you mentioned I used a FIFO in /tmp/fifo
 and made the runProcess just call cat /tmp/fifo.

 Which GHC version and platform is this on?

I test your example. It doesn't work for me. Both for 5.00.1
and 5.00.2. That's glibc-2.0.7/linux-2.2.19/x86 (does it
matter?). Tried both with '-O -fglasgow-exts' and no
options. I't quite stable behavior.

that's what strace told me:

succeeded case:

 cut begin
 gettimeofday({1002682961, 979251}, NULL) = 0
 select(1, [0], [], NULL, {0, 0})= 0 (Timeout)
 gettimeofday({1002682961, 980192}, NULL) = 0
 write(1, tick\n, 5)   = 5
 gettimeofday({1002682961, 981179}, NULL) = 0
 gettimeofday({1002682961, 981525}, NULL) = 0
 select(1, [0], [], NULL, {1, 0})= 0 (Timeout)
 gettimeofday({1002682962, 980292}, NULL) = 0
[skipped]
 select(1, [0], [], NULL, {0, 0})= 0 (Timeout)
 gettimeofday({1002682963, 162}, NULL)   = 0
 write(1, tick\n, 5)   = 5
 gettimeofday({1002682963, 1134}, NULL)  = 0
 gettimeofday({1002682963, 1497}, NULL)  = 0
 select(1, [0], [], NULL, {1, 0})= 0 (Timeout)
 gettimeofday({1002682964, 433}, NULL)   = 0
[skipped..repeated several times]
 select(1, [0], [], NULL, {0, 0})= 0 (Timeout)
 gettimeofday({1002682964, 20740}, NULL) = 0
 write(1, tick\n, 5)   = 5
 gettimeofday({1002682964, 21560}, NULL) = 0
 gettimeofday({1002682964, 21876}, NULL) = 0
 select(1, [0], [], NULL, {1, 0})= 1 (in [0], left {0, 25})
 read(0, qwertrt\n, 8192)  = 8
 write(1, qwertrt\n, 8)= 8
 read(0, 0x8079f80, 8192)= -1 EAGAIN (Resource temporarily 
unavailable)
 gettimeofday({1002682964, 772256}, NULL) = 0
 select(1, [0], [], NULL, {0, 26})   = 0 (Timeout)
 gettimeofday({1002682965, 30227}, NULL) = 0
 select(1, [0], [], NULL, {0, 0})= 0 (Timeout)
 cut end

failed case:

 cut begin
 brk(0x8085000)  = 0x8085000
 write(1, tick\n, 5)   = 5
 gettimeofday({1002682710, 783155}, NULL) = 0
 gettimeofday({1002682710, 783502}, NULL) = 0
 select(0, [], [], NULL, {0, 0}) = 0 (Timeout)
 read(4, click\n, 8192)= 6
 write(1, click\n, 6)  = 6
 read(4, click\n, 8192)= 6
 write(1, click\n, 6)  = 6
 cut end


I didn't try ghc-5.02 since I haven't installed it yet.

Max.

___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users