Re[2]: [Haskell-cafe] runInteractiveCommand: program ends before writing or reading all the output

2008-05-15 Thread Bulat Ziganshin
Hello Olivier, Thursday, May 15, 2008, 11:06:19 PM, you wrote: As I could not find a function to wait on a ThreadId I used a MVar to synchronize both threads. Is this normal or have I missed the `waitOnThreadId` function? yes, it's common idiom -- Best regards, Bulat

Re[2]: [Haskell-cafe] Fun with Darcs

2008-05-14 Thread Bulat Ziganshin
Hello Andrew, Thursday, May 15, 2008, 12:49:32 AM, you wrote: touch. Now, let's see what this IDE actually looks li-- oh you have GOT to be KIDDING me! It can't find the right GTK DLL?!? gtk2hs includes *developer* gtk2 environment. while it should work fine (as far as it's in your path), you

Re: [Haskell-cafe] FFI: newbie linking problem

2008-05-14 Thread Bulat Ziganshin
Hello Olivier, Thursday, May 15, 2008, 1:26:28 AM, you wrote:     RFC_RC _stdcall RfcUTF8ToSAPUC(const RFC_BYTE *utf8, unsigned utf8Length,  SAP_UC *sapuc,   unsigned *sapucSize, unsigned *resultLength, RFC_ERROR_INFO *info)     foreign import ccall unsafe sapnwrfc.h RfcUTF8ToSAPUC    

Re[2]: [Haskell-cafe] saner shootout programs

2008-05-13 Thread Bulat Ziganshin
Hello Richard, Tuesday, May 13, 2008, 7:56:36 PM, you wrote: In July 2007 -O2 was documented in GHC as making no difference to the speed of programs : http://www.haskell.org/pipermail/haskell-cafe/2007-July/029118.html it's because ghc is 15 years old and its documentation may be not

Re: [Haskell-cafe] Data.Dynamic over the wire

2008-05-13 Thread Bulat Ziganshin
Hello Jules, Tuesday, May 13, 2008, 9:39:12 PM, you wrote: This is close, and works as far as it goes. It is a limited reimplementation of Dynamic which uses show/read instead of there are gread/gshow funcs. don't know how these works, though :) -- Best regards, Bulat

Re: [Haskell-cafe] Trying to avoid duplicate instances

2008-05-13 Thread Bulat Ziganshin
Hello Eric, Tuesday, May 13, 2008, 10:16:48 PM, you wrote: -fallow-overlapping-instances doesn't convince GHC. Is there a way around this other than manually writing out all the instances I want? afaik, no. typeclasses are not the same as OOP classes. i suggest you to look into

Re[2]: [Haskell-cafe] Re: Parsec3 performance issues (in relation to v2)

2008-05-13 Thread Bulat Ziganshin
Hello Antoine, Wednesday, May 14, 2008, 8:43:47 AM, you wrote: Is this expected? I don't really understand why adding an extra layer of indirection should speed things up. adding laziness may improve performance by avoiding calculation of unnecessary stuff or moving into into later stage

Re[2]: [Haskell-cafe] Re: Order of Evaluation

2008-05-11 Thread Bulat Ziganshin
Hello Luke, Sunday, May 11, 2008, 1:24:04 PM, you wrote: So.. what do you use unsafePerformIO together with? when i call function that in general case depends on the execution order (so it's type is ...-IO x), but in my specific case it doesn't matter. typical example is hGetContents on config

Re[2]: [Haskell-cafe] Type unions

2008-05-10 Thread Bulat Ziganshin
Hello Eric, Saturday, May 10, 2008, 8:26:27 PM, you wrote: Thank you -- looking at Printf was very helpful. My syntax is much happier as a result. btw, i also recommend to look into HsLua[1] which uses type classes in very smart and elegant way to automatically convert between Haskell and

Re: [Haskell-cafe] seeking advice on my POSIX wrapper

2008-05-10 Thread Bulat Ziganshin
Hello Vasili, Sunday, May 11, 2008, 12:47:52 AM, you wrote: . When I call this function (mqReceive), I get message too long. you can divide-and-conquer the problem by trying 1) write the C code that calls mq_receive with the same params 2) call your own function instead of mq_receive and

Re[2]: [Haskell-cafe] I am new to haskell

2008-05-09 Thread Bulat Ziganshin
Hello Giorgio, Friday, May 9, 2008, 10:40:47 AM, you wrote: be the next one. Should I wait for Real world Haskell or do you think that the books you listed offer something new/different/more advanced than Programming in Haskell? i recommend you to read papers from the

Re[2]: [Haskell-cafe] FFI: Creating a Storable for a C-struct composed of char arrays

2008-05-09 Thread Bulat Ziganshin
Hello Olivier, Friday, May 9, 2008, 6:28:38 PM, you wrote: Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? TString. they are used a lot for interfacing with Win32 API -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] (Num t) = [t] or [Int]

2008-05-09 Thread Bulat Ziganshin
Hello PR, Saturday, May 10, 2008, 1:07:48 AM, you wrote: Okay, when it comes to 3.3:[1,2,3] (Num t) = [t] makes more sense. Is that the only reason? the reason is that 1 as any other numerical constant, may be directly used as Int, Integer, Double or any other Num value. if 1 is Int, you will

Re[2]: [Haskell-cafe] inserting values in a binary tree

2008-05-09 Thread Bulat Ziganshin
Hello PR, Saturday, May 10, 2008, 3:10:59 AM, you wrote: in C you'd fiddle with pointers and Bob's your uncle. Here I'm not sure how to piece that tree back together again with the new element after having expanded it recursively. in Haskell, you just return new tree with element inserted.

Re: [Haskell] [Haskell-cafe] Help with polymorphic functions

2008-05-08 Thread Bulat Ziganshin
Hello Wei, Thursday, May 8, 2008, 11:10:08 PM, you wrote: test :: a - Int - a shift is defined as a - Int - a not exactly ;) this type signature is given inside class Bits, where 'a' isn't a free variable (as in standalone signature declaration), but means 'a' from type class header: class

Re: [Haskell-cafe] Newbie Question: Using Haskell Functions in a C Program

2008-05-08 Thread Bulat Ziganshin
Hello Philip, Friday, May 9, 2008, 2:17:41 AM, you wrote: Is there a way to write some of the functions in Haskell and then use them in my C code via some kind of interface? http://haskell.org/haskellwiki/IO_inside#Interfacing_with_foreign_evil_.28under_development.29 and then entries 1,6,7

Re[2]: [Haskell-cafe] Newbie Question: Using Haskell Functions in a C Program

2008-05-08 Thread Bulat Ziganshin
Hello Philip, Friday, May 9, 2008, 3:09:33 AM, you wrote: Thanks for all the answers. I'm testing this right now and simples cases work as expected. However from what I've read it seems it'll get ugly once I try to pass a C array to a Haskell function.

Re[2]: [Haskell-cafe] runInteractiveProcess and hGetLine on Windows

2008-05-07 Thread Bulat Ziganshin
Hello David, Wednesday, May 7, 2008, 7:46:11 PM, you wrote: I don't see any reason to support text mode. It's easy to filter by hand if you absolutely have to deal with ugly applications on ugly platforms. you mean unix, of course? ;) -- Best regards, Bulat

Re[2]: [Haskell-cafe] Using Template Haskell to make type-safe database access

2008-05-07 Thread Bulat Ziganshin
Hello Mads, Thursday, May 8, 2008, 1:24:05 AM, you wrote: also because TH is difficult. At least TH was difficult for me. It might just be because I have never worked with anything like TH before (have no, TH is dificult by itself. if you have spare time - read about metalua, which implements

Re: [Haskell-cafe] Question related to Multi Param Type Classes

2008-05-05 Thread Bulat Ziganshin
Hello Sai, Monday, May 5, 2008, 7:52:29 PM, you wrote: class MyString m c  where it should be class MyString m c | m-c where so ghc will realize that same m means the same c. read about functional dependencies in ghc user manual -- Best regards, Bulat

Re: [Haskell-cafe] castIOUArray and hPutArray redux

2008-05-02 Thread Bulat Ziganshin
Hello Ben, Saturday, May 3, 2008, 5:13:48 AM, you wrote: have the issues with castIOUArray (and thus hGetArray, hPutArray) in Data.Array.IO discussed below been resolved? there is alternative arrays library [1], where bounds are recalculated when casting [1]

Re: [Haskell-cafe] force inlining in GHC

2008-04-29 Thread Bulat Ziganshin
Hello Henning, Tuesday, April 29, 2008, 2:01:39 PM, you wrote: However, in the Core output 'doubleFunc' does not get the __inline_me tag and thus will not be inlined, too. :-( ghc is so smart that sometimes it fool itself :D i bet that in this case generic and specific functions are

Re: [Haskell-cafe] Haskell as a general purpose programming language...

2008-04-28 Thread Bulat Ziganshin
Hello Martin, Monday, April 28, 2008, 3:51:11 PM, you wrote: just a thought: is it just me, or is Haskell really really really the coolest general-purpose programming language? the only Haskell drawback is that it forces you to hate all other programming languages (c) people :) -- Best

Re: [Haskell-cafe] FFI Query: How to free a CString allocated in Haskell

2008-04-28 Thread Bulat Ziganshin
Hello Verma, Monday, April 28, 2008, 4:11:51 PM, you wrote: newCString str Now once I call this function from C code, I am freeing the allocated memory using free function. I want to confirm that this is the right thing to do. yes, i've traced this function down to mallocArray -

Re[2]: [Haskell-cafe] n00b circular dep question

2008-04-26 Thread Bulat Ziganshin
Hello Stuart, Saturday, April 26, 2008, 1:57:47 PM, you wrote: Are you sure? I would be very interested in a switch that automatically generates hs-boot files, but I've been unable to find any mention of it. no, i never used this function, so you should be informed better -- Best regards,

Re: [Haskell-cafe] n00b circular dep question

2008-04-25 Thread Bulat Ziganshin
Hello Jennifer, Friday, April 25, 2008, 8:54:42 PM, you wrote: So, I have a circular dependency in my modules that I don't know how to resolve in Haskell. 1. haskell standard allows circular deps between modules 2. ghc supports this part of standard in a rather awkward way - you need to

Re: a faster, accumulating mapM (was Re: [Haskell-cafe] mapM vs mapM_ performance)

2008-04-24 Thread Bulat Ziganshin
Hello Ben, Friday, April 25, 2008, 1:14:17 AM, you wrote: mapM2 :: Monad m = (a - m b) - [a] - m [b] {-# INLINE mapM2 #-} mapM2 fn lst = mapM2accum fn lst [] where mapM2accum _ [] accum = return accum mapM2accum fn (x:xs) accum = do r - fn x mapM2accum

Re[2]: a faster, accumulating mapM (was Re: [Haskell-cafe] mapM vs mapM_ performance)

2008-04-24 Thread Bulat Ziganshin
Hello Niklas, Friday, April 25, 2008, 1:25:39 AM, you wrote: Not that it should matter for performance any, but you really ought to reverse the result list too, or compute the accumulator in the right order. :-) unfortunately, this affects performance too. reverse costs one more scan through

Re[2]: [Haskell-cafe] Storable class?

2008-04-22 Thread Bulat Ziganshin
Hello Evan, Wednesday, April 23, 2008, 1:48:30 AM, you wrote: The FFI doc doesn't really talk about the alignment method at all, so I don't really understand how to write one or how it's used. write: easy. just specify how much data shoulkd be aligned. for primitive datatypes this usually

Re: [Haskell-cafe] Functional board games

2008-04-21 Thread Bulat Ziganshin
Hello Dougal, Monday, April 21, 2008, 7:22:49 PM, you wrote: Does anyone know of functional-style implementations of chess/draughts/go/anything else that might give me ideas? I am writing once we have seen 100-line chess published in this list -- Best regards, Bulat

Re[4]: [Haskell-cafe] C++ interface with Haskell

2008-04-20 Thread Bulat Ziganshin
Hello Don, Saturday, April 19, 2008, 12:08:11 AM, you wrote: Would someone like to summarise the current approaches to combining Haskell C++ on the Haskell wiki, even if just in bullet points? started at http://haskell.org/haskellwiki/IO_inside#Interfacing_with_foreign_evil -- Best

Re[2]: [Haskell-cafe] Parallel weirdness [new insights]

2008-04-20 Thread Bulat Ziganshin
Hello Andrew, Sunday, April 20, 2008, 11:41:52 PM, you wrote: yes, GC behavior has significant impact on any new language (i mean java, c#, f# and so on) 1. Does running the GC force all threads to stop? I know some GC designs do this, but I have no idea how the one GHC implements works. yes

Re: [Haskell-cafe] Parallel weirdness

2008-04-19 Thread Bulat Ziganshin
Hello Andrew, Saturday, April 19, 2008, 6:56:10 PM, you wrote: OK, so just for fun, I decided to try implementing a parallel merge sort coincedence - now i'm writing a parallel compression algorithm, very much like parallel bzip2, but using ghc, of course Weird thing #1: The first time you

Re[2]: [Haskell-cafe] Parallel weirdness

2008-04-19 Thread Bulat Ziganshin
Hello Andrew, Saturday, April 19, 2008, 7:50:30 PM, you wrote: this looks like disk caching effects. if data are read from disj on first run and from disk cache on the next runs, this only means that your algorithm works faster than reading its data from disk Negative. No data is ever

Re[2]: [Haskell-cafe] Parallel weirdness

2008-04-19 Thread Bulat Ziganshin
Hello Brandon, Saturday, April 19, 2008, 8:24:03 PM, you wrote: contention. (Note that resource locking will be done by the threaded runtime even with only one thread, so you will see some slowdowns especially in I/O-related code.) yes, i forget about this. Simon wrote once that locking

Re[2]: [Haskell-cafe] Hackage being too strict?

2008-04-18 Thread Bulat Ziganshin
Hello Duncan, Friday, April 18, 2008, 1:43:24 PM, you wrote: older Cabal versions). We can make it stricter again in the future when Cabal-1.4+ is much more widely deployed. the problem, imho, is that such tools as Cabal, GHC, Hackage should be built with forward and backward compatibility in

Re[2]: [Haskell-cafe] compressed pointers?

2008-04-18 Thread Bulat Ziganshin
Hello Ketil, Friday, April 18, 2008, 10:44:53 AM, you wrote: This probably becomes too complicated, but I thought it was interesting that the Java people are making use of 32bit pointers on a 64bit system, and are seeing a good performance benefit from it. afaik, C compilers support this

Re[2]: [Haskell-cafe] C++ interface with Haskell

2008-04-18 Thread Bulat Ziganshin
Hello Miguel, Friday, April 18, 2008, 7:06:07 PM, you wrote: you may look into my freearc.org project overall, nothing complex as far as you got it :) i use ghc -c c_file.cpp ghc --make main.hs c_file.o in order to call from C++ to Haskell or vice versa you should define function in C++ as

Re[2]: [Haskell-cafe] C++ interface with Haskell

2008-04-18 Thread Bulat Ziganshin
Hello Isaac, Friday, April 18, 2008, 7:27:56 PM, you wrote: absolutely true! it's required if you use new/delete and other things supported by c++ RTS if you'd normally be linking using g++, you'll need (IIRC) -lstdc++ added to linking-ghc's command line Alfonso Acosta wrote: Although you

Re[2]: [Haskell-cafe] announce: Glome.hs-0.3 (Haskell raytracer)

2008-04-18 Thread Bulat Ziganshin
Hello Jim, Saturday, April 19, 2008, 12:10:23 AM, you wrote: The other problem I had with concurrency is that I was getting about a 50% speedup instead of the 99% or so that I'd expect on two cores. I 2 cores doesn't guarantee 2x speedup. some programs are limited by memory access speed and

Re: [Haskell-cafe] Intro to functional dependencies in Haskell?

2008-04-17 Thread Bulat Ziganshin
Hello Alexis, Thursday, April 17, 2008, 9:21:16 AM, you wrote: i'm having some trouble 'getting' functional dependencies in the Haskell ghc 6.8 manual contains good introduction into FDs -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re[2]: [Haskell-cafe] GC'ing file handles and other resources

2008-04-16 Thread Bulat Ziganshin
Hello Abhay, Wednesday, April 16, 2008, 9:30:34 AM, you wrote: i think it will not work with current ghc GC - it scans entire memory/nursery when garbage collected so anyway you will need to wait until next GC event occurs Your mail gives me an idea, though I am not an iota familiar with

Re[4]: [Haskell-cafe] GC'ing file handles and other resources

2008-04-16 Thread Bulat Ziganshin
minor GC will become as slow as major ones Generational garbage collection for Haskell http://research.microsoft.com/~simonpj/Papers/gen-gc-for-haskell.ps.gz Regards, Abhay On Wed, Apr 16, 2008 at 11:55 AM, Bulat Ziganshin [EMAIL PROTECTED] wrote: Hello Abhay, Wednesday, April 16, 2008

Re[2]: [Haskell-cafe] looking for examples of non-full Functional Dependencies

2008-04-16 Thread Bulat Ziganshin
Hello Martin, Wednesday, April 16, 2008, 7:06:07 PM, you wrote: i'm not 100% sure that you'll find there appropriate examples but i suggest you too look into http://haskell.org/haskellwiki/Library/Streams where i've used very sophisticated (for me) FDs We're also looking for (practical)

Re: [Haskell-cafe] monadic debugging

2008-04-15 Thread Bulat Ziganshin
Hello Vasili, Wednesday, April 16, 2008, 2:53:32 AM, you wrote: I have an Linux executable of my Haskell library and test case. I see there are several debuggers, e.g. Buddha, Hat, etc. Which debugger is currently preferred for monadic (imperative) code? Thanks. i use print mainly :)

Re[2]: [Haskell-cafe] ANNOUNCE: Generic Haskell 1.80 (Emerald)

2008-04-12 Thread Bulat Ziganshin
Hello Miguel, Saturday, April 12, 2008, 5:54:45 PM, you wrote: How come I haven't ever heard about such a thing?! it's an overview of generic haskell programming systems: http://dfa.imn.htwk-leipzig.de/~waldmann/draft/meta-haskell/second.pdf ask here about final version of this paper -- Best

Re[3]: [Haskell-cafe] ANNOUNCE: Generic Haskell 1.80 (Emerald)

2008-04-12 Thread Bulat Ziganshin
Hello Bulat, Saturday, April 12, 2008, 6:10:04 PM, you wrote: it's an overview of generic haskell programming systems: found longer paper myself: Comparing Approaches to Generic Programming in Haskell http://www.cs.uu.nl/~johanj/publications/ComparingGP.pdf -- Best regards, Bulat

Re: [Haskell-cafe] Haskell library install question

2008-04-10 Thread Bulat Ziganshin
Hello Vasili, Thursday, April 10, 2008, 6:12:45 PM, you wrote: Registering unix-2.2.0.0... In what sense is it being registered? Can I query this registry information? ghc-pkg -- Best regards, Bulatmailto:[EMAIL PROTECTED]

Re[4]: [Haskell-cafe] deriving

2008-04-08 Thread Bulat Ziganshin
Hello Hans, Tuesday, April 8, 2008, 12:17:38 PM, you wrote: deriving which I think is not used elsewhere. It will break a lot of code, but it is easy to change, and also easy to make a compatibility mode. it's also easy to replace all the books, update all code repositories and reteach all

Re: [Haskell-cafe] announcing the darcs 2.0.0 release

2008-04-07 Thread Bulat Ziganshin
Hello David, Monday, April 7, 2008, 9:22:25 PM, you wrote: * I'm sure there are other new features, but this is all that comes to mind at the moment. there was some issues with efficiency of darcs 1.x. am i correctly understood that these issues was not addressed by new release? its hard

Re[2]: [Haskell-cafe] deriving

2008-04-07 Thread Bulat Ziganshin
Hello Hans, Tuesday, April 8, 2008, 2:28:53 AM, you wrote: At least Hugs complains if one does not indent deriving ..., but I do not know what the standard says. If is required, then it can be changed. deriving is a part of data clause and indentation just allows us to continue clause from

Re: [Haskell-cafe] ANNOUNCE: Well-Typed LLP - The Haskell Consultants

2008-04-06 Thread Bulat Ziganshin
Hello Ian, Monday, April 7, 2008, 2:50:02 AM, you wrote: We (Bjorn Bringert, Duncan Coutts and Ian Lynagh) are pleased to announce that we have recently set up a Haskell consultancy company, Well-Typed LLP (http://www.well-typed.com/). my congrats! seems you are first in this business :)

Re: [Haskell-cafe] Re: Function Precedence

2008-04-03 Thread Bulat Ziganshin
Hello Chris, Thursday, April 3, 2008, 6:07:53 PM, you wrote: On the other hand, I have enough time already trying to explain Num, Fractional, Floating, RealFrac, ... to new haskell programmes. I'm not sure it's an advantage if someone must learn the meaning of an additive commutative

Re: [Haskell-cafe] compile-time question

2008-04-03 Thread Bulat Ziganshin
Hello Galchin, Friday, April 4, 2008, 2:50:42 AM, you wrote: 3) runhaskell Setup.hs install    I write a small test case that references one of the new functions; however, when I build the test case, I get an Out of scope message indicated that at ghc(i) compile time the new function

Re: [Haskell-cafe] FW: Haskell

2008-04-01 Thread Bulat Ziganshin
Hello Simon, Tuesday, April 1, 2008, 2:18:25 PM, you wrote: How can one answer the question--why choose Haskell over Scheme? 1. static typing with type inference - imho, must-be for production code development. as many haskellers said, once compiler accept your program, you may be 95% sure

Re: [Haskell-cafe] [Newbie] Problem with Data.Map (or something else ?)

2008-03-31 Thread Bulat Ziganshin
Hello Bruno, Monday, March 31, 2008, 7:51:43 PM, you wrote: I've written the following program... Which does not end in a reasonable time :( My algorithm seems ok to me but I see that memory consumption is gigantic... Is this a memory problem with Data.Map ? Or an infinite loop ? (Where ?)

Re: [Haskell-cafe] lexicographic order

2008-03-30 Thread Bulat Ziganshin
Hello Simeon, Monday, March 31, 2008, 12:45:54 AM, you wrote: The latter specifies a lexicographic order: Constructors are ordered by the order of their appearance the data declaration, and the arguments of a constructor are compared from left to right. Although I have tried to make sense

Re[2]: [Haskell-cafe] lexicographic order

2008-03-30 Thread Bulat Ziganshin
Hello Bulat, Monday, March 31, 2008, 1:16:35 AM, you wrote: if you can compare chars and 'a' 'b', then *lists* of chars compared in lexicographic order will be aaa aab aab aba baa abb as it was mentioned by Niklas Broberg, the last sentence should be reversed: abb baa sorry for +1

[Haskell-cafe] [gsoc] mingw64 ghc port

2008-03-28 Thread Bulat Ziganshin
Hello haskell-cafe, it's probably a bit too late, but i recalled that there is one project that will be very useful - it's porting ghc to mingw64 platform, allowing it to generate 64-bit windows platforms. may be someone will find it interesting -- Best regards, Bulat

Re[2]: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-27 Thread Bulat Ziganshin
Hello Andrew, Thursday, March 27, 2008, 12:27:47 PM, you wrote: plus a b = unsafePerformIO (modifyIORef counter (+1)) `seq` a+b Erm... might it be better to use an MVar? (To avoid lost updates if there are multiple render threads.) you are right, IORef is appropriate only for single-threaded

Re: [Haskell-cafe] MonadMemory class

2008-03-27 Thread Bulat Ziganshin
Hello Ariel, Friday, March 28, 2008, 1:02:39 AM, you wrote: class (Monad m) = MonadMemory m r | m - r where there are more than one way to define such class. look at http://haskell.org/haskellwiki/Library/ArrayRef for examples -- Best regards, Bulatmailto:[EMAIL

Re: [Haskell-cafe] No newlines in the whitespace for Parsec lexeme parsers

2008-03-26 Thread Bulat Ziganshin
Hello Paul, Wednesday, March 26, 2008, 2:32:53 PM, you wrote: I'm looking to parse a Fortran dialect using Parsec, and was afair, some months ago BASIC parsing was discussed here. the first solution one can imagine is to add preprocessing stage replacing line ends with ';'-alike -- Best

Re: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Bulat Ziganshin
Hello Andrew, Wednesday, March 26, 2008, 3:37:53 PM, you wrote: type of your own, you just need to write your own instance. The thing that makes me suspicious of this logic is the absense of an instance for tuples. Any insights here? and even insiders :) i've rewrote arrays library to be

Re[2]: [Haskell-cafe] Unboxed arrays

2008-03-26 Thread Bulat Ziganshin
Hello Jed, Wednesday, March 26, 2008, 7:02:28 PM, you wrote: StorableArray. Unfortunately there is a performance hit to using Storable versus the built in unboxed types. are you sure? it was in ghc 6.4, now afair they should be the same. look in

Re: [Haskell-cafe] announce: Glome.hs raytracer

2008-03-26 Thread Bulat Ziganshin
Hello Jim, Thursday, March 27, 2008, 12:33:20 AM, you wrote: -Multi-core parallelism is working, but not as well as I'd expect: I get about a 25% reduction in runtime on two cores rather than 50%. I split this may be an effect of limited memory bandwidth -Memory consumption is atrocious:

Re: [Haskell-cafe] True parallelism missing :-(

2008-03-25 Thread Bulat Ziganshin
Hello Dusan, Tuesday, March 25, 2008, 3:47:50 PM, you wrote: (smp). The truth is that only the first one exploits multicore CPU. Why? +RTS -N2 -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing

Re: [Haskell-cafe] SoC project: Python-Haskell bridge - request for feedback

2008-03-24 Thread Bulat Ziganshin
Hello Michal, Monday, March 24, 2008, 11:38:07 PM, you wrote: Python-Haskell bridge seems interesting Benefits for Haskell you forget about ability to use Python as scripting language inside Haskell programs. look at HsLua library as example of this -- Best regards, Bulat

Re[2]: [Haskell-cafe] SoC project: Python-Haskell bridge - request for feedback

2008-03-24 Thread Bulat Ziganshin
Hello Dan, Tuesday, March 25, 2008, 1:29:51 AM, you wrote: you forget about ability to use Python as scripting language inside Haskell programs. look at HsLua library as example of this This is much less interesting for those (like me) who, once in Haskell, don't feel the least inclined to

Re: [Haskell-cafe] [GSoC] Plugins for GHC

2008-03-22 Thread Bulat Ziganshin
Hello Max, Saturday, March 22, 2008, 1:23:37 AM, you wrote: around with modifying GHC itself. Potential use cases are: * And whatever clever ideas the community comes up with! i'm interested in syntax macros feature like metalua -- Best regards, Bulat

Re: [Haskell-cafe] Dynamic typing makes you more productive?

2008-03-18 Thread Bulat Ziganshin
Hello Justin, Tuesday, March 18, 2008, 7:41:15 PM, you wrote: is probably the wrong thing to do. Static typing makes it harder to maintain software because it's harder to change it. Two years ago I would have agreed with that statement. Now - no way. f few weeks ago i made a post to main

Re[2]: [Haskell-cafe] floating point operations and representation

2008-03-17 Thread Bulat Ziganshin
Hello David, Monday, March 17, 2008, 7:59:09 PM, you wrote: foreign import ccall unsafe math.h log10 c_log10 :: CDouble - CDouble log10 :: Double - Double log10 x = realToFrac (c_log10 (realToFrac x)) It's a bit sloppier, but shouldn't cause any trouble. And I've no

Re[2]: [Haskell-cafe] Problem making a program in ghc

2008-03-14 Thread Bulat Ziganshin
Hello Sterling, Friday, March 14, 2008, 7:06:24 AM, you wrote: yes, it's another question. my own program also writes to logfile and it got lock-free only when i've switched to using my own IO routines This answer may be way off base, but if differences appear between ghci and compiled

Re: [Haskell-cafe] File I/O question

2008-03-13 Thread Bulat Ziganshin
Hello Andrew, Wednesday, March 12, 2008, 10:06:44 PM, you wrote: When I write to a file using System.IO, the file is locked for exclusive access. I gather this is as specified in the Haskell Report. Which is nice, but... I'd actually prefer the file to *not* be locked. Anybody know how to

Re[2]: [Haskell-cafe] Re: (flawed?) benchmark : sort

2008-03-10 Thread Bulat Ziganshin
Hello Adrian, Monday, March 10, 2008, 2:00:18 PM, you wrote: instance Ord Foo where compare (Foo a _) (Foo b _) = compare a b I would consider such an Ord instance to be hopelessly broken, and I h. for example, imagine files in file manager sorted by size or date -- Best regards,

Re[2]: [Haskell-cafe] Graphical graph reduction

2008-02-25 Thread Bulat Ziganshin
Hello dainichi, Monday, February 25, 2008, 2:46:20 AM, you wrote: Jersey. (Sorry, this will probably make me unpopular here on Haskell-cafe, but the ability to use references was just too tempting, and I'm not too experienced with purely functional data structures). we have references,

Re: [Haskell-cafe] how to catch keyboard interrupts?

2008-02-23 Thread Bulat Ziganshin
Hello Uwe, Saturday, February 23, 2008, 11:35:35 PM, you wrote: mysighandler = Catch (do hPutStrLn stderr caught a signal! fail Interrupt!) scheme calculation doesn't get interrupted at all! I see in the System.Posix.Signals documentation that the signal handler gets invoked

Re: [Haskell-cafe] Graphical graph reduction

2008-02-22 Thread Bulat Ziganshin
Hello dainichi, Friday, February 22, 2008, 6:55:54 PM, you wrote: If nothing similar exists, I was thinking about creating such a tool (i.e. an interpreter with additional graph-displaying features) not exactly this, but now i'm reading introduction into Q language [1] which says on p.11 The

Re[2]: [Haskell-cafe] A little toy of Haskell Trivia

2008-02-21 Thread Bulat Ziganshin
Hello Wolfgang, Thursday, February 21, 2008, 2:45:43 AM, you wrote: I proudly announce a little toy that lists the frequency of modules being imported by other modules. Do you know Control.Monad is the most frequently imported module? I did not! This doesn’t surprise me very much. What

[Haskell-cafe] Haskell + Windows Mobile?

2008-02-21 Thread Bulat Ziganshin
Hello haskell-cafe, is there any haskell implementation for Windows Mobile? does they are support creation of GUI apps and internet networking features? -- Best regards, Bulat mailto:[EMAIL PROTECTED] ___ Haskell-Cafe

Re[2]: [Haskell-cafe] question about STM and IO

2008-02-21 Thread Bulat Ziganshin
Hello Ryan, Thursday, February 21, 2008, 5:02:52 AM, you wrote: values, determine that x = y, and just return (), but it's too late, the missiles have already been launched. it seems that asymmetrical answer of mr.Putin is just to hire a bit more Haskell Hackers :) -- Best regards, Bulat

Re: [Haskell-cafe] question about STM and IO

2008-02-20 Thread Bulat Ziganshin
Hello John, Tuesday, February 12, 2008, 9:28:22 PM, you wrote: I was recently looking at the STM library, and I have a question about the function unsafeIOToSTM. Can anyone explain to me what is unsafe about it, and what sort of use would be considered safe? STM operations can be repeated if

Re: [Haskell-cafe] Haddock documentation of Data.Array.* is confusing

2008-02-20 Thread Bulat Ziganshin
Hello Alfonso, Tuesday, February 12, 2008, 11:32:20 PM, you wrote: Excuse me for the subject, but IMHO is absolutely true. Anyhow, the of course, you are right, but for practical goals i may suggest just to read module sources instead of reading [had]docs. seeing the implementation is much

Re: [Haskell-cafe] I love purity, but it's killing me.

2008-02-08 Thread Bulat Ziganshin
Hello Tom, Friday, February 8, 2008, 9:33:35 AM, you wrote: The process of converting an expression tree to a graph uses either Eq or Ord (either derived or a custom instance) to search and build a set of unique nodes to be ordered for execution. in similar situation, i've added hash field

Re[4]: [Haskell-cafe] Signature for non-empty filter

2008-02-07 Thread Bulat Ziganshin
Hello Henning, Thursday, February 7, 2008, 12:29:02 AM, you wrote: it's impossible to check for *arbitrary* function call whether it will be terminated. seems that you don't have formal CS education? :) so one can develop set of functions that are guaranteed to be terminated or guaranteed

Re[2]: [Haskell-cafe] Mutable arrays

2008-02-07 Thread Bulat Ziganshin
Hello Jeff, Thursday, February 7, 2008, 1:31:59 AM, you wrote: I noticed that GHC implements mutable arrays in the IO monad.  This seems odd to me.  Arrays aren't related to IO.  IO monad isn't only about I/O but about imperative stuff in general. there is also special monad limited to

Re[2]: [Haskell-cafe] Signature for non-empty filter

2008-02-07 Thread Bulat Ziganshin
Hello Dan, Thursday, February 7, 2008, 4:04:03 AM, you wrote: I.e., it's not necessary to restrict the class of functions you consider if you're willing to give up on full automation. So I disagree with the only if below. ok, read this as computer can ensure..., because it was exactly the

Re[2]: [Haskell-cafe] Mutable arrays

2008-02-07 Thread Bulat Ziganshin
Hello Jeff, Thursday, February 7, 2008, 4:17:27 AM, you wrote: logical place for mutable arrays.  However, I don't understand the motivation for implementing it in IO.  Were mutable arrays added to IO because it would be difficult to write code that does both IO and manipulates arrays

Re: [Haskell-cafe] background question about IO monad

2008-02-06 Thread Bulat Ziganshin
Hello Uwe, Wednesday, February 6, 2008, 7:44:27 AM, you wrote: But after that, it sure seems to me as if I've taken data out of the IO monad... this means that you can't use results of IO actions in pure functions. your code works in some transformed version of IO monad, so you don't escaped

Re[2]: [Haskell-cafe] Signature for non-empty filter

2008-02-06 Thread Bulat Ziganshin
Hello Henning, Wednesday, February 6, 2008, 5:09:56 PM, you wrote: Is Haskell's type system including extensions strong enough for describing a function, that does not always return a trivial value? E.g. (filter (\x - x==1 x==2)) such things may be detected by (too) smart compiler,

Re[3]: [Haskell-cafe] Signature for non-empty filter

2008-02-06 Thread Bulat Ziganshin
Hello Henning, Wednesday, February 6, 2008, 6:09:28 PM, you wrote: it's another question: you can describe trivial values using type system, but can't prohibit them using it - it's impossible because you can't check for arbitrary algorithm whether it will be finally stopped I could consider

Re[2]: [Haskell-cafe] Haskell maximum stack depth

2008-02-05 Thread Bulat Ziganshin
Hello Matthew, Monday, February 4, 2008, 11:45:51 PM, you wrote: That would be nice. But its only beneficial if there are programs which takes large amounts of stack at some point, but then shrink down to very little stack and continue for a reasonable amount of time. From the 'when I was a

Re[2]: [Haskell-cafe] bimap 0.2

2008-02-05 Thread Bulat Ziganshin
Hello Neil, Tuesday, February 5, 2008, 1:11:47 PM, you wrote: insert x y = delete x deleteR y unsafeInsert x y i use the following trick: (.$) = flip ($) insert x y it = it.$ delete x .$ deleteR y .$ unsafeInsert x y -- Best

Re: [Haskell-cafe] Signature for non-empty filter

2008-02-05 Thread Bulat Ziganshin
Hello Henning, Tuesday, February 5, 2008, 6:01:27 PM, you wrote: Is Haskell's type system including extensions strong enough for describing a function, that does not always return a trivial value? E.g. (filter (\x - x==1 x==2)) such things may be detected by (too) smart compiler, but in

Re[2]: [Haskell-cafe] Mutable arrays

2008-02-05 Thread Bulat Ziganshin
Hello Jeff, Tuesday, February 5, 2008, 7:36:27 PM, you wrote: Changing the subject slightly, I once wrote code in Concurrent Clean that filtered a file that was larger than the available memory on my PC.  Is this possible with Monads in Haskell?  google for simple unix tools -- Best

Re[2]: [Haskell-cafe] Haskell maximum stack depth

2008-02-05 Thread Bulat Ziganshin
Hello Adrian, Tuesday, February 5, 2008, 10:15:59 PM, you wrote: i would be also happy if ghc will return unused *heap* memory back to OS - it's immediately required for my GUI program where users may open huge files and then close them. but i personally don't have the same need for *stack*

Re[2]: [Haskell-cafe] A handy little consequence of the Cont monad

2008-02-01 Thread Bulat Ziganshin
Hello Conor, Saturday, February 2, 2008, 1:29:02 AM, you wrote: nest = ala Cont traverse id Third-order: it's a whole other order. oh! i remember faces of my friends when i showed them something like sortOn snd . zip [0..]. probably i have the same face now :))) -- Best regards, Bulat

Re[2]: [Haskell-cafe] Implementing fixed-sized vectors (using datatype algebra?)

2008-01-31 Thread Bulat Ziganshin
Hello Henning, Thursday, January 31, 2008, 5:49:23 PM, you wrote: I remember that type-level arithmetic is already implemented somewhere, certainly more than once, but certainly seldom in a nicely packaged form. one more: darcs get --partial --tag '0.1'

Re: Cryptographic hash uniquness (was [Haskell-cafe] Simple network client)

2008-01-31 Thread Bulat Ziganshin
Hello Peter, Thursday, January 31, 2008, 8:01:36 PM, you wrote: files with different content generating the same hash)... My intuition told me that the odds of two cryptographic hashes (on meaningful content) colliding was much less than the earth being destroyed by an asteroid... But this

Re: [Haskell-cafe] data and classes question

2008-01-29 Thread Bulat Ziganshin
Hello Chaim, Tuesday, January 29, 2008, 7:26:25 PM, you wrote: your approach is completely wrong (OOP-inspired, but haskell isn't OOP language). type class is common interface to different types. just for example: data BinState = On | Off data BinChange = OnToOff | OffToOn class MinValue a

Re[2]: The programming language market (was Re: [Haskell-cafe] Why functional programming matters

2008-01-27 Thread Bulat Ziganshin
Hello Paul, Saturday, January 26, 2008, 11:03:30 PM, you wrote: * Say computers are cheap but programmers are expensive whenever explaining a correctness or productivity feature. This is true only if talking to people in high-income nations. Even in low-income nations, its only

<    4   5   6   7   8   9   10   11   12   13   >