[Haskell-cafe] Parsec type error with Flexible Contexts
Hi. I wanted to generalize the definitions in Text.Parsec.Language to be able to use them with Parsec Text instead of Parsec String. I'm getting a type error with the following code snippet: http://hpaste.org/72844 I don't really understand the error, specially with regard to the fact that the if I comment one of the marked lines on the code pasted the program build. Any help is welcome. Greetings. -- marcot http://marcot.eti.br/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: thread blocked indefinitely in an MVar operation in unsafePerformIO
Hi Simon. On Mon, Jul 30, 2012 at 12:00 PM, Simon Marlow marlo...@gmail.com wrote: (...) Is it possible that the String you are passing to uLog contains unevaluated calls to uLog itself, which would thereby create a deadlock as uLog tries to take the MVar that is already being held by the same thread? Yes, that's right. I removed the recursive call to uLog and it worked, thanks. Greetings. (...) -- marcot http://marcot.eti.br/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
thread blocked indefinitely in an MVar operation in unsafePerformIO
Hi. I'm having a problem calling logM from hsLogger inside unsafePerformIO. I have described the problem in Haskell-cafe, so I'll avoid repeating it here: http://www.haskell.org/pipermail/haskell-cafe/2012-July/102545.html I've had this problem both with GHC 7.4.1 and 7.4.2. Do you have any suggestion? Greetings. -- marcot http://marcot.eti.br/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Logging pure code
Hi Joey. Thanks for your answer. On Sun, Jul 29, 2012 at 3:16 PM, Joey Adams joeyadams3.14...@gmail.com wrote: On Fri, Jul 27, 2012 at 9:52 AM, Marco Túlio Gontijo e Silva marcotmar...@gmail.com wrote: I thought that the only thing I needed to take care while using unsafePerformIO was knowing that the time of execution is undetermined and that it could even run more than once. This is not a problem for my logging. Is there something else I should be aware while using unsafePerformIO? Another thing to be aware of is that unsafePerformIO and STM don't interact well. In particular, STM will abort doomed transactions. If the transaction is IO that has exception handlers set up, those handlers won't be run. This is the case for unsafeIOToSTM, but I'm not sure if it's the case for unsafePerformIO as well. Are you using STM in your program? Also, what version of GHC are you using? No, not in my program. Maybe a library that I use uses it, but not that I'm aware of. I'm using GHC version 7.4.1, I'll try it with 7.4.2 later. Greetings! (...) -- marcot http://marcot.eti.br/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Logging pure code
Hi. I'm using the hslogger library for logging pure code, using the following function: uLog :: Priority - String - a - a uLog pri str x = unsafePerformIO $ logM rootLoggerName pri str return x Everything was working fine, till I used uLog on a very accessed function. Then the program started to fail with: thread blocked indefinitely in an MVar operation I've changed uLog to: uLog :: Priority - String - a - a uLog pri str x = unsafePerformIO $ hPutStrLn stderr (show str) return x And I noticed on the log that two messages were sent at the same time on the point where the version with hslogger fails: canonicate 4 canonicate 1 \r\n\t\t\t\t\t\t\t\tRio Branco = rio branco canonicate 2 AC\r\n\t\t\t\t\t\t\t\t = ac ac = ac They were sent as (in any order): canonicate 4 ac = ac canonicate 1 \r\n\t\t\t\t\t\t\t\tRio Branco = rio branco canonicate 2 AC\r\n\t\t\t\t\t\t\t\t = ac I tried changing hslogger to avoid calling modifyMVar when getting logger for rootLoggerName, and using withMVar instead, but the problem persisted. I tried to create a simple test case to reproduce the problem, but I couldn't, all test cases I created worked as expected. As I was with no other ideas, I tried some things that make little sense. This happens with optimization or without it. Following http://hackage.haskell.org/trac/ghc/ticket/5859 I tried using -fno-state-hack, but the problem persisted. I tried adding NOINLINE to uLog, without success. I also tried changing unsafePerformIO to unsafeDupablePerformIO. I thought that the only thing I needed to take care while using unsafePerformIO was knowing that the time of execution is undetermined and that it could even run more than once. This is not a problem for my logging. Is there something else I should be aware while using unsafePerformIO? Greetings. -- marcot http://marcot.eti.br/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Google Summer of Code student application period opens today
Hi Johan. Excerpts from Johan Tibell's message of Seg Mar 28 10:58:16 -0300 2011: (...) If you're a student and like to get paid to work on a Haskell project this summer I recommend you go find an interesting project [1] and start working on your application. I plan to apply to the Google Summer of Code, to work on the parallelization of Cabal Install. As stated in some comments, this project may be too small for three months, so I included some other things in my proposal. The first is to work on making GHC parallel while building different modules. The second is to make a tool that I'm creating, hackage-debian, parallel. I intend to hackage-debian before the deadline for project submissions. It's a tool to create a debian repository with as much as possible hackage libraries. I've writed a draft of the proposal at http://www2.dcc.ufmg.br/laboratorios/llp/wiki/doku.php?id=marco_soc2011 . If you have any comments, I'll be glad to receive them. Greetings. (...) -- marcot http://marcot.eti.br/ signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Exportable and importable instances
Hi. I'm planning to propose a language extension for Haskell to make it possible to control the visibility of type class instances in module export and import lists as a research project. I'm planning to implement this in GHC. I've already mentioned it in #...@irc.freenode.net and got interesting comments from tibbe and quicksilver. I'd be glad to receive more feedback on the idea. If you have any comments, please reply to this thread or mail me individually, at your will. Greetings. -- marcot http://marcot.eti.br/ [Flattr=54498] signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Proposal to solve Haskell's MPTC dilemma
Hi Max. Excerpts from Max Bolingbroke's message of Sex Mai 21 04:56:51 -0300 2010: (...) (Incidentally, the link to your paper is broken, so I haven't actually been able to read it, sorry!) It was easy to find it on google. http://www.dcc.ufmg.br/~camarao/CT/solution-to-mptc-dilemma.pdf Greetings. (...) -- marcot http://wiki.debian.org/MarcoSilva signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] LLVM study SoC proposal
Hi. I wrote a(nother) SoC proposal for studying LLVM performance, compared with the Native Code Generator back-end. It's available at: http://www2.dcc.ufmg.br/laboratorios/llp/wiki/doku.php?id=marco_soc2 I know the deadline is now near, but I'd be happy to hear comments about it and update it before 19:00 UTC. Thanks. -- marcot http://wiki.debian.org/MarcoSilva ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Immix GC as a Soc proposal
Hi. I've written a Google Summer of Code proposal for implementing the Immix Garbage Collector in GHC[0]. It's not on dons list of the 8 most important projects[1], but I only saw that list after the proposal is done. I'd like to hear comments about it, specially about its relevance, since it's not on the list of 8. 0: http://www2.dcc.ufmg.br/laboratorios/llp/wiki/doku.php?do=showid=marco_soc 1: http://donsbot.wordpress.com/2010/04/01/the-8-most-important-haskell-org-gsoc-projects/ I'm planning to write another proposal, maybe about LLVM Performance Study, LLVM Cross Compiler, A Package Versioning Policy Checker or “cabal test”, if mentors think they're more relevant than my current proposal. Please let me know if this is the case. Greetings. -- marcot http://wiki.debian.org/MarcoSilva ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Haskell-friendly Linux Distribution
Hi Ivan. Excerpts from Ivan Miljenovic's message of Ter Mar 30 00:01:19 -0300 2010: On 30 March 2010 13:55, Jason Dagit da...@codersbase.com wrote: (...) [..] now trying to profile something, oh wait, some problem again. Agreed, if Debian didn't include the profiling libraries with GHC (though is this due to how Debian does packages?). The profiling libraries included in ghc6 are available in the ghc6-prof package. Greetings. (...) -- marcot http://wiki.debian.org/MarcoSilva ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [Haskell.org Google Summer of Code] trac signup issues
Hi Edward. Excerpts from Edward Kmett's message of Sex Mar 12 15:52:50 -0300 2010: It has come to my attention that there is an issue with creating accounts on the summer-of-code trac at the moment. Yes, I had one of those. I tried to create an account with the user marcot, and it asked me for a username and password. I entered marcot and the password I've written in the registration page, but it didn't worked. After that I tried again to create my user, but it said the user marcot was already taken. Any chance you can fix this somehow to me? In the meantime, if you want to sign up as a student or mentor for this year's summer of code, please email me with your name and desired contact email address, and I'll make sure your name winds up on the list. I want to sign up as a student, please. Thanks in advance. (...) -- marcot http://wiki.debian.org/MarcoSilva ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Fwd: Still causes segfault.
--- Begin forwarded message from Marco Túlio Gontijo e Silva --- From: Marco Túlio Gontijo e Silva mar...@riseup.net To: 557185 557...@bugs.debian.org Cc: debian-haskell debian-hask...@lists.debian.org, glasgow-haskell-users glasgow-haskell-us...@lists.debian.org Date: Fri, 05 Feb 2010 15:26:51 -0200 Subject: Still causes segfault. Hi. I just tested building ghc6-6.12.1-4_powerpc with a registered build, that is, without those lines from debian/rules that make an unregistered build, and got a segfault just after running inplace/bin/ghc-stage2 --interactive. Just confirming that this bug is still present in this version. Greetings. --- End forwarded message --- -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Trying to build from the darcs repository
Hi Florian. Dom, 2010-01-24 às 13:10 +0100, Florian Weimer escreveu: How much memory does GHC need to build on amd64 GNU/Linux? I'm trying to build from the darcs repository, and this command inplace/bin/ghc-stage1 -H32m -O -package-name terminfo-0.3.1.1 -hide-all-packages -i ilibraries/terminfo/. --ilibraries/terminfo/dist-install/build -ilibraries/terminfo/dist-install/build/autogen -Ilibraries/terminfo/dist-install/build -Ilibraries/terminfo/dist-install/build/autogen --Ilibraries/terminfo/. optP-include -optPlibraries/terminfo/dist-install/build/autogen/cabal_macros.h -package base-4.2.0.0 -package extensible-exceptions-0.1.1.1 -split-objs -Wall -XForeignFunctionInterface -XDeriveDataTypeable -XEmptyDataDecls -XScopedTypeVariables -XFlexibleInstances -O2 -XGenerics -fno-warn-deprecated-flags -odir -libraries/terminfo/dist-install/build -hidir -libraries/terminfo/dist-install/build -stubdir -libraries/terminfo/dist-install/build -hisuf hi -osuf o -hcsuf hc --c libraries/terminfo/./System/Console/Terminfo/Effects.hs -o -libraries/terminfo/dist-install/build/System/Console/Terminfo/Effects.o needs more than 3.5 GB of RAM. I guess this is related to http://hackage.haskell.org/trac/ghc/ticket/3831 . Greetings. (...) -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: ghc API in platforms with no GHCi
Hi Thomas. Qua, 2010-01-20 às 18:47 +, Thomas Schilling escreveu: The byte code interpreter (which hlint uses) has its own dynamic linker to load binaries. I suppose the platforms that you listed this is not supported and GHCi (or more precisely the part of GHCi that requires the byte code interpreter) is not built. Thanks for your answer. If you're interested, I've changed hlint in Debian to be built only in i386, amd64 and sparc. Greetings. (...) -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Broken link in GHC page
Hi. The link to the mailing list on the GHC page is not correct. It should link to http://www.haskell.org/ghc/docs/latest/html/users_guide/mailing-lists-GHC.html instead of http://www.haskell.org/ghc/docs/latest/html/users_guide/introduction-GHC.html#mailing-lists-GHC . Greetings. -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Fwd: Re: [Gtk2hs-devel] Help with build on Alpha]
Hi. I sent a mail to gtk2hs-devel about this bug, and I'm forwarding it's response to here. Greetings. Mensagem encaminhada De: Axel Simon axel.si...@ens.fr (...) On Sep 27, 2009, at 18:02, Marco Túlio Gontijo e Silva wrote: (...) I don't have a clue about this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=540879 . Do you have any idea about what could be causing this? (...) This is a limitation of ghc. So you should ask the ghc people if they can fix this. Then we could think of a work-around. But the only workaround there is is not to bind functions that are affected by the limitation. That would pretty much rule out all modules in ModelView/ which is a rather important part of Gtk2Hs. (...) -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Problem with profiling
Hello Axel. Em Ter, 2009-06-02 às 23:19 +0200, Axel Simon escreveu: On May 31, 2009, at 21:20, Marco Túlio Gontijo e Silva wrote: (...) recently there was a thread about a problem in profiling in gtk2hs-users, and it was menitoned that this could be a GHC6 bug. The problem is described in http://sourceforge.net/mailarchive/forum.php? thread_name=1242762143.18742.277.camel%40zezinhoforum_name=gtk2hs- users . Do you think this is a gtk2hs specific problem, or is it something about GHC? Are you sure that you compiled from scratch, i.e. did you do a 'make distclean'? You could try to give --disable-split-objs to configure and see if that helps. I build from a just extracted tree. Should I do make distclean just after extracting the .tar.gz? Greetings. -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Problem with profiling
Hello, recently there was a thread about a problem in profiling in gtk2hs-users, and it was menitoned that this could be a GHC6 bug. The problem is described in http://sourceforge.net/mailarchive/forum.php?thread_name=1242762143.18742.277.camel%40zezinhoforum_name=gtk2hs-users . Do you think this is a gtk2hs specific problem, or is it something about GHC? Greetings. -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] #haskell.pt IRC channel
Hello, I'd like to invite all Portuguese speakers haskellers to join #haskell.pt in irc.freenode.net. I added it to the list in http://www.haskell.org/haskellwiki/IRC_channel . Greetings. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Int vs Word performance?
Hello, sorry for breaking the thread, I just got in the list. Simon Peyton-Jones simonpj at microsoft.com : PS: in the case that no one gets around to creating such a patch, creating a ticket that documents the problem and points to the needed specialisations would be a start Was this created? I could not find something about it in the GHC trac. Greetings. -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Error in building profiling
Em Sex, 2009-02-06 às 22:55 +, Duncan Coutts escreveu: On Fri, 2009-02-06 at 08:28 -0200, Marco Túlio Gontijo e Silva wrote: $ ./setup configure --enable-library-profiling --disable-library-vanilla /usr/bin/ld: dist/build/Control/Monad/Cont.o: No such file: No such file or directory I'm using ghc6 6.10.1+dfsg1-5 and binutils 2.19-1~exp1. I tried the same with ghc6 6.8.2dfsg1-1 and it worked. Turns out I broke it in Cabal-1.4. It used to be that --disable-library-vanilla implied --disable-library-for-ghci where as they're now independent. Try the Cabal head branch now. Let me know if that fixes it for you. If it does I'll push it to the Cabal-1.6 branch. I tried with the updated cabal and it's working. Thanks. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Error in building profiling
Hello, I'm trying to package ghc-paths for debian, and I got to this: $ ./setup configure --enable-library-profiling --disable-library-vanilla Configuring ghc-paths-0.1.0.5... $ ./setup build Preprocessing library ghc-paths-0.1.0.5... Building ghc-paths-0.1.0.5... /usr/bin/ar: creating dist/build/libHSghc-paths-0.1.0.5_p.a /usr/bin/ld: dist/build/GHC/Paths.o: No such file: No such file or directory I thought this could be a problem with this package, but I've tried with mtl, and I got the same result: /usr/bin/ld: dist/build/Control/Monad/Cont.o: No such file: No such file or directory I'm using ghc6 6.10.1+dfsg1-5 and binutils 2.19-1~exp1. I tried the same with ghc6 6.8.2dfsg1-1 and it worked. Greetings. -- marcot http://marcot.iaaeee.org/ ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Error in building profiling
Hi, Em Qui, 2009-02-05 às 20:38 -0200, Marco Túlio Gontijo e Silva escreveu: I'm trying to package ghc-paths for debian, and I got to this: $ ./setup configure --enable-library-profiling --disable-library-vanilla Configuring ghc-paths-0.1.0.5... $ ./setup build Preprocessing library ghc-paths-0.1.0.5... Building ghc-paths-0.1.0.5... /usr/bin/ar: creating dist/build/libHSghc-paths-0.1.0.5_p.a /usr/bin/ld: dist/build/GHC/Paths.o: No such file: No such file or directory I thought this could be a problem with this package, but I've tried with mtl, and I got the same result: /usr/bin/ld: dist/build/Control/Monad/Cont.o: No such file: No such file or directory I'm using ghc6 6.10.1+dfsg1-5 and binutils 2.19-1~exp1. I tried the same with ghc6 6.8.2dfsg1-1 and it worked. Greetings. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Error in building profiling
Hello, I'm trying to package ghc-paths for debian, and I got to this: $ ./setup configure --enable-library-profiling --disable-library-vanilla Configuring ghc-paths-0.1.0.5... $ ./setup build Preprocessing library ghc-paths-0.1.0.5... Building ghc-paths-0.1.0.5... /usr/bin/ar: creating dist/build/libHSghc-paths-0.1.0.5_p.a /usr/bin/ld: dist/build/GHC/Paths.o: No such file: No such file or directory I thought this could be a problem with this package, but I've tried with mtl, and I got the same result: /usr/bin/ld: dist/build/Control/Monad/Cont.o: No such file: No such file or directory I'm using ghc6 6.10.1+dfsg1-5 and binutils 2.19-1~exp1. Greetings. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Small haskell practical course
Hello, I've presented a small practical course[0] in EMSL[1]. Any comments are welcome. 0: http://marcot.iaaeee.org/mini-curso.pdf (Portuguese only) 1: http://emsl.softwarelivre.org/ Greetings. -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Small haskell practical course
Em Sáb, 2008-12-13 às 13:07 -0800, Don Stewart escreveu: marcot: Hello, I've presented a small practical course[0] in EMSL[1]. Any comments are welcome. 0: http://marcot.iaaeee.org/mini-curso.pdf (Portuguese only) 1: http://emsl.softwarelivre.org/ Wonderful. Maybe you can add it to the .pt section of the Haskell wiki? Done, thanks for the suggestion. http://haskell.org/haskellwiki/Livros_e_tutoriais -- marcot http://marcot.iaaeee.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell] Catching error / making library functions monadic (in failure)
Hello, Op woensdag 08-10-2008 om 15:42 uur [tijdzone +0100], schreef Mitchell, Neil: http://www-users.cs.york.ac.uk/~ndm/safe/ I think takeDef should be tailDef, in this page. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell-cafe] csv one-liner
Op woensdag 01-10-2008 om 18:59 uur [tijdzone -0700], schreef Jason Dusek: Reply to all? No. Reply-to-list is a different thing. When you reply-to-all to a person who is in the list, the person gets two copies of the e-mail with different headers, which messes with filters and replies. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] csv one-liner
Op woensdag 01-10-2008 om 13:25 uur [tijdzone -0700], schreef Martin DeMello: 2008/10/1 wman [EMAIL PROTECTED]: PS: Sorry, Andrew, that I first posted the reply directly to you, still getting used to the fact that gmail kindly replies to the user on whose behalf the message was sent, not to the list. I think that's a list setting, not a gmail one. The list could set reply-to, which is usually not very recommended in netiquettes. And gmail doesn't have a reply-to-list option, which is very useful when the lists doesn't set reply-to, like haskell-cafe. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Hmm, what license to use?
Op vrijdag 26-09-2008 om 11:45 uur [tijdzone -0400], schreef Stefan Monnier: When I compare GPL and MIT/BSD licenses, I do a simple reasoning. Suppose a doctor in a battle field meet a badly injuried enemy. Should he help the enemy? My answer would be that he indeed should, at the condition that the patient will switch side. Oh wait, that's just what the GPL says. This is a good requisition if he is sure that he is on the right side of the battle, which is a assumption the soldier probably does, but should the doctor do it too? Accept my truth or die. Stefan Analogies are broken Analogies doesn't have the pretension of being perfect. If they were, they wouldn't be analogies. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] piping to system call
Em Ter, 2008-09-23 às 13:37 +0200, Janis Voigtlaender escreveu: (...) That is, I want a function like system' :: String - String - IO ExitCode such that system' cmd inp would be equivalent to first writing inp to a file, say temp, and then calling system (cmd ++ temp) (...) Does such a system' exist? I think you should take a look at HSH[0]. Greetings. 0: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/HSH -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] control-timeout with gtk
Em Qui, 2008-09-18 às 16:14 -0300, Marco Túlio Gontijo e Silva escreveu: Em Qui, 2008-09-18 às 11:51 -0700, Adam Langley escreveu: Do you want control-timeout? I think control-timeout is very useful. I'll try to fix it, and if I could, I'll upload it to hackage then. I couldn't, and I found a solution to what I want in System.Glib.MainLoop. So, if someone else is interested in maintaining this package, feel free to do it. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] control-timeout with gtk
Hello, Em Qui, 2008-09-18 às 10:05 -0700, Judah Jacobson escreveu: Just a guess, but this might be a problem with control-timeout's use of the unsafePerformIO global variables hack. It's missing the standard NOINLINE annotations which prevent multiple copies of the global variable from being created. I added the NOINLINE annotations and even tried building with -fno-cse, but the result was the same. Do you have any other suggestions? Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] control-timeout with gtk
Hello, I've written a simple sequencer[0] using gtk2hs and control-timeout[1]. In GHCi it works fine, but when I compile it, the timeouts generated by control-timeout are not executed. Actually, when I use the keyboard a lot, at some time they got executed. I thought it could be that these two packages are incompatible, but the I wondered why they work in GHCi. Any ideas? Greetings. 0: http://marcot.iaaeee.org/capoeira 1: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/control-timeout -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] control-timeout with gtk
Em Qui, 2008-09-18 às 11:30 -0700, Adam Langley escreveu: I'm afraid that I don't have enough time to do justice to my packages on Hackage these days so I've just sent an email requesting that they be removed. Maybe it's better that they stay there, even with nobody maintaining them. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] control-timeout with gtk
Em Qui, 2008-09-18 às 11:51 -0700, Adam Langley escreveu: Do you want control-timeout? I think control-timeout is very useful. I'll try to fix it, and if I could, I'll upload it to hackage then. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] system in forkIO
Hello. import System.Cmd import GHC.Conc main :: IO () main = forkIO ( do putStrLn fork system ls return ()) getChar return () When I run this code, I get fork and the result of ls only after I press a key. Does getChar blocks the other threads? Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] system in forkIO
Em Dom, 2008-09-14 às 11:08 -0700, Judah Jacobson escreveu: On Sun, Sep 14, 2008 at 10:24 AM, Marco Túlio Gontijo e Silva [EMAIL PROTECTED] wrote: When I run this code, I get fork and the result of ls only after I press a key. Does getChar blocks the other threads? I think this behavior is caused by (or at least related to) the following GHC bug: http://hackage.haskell.org/trac/ghc/ticket/2363 Thanks, I got it to work running threadWaitRead stdInput before getChar. Only changing forkIO for forkOS gave me the same result. Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] system in forkIO
Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu: Thanks, I got it to work running threadWaitRead stdInput before getChar. Now I've got another problem: import Control.Concurrent import System.IO import System.Process main :: IO () main = do process - runCommand wget http://ftp.br.debian.org/debian/pool/main/g/ghc6/ghc6_6.8.2-6_amd64.deb; forkIO $ putStrLn fork getChar = putChar terminateProcess process waitForProcess process return () Not even fork is shown. Any hints? Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] system in forkIO
Em Dom, 2008-09-14 às 14:52 -0700, Don Stewart escreveu: marcot: Em Dom, 2008-09-14 às 16:07 -0300, Marco Túlio Gontijo e Silva escreveu: Thanks, I got it to work running threadWaitRead stdInput before getChar. Now I've got another problem: import Control.Concurrent import System.IO import System.Process main :: IO () main = do process - runCommand wget http://ftp.br.debian.org/debian/pool/main/g/ghc6/ghc6_6.8.2-6_amd64.deb; forkIO $ putStrLn fork getChar = putChar terminateProcess process waitForProcess process return () Not even fork is shown. Any hints? Daemonic threads. When the main thread exits, everything exits. Check the docs for Control.Concurrent. You better use an MVar to ensure the main thread waits on its child. I don't think this is the problem because the mais thread is not exiting. wget takes a lot of time to end, and I never really wait it to finish. I wanted to enable the user to interrupt it, but if it's finished, I don't want to wait for the user input anymore, so the child thread can exit with the main one. I just noticed that if I add a putStrLn wait before waitForProcess, it'll print wait and then fork. I couldn't understand why this happened, but I can't still pass through getChar to get to terminateProcess. Is it right to call getChar inside a forkIO? Greetings. -- marcot Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Connecting to wireless network
Hello, I've made a small program[0] to connect to a wireless network. Comments are welcome. Greetings. 0: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/n-m -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.iaaeee.org/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] InterleavableIO
Hello, I've done a package based on the Jules Bean's e-mail [1] to Haskell-Café, with a more generalized implementation. In the original version, you could use InterleavableIO with StateT Int IO (), but not with StateT Int (ReaderT Char IO) (). In this version, this is possible. The package, interleavableIO, is available at [2]. I've also done an application that generates a version of a module with generalized parameters, called interleavableGen, available at [3]. This is very alpha, and interleavableGen has been tested only with Control.Exception yet. Comments are very welcome. Greetings. [1]: http://www.haskell.org/pipermail/haskell-cafe/2007-July/028501.html [2]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableIO-0.0.1 [3]: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/interleavableGen-0.0.1 -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Existential quantification problem
Hello, how do I unbox a existential quantificated data type? {-# LANGUAGE ExistentialQuantification #-} data L a = forall l. L (l a) unboxL (L l) = l is giving me, in GHC: Inferred type is less polymorphic than expected Quantified type variable `l' escapes When checking an existential match that binds l :: l t The pattern(s) have type(s): L t The body has type: l t In the definition of `unboxL': unboxL (L l) = l Thanks. -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Trying to install cabal
Hello Eric. Em Qui, 2008-07-10 às 19:00 +0100, Eric escreveu: C:\cabal\cabal-install-0.5.1runghc Setup configure Configuring cabal-install-0.5.1... Setup: At least the following dependencies are missing Cabal =1.41.5, HTTP =30003002, zlib =0.4 I'm not sure from this message what packages I need to install to get cabal up and running. Can anyone help? You can get these listed packages (Cabal, HTTP and zlib) in Hackage ( http://hackage.haskell.org/ ). Greetings. -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.blogspot.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] sdl-mixer loading issue
Em Ter, 2008-06-24 às 14:57 -0500, Norbert Wojtowicz escreveu: Prelude import Graphics.UI.SDL.Mixer.Music Prelude Graphics.UI.SDL.Mixer.Music loadMUS test.wav Loading package SDL-0.5.4 ... linking ... done. Loading package SDL-mixer-0.5.2 ... linking ... interactive: /home/norbert/bin/lib/SDL-mixer-0.5.2/ghc-6.8.2/HSSDL-mixer-0.5.2.o: unknown symbol `Mix_LoadWAV' ghc-6.8.2: unable to load package `SDL-mixer-0.5.2' Hello. SDL-mixer does not support the most recent SDL version. The problem is that in SDL now Mix_LoadWAV is a macro. -- Marco Túlio Gontijo e Silva Página: http://marcotmarcot.googlepages.com/ Blog: http://marcotmarcot.wordpress.com/ Correio: [EMAIL PROTECTED] XMPP: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Telefone: 25151920 Celular: 98116720 Endereço: Rua Turfa, 639/701 Prado 30410-370 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Text.Xhtml.Strict
Hello there. I don't know if it's off topic, but I don't know where else to ask. I've been using Text.Xhtml.Strict, and I'm wondering why the functions are mostly Html - Html and not HTML a = a - Html, or something similar. If they were like this, and toHtml would be not needed, what would make it simpler to call the functions with arguments that are not Html. The question is specific to this library, but I think it's a very general one: isn't it better to have more generic functions with type changing inside? It seems to me that it would make things better from the users point of view. What do you think? -- Marco Túlio Gontijo e Silva Blog: http://marcotmarcot.blogspot.com/ Página: http://marcotmarcot.googlepages.com/ Correio, Jabber, GTalk, MSN: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Error and warning messages with -O
Hello, I was trying to compile a library I wrote with cabal, but I couldn't because of -O. I tried removing it and it worked ok. Then I noticed that -O was giving some warnings and an error that are not present without it: [EMAIL PROTECTED]:~/codigo/haskell/haskellgpc/haskellgpc$ /usr/bin/ghc -package-name HaskellGPC-0.0.1 --make -hide-all-packages -i -idist/build/autogen -i. -odir dist/build -hidir dist/build -package base-2.0 -O -Wall -Werror -fffi Algebra.Geometric.Gpc [1 of 1] Compiling Algebra.Geometric.Gpc ( Algebra/Geometric/Gpc.hs, dist/build/Algebra/Geometric/Gpc.o ) /tmp/ghc5871_0/ghc5871_0.hc:5:35: error: Algebra/Geometric/Gpc.h: Arquivo ou diretório não encontrado /tmp/ghc5871_0/ghc5871_0.hc: In function ‘r2Hk_entry’: /tmp/ghc5871_0/ghc5871_0.hc:290:0: warning: implicit declaration of function ‘gpc_polygon_clip’ /tmp/ghc5871_0/ghc5871_0.hc: In function ‘r2Hm_entry’: /tmp/ghc5871_0/ghc5871_0.hc:327:0: warning: implicit declaration of function ‘gpc_free_polygon’ [EMAIL PROTECTED]:~/codigo/haskell/haskellgpc/haskellgpc$ /usr/bin/ghc -package-name HaskellGPC-0.0.1 --make -hide-all-packages -i -idist/build/autogen -i. -odir dist/build -hidir dist/build -package base-2.0 -Wall -Werror -fffi Algebra.Geometric.Gpc [1 of 1] Compiling Algebra.Geometric.Gpc ( Algebra/Geometric/Gpc.hs, dist/build/Algebra/Geometric/Gpc.o ) [EMAIL PROTECTED]:~/codigo/haskell/haskellgpc/haskellgpc$ Why can't I use -O? Thanks. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Error and warning messages with -O
Em Seg, 2007-01-29 às 13:34 -0200, Marco Túlio Gontijo e Silva escreveu: Hello, I was trying to compile a library I wrote with cabal, but I couldn't because of -O. I tried removing it and it worked ok. Then I noticed that -O was giving some warnings and an error that are not present without it: I just got it with a suggestion from bd_ on IRC, I was missing include-dirs: . Thanks anyway. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] Type infer
Em Qui, 2007-01-25 às 16:58 +, Simon Peyton-Jones escreveu: | -Original Message- | From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Marco | Túlio Gontijo e Silva | Sent: 25 January 2007 12:57 | To: haskell-cafe | Subject: Re: [Haskell-cafe] Type infer | | Em Qua, 2007-01-24 às 20:36 -0500, Bryan Donlan escreveu: | Marco Túlio Gontijo e Silva wrote: | Hello, | | I'm trying to define a partition__ function that is like | Data.Set.partition, but use State Monad: | | import Data.Set | import Control.Monad.State | | partition__ f = | do | snapshot - get | let | (firsts, rest) = Set.partition f snapshot | put rest | return firsts | | When I try to infer it's type in ghci I got: | | $ ghci | ___ ___ _ | / _ \ /\ /\/ __(_) |/ /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. | / /_\\/ __ / /___| | http://www.haskell.org/ghc/ | \/\/ /_/\/|_| Type :? for help. | | Loading package base ... linking ... done. | Prelude :load partition.hs | [1 of 1] Compiling Main ( partition.hs, interpreted ) | Ok, modules loaded: Main. | *Main :type partition__ | partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) | | Ok, then I add | | partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set | a) | | to the file and then: | | *Main :reload | [1 of 1] Compiling Main ( partition.hs, interpreted ) | | partition.hs:4:0: | Non type-variable argument in the constraint: MonadState (Set a) t | (Use -fglasgow-exts to permit this) | In the type signature for `partition__': | partition__ :: (MonadState (Set a) t, Ord a) = |(a - Bool) - t (Set a) | Failed, modules loaded: none. | | Why do I need glasgow-exts to specify a type infered by GHCi without | -fglasgow-exts? | | I'd imagine the check that you're using -fglasgow-exts is performed when | parsing type signatures from the parser. When you allow GHC to infer the | type, it's pulling that from Control.Monad.State, which was compiled | with -fglasgow-exts - it's simply not checking that all the types you | might infer from there are legal without -fglasgow-exts. | | Makes sense, but isn't it a bug? It shouldn't be able infer types that | are not allowed without -fglasgow-exts, right? This isn't a type-soundness bug; but it could be considered a user-interface sort of bug. After all, it's caused users to be puzzled. It arises really because it was convenient for the implementation. Do go ahead and file it as a Trac bug if it tripped you up enough to be worth fixing. A fix should not take long, but might be a bit fiddly. But if I can't write this type signature without -fglasgow-exts, I thought that it couldn't infer this type. For me it's strange that it's ok to have a very generic function if I don't have a type signature, but if I write it the function will not be so generic. Shouldn't it infer only types that could be written? Thanks. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Type infer
Em Qua, 2007-01-24 às 20:36 -0500, Bryan Donlan escreveu: Marco Túlio Gontijo e Silva wrote: Hello, I'm trying to define a partition__ function that is like Data.Set.partition, but use State Monad: import Data.Set import Control.Monad.State partition__ f = do snapshot - get let (firsts, rest) = Set.partition f snapshot put rest return firsts When I try to infer it's type in ghci I got: $ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for help. Loading package base ... linking ... done. Prelude :load partition.hs [1 of 1] Compiling Main ( partition.hs, interpreted ) Ok, modules loaded: Main. *Main :type partition__ partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) Ok, then I add partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) to the file and then: *Main :reload [1 of 1] Compiling Main ( partition.hs, interpreted ) partition.hs:4:0: Non type-variable argument in the constraint: MonadState (Set a) t (Use -fglasgow-exts to permit this) In the type signature for `partition__': partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) Failed, modules loaded: none. Why do I need glasgow-exts to specify a type infered by GHCi without -fglasgow-exts? I'd imagine the check that you're using -fglasgow-exts is performed when parsing type signatures from the parser. When you allow GHC to infer the type, it's pulling that from Control.Monad.State, which was compiled with -fglasgow-exts - it's simply not checking that all the types you might infer from there are legal without -fglasgow-exts. Makes sense, but isn't it a bug? It shouldn't be able infer types that are not allowed without -fglasgow-exts, right? Thanks. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Monomorphism restriction
Hello, I talked for a while with bd_ about this on #haskell, and I think maybe I'm just being silly. But I can't get why: lambda = \x - length (show x) or dot = length . show is different from pre x = length $ show x I read about monomorphism restriction on the haskell 98 report, but I couldn't find where it explains the reason why these different versions influence on type infer. Thanks for any help. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Type infer
Hello, I'm trying to define a partition__ function that is like Data.Set.partition, but use State Monad: import Data.Set import Control.Monad.State partition__ f = do snapshot - get let (firsts, rest) = Set.partition f snapshot put rest return firsts When I try to infer it's type in ghci I got: $ ghci ___ ___ _ / _ \ /\ /\/ __(_) / /_\// /_/ / / | | GHC Interactive, version 6.6, for Haskell 98. / /_\\/ __ / /___| | http://www.haskell.org/ghc/ \/\/ /_/\/|_| Type :? for help. Loading package base ... linking ... done. Prelude :load partition.hs [1 of 1] Compiling Main ( partition.hs, interpreted ) Ok, modules loaded: Main. *Main :type partition__ partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) Ok, then I add partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) to the file and then: *Main :reload [1 of 1] Compiling Main ( partition.hs, interpreted ) partition.hs:4:0: Non type-variable argument in the constraint: MonadState (Set a) t (Use -fglasgow-exts to permit this) In the type signature for `partition__': partition__ :: (MonadState (Set a) t, Ord a) = (a - Bool) - t (Set a) Failed, modules loaded: none. Why do I need glasgow-exts to specify a type infered by GHCi without -fglasgow-exts? Thanks. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Ekiga: [EMAIL PROTECTED] IRC: [EMAIL PROTECTED] [EMAIL PROTECTED] Skype: marcotmarcot Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] mapTuple
Hello, is there a way to defined something as a map to use in tuples? I tried this: mapTuple f (a, b) = (f a, f b) But the type inferred to it is not as generic as I wanted: mapTuple :: (t - t1) - (t, t) - (t1, t1) Then I tried a different, but not much, implementation: mapTuple' f g (a, b) = (f a, g b) mapTuple f = mapTuple' f f But the inferred type was the same. Is there a way to define a function in which I can be able to do something as this? mapTuple show (string, True) -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mapTuple
Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu: you might want invistigate heterogeneous lists : in your case, it's heterogeneous typle. But aren't tuples always heterogeneous? Regards. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] mapTuple
Em Qui, 2007-01-11 às 16:51 +0100, minh thu escreveu: 2007/1/11, Marco Túlio Gontijo e Silva [EMAIL PROTECTED]: Em Qui, 2007-01-11 às 16:14 +0100, minh thu escreveu: you might want invistigate heterogeneous lists : in your case, it's heterogeneous typle. But aren't tuples always heterogeneous? You're right but the fact you apply a function on both element of the tuple constrains them to have the same type. Thus the problem is reminiscent of heterogeneous lists: how can you make (i.e. wrap) two values of different type so they have (after being wrapped) the same type ? I couldnt find the page I was refering but found this one: http://en.wikibooks.org/wiki/Haskell/Existentially_quantified_types Look at the part on heterogeneous list, the examples are the thing you want (but for a list, not for a tuple). Oh two things: 1/ I'm a bad haskell programmers since I have not enough experience (so maybe I'm throwing you in the bad direction but I prefer to answer so you not have to wait to long...); 2/ It's a bit of a habit here to answer with quite involved material even when a noob asks something (which I don't know if you are or not). Thus maybe the real answer to your question is wether what you ask for is really the root of the problem (I can't answer for you). Another way to do what you want if you just want to use the 'show' function above on some types (and not every instance of Show) is to wrap each type individually in a variant type something like this: data MyShowable = S String | B Bool myShow :: MyShowable - String Optionnaly you can then make MyShowable an instance of Show. This way is much more 'basic level' haskell than the wiki page above. Thanks for your answers. I found the page of heterogeneous collections in haskell wiki: http://haskell.org/haskellwiki/Heterogenous_collections But my point was trying to do this without having to convert it to a homogeneous tuple by using Dynamic. I read a little of the wiki page, and it gave me some ideas: (with ghci -fglasgow-exts) let mapTuple :: forall c d e f. (forall a b. a - b) - (c, d) - (e, f); mapTuple f (x, y) = (f x, f y) works fine, but when I run: Prelude mapTuple show (string, True) interactive:1:9: Couldn't match expected type `b' (a rigid variable) against inferred type `String' `b' is bound by the polymorphic type `forall a b. a - b' at interactive:1:0-29 In the first argument of `mapTuple', namely `show' In the expression: mapTuple show (string, True) In the definition of `it': it = mapTuple show (string, True) Prelude And: Prelude mapTuple head ([string], [True]) interactive:1:9: Couldn't match expected type `a' (a rigid variable) against inferred type `[a1]' `a' is bound by the polymorphic type `forall a b. a - b' at interactive:1:0-33 Expected type: a - b Inferred type: [a1] - a1 In the first argument of `mapTuple', namely `head' In the expression: mapTuple head ([string], [True]) Prelude This seemed to work: Prelude mapTuple (const undefined) (string, True) (*** Exception: Prelude.undefined Prelude The problem is it only works with forall a b. a - b functions. I tried with exits, but I got an error: Prelude let mapTuple :: forall c d e f. (exists a b. a - b) - (c, d) - (e, f); mapTuple f (x, y) = (f x, f y) interactive:1:43: parse error on input `.' Prelude Thanks for any help. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] trouble installing greencard -- -fno-prune-tydecls flag ( was Re: trivial function application question )
Em Dom, 2007-01-07 às 02:07 +, Ross Paterson escreveu: On Sun, Jan 07, 2007 at 12:44:46PM +1100, Donald Bruce Stewart wrote: dmhouse: On 06/01/07, Chris Kuklewicz [EMAIL PROTECTED] wrote: Running --configure notices that many things are not installed, but this is just noise from Cabal. This is the second time I've seen someone get confused by these messages. I propose we add a 'Configuration successful, now type runhaskell Setup.hs build.' to the bottom of the configure output. I agree. This issue is even mentioned here: www.serpentine.com/blog/2007/01/05/getting-started-with-installing-third-party-haskell-packages/ Those new to Cabal always seem to assume things are going badly when happy not found. We need to address the psychological aspect of Cabal's config process :) But it's not enough to just say Ignore any errors above. Some packages really do need happy (or some other tool) to build. Cabal would need to crawl over the source files to see what preprocessors are really needed. (It does that in the build phase, but not configure.) If haddock is absent, you can build and install, but not build documentation. Maybe if in the Cabal file was specified what's needed for compiling the package, this would not happen. -- malebria Marco Túlio Gontijo e Silva Correio (MSN): [EMAIL PROTECTED] Jabber (GTalk): [EMAIL PROTECTED] Telefone: 33346720 Celular: 98116720 Endereço: Rua Paula Cândido, 257/201 Gutierrez 30430-260 Belo Horizonte/MG Brasil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe