[Haskell-cafe] Re: Set Operations In Haskell's Type System

2010-05-07 Thread John Creighton
On May 6, 4:30 am, Bartek Ćwikłowski paczesi...@gmail.com wrote: hello, 2010/5/6 John Creighton johns2...@gmail.com: a isa d if their exists a b and c such that the following conditions hold: a isa subset of b, b isa c c is a subset of d This definition doesn't make sense - it's

Re: [Haskell-cafe] Dynamic CSV Parsing - Parsec

2010-05-07 Thread Bernd Holzmüller
Hi Günther, A simple method is to parameterize a parse function by something you parsed previously. For the example you gave, I would try something like this: import ParseToken cellContent = do ... -- parses the contents of a cell cvsParser = do headings - sepBy identifier semi cs - count

Re: [Haskell-cafe] darcs to mercurial migration

2010-05-07 Thread Nicolas Pouillard
On Thu, 06 May 2010 01:08:08 +0200, Günther Schmidt gue.schm...@web.de wrote: Hello, I'm switching from darcs to mercurial with some of my projects. I'd like to retain as much of the history as possible, what tools are there available for this? I recommend you darcs-fast-export and then

[Haskell-cafe] Mirror repository for gtk2hs

2010-05-07 Thread Andy Stewart
Hi all, Because code.haskell.org is unstable recently, and many gtk2hs users can't get code from http://code.haskell.org/gtk2hs So i build a mirror repository at http://patch-tag.com/r/AndyStewart/gtk2hs-sync-mirror/home You can access this mirror repository when code.haskell.org down. This

Re: [Haskell-cafe] Database connection pool

2010-05-07 Thread Michael Snoyman
On Fri, May 7, 2010 at 1:02 AM, Bas van Dijk v.dijk@gmail.com wrote: On Thu, May 6, 2010 at 11:54 PM, Bas van Dijk v.dijk@gmail.com wrote: On Thu, May 6, 2010 at 7:48 PM, Bas van Dijk v.dijk@gmail.com wrote: On Thu, May 6, 2010 at 3:24 PM, Michael Snoyman mich...@snoyman.com

Re: [Haskell-cafe] ANNOUNCE: gt-tools-0.1.4

2010-05-07 Thread Max Rabkin
On Fri, May 7, 2010 at 4:12 AM, Felipe Lessa felipe.le...@gmail.com wrote: On Thu, May 06, 2010 at 09:30:50PM +0300, Sergei Trofimovich wrote: /me wonders if Miss lambdabot might like to have such functionality. What do you think? Do the terms of use of Google Translate allow it? I can't

[Haskell-cafe] Re: [Long, probably not-beginners anymore] Parallel folds and folds as arrows (was: Re: [Haskell-beginners] Re: When, if ever, does Haskell calculate once?)

2010-05-07 Thread Daniel Fischer
On Friday 07 May 2010 03:15:19, Maciej Piechotka wrote: On Thu, 2010-05-06 at 23:46 +0200, Daniel Fischer wrote: Share.share :: GHC.Types.Int GblId [Str: DmdType] Share.share = case GHC.List.$wlen @ GHC.Integer.Type.Integer Share.share_a 0 of ww_amc { __DEFAULT - GHC.Types.I#

[Haskell-cafe] Re: [Long, probably not-beginners anymore] Parallel folds and folds as arrows (was: Re: [Haskell-beginners] Re: When, if ever, does Haskell calculate once?)

2010-05-07 Thread Daniel Fischer
On Friday 07 May 2010 16:15:41, Daniel Fischer wrote: b) using Don Stewart's ghc-core (http://hackage.haskell.org/package/ghc- core), e.g. ghc.core -f html -- -O2 Source.hs Source.html And of course, the html backend of ghc-core was removed with version 0.5 :( If you want html output, $ cabal

Re: [Haskell-cafe] accents

2010-05-07 Thread Dupont Corentin
Hello, i'm still struggling with ghci and accents. Prelude é \233 I've installed GHC 6.12.1, which gave me a better result: Prelude putStrLn é é but still: Prelude é \233 I'm trying to search a file with french words with Regex, but i stumble on accents: *Main findRegexFile abnégation []

[Haskell-cafe] Type system game (was: Nomic game in Haskell)

2010-05-07 Thread Dupont Corentin
Hello, I think your type should be: type Board a b c d e f g h i = Either (Three a b c) (Either (Three d e f) (Either (Three g h i) (Either (Three a d g) (Either (Three b e h) (Either (Three c f i) (Either (Three a e i) (Three c e g))) as far as i can understand, it

Re: [Haskell-cafe] accents

2010-05-07 Thread Daniel Fischer
On Friday 07 May 2010 17:05:08, Dupont Corentin wrote: Hello, i'm still struggling with ghci and accents. Prelude é \233 That uses the Show instance of Char, which escapes all characters greater than '\127' ('\DEL'), so that's no problem, jut inconvenient. I've installed GHC 6.12.1,

Re: [Haskell-cafe] darcs to mercurial migration

2010-05-07 Thread Jason Dagit
On Fri, May 7, 2010 at 2:29 AM, Nicolas Pouillard nicolas.pouill...@gmail.com wrote: On Thu, 06 May 2010 01:08:08 +0200, Günther Schmidt gue.schm...@web.de wrote: Hello, I'm switching from darcs to mercurial with some of my projects. I'd like to retain as much of the history as

[Haskell-cafe] Re: ANNOUNCE: network-protocol-xmpp 0.3

2010-05-07 Thread Sergei Trofimovich
On Mon, 3 May 2010 07:43:25 -0700 John Millikin jmilli...@gmail.com wrote: My library, network-protocol-xmpp[2], is an implementation of most of RFC 3920 and a bit of RFC 3921. It supports opening client-to-server and component-to-server sessions, which is useful for implementing XMPP-based

[Haskell-cafe] ANN: test-framework 0.3.0

2010-05-07 Thread Max Bolingbroke
I'm pleased to announce the release of version 0.3 of test-framework (http://hackage.haskell.org/package/test-framework-0.3.0). This package provides a nice test runner for HUnit, QuickCheck 1 and QuickCheck 2 tests. To see a detailed example of the runner in action, please check out our website

Re: [Haskell-cafe] {-# LANGUAGE DeriveApplicative #-} ?

2010-05-07 Thread Neil Mitchell
Hi, If you think you can write an algorithm for deriving Applicative, I'd welcome you to try adding it to Derive: http://community.haskell.org/~ndm/derive The Functor/Foldable/Traversable derivations all started out in Derive, got tested/implemented/refined there, then moved to GHC later. I

Re: [Haskell-cafe] Would it be evil to add deriving Typeable to newtype Q?

2010-05-07 Thread Neil Mitchell
Hi Leonel, You might want to try Derive (http://community.haskell.org/~ndm/derive) if DrIFT doesn't work for you. They do roughly the same jobs, but Derive has more output formats (it can be spliced in as Template Haskell, generate #include files, output text etc) more derivations (but not quite

[Haskell-cafe] Re: ANNOUNCE: network-protocol-xmpp 0.3

2010-05-07 Thread John Millikin
On Fri, May 7, 2010 at 10:09, Sergei Trofimovich sly...@gmail.com wrote: 1. gsasl hackage package did not build for me against libgsasl-0.2.28.    It did not define _MAJOR _MINOR macros, So I had to update    up to libgsasl-1.4 which worked fine. Is there way to put constraints    to

[Haskell-cafe] Re: ANN: test-framework 0.3.0

2010-05-07 Thread Simon Michael
On 5/7/10 10:49 AM, Max Bolingbroke wrote: * There is a new command line option (--plain), which tells the test runner to avoid using any ANSI features - this can be handy if you are (for example) viewing test output in Emacs Thanks! I'll use that in the next release of shelltestrunner.

Re: [Haskell-cafe] Would it be evil to add deriving Typeable to newtype Q?

2010-05-07 Thread Ivan Lazar Miljenovic
Neil Mitchell ndmitch...@gmail.com writes: You might want to try Derive (http://community.haskell.org/~ndm/derive) if DrIFT doesn't work for you. They do roughly the same jobs, but Derive has more output formats (it can be spliced in as Template Haskell, generate #include files, output text

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Limestraël
Yes, I wonder why mtl is not updated so as to remove this restriction. 2010/5/1 John Millikin jmilli...@gmail.com You might want to make a local version of ErrorT in your library, to avoid the silly 'Error' class restriction. This is pretty easy; just copy it from the 'transformers' or 'mtl'

Re: [Haskell-cafe] GHC 6.12 on OS X 10.5

2010-05-07 Thread Jason Dagit
On Mon, Dec 28, 2009 at 9:03 AM, Aaron Tomb at...@galois.com wrote: On Dec 22, 2009, at 9:36 PM, wren ng thornton wrote: Aaron Tomb wrote: I've come across the issue with iconv, as well. The problem seems to be that some versions of iconv define iconv_open and some related functions as

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ivan Lazar Miljenovic
Limestraël limestr...@gmail.com writes: 2010/5/1 John Millikin jmilli...@gmail.com You might want to make a local version of ErrorT in your library, to avoid the silly 'Error' class restriction. This is pretty easy; just copy it from the 'transformers' or 'mtl' package. Yes, I wonder why

[Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Gene A
The problem I see is that in both: Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and ghci 6.10.4, they both exhibit a {I think} strange behaviour, in regards to the shorthand way of calling out a list of enumerable values. I will explain the problem

Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Ivan Lazar Miljenovic
Gene A yumag...@gmail.com writes: The problem I see is that in both: Version: September 2006 of hugs, which is the one that is current for Ubuntu 9.10 release, and ghci 6.10.4, they both exhibit a {I think} strange behaviour, in regards to the shorthand way of calling out a list of

Re: [Haskell-cafe] Shorthand method of enumerating a list a gotcha ... or is it just me?

2010-05-07 Thread Roel van Dijk
From the Haskell 98 report (section 6.3.4): For Float and Double, the semantics of the enumFrom family is given by the rules for Int above, except that the list terminates when the elements become greater than e3+i/2 for positive increment i, or when they become less than e3+i/2 for

Re: [Haskell-cafe] Would it be evil to add deriving Typeable to newtype Q?

2010-05-07 Thread Mike Dillon
begin Ivan Lazar Miljenovic quotation: Neil Mitchell ndmitch...@gmail.com writes: You might want to try Derive (http://community.haskell.org/~ndm/derive) if DrIFT doesn't work for you. They do roughly the same jobs, but Derive has more output formats (it can be spliced in as Template

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 4, 2010, at 01:52 , Maciej Piechotka wrote: After change of file you have to wait a long time as it compiles and links with yi. On my system (1 GB of RAM taken by system + 1 GB 'free' + 2 GB swaps, x86-64) it could in some situations it caused OOM. I'd prefer if the code was

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ross Paterson
On Sat, May 08, 2010 at 07:49:57AM +1000, Ivan Lazar Miljenovic wrote: Limestraël limestr...@gmail.com writes: 2010/5/1 John Millikin jmilli...@gmail.com You might want to make a local version of ErrorT in your library, to avoid the silly 'Error' class restriction. This is pretty easy;

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 5, 2010, at 21:49 , Pierre-Etienne Meunier wrote: - all these =, significative indentation, You're from the past dude. Careful, or Guido (van Rossum) is going to show up on your doorstep -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 6, 2010, at 11:08 , Donn Cave wrote: different ambitions. Who would pick Tcl for a programming language? but it has been popular for scripting (still? don't know.) It would I think Lua has superseded it, because it has the compactness advantage and easy embeddability of of the Tcl

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Limestraël
There is the package hint, which embeds the calls to GHC API. Quite easy to use: Let's say your configuration file (cfg/Script.hs) contains a function script that you want to get: type ScriptFun = IO () loadScript :: IO ScriptFun loadScript = do liftM (either (error . show) id) $

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Limestraël
Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. 2010/5/8 Ross Paterson r...@soi.city.ac.uk On Sat, May 08, 2010 at 07:49:57AM +1000, Ivan Lazar Miljenovic wrote:

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Gregory Crosswhite
On May 7, 2010, at 4:54 PM, Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. As far as I can tell, its purpose is to essentially allow you to

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 7, 2010, at 19:51 , Limestraël wrote: then interpret script (as :: ScriptFun) There is just the line I put in bold that bothers me. Can't we get the action script more easily than by re-interpreting some code? Make up your mind: you don't want to have to compile the script,

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ross Paterson
On Sat, May 08, 2010 at 01:54:21AM +0200, Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. It was introduced to implement pattern match failure in

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 7, 2010, at 19:54 , Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. The translation of do syntax involves pattern matching (do { [x,y,z]

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Dan Doel
On Friday 07 May 2010 7:54:21 pm Limestraël wrote: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. Understanding why fail exists requires going back to before

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Pierre-Etienne Meunier
Shit ! I'll have to explain him how to add monads in python 3 ;-) El 07/05/2010, a las 19:31, Brandon S. Allbery KF8NH escribió: On May 5, 2010, at 21:49 , Pierre-Etienne Meunier wrote: - all these =, significative indentation, You're from the past dude. Careful, or Guido (van Rossum) is

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Pierre-Etienne Meunier
By the way, I do not know the GHC API well enough to say if it is possible to embed a super small bytecode interpreter, but : - If it is the case, then users who do not want to write scripts can use it. Others would want to compile haskell code, therefore they need GHC anyway. - If it is not,

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Pierre-Etienne Meunier
There is a also a problem with polymorphic actions of functions. The GHC API is typesafe only when returning elements of the Typeable class. Else you can do an unsafeCoerce, but I assume that hint uses Typeable, with a wrapper class to ensure monomorphism. But if your script action returns a

[Haskell-cafe] Haskell interface to Frama-C

2010-05-07 Thread Tom Hawkins
I just started using Frama-C [1] for analyzing some of our embedded C programs. Pretty awesome suite of tools. Especially its ability to describe and verify function contracts with ACSL [2]. The tool suite is primarily build with OCaml. Has anyone considered building a Haskell interface to

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 3, 2010, at 12:14 , Henning Thielemann wrote: Ketil Malde schrieb: Henning Thielemann lemm...@henning-thielemann.de writes: http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Control-Exception.html#v%3Athrow I see. This should be forbidden, at all! :-) Why is this

[Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Andy Stewart
Daniel Fischer daniel.is.fisc...@web.de writes: On Wednesday 05 May 2010 23:36:26, Limestraël wrote: but you will not object if I say that scheme is quicker to learn than Haskell. Well, I do object. Learning Haskell went like a breeze (not to perfection, but well enough). Only Python was

Re: [Haskell-cafe] Haskell and the Software design process

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 4, 2010, at 12:31 , Gregory Crosswhite wrote: On May 4, 2010, at 5:22 AM, John Lato wrote: Crashing at the point of the error isn't necessarily useful in Haskell due to lazy evaluation. The code will crash when the result of the partial function is evaluated, which may be quite far away

Re: [Haskell-cafe] ANN: test-framework 0.3.0

2010-05-07 Thread Gregory Collins
Max Bolingbroke batterseapo...@hotmail.com writes: I'm pleased to announce the release of version 0.3 of test-framework (http://hackage.haskell.org/package/test-framework-0.3.0). ... * There is a new command line option (--plain), which tells the test runner to avoid using any ANSI

Re: [Haskell-cafe] darcs to mercurial migration

2010-05-07 Thread Marc Weber
Hi Günther, tehre is a fast darcs to git tool. Maybe you can convert to mercurial easily then. Ping me on irc (MarcWeber) or write back if you're interested. I'll digg the link up then. Marc Weber ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Limestraël
You might have misunderstood me. When using hint, one wants the script to be interpreted. It is interpreted when called loadModules [Script] , but if we call later interpret *something* (as :: Something) , the *something *can be any Haskell code, not just a function name, which means hint has

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread John Meacham
On Fri, May 07, 2010 at 08:27:04PM -0400, Dan Doel wrote: Personally, I don't really understand why unfailable patterns were canned (they don't seem that complicated to me), so I'd vote to bring them back, and get rid of fail. But hind sight is 20/20, I suppose (or perhaps there exist cogent

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread David Menendez
On Fri, May 7, 2010 at 10:26 PM, John Meacham j...@repetae.net wrote: On Fri, May 07, 2010 at 08:27:04PM -0400, Dan Doel wrote: Personally, I don't really understand why unfailable patterns were canned (they don't seem that complicated to me), so I'd vote to bring them back, and get rid of

[Haskell-cafe] installing haskell platform on 64-bit ubuntu 10.04 (Lucid)

2010-05-07 Thread Andy Lee
Has anyone had problems getting Haskell Platform installed on Ubuntu 10.04? I've got GHC 6.12.1 installed via apt-get, and I've downloaded/untarred haskell-platform-2010.1.0.0.tar.gz. But when I run ./configure, it fails fairly quickly, with an error 'cause it can't build the hello world

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 7, 2010, at 22:18 , Limestraël wrote: When using hint, one wants the script to be interpreted. It is interpreted when called loadModules [Script] , but if we call later interpret something (as :: Something) , the something can be any Haskell code, not just a function name, which

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ivan Lazar Miljenovic
Limestraël limestr...@gmail.com writes: Personally I think fail is a terrible wart, and should be shunned. So do I. I can't understand its purpose since monads which can fail can be implemented through MonadPlus. Polyparse uses it, and I believe Parsec does as well... -- Ivan Lazar

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ivan Lazar Miljenovic
David Menendez d...@zednenem.com writes: I wonder how often people rely on the use of fail in pattern matching. Could we get by without fail or unfailable patterns? ensureCons :: MonadPlus m = [a] - m [a] ensureCons x@(_:_) = return x ensureCons _ = mzero do ... x:xs - ensureCons $

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread David Menendez
On Sat, May 8, 2010 at 12:15 AM, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: David Menendez d...@zednenem.com writes: I wonder how often people rely on the use of fail in pattern matching. Could we get by without fail or unfailable patterns? ensureCons :: MonadPlus m = [a] - m [a]

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ivan Lazar Miljenovic
David Menendez d...@zednenem.com writes: On Sat, May 8, 2010 at 12:15 AM, Ivan Lazar Miljenovic Well, any time you have a do-block like this you're using failable patterns: maybeAdd :: Maybe Int - Maybe Int - Maybe Int maybeAdd mx my = do x - mx y - my

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Brandon S. Allbery KF8NH
On May 8, 2010, at 01:16 , Ivan Lazar Miljenovic wrote: David Menendez d...@zednenem.com writes: On Sat, May 8, 2010 at 12:15 AM, Ivan Lazar Miljenovic Well, any time you have a do-block like this you're using failable patterns: maybeAdd :: Maybe Int - Maybe Int - Maybe Int maybeAdd mx

[Haskell-cafe] Re: IO (Either a Error) question

2010-05-07 Thread Maciej Piechotka
On Fri, 2010-05-07 at 19:26 -0700, John Meacham wrote: On Fri, May 07, 2010 at 08:27:04PM -0400, Dan Doel wrote: Personally, I don't really understand why unfailable patterns were canned (they don't seem that complicated to me), so I'd vote to bring them back, and get rid of fail. But

Re: [Haskell-cafe] IO (Either a Error) question

2010-05-07 Thread Ivan Lazar Miljenovic
Brandon S. Allbery KF8NH allb...@ece.cmu.edu writes: On May 8, 2010, at 01:16 , Ivan Lazar Miljenovic wrote: Huh? What about maybeAdd (Just 2) Nothing ? Isn't that handled by the definition of (=) in Maybe, as opposed to by invoking fail? instance Monad Maybe where -- ... Nothing =

Re: [Haskell-cafe] Re: Haskell and scripting

2010-05-07 Thread Evan Laforge
On the one hand, this is doable with the GHC API.  On the other, that more or less means your program contains what amounts to a full copy of GHC. And the result is that your binary will grow by 35mb, add a few seconds to launch time, the first expression will take 3 or 4 seconds to evaluate,