Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Andrea Rossato
On Wed, Mar 04, 2009 at 10:59:53PM -0500, Brandon S. Allbery KF8NH wrote: On 2009 Mar 4, at 21:40, Magicloud Magiclouds wrote: Could someone give me a sample or something I could learn from? Thanks. (xmobar is open source, you could look through its source) xmobar is not open source. xmobar

Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?

2009-03-05 Thread Andrea Rossato
On Thu, Mar 05, 2009 at 12:50:20PM -0500, Brandon S. Allbery KF8NH wrote: On 2009 Mar 5, at 8:21, Andrea Rossato wrote: xmobar is not open source. xmobar is FREE software! I don't do fundamentalist religion... qualifying as fundamentalism the avoidance of cheap marketing strategies is just

[Haskell-cafe] ANNOUNCE: hs-bibutils-0.1

2008-12-27 Thread Andrea Rossato
://code.google.com/p/citeproc-hs/issues Hope you'll enjoy, Andrea Rossato [1] http://www.scripps.edu/~cdputnam/software/bibutils/ [2] http://code.haskell.org/citeproc-hs/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo

[Haskell-cafe] ANNOUNCE: citeproc-hs-0.2

2008-12-27 Thread Andrea Rossato
by Zotero for bibliographic style formatting, and a huge number of CSL styles have been developed by the Zotero community. More information, with installation instructions, can be found here: http://code.haskell.org/citeproc-hs/ Hope you'll enjoy, Andrea Rossato [1] http://code.haskell.org/hs-bibutils

Re: [Haskell-cafe] Can my type be allowed as return type in FFI?

2008-12-10 Thread Andrea Rossato
On Wed, Dec 10, 2008 at 12:30:56PM +, Duncan Coutts wrote: If do recommend reading the FFI spec. It's quite readable and explains a lot of the issues. Getting familiar with the Foreign libraries will help too. The most important bits are understanding ForeignPtr and the Storable class. I

Re: [Haskell-cafe] FFI, TH or GHCI, foreign bindings and the linker(s)

2008-12-09 Thread Andrea Rossato
For later reference: I created a minimal test case to illustrate the issue and moved to the (hopefully) more appropriate glasgow-haskell-users list: http://www.haskell.org/pipermail/glasgow-haskell-users/2008-December/016312.html cheers, andrea On Sun, Dec 07, 2008 at 07:08:28PM +0100, Andrea

[Haskell-cafe] FFI, TH or GHCI, foreign bindings and the linker(s)

2008-12-07 Thread Andrea Rossato
Hello, I know that this is somehow a recurring question, still the archives have not been helpful for finding a working solution. I'm writing the bindings[1] to bibutils[2], a set of utilities for converting from and to different bibliographic databases (MODS, bibtex, etc.). bibutilis uses a

[Haskell-cafe] handles and foreign C functions

2008-12-03 Thread Andrea Rossato
Hello, suppose a simple C function like this: void printStuff(FILE *f) { fprintf (f, Hello World\n); } In order to use it I need to import fopen and pass to it a Ptr CFile: foreign import ccall unsafe fopen fopen :: CString - CString - IO (Ptr CFile) foreign import ccall unsafe fclose

Re: [Haskell-cafe] handles and foreign C functions

2008-12-03 Thread Andrea Rossato
On Wed, Dec 03, 2008 at 07:08:00PM +0300, Bulat Ziganshin wrote: Hello Andrea, Wednesday, December 3, 2008, 5:09:21 PM, you wrote: How can I pass to printStuff a stdout FILE pointer? afair, stdout syntax used to import variables. it was discussed just a day or two ago :) you mean

Re: [Haskell-cafe] handles and foreign C functions

2008-12-03 Thread Andrea Rossato
Hello Bulat, On Wed, Dec 03, 2008 at 07:26:39PM +0300, Bulat Ziganshin wrote: either some error in the code (i neevr used this feature) or stdout may be defile by a macro. the second you said: /* C89/C99 say they're macros. Make them happy. */ (from stdio.h) can you try to define

Re: [Haskell-cafe] global variables for foreign C functions

2008-12-02 Thread Andrea Rossato
On Mon, Dec 01, 2008 at 05:30:33PM -0800, Judah Jacobson wrote: You can limit the size of that stub file using: foreign import ccall progname progname :: Ptr (Ptr CChar) which lets you access that global variable and write the getters/setters in Haskell rather than C. this solves my

[Haskell-cafe] global variables for foreign C functions

2008-12-01 Thread Andrea Rossato
Hello, I'm writing the bindings to a C library which uses, in some functions, global variables. To make it clearer, those functions need a global variable to be defined. A C program using my_function, one of the library functions, would look like: char progname[] = a_program_name; int main(

Re: [Haskell-cafe] ANNOUNCE: citeproc-hs, a Haskell implementation of the Citation Style Language designed for Pandoc

2008-09-22 Thread Andrea Rossato
Hi Gwern, On Fri, Sep 19, 2008 at 09:01:46PM -0400, Gwern Branwen wrote: Hi Andrea. So I was looking at the README. Does citeproc-hs only support adding refs from a .xml file when one's written in Pandoc markdown? That is, I don't see how I could take a .lhs file and a .bib file and produce

Re: [Haskell-cafe] system in forkIO

2008-09-14 Thread Andrea Rossato
On Sun, Sep 14, 2008 at 02:24:23PM -0300, Marco Túlio Gontijo e Silva wrote: and the result of ls only after I press a key. Does getChar blocks the other threads? yes, but you can use forkOS from Control.Concurrent and compile with -threaded. See the relevant documentation for the details.

[Haskell-cafe] ANNOUNCE: citeproc-hs, a Haskell implementation of the Citation Style Language designed for Pandoc

2008-09-13 Thread Andrea Rossato
and suggestions that made it possible to come to something usable. John MacFarlane, the author of Pandoc, has been very supportive of the project and provided a lot of useful feed back, comments and suggestions. Hope you'll enjoy, Andrea Rossato

[Haskell-cafe] Hackage checks

2008-09-13 Thread Andrea Rossato
Hi, the Hackage upload script performs some checks on the packages being uploaded. In my case, a library, I need to use the cabal generated Paths_package file to access some locale data stored in a data file directory. This requires to include in hs-source-dirs dist/build/autogen, which doesn't

Re: [Haskell-cafe] HXT from schema to data model

2008-09-07 Thread Andrea Rossato
On Sun, Sep 07, 2008 at 03:35:40PM +0200, Pierre-Edouard Portier wrote: Hi! Is there a way to generate a data model and a set of picklers from an XML (or RelaxNG) Schema using the HXT tool box? not that I'm aware of. There's something for generating a data type and an access interface from

[Haskell-cafe] hxt and pickler combinations

2008-06-26 Thread Andrea Rossato
Hello, I'm using HXT for writing a Citation Style Language (http://xbiblio.sourceforge.net) implementation in Haskell and I'm trying to use the hxt pickler library to parse XML data contained in elements that can be interleaved, that is to say, elements that can appear in any order within other

Re: [Haskell-cafe] hxt and pickler combinations

2008-06-26 Thread Andrea Rossato
On Thu, Jun 26, 2008 at 04:11:58PM +0200, Andrea Rossato wrote: Hello, I'm using HXT for writing a Citation Style Language (http://xbiblio.sourceforge.net) implementation in Haskell and I'm trying to use the hxt pickler library to parse XML data contained in elements that can be interleaved

[Haskell-cafe] Announce: xmobar-0.8 released!

2007-11-11 Thread Andrea Rossato
you will enjoy! Andrea Rossato What's new == There are a lot of changes since the last release: a. Configuration: - removed xPos, yPos, width, height, align, and refresh configuration options; - added position and alignSep configuration options: the first is used to set

Re: [Haskell-cafe] hoogle broken?

2007-11-07 Thread Andrea Rossato
On Wed, Nov 07, 2007 at 10:36:05AM +0100, Thomas Schilling wrote: On Tue, 2007-11-06 at 19:20 -0800, Michael Vanier wrote: It looks as if hoogle isn't working. I get 404s whenever I try to do any search on hoogle. Mike Yes, that's because the ghc-docs now have been slightly

Re: [Haskell-cafe] Tutorial: Curry-Howard Correspondence

2007-10-17 Thread Andrea Rossato
On Tue, Oct 16, 2007 at 08:03:52PM -1000, Tim Newsham wrote: A tutorial on the Curry-Howard Correspondence in Haskell: http://www.thenewsh.com/%7Enewsham/formal/curryhoward/ Feedback appreciated. Very clear and useful for me. Thank you for sharing it. Andrea

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-25 Thread Andrea Rossato
On Mon, Sep 24, 2007 at 11:00:00AM +0100, Jules Bean wrote: I saw it. In total, four messages from you in this thread. I'm really sorry about that, but it was due to a problem and a misunderstanding with the administrator of my STMP server: at first it appeared the server was dropping my mail,

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-22 Thread Andrea Rossato
On Fri, Sep 21, 2007 at 09:08:13AM +0200, Andrea Rossato wrote: To make a short story long, I needed some client for the Audacious media player, something I could use to remote control it and, since I'm addicted to Haskell, instead of surfing the web to find a suitable client I surfed the web

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-22 Thread Andrea Rossato
On Fri, Sep 21, 2007 at 11:44:38AM +0200, Andrea Rossato wrote: I apologize for the noise. The auto-replay is for documentation (who knows, maybe others searching the list archives may find this info useful). I tried to send a couple of messages to inform that the API I was writing a binding

Re: [Haskell-cafe] Re: interaction between OS processes

2007-09-21 Thread Andrea Rossato
On Fri, Sep 14, 2007 at 01:55:32AM +, Aaron Denney wrote: On 2007-08-31, Andrea Rossato [EMAIL PROTECTED] wrote: Thanks for your kind attention, but I don't think it's a matter of buffering (I indeed tried playing with hSetBuffering with no results). I'd like to convince you otherwise

[Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-21 Thread Andrea Rossato
Hi, I think there's a huge flaw in the Haskell design: if you conceive such a powerful and expressive programming language, one that empowers even the most ignorant computer user to write complex applications, instead of sticking to basic shell scripting - the only domain graspable by such stupid

Re: [Haskell-cafe] bindings to the xmms_remote API, GList and something more

2007-09-21 Thread Andrea Rossato
On Fri, Sep 21, 2007 at 09:08:13AM +0200, Andrea Rossato wrote: Hi, I think there's a huge flaw in the Haskell design: I don't know if this is a feature, the fact that most of the times you can find a solution to your problems by yourself, but only after polluting the haskell-cafe mailing list

Re: [Haskell-cafe] yi-gtk

2007-09-18 Thread Andrea Rossato
On Tue, Sep 18, 2007 at 09:20:44AM +0800, clisper wrote: who knows how to compile yi-gtk? i tried,but it told me mine miss gtk. probably what you need is gtk2hs: http://haskell.org/gtk2hs/ andrea ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: getting crazy with character encoding

2007-09-13 Thread Andrea Rossato
On Thu, Sep 13, 2007 at 11:07:03AM +0200, Stephane Bortzmeyer wrote: On Thu, Sep 13, 2007 at 12:23:33AM +, Aaron Denney [EMAIL PROTECTED] wrote a message of 76 lines which said: the characters read and written should correspond to the native environment notions and encodings.

[Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Andrea Rossato
Hi, supposed that, in a Linux system, in an utf-8 locale, you create a file with non ascii characters. For instance: touch abèèè Now, I would expect that the output of a shell command such as ls ab* would be a string/list of 5 chars. Instead I find it to be a list of 8 chars...;-) That is to

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Andrea Rossato
On Wed, Sep 12, 2007 at 10:53:29AM -0400, Brandon S. Allbery KF8NH wrote: That is expected. The low level filesystem storage doesn't know about character sets, so non-ASCII filenames must be encoded in e.g. UTF-8. 8 characters is therefore correct, and you must do UTF-8 decoding on input

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Andrea Rossato
On Wed, Sep 12, 2007 at 11:16:25AM -0400, Seth Gordon wrote: It appears that in spite of the locale definition, hGetContents is treating each byte as a separate character without translating the multi-byte sequences *from* UTF-8, and then putStrLn sends each of those bytes to standard

[Haskell-cafe] Re: getting crazy with character encoding

2007-09-12 Thread Andrea Rossato
On Wed, Sep 12, 2007 at 04:35:50PM +0200, Stephane Bortzmeyer wrote: This is not an Haskell issue but a ls issue. use System.Directory.getDirectoryContents and we'll see. I get the very same output. Thanks for you kind attention. Andrea ___

Re: [Haskell-cafe] getting crazy with character encoding

2007-09-12 Thread Andrea Rossato
On Wed, Sep 12, 2007 at 11:40:11AM -0400, Seth Gordon wrote: The Unix utility od can be very helpful in figuring out problems like this. Thanks for pointing me to od, I didn't know it. [*]At least on my computer, I get the same result *even if* I change LANG from en_US.utf8 to C. As

Re: [Haskell-cafe] interaction between OS processes

2007-09-02 Thread Andrea Rossato
On Sat, Sep 01, 2007 at 09:12:30PM -0400, Albert Y. C. Lai wrote: Andrea Rossato wrote: loop s = do putStrLn s Most likely, the content of s sits in a local buffer and never leaves this process, following most OS conventions and as others point out. Another process

[Haskell-cafe] GHC-API: a few questions

2007-09-02 Thread Andrea Rossato
Hi, I'm trying to acquire some confidence with the GHC-API and I'm having some problems, related to error handling, I seem not be able to solve. Basically there are 3 functions to (interactively) compile/run Haskell expressions: compileExpr, dyCompileExpr and runStmt. The first 2 will return

[Haskell-cafe] interaction between OS processes

2007-08-30 Thread Andrea Rossato
Hi, there's something I don't get about interaction among OS processes and Haskell handles/channels. Suppose I have a very small program that takes a line and prints it till you write quit: main = do s - getLine case s of quit - putStrLn quitting return () _ - loop s where

[Haskell-cafe] Help with a project design

2007-08-12 Thread Andrea Rossato
Hi, I'm going to be long, sorry for it. And probably also off topic, a bit at least...;-) I need a way to manage bibliographies, pretty common problem isn't it? I used to use a wiki I developed also for such a task.[1] The wiki was basically based on Bibtex. I thought I could rewrite that

[Haskell-cafe] arrow question HXT related

2007-08-11 Thread Andrea Rossato
Hi, I think this is just a stupid arrow question. Still I cannot find where my mistake is located. Suppose I have a simple xml document I want to process with HXT: root elem sub / risubtext/risub /elem /root After extracting elem I want to duplicate the children trees with the arrow

Re: [Haskell-cafe] arrow question HXT related

2007-08-11 Thread Andrea Rossato
On Sat, Aug 11, 2007 at 11:50:19AM +0200, Andrea Rossato wrote: Hi, I think this is just a stupid arrow question. Still I cannot find where my mistake is located. well, it was not an arrow problem but a HXT problem. This new version of tryMe2 does work as expected: tryMe2 = runLA arrow

Re: [Haskell-cafe] Avoiding boilerplate retrieving GetOpt cmd line args

2007-07-27 Thread Andrea Rossato
On Thu, Jul 26, 2007 at 10:25:06PM -0700, Dave Bayer wrote: Ok, I'm writing a command line tool, using System.Console.GetOpt to handle command line arguments. My Flags structure so far is data Flag = Filter String | DateFormat String | DocStart String | DocEnd

[Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
this. Sorry for such a long useless letter, but I've seen that the Haskell community loves to talk about maintaining itself, and so on. I thought that my 2 cents could be enjoyable too. Regards, Andrea Rossato ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
On Wed, Jul 25, 2007 at 11:14:59AM +0100, Neil Mitchell wrote: You know, changing a wiki page title means breaking all links to that page from other sites. So, changing an old page title, means taking that page off the Net. Not if the redirect is done, certainly wikipedia does this. I

Re: [Haskell-cafe] [meta] the haskell wiki management

2007-07-25 Thread Andrea Rossato
On Wed, Jul 25, 2007 at 11:14:59AM +0100, Neil Mitchell wrote: You know, changing a wiki page title means breaking all links to that page from other sites. So, changing an old page title, means taking that page off the Net. Not if the redirect is done, certainly wikipedia does this.

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Andrea Rossato
On Tue, Jul 17, 2007 at 06:52:43PM +0400, Dmitri O.Kondratiev wrote: I am trying to use Graphics.SOE (that was present at least in GHC 6.4) to go through Simple Graphics examples as described in Pail Hudak book The Haskell School of Expression. Learning functional programming through

Re: [Haskell-cafe] GHC 6.6.1: Where is Graphics.SOE ?

2007-07-18 Thread Andrea Rossato
On Wed, Jul 18, 2007 at 03:58:58PM +0400, Dmitri O.Kondratiev wrote: Andrea thanks! I tried to install HGL on Win32 and got this unresolved dependency: HGL-3.1runghc Setup.hs configure Configuring HGL-3.1... configure: Dependency base-any: using base-2.1.1 Setup.hs: cannot satisfy

Re: [Haskell-cafe] Maintaining the community

2007-07-15 Thread Andrea Rossato
On Sat, Jul 14, 2007 at 11:24:36AM +0800, Michael T. Richter wrote: I've seen this pattern so often in communities. I've also seen it in management (the supervisor/manager who can do the job better than his underlings -- so he does) or in teaching (the popular teacher gets a heavier

Re: [Haskell-cafe] Maintaining the community

2007-07-15 Thread Andrea Rossato
On Sun, Jul 15, 2007 at 07:05:53PM +1000, Donald Bruce Stewart wrote: So how would you think we can approve? We have to help in more specific ways, and listen more carefully to what people are asking? I usually do this when I want a newcomer to join my community (for instance my research

Re: [Haskell-cafe] ANN: Finance.Quote.Yahoo 0.1 on hackage

2007-07-14 Thread Andrea Rossato
On Fri, Jul 13, 2007 at 09:24:48PM -0700, brad clawsie wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Finance-Quote-Yahoo-0.1 this is a simple module to get stock quote information from yahoo finance, considered alpha quality Hi, cool! I wanted to use it to write a small

Re: [Haskell-cafe] ANN: Finance.Quote.Yahoo 0.1 on hackage

2007-07-14 Thread Andrea Rossato
On Sat, Jul 14, 2007 at 10:20:56AM +0200, Andrea Rossato wrote: On Fri, Jul 13, 2007 at 09:24:48PM -0700, brad clawsie wrote: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Finance-Quote-Yahoo-0.1 this is a simple module to get stock quote information from yahoo finance

Re: [Haskell-cafe] ANN: Finance.Quote.Yahoo 0.1 on hackage

2007-07-14 Thread Andrea Rossato
On Sat, Jul 14, 2007 at 08:20:04AM -0700, brad clawsie wrote: i'm not sure i understand - you want to rewrite these functions that are already implemented in Data.String? why? this is why hackage exists - so you don't have to rewrite these functions. MissingH is well maintained by an

Re: [Haskell-cafe] reading existential types

2007-07-13 Thread Andrea Rossato
On Mon, Jul 09, 2007 at 09:41:32PM +0100, Claus Reinke wrote: hiding concrete types in existentials sometimes only defers problems instead of solving them, but exposing class interfaces instead of types is a useful way to mitigate that effect. it just so happens that this particular

Re: [Haskell-cafe] Maintaining the community

2007-07-13 Thread Andrea Rossato
On Fri, Jul 13, 2007 at 12:11:58PM +1000, Donald Bruce Stewart wrote: As we sit here riding the Haskell wave: http://www.cse.unsw.edu.au/~dons/tmp/cafe.png [..] That is, to help people progress from newbie, to intermediate, to expert, and thus ensure the culture is maintained (avoiding

Re: [Haskell-cafe] Yet another implementation of cond

2007-06-28 Thread Andrea Rossato
On Wed, Jun 27, 2007 at 05:07:54PM -0500, Jon Cast wrote: I discovered this trick the other day, and didn't remember seeing it anywhere as a cond implementation: head $ [ e1 | cond1 ] ++ [ e2 | cond2 ] ++ [ e3 | cond3 ] Cool! Thanks for sharing it. All the best, andrea

Re: [Haskell-cafe] Re: ANN: Scripting.Lua 0.1

2007-06-26 Thread Andrea Rossato
On Tue, Jun 26, 2007 at 07:54:26AM -0500, Maxim Khailo wrote: You have just combined two of my favorite languages! Gracjan Polak wrote: Hi all, I'm pleased to announce the first public release of Scripting.Lua. I quote: this is a really nice news. I'll be trying to use it in project of

Re: [Haskell-cafe] Plugin Problem - Weirder

2007-06-25 Thread Andrea Rossato
On Fri, Jun 22, 2007 at 03:32:19PM +0200, Daniel Fischer wrote: Am Freitag, 22. Juni 2007 04:29 schrieb Donald Bruce Stewart: The file system was down here, sorry. Should be up now. Ah, just unlucky timing. darcs got, installed, all well. I Know I'm probably late, but with the darcs

[Haskell-cafe] runInteractiveProcess leaks memory, runInteractiveCommand does not

2007-06-25 Thread Andrea Rossato
Hi, after many test I found out that System.Process.runInteractiveProcess leaks memory while runInteractiveCommand does. The issue of memory leaks related to running external program was raised here: http://www.haskell.org/pipermail/haskell-cafe/2007-June/027234.html and Bryan noted that after a

[Haskell-cafe] memory usage in repeated reading of an external program's output

2007-06-21 Thread Andrea Rossato
Hello, I have this very simple program that executes an external program, reads its output and prints it (the program is date). The readings is done with pipes. The problem is that memory usage constantly increases over time. Profiling does not show garbage collection of any sort. File

Re: [Haskell-cafe] memory usage in repeated reading of an external program's output

2007-06-21 Thread Andrea Rossato
On Thu, Jun 21, 2007 at 08:18:23AM -0400, Brandon S. Allbery KF8NH wrote: On Jun 21, 2007, at 6:40 , Andrea Rossato wrote: I have this very simple program that executes an external program, reads its output and prints it (the program is date). The readings is done with pipes

Re: [Haskell-cafe] Filesystem access

2007-06-21 Thread Andrea Rossato
On Thu, Jun 21, 2007 at 09:19:51PM +0100, Andrew Coppin wrote: OK, a few questions... 1. Is there *any* way to determine how large a file is *without* opening it? The only library function I can find to do with file sizes is hFileSize; obviously this only works for files that you have

Re: [Haskell-cafe] Filesystem access

2007-06-21 Thread Andrea Rossato
On Thu, Jun 21, 2007 at 09:38:49PM +0100, Andrew Coppin wrote: Andrea Rossato wrote: On Thu, Jun 21, 2007 at 09:19:51PM +0100, Andrew Coppin wrote: 2. Is there any way to discover Windoze-style attributes for files? The module before, if I understand correctlu. No, AFAIK

Re: [Haskell-cafe] memory usage in repeated reading of an external program's output

2007-06-21 Thread Andrea Rossato
On Thu, Jun 21, 2007 at 01:36:16PM -0700, Bryan O'Sullivan wrote: Andrea Rossato wrote: Still I do not understand you reference to the leak problem. Could you please elaborate a bit? The runProcess function returns a ProcessHandle. If you don't call waitForProcess on that handle

[Haskell-cafe] Xlib: problem creating a window with override_redirect set

2007-06-16 Thread Andrea Rossato
Hi, I'm trying, without success, to create a window with the attribute override_redirect set to True (this way the window manager should not take care of it). Obviously with Xlib (X11-1.2.2). No meter how I try I seem not to be able to get there. In test1 I try with the correct method

Re: [Haskell-cafe] Xlib: problem creating a window with override_redirect set

2007-06-16 Thread Andrea Rossato
On Sat, Jun 16, 2007 at 07:03:24PM +0200, Andrea Rossato wrote: Hi, I'm trying, without success, to create a window with the attribute override_redirect set to True (this way the window manager should not take care of it). Obviously with Xlib (X11-1.2.2). just for the sake of documentation

Re: [Haskell-cafe] Xlib: problem creating a window with override_redirect set

2007-06-16 Thread Andrea Rossato
On Sat, Jun 16, 2007 at 11:39:51PM +0200, Andrea Rossato wrote: On Sat, Jun 16, 2007 at 07:03:24PM +0200, Andrea Rossato wrote: Hi, I'm trying, without success, to create a window with the attribute override_redirect set to True (this way the window manager should not take care

Re: [Haskell-cafe] More documentation: how to create a Haskell project

2006-10-30 Thread Andrea Rossato
On Mon, Oct 30, 2006 at 09:54:08AM +0100, Ketil Malde wrote: How to make cabal projects into distribution-specific (.deb, .rpm, and so on) packages? for slackware you can have a look to this slackBuild script: http://gorgias.mine.nu/repos/slackBuild/hxt/hxt/hxt.SlackBuild regards, andrea

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-22 Thread Andrea Rossato
Hello! On Sun, Oct 22, 2006 at 12:27:05AM +0400, Bulat Ziganshin wrote: as Udo said, it should be better to evaluate thunks just when they are created, by using proper 'seq' calls. While I understand why you and Udo are right, still it is difficult for me to related this discussion to my code.

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-22 Thread Andrea Rossato
Hello Bullat, first of all, thanks for your lengthy and clear explanation. On Sun, Oct 22, 2006 at 04:08:49PM +0400, Bulat Ziganshin wrote: f a b = let x = a*b y = a+b in x `seq` y `seq` (x,y) this f definition will not evaluate x and y automatically. BUT its returned

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-21 Thread Andrea Rossato
Hallo Bulat! On Fri, Oct 20, 2006 at 10:21:51PM +0400, Bulat Ziganshin wrote: first, GC don't occurs automatically when you close file. you can help GHC by using performGC from System.Mem. i does it in my own prog I did not get an appreciable improvement with performGC, as you can see from

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-21 Thread Andrea Rossato
Hallo! Thanks a lot for stopping by. On Sat, Oct 21, 2006 at 06:41:32PM +0200, Udo Stenzel wrote: The correct solution however, is the application of 'seq' at the right places. To understand where these are, perform a simulation of Haskell's reduction strategy on paper. I will definitely

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-21 Thread Andrea Rossato
On Sat, Oct 21, 2006 at 09:09:13PM +0200, Andrea Rossato wrote: So, it's parsec, on your side...;-) I sorry, I was a bit confused when I wrote that. I confused you for another person, obviously. Sorry about that. Andrea pgpx3F8PsFdVW.pgp Description: PGP signature

Re: [Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-20 Thread Andrea Rossato
On Thu, Oct 19, 2006 at 06:23:35PM +0400, Bulat Ziganshin wrote: Hello Andrea, Wednesday, October 18, 2006, 9:34:28 PM, you wrote: solution? Or just some hints on the kind of problem I'm facing: is it related to strictness/laziness, or it's just that I did not understand a single bit

[Haskell-cafe] memory, garbage collection and other newbie's issues

2006-10-18 Thread Andrea Rossato
Hi! I'm a newbie and, as a learning experience, I'm writing a feed reader with hscurses and hxt. For the present time the feed reader just reads a Liferea cache but, as you can imagine, I'm running into the usual newbie problems of memory consumption and garbage collection, probably (I'm not

[Haskell-cafe] cutting long strings into lines

2006-09-30 Thread Andrea Rossato
Hello! I've been trying for quite some time to find an elegant solution to cut long strings into lines, but the only solution I was able to come up is the following piece of ugly code. Is there a library function for that? What kind of approach would you suggest? Thanks for your kind attention.

Re: [Haskell-cafe] cutting long strings into lines

2006-09-30 Thread Andrea Rossato
On Sat, Sep 30, 2006 at 08:56:24PM +0400, Bulat Ziganshin wrote: i think that your algorithm is too complex. standard algorithm, imho, is to find last space before 80 (or 75) chars margin, split here and then repeat this procedure again. so, one line split may look like splitAt . last .

Re: [Haskell-cafe] cutting long strings into lines

2006-09-30 Thread Andrea Rossato
On Sat, Sep 30, 2006 at 08:56:24PM +0400, Bulat Ziganshin wrote: splitByLen len_f [] = [] splitByLen len_f xs = y : splitByLen len_f ys where (y,ys) = splitAt (len_f xs) xs ... so, splitByLen len_f should give you that you need, you need only to add checks for some

Re: [Haskell-cafe] Java or C to Haskell

2006-09-20 Thread Andrea Rossato
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote: I'm trying to write in Haskell a function that in Java would be something like this: char find_match (char[] l1, char[] l2, char e){ //l1 and l2 are not empty int i = 0; while (l2){ char aux =

Re: [Haskell-cafe] Java or C to Haskell

2006-09-20 Thread Andrea Rossato
On Wed, Sep 20, 2006 at 01:31:22AM -0700, Carajillu wrote: compare function just compares the two lists and return true if they are equal, or false if they are not. it is really a simple function, but I've been thinking about it a lot of time and I can't get the goal. I forgot, obviously,

Re: [Haskell-cafe] Java or C to Haskell

2006-09-20 Thread Andrea Rossato
On Wed, Sep 20, 2006 at 07:20:23PM +1000, Donald Bruce Stewart wrote: comp l1 l2 = if l1 == l2 then True else False You never stop learning! andrea which you would just write as: comp = (==) and then you'd just use == anyway :) this is why I came to love haskell: it remembers

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 02:51:34AM -0700, Carajillu wrote: Hi, I'm a student and I have to do a program with Haskell. This is the first time I use this languaje, and I'm having problems with the indentation. I want to check if this function is correct, but when I try to make the GHCi

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 12:54:34PM +0200, Albert Crespi wrote: Thank you very much for your reply! As I said, it is my first experience with Haskell, I have been programming in Java and C for some years, and I find this language very different from them. Anyway I'll try to fix the function

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 04:16:55AM -0700, Carajillu wrote: Wow! I'm starting to love this languaje, and the people who uses it!:) You spoke too early. My code had a bug, a huge one... this is the right one: -- Replaces a wildcard in a list with the list given as the third argument

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 12:25:21PM +0100, Neil Mitchell wrote: Why not: check_elem (x:xs) = if x == e then (l2 ++ xs) else x : check_elem xs Thanks Thank you! Lists are my personal nightmare...;-) Andrea ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Re: Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 12:42:59PM +0100, Jón Fairbairn wrote: And if you do that, you can write it like this: subst e l' = concat . map subst_elem where subst_elem x | x == e = l' | otherwise = [x] Pretty. Just to many keystrokes.

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 05:42:47AM -0700, Carajillu wrote: Not a good solution, it just substitutes the first occurrence of the item in the list. I'll try the others I did not get this point. You must take Jón's approach with map. andrea ___

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 02:52:45PM +0200, Andrea Rossato wrote: On Mon, Sep 18, 2006 at 05:42:47AM -0700, Carajillu wrote: Not a good solution, it just substitutes the first occurrence of the item in the list. I'll try the others I did not get this point. You must take Jón's approach

Re: [Haskell-cafe] Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 05:35:47AM -0700, Carajillu wrote: I'm testing it and it's working really well. The other solutions are a little complicated for me, but I'm still trying to undestand them. Jón's approach (the last version of his message), usually cleaner and more concise, is called

Re: [Haskell-cafe] Re: Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 04:52:33PM +0400, Bulat Ziganshin wrote: but the goal is not keystrokes itself but easy of understanding. for me, first solution looks rather idiomatic and intuitively understandable. second solution requires more time to got it, but seems easier for novices that are

Re: [Haskell-cafe] Re: Problems interpreting

2006-09-18 Thread Andrea Rossato
On Mon, Sep 18, 2006 at 11:04:27AM -0400, Lennart Augustsson wrote: Or even shorter: subst e l = concatMap $ \x-if x==e then l else [x] I kinda like the list comprehension version too subst e l1 l2 = [ r | x - l2, r - if x==e then l1 else [x] ] This is the version I first wanted to (try

[Haskell-cafe] parsing long numbers

2006-09-15 Thread Andrea Rossato
Hello! I'm trying to learn parsing and parser combinations in Haskell, using, as usual, Wadler's Monads in Functional Programming as my text book. Everything works fine except for a small but annoying problem related to read. I'm sure it must be something easy, some kind of stupid faq. Still I'm

Re: [Haskell-cafe] Newbied question on IO Monad

2006-09-12 Thread Andrea Rossato
Il Tue, Sep 12, 2006 at 08:05:42AM -0400, Sara Kenedy ebbe a scrivere: Hello all, update :: String - String update sss = ... main = do writeFile myFile.txt sss x - callSystem myFile.txt y - openFile result.txt ReadMode zzz - hGetContents y

Re: [Haskell-cafe] Newbied question on IO Monad

2006-09-12 Thread Andrea Rossato
Il Tue, Sep 12, 2006 at 09:00:19AM -0400, Sara Kenedy ebbe a scrivere: Hello, Maybe what I talk is not clear. I want to take the input string sss of update to use in: writeFile myFile.txt sss of function main and get the value zzz from main to assign for the value return of update. I

[Haskell-cafe] haskell toolchain for slackware

2006-09-12 Thread Andrea Rossato
Hello! Since there seems to be very little support for haskell in Slackware Linux, I'm putting together a repository with the most useful (for me) hasekll utilities. For the time being there are: 1. ghc-6.4.2 (precompiled binaries packaged for slackware) 2. haddock 3. darsc 4. hscurses 5.

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-11 Thread Andrea Rossato
Il Mon, Sep 11, 2006 at 11:30:41AM +0200, Udo Stenzel ebbe a scrivere: Whatever it is, I cannot reproduce any of your problems. I installed HaXml-1.13.2 from source using Cabal, and both ghc -c Xml.hs and ghc --make xml.hs work as expected, even without the -package switch. This is GHC 6.4.1

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-10 Thread Andrea Rossato
Il Sat, Sep 09, 2006 at 05:20:55PM -0400, Mark T.B. Carroll ebbe a scrivere: FWIW I have the same problem - I can't use HaXml with ghci. So it's not just you. (-: Indeed! So I found my first bug in ghc... And now I'll dig into ghc bug reports to see if someone is working on the problem...

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-10 Thread Andrea Rossato
Il Sat, Sep 09, 2006 at 04:34:04AM +0100, Marco André F. de Almeida ebbe a scrivere: I know this will not solve your problem, but just so that you know that with Hugs, you code works without any problems. If you don't want/need to compile the program, I guess one interpreter (Hugs) is as good

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-10 Thread Andrea Rossato
Il Sun, Sep 10, 2006 at 11:41:45AM +0200, Lemmih ebbe a scrivere: It looks a bit like 'HaXml' has been updated after 'hxml' was built. Try rebuilding 'hxml' against the 'HaXml' you've got installed. No, I installed the together, HaXml first and then hxml In hxml there where a couple of bugs,

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-10 Thread Andrea Rossato
Il Sun, Sep 10, 2006 at 01:56:25PM +0200, Udo Stenzel ebbe a scrivere: Hrm, you're accessing a symbol presumably found in a library that isn't loaded. Either GHC cannot find the library, which shouldn't happen if you're using the right package switch, or the .hi file you compiled against is

Re: [Haskell-cafe] HaXml and ghci unresolved symbol

2006-09-10 Thread Andrea Rossato
Il Sat, Sep 09, 2006 at 02:17:36PM +0200, Andrea Rossato ebbe a scrivere: probably it's me, but I cannot understand what I'm doing wrong. Thanks to the discussion of this thread I was able to (sort of) isolate the problem and understand why I cannot get hxml (if linked with HaXml) to work

  1   2   >