Re: [Haskell-cafe] A weird bug of regex-pcre

2012-12-18 Thread José Romildo Malaquias
On Tue, Dec 18, 2012 at 02:28:26PM +0800, Magicloud Magiclouds wrote: Attachment is the test text file. And I tested my regexp as this: Prelude :m + Text.Regex.PCRE Prelude Text.Regex.PCRE z - readFile test.html Prelude Text.Regex.PCRE let (b, m ,a, ss) = z =~ a href=\(.*?)\.*?img

[Haskell-cafe] regex-pcre and ghc-7.4.2 is not working with UTF-8

2012-08-23 Thread José Romildo Malaquias
Hello. I think I have an explanation for the problem with regex-pcre, ghc-7.4.2 and UTF Strings. The Text.Regex.PCRE.String module uses the withCString and withCStringLen from the module Foreign.C.String to pass a Haskell string to the C library pcre functions that compile regular expressions,

Re: [Haskell-cafe] regex-pcre and ghc-7.4.2 is not working with UTF-8

2012-08-23 Thread José Romildo Malaquias
On Thu, Aug 23, 2012 at 08:59:52AM -0300, José Romildo Malaquias wrote: Hello. I think I have an explanation for the problem with regex-pcre, ghc-7.4.2 and UTF Strings. The Text.Regex.PCRE.String module uses the withCString and withCStringLen from the module Foreign.C.String to pass

Re: [Haskell-cafe] regex-pcre is not working with UTF-8

2012-08-22 Thread José Romildo Malaquias
On Tue, Aug 21, 2012 at 05:50:44PM -0300, José Romildo Malaquias wrote: On Tue, Aug 21, 2012 at 04:05:28PM +0100, Chris Kuklewicz wrote: I do not have time to test this myself right now. But I will unravel my code a bit for you. By November 2011 it worked without problems in my

Re: [Haskell-cafe] regex-pcre is not working with UTF-8

2012-08-21 Thread José Romildo Malaquias
On Tue, Aug 21, 2012 at 10:25:53PM +0300, Konstantin Litvinenko wrote: On 08/18/2012 06:16 PM, José Romildo Malaquias wrote: Hello. It seems that the regex-pcre has a bug dealing with utf-8: I hope this bug can be fixed soon. Is there a bug tracker to report the bug? If so, what

[Haskell-cafe] Regex string replacement

2012-08-18 Thread José Romildo Malaquias
Hello. I am looking for a substring replacement based on Perl like regular expressions that would let me use part of the original string in the replacement string. Something like: reReplace name is (.*)\\. hi \1! my name is john. which would result in hy john! Any help? Romildo

Re: [Haskell-cafe] Regex string replacement

2012-08-18 Thread José Romildo Malaquias
On Sat, Aug 18, 2012 at 09:39:01AM -0300, Marco Túlio Pimenta Gontijo wrote: Hi Romildo. On Sat, Aug 18, 2012 at 9:18 AM, José Romildo Malaquias j.romi...@gmail.com wrote: (...) I am looking for a substring replacement based on Perl like regular expressions that would let me use part

[Haskell-cafe] regex-pcre is not working with UTF-8

2012-08-18 Thread José Romildo Malaquias
Hello. It seems that the regex-pcre has a bug dealing with utf-8: Prelude :m + Text.Regex.PCRE Prelude Text.Regex.PCRE país:Brasil =~ país:(.*) :: (String,String,String,[String]) (,pa\237s:Brasil,,[rasil]) Notice the missing 'B' in the result of the regex matching. With regex-posix

[Haskell-cafe] Annotaing abstract syntax trees

2012-05-08 Thread José Romildo Malaquias
Hello. I am reading Martijn's MSc Thesis Generic Selections of Subexpressions, where one can found some discussions about annotating abstract syntax trees (AST). In order to follow the discussion I wrote the attached Haskell program, which is an interpreter for an simple typed expression

[Haskell-cafe] Parameters and patterns

2011-10-01 Thread José Romildo Malaquias
Hello. When studing programming languages I have learned that parameter is a variable (name) that appears in a function definition and denotes the value to which the function is applied when the function is called. Argument is the value to which the function is applied. The parameter allows the

[Haskell-cafe] ghc-mtl and ghc-7.2.1

2011-09-07 Thread José Romildo Malaquias
Hello. In order to compile ghc-mtl-1.0.1.0 (the latest released version) with ghc-7.2.1, I would apply the attached patch, which removes any references to WarnLogMonad. ghc-7.2.1 does not have the monad WarnLogMonad anymore. As I do not know the details of the GHC api, I am not sure if this is

[Haskell-cafe] Subtitles for Programming in Haskell videos

2011-08-13 Thread José Romildo Malaquias
Hello. Are there subtitles (in English or Portuguese) for the video lectures[1] given by Erik Meijer using the book Programming in Haskell, by Graham Hutton? [1] http://www.cs.nott.ac.uk/~gmh/book.html Romildo ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] error with nanocurses-1.5.2

2011-07-10 Thread José Romildo Malaquias
On Sat, Jul 09, 2011 at 01:59:12PM -0300, José Romildo Malaquias wrote: Hello. When trying to install nanocurses-1.5.2 on my Fedora Linux system, I am getting the following error: $ cabal install nanocurses Resolving dependencies... Configuring nanocurses-1.5.2... Preprocessing library

Re: [Haskell-cafe] unbuffered raw keyboard input on Windows

2011-07-10 Thread José Romildo Malaquias
On Wed, Jul 06, 2011 at 02:48:47PM -0700, David Barbour wrote: You could try the SDL package to support user input. Unfortunatly it does not run on a terminal. 2011/7/6 José Romildo Malaquias j.romi...@gmail.com Hello. I want to write a Haskell console application (a game) in ghc where

Re: [Haskell-cafe] unbuffered raw keyboard input on Windows

2011-07-10 Thread José Romildo Malaquias
On Wed, Jul 06, 2011 at 06:46:32PM -0300, José Romildo Malaquias wrote: Hello. I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console. Although

[Haskell-cafe] unbuffered raw keyboard input on Windows

2011-07-06 Thread José Romildo Malaquias
Hello. I want to write a Haskell console application (a game) in ghc where the user will interact using the keyboard. I need to read the keys as soon as they are typed and without echoing to the console. Although Haskell provides this capability in the standard libraries (using hSetEcho and

[Haskell-cafe] GHC and MinGW

2011-02-12 Thread José Romildo Malaquias
Hello. How do I make ghc use my installation of MinGW on Windows? I have ghc-7.0.1 installed and the latest MinGW packages. I want ghc to automatically find libraries installed by the MinGW installer. Currently I am getting the error with my application: Linking Gui.exe ... C:\Program

Re: [Haskell-cafe] GHC and MinGW

2011-02-12 Thread José Romildo Malaquias
On Sat, Feb 12, 2011 at 01:12:22PM -0200, José Romildo Malaquias wrote: Hello. How do I make ghc use my installation of MinGW on Windows? I have ghc-7.0.1 installed and the latest MinGW packages. I want ghc to automatically find libraries installed by the MinGW installer. Currently I am

Re: [Haskell-cafe] regex libraries: matching operators (=~) and (=~~) are not methods

2010-12-04 Thread José Romildo Malaquias
On Tue, Nov 30, 2010 at 05:50:02PM -0200, José Romildo Malaquias wrote: Hello. When learning how to use the many regular expression libraries for Haskell, I noticed that the interface API from the regex-base package introduces several high level operations that are abstracted from

[Haskell-cafe] regex libraries: matching operators (=~) and (=~~) are not methods

2010-11-30 Thread José Romildo Malaquias
Hello. When learning how to use the many regular expression libraries for Haskell, I noticed that the interface API from the regex-base package introduces several high level operations that are abstracted from the implementations (backends). This is done by means of classes. For instance, there

[Haskell-cafe] version of findIndex that works with a monadic predicate

2010-11-26 Thread José Romildo Malaquias
Hello. I need a function findIndexM, similar to findIndex from the standard module Data.List, but which works with a monadic predicate to test list elements. findIndex :: (a - Bool) - [a] - Maybe Int findIndexM :: (Monad m, Num a) = (t - m Bool) - [t] - m (Maybe a) findIndexM p xs = go 0 xs

[Haskell-cafe] Wrong Package-URL in regex-tdfa.cabal

2010-11-23 Thread José Romildo Malaquias
Hello. The cabal file for the regex-tddfa-1.1.6 package seems to have an invalid URL for the Package-URL field: Package-URL: http://darcs.haskell.org/packages/regex-unstable/regex-tdfa/ It should be fixed. Regards. Romildo ___ Haskell-Cafe mailing

[Haskell-cafe] looking for tagsoup-parsec examples

2010-11-22 Thread José Romildo Malaquias
Hello. I am looking for some examples of code using Text.HTML.TagSoup.Parsec, from the tagsoup-parsec package. Romildo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] looking for tagsoup-parsec examples

2010-11-22 Thread José Romildo Malaquias
On Mon, Nov 22, 2010 at 02:20:22PM -0200, José Romildo Malaquias wrote: I am looking for some examples of code using Text.HTML.TagSoup.Parsec, from the tagsoup-parsec package. In an attempt to learn how to use tagsoup together with parsec in order to do web scrapping, I rewrote

[Haskell-cafe] Tooltips on tree view rows

2010-11-21 Thread José Romildo Malaquias
Hello. I need the gtk_tree_view_set_tooltip_column from Gtk+, but it seems tht it has not been ported to gtk2hs. Is it the case? How can I easily add tooltips to rows in a TreeView? Regards, Romildo ___ Haskell-Cafe mailing list

[Haskell-cafe] Downloading web page in Haskell

2010-11-20 Thread José Romildo Malaquias
In order to download a given web page, I wrote the attached program. The problem is that the page is not being full downloaded. It is being somehow intettupted. Any clues on how to solve this problem? Romildo module Main where import Network.HTTP (getResponseBody, getRequest, simpleHTTP)

Re: [Haskell-cafe] Downloading web page in Haskell

2010-11-20 Thread José Romildo Malaquias
On Sat, Nov 20, 2010 at 10:26:49PM +0100, Daniel Fischer wrote: On Saturday 20 November 2010 21:47:52, Don Stewart wrote: 2010/11/20 José Romildo Malaquias j.romi...@gmail.com: In order to download a given web page, I wrote the attached program. The problem is that the page

[Haskell-cafe] ghc panic when compiling blaze-builder

2010-11-20 Thread José Romildo Malaquias
When compiling blaze-builder-0.2.0.1 with ghc-7.0.1 on my ~amd64 gentoo system, I am getting the shown below. Any clues? Romildo [...] Building blaze-builder-0.2.0.1... [1 of 8] Compiling Blaze.ByteString.Builder.Internal ( Blaze/ByteString/Builder/Internal.hs,

Re: [Haskell-cafe] Tiger compiler in Haskell: annotating abstract syntax tree

2010-07-23 Thread José Romildo Malaquias
On Tue, Jul 20, 2010 at 09:17:15AM +0200, José Pedro Magalhães wrote: 2010/7/19 José Romildo Malaquias j.romi...@gmail.com I am writing here to ask suggestions on how to annotate an ast with types (or any other information that would be relevant in a compiler phase) in Haskell

[Haskell-cafe] List manager and duplicate copies of messsages

2010-07-21 Thread José Romildo Malaquias
Hello. I have noticed that I do not receive duplicate copies of messages from haskell-cafe, although Avoid duplicate copies of messages? is set to No in the mailing list membership configuration. I want the copies because I archive all the mailing list messages with procmail based on the

Re: [Haskell-cafe] List manager and duplicate copies of messsages

2010-07-21 Thread José Romildo Malaquias
On Wed, Jul 21, 2010 at 02:42:37PM +0200, Martijn van Steenbergen wrote: On 7/21/10 12:48, José Romildo Malaquias wrote: Hello. I have noticed that I do not receive duplicate copies of messages from haskell-cafe, although Avoid duplicate copies of messages? is set to No in the mailing

[Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
Please, ignore this message. Romildo -- ___ Surf the Web in a faster, safer and easier way: Download Opera 9 at http://www.opera.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
On Wed, Jul 21, 2010 at 12:53:53PM -0300, José Romildo Malaquias wrote: Please, ignore this message. Replying to the list and to the sender, to see if he gets both messages using a non gmail account. Romildo ___ Haskell-Cafe mailing list Haskell-Cafe

Re: [Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
- Original Message - From: José Romildo Malaquias j.romi...@gmail.com To: José Romildo Malaquias romi...@operamail.com Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Test. Ignore. Date: Wed, 21 Jul 2010 13:01:03 -0300 On Wed, Jul 21, 2010 at 12:53:53PM -0300, José

Re: [Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
- Original Message - From: José Romildo Malaquias romi...@operamail.com To: José Romildo Malaquias j.romi...@gmail.com Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Test. Ignore. Date: Wed, 21 Jul 2010 13:09:16 -0300 - Original Message - From: José Romildo

Re: [Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
On Wed, Jul 21, 2010 at 01:25:19PM -0300, José Romildo Malaquias wrote: - Original Message - From: José Romildo Malaquias romi...@operamail.com To: José Romildo Malaquias j.romi...@gmail.com Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Test. Ignore. Date: Wed, 21

Re: [Haskell-cafe] Test. Ignore.

2010-07-21 Thread José Romildo Malaquias
- Original Message - From: José Romildo Malaquias j.romi...@gmail.com To: José Romildo Malaquias romi...@operamail.com Cc: haskell-cafe@haskell.org Subject: Re: [Haskell-cafe] Test. Ignore. Date: Wed, 21 Jul 2010 13:33:34 -0300 On Wed, Jul 21, 2010 at 01:25:19PM -0300, José

Re: [Haskell-cafe] List manager and duplicate copies of messsages

2010-07-21 Thread José Romildo Malaquias
On Wed, Jul 21, 2010 at 12:18:14PM -0300, José Romildo Malaquias wrote: On Wed, Jul 21, 2010 at 02:42:37PM +0200, Martijn van Steenbergen wrote: On 7/21/10 12:48, José Romildo Malaquias wrote: Hello. I have noticed that I do not receive duplicate copies of messages from haskell-cafe

[Haskell-cafe] Tiger compiler in Haskell: annotating abstract syntax tree

2010-07-19 Thread José Romildo Malaquias
Hello. In his book Modern Compilder Implementation in ML, Appel presents a compiler project for the Tiger programming language where type checking and intermediate code generation are intrinsically coupled. There is a function transExp :: Absyn.Exp - (Tree.Exp,Types.Type) that do semantic

[romi...@malaquias.dhcp-geral: Re: [Haskell-cafe] Tiger compiler in Haskell: annotating abstract syntax tree]

2010-07-19 Thread José Romildo Malaquias
in deriving Show for the data types. Any help? Romildo 2010/7/19 José Romildo Malaquias j.romi...@gmail.com Hello. In his book Modern Compilder Implementation in ML, Appel presents a compiler project for the Tiger programming language where type checking and intermediate code generation

[Haskell-cafe] Haskell and Standard ML modules

2010-07-04 Thread José Romildo Malaquias
Hello. I am writing a Haskell program based on some guidelines written for Standard ML (The Tiger compiler from the Modern Compiler Implementation in ML book). The author uses modules for abstracting things like specifities of the taraget machine. For intance, there is a general Frame signature

[Haskell-cafe] Physical equality

2010-06-28 Thread José Romildo Malaquias
Is there in Haskell a non monadic function of type a - a - Bool which test for physical equality of two values? It would return True if only if both values are the same object in memory. For instance: value1 = good value2 = good eq value1 value2 = False value1 = good value2 = value1

Re: [Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-24 Thread José Romildo Malaquias
On Tue, Jun 22, 2010 at 04:44:09PM +0200, Vo Minh Thu wrote: 2010/6/22 José Romildo Malaquias j.romi...@gmail.com: On Tue, Jun 22, 2010 at 02:54:08PM +0200, Vo Minh Thu wrote: 2010/6/22 José Romildo Malaquias j.romi...@gmail.com: Hello. I have been teaching an introductory course

[Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-22 Thread José Romildo Malaquias
Hello. I have been teaching an introductory course on compiler construction to our undergraduates students using Appel's Modern Compiler Implementation in Java. There are also versions of the book in ML and C. The books explain how to write a compiler for the Tiger programming language. Now I

Re: [Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-22 Thread José Romildo Malaquias
On Tue, Jun 22, 2010 at 02:30:04PM +0100, Stephen Tetley wrote: Hello Doaitse Swierstra has a Tiger compiler written in Haskell + UUAG as a demonstration for UUAG attribute grammar system. The package on Hackage only contains the derived source - i.e not the original attribute grammar

Re: [Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-22 Thread José Romildo Malaquias
On Tue, Jun 22, 2010 at 02:54:08PM +0200, Vo Minh Thu wrote: 2010/6/22 José Romildo Malaquias j.romi...@gmail.com: Hello. I have been teaching an introductory course on compiler construction to our undergraduates students using Appel's Modern Compiler Implementation in Java

Re: [Haskell-cafe] Tiger compiler: variable escaping analysis phase

2010-06-22 Thread José Romildo Malaquias
On Tue, Jun 22, 2010 at 10:01:37AM -0300, Felipe Lessa wrote: On Tue, Jun 22, 2010 at 09:33:22AM -0300, José Romildo Malaquias wrote: In the variable escaping analysis phase of the compiler, a function findEscape looks for escaping variables and record this information in the escape fields

[Haskell-cafe] Get data from HTML pages

2009-08-31 Thread José Romildo Malaquias
Hello. I am porting to Haskell a Java application I have written to manage collections of movies. Currently the application has an option to indirectly import movie data from web pages. For that first the user should access the page in a web browser. Then the user should copy the rendered text

[Haskell-cafe] Pretty printing a tree

2009-05-14 Thread José Romildo Malaquias
Hello. I would like to pretty print a tree in a way that its structure is easily perceived. For instance, consider the declarations: data Node a = Node a [Node a] type Tree a = [ Node a ] t = [ Node a [ Node b [] , Node c [ Node c1 [] ,