Re: [Haskell-cafe] Ajax-Haskell framework?

2008-09-18 Thread Titto Assini
Hi Greg, have a look at: http://www.haskell.org/haskellwiki/Hajax Best, titto 2008/9/17 Greg Meredith [EMAIL PROTECTED]: Haskellians, Is there an Ajax-Haskell framework? In case there are many, is there a preferred one? Experiences people would like to share? Best wishes, --greg

Re: [Haskell-cafe] Ajax-Haskell framework?

2008-09-18 Thread Don Stewart
Something like what Hayoo uses? http://holumbus.fh-wedel.de/hayoo/hayoo.html Lots of async stuff, JS and server chatter? -- Don titto: Hi Greg, have a look at: http://www.haskell.org/haskellwiki/Hajax Best, titto 2008/9/17 Greg Meredith [EMAIL PROTECTED]: Haskellians,

[Haskell-cafe] announcing darcs 2.0.3pre1

2008-09-18 Thread Eric Kow
Hi everybody, I am very pleased to announce the first pre-release of darcs 2.0.3, available at http://www.darcs.net/darcs-2.0.3pre1.tar.gz This pre-release includes a few major bug fixes and a handful of interesting features. I expect darcs 2.0.3 to be more reliable than its predecessors. We

[Haskell-cafe] XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Lev Walkin
Recently I had to process some multi-megabyte XML files. Tried a few Haskell XML parsers (HaXML, HXT, HXML) but all of them were exhibiting very pronounced space leaks, and all but HXML were too strict for my input. Judging by the code and stated objectives, Joe English's HXML (0.2, circa 2003)

[Haskell-cafe] Re: ANN: pandoc 1.0.0.1

2008-09-18 Thread Gour
Alfonso == Alfonso Acosta [EMAIL PROTECTED] writes: Alfonso I can't wait for a: Alfonso + New Docbook markup reader Alfonso The reason being, I would kill for a good Docbook-to-LaTeX Alfonso translator (or a good set of Docbook-to-TeXML XSLT Alfonso stylesheets): Alfonso * Most of the

Re: [Haskell-cafe] XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Ketil Malde
Lev Walkin [EMAIL PROTECTED] writes: Recently I had to process some multi-megabyte XML files. Join the club! FWIW, I ended up using tagsoup. -- %%% There is apparently a space leak here, but I can't find it. -- %%% Update 28 Feb 2000: There is a leak, but it's fixed -- %%% by a well-known

[Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Simon Marlow
Lev Walkin wrote: I wondered why would a contemporary GHC 6.8.3 exhibit such a leak? After all, the technique was known in 2000 (and afir by Wadler in '87) and one would assume Joe English's reference to most other Haskell systems ought to mean GHC. Thanks for this nice example - Don Stewart

[Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Simon Marlow
Jonathan Cast wrote: On Wed, 2008-09-17 at 13:44 -0700, Evan Laforge wrote: systems that don't use an existing user-space thread library (such as Concurrent Haskell or libthread [1]) emulate user-space threads by keeping a pool of processors and re-using them (e.g., IIUC Apache does this).

[Haskell-cafe] MetaHDBC paper

2008-09-18 Thread Mads Lindstrøm
Hi all, In May I started a Haskell-cafe discussions[1], where I proposed using Template Haskell to do type-safe database access. The idea got well received and turned into the MetaHDBC library[2]. Concurrently with development I also wrote a paper describing MetaHDBC. I have never writing a

[Haskell-cafe] Re: Float instance of 'read'

2008-09-18 Thread Mauricio
Agree about the answer, not about the question. The correct one would be is it possible to change haskell syntax to support the international notation (...) For some sense of possible, the answer is clearly yes. However, it is perhaps misleading to call commas THE international notation. (...)

Re: [Haskell-cafe] Exceptions

2008-09-18 Thread Marc Weber
On Wed, Sep 17, 2008 at 09:54:13PM -0700, Ryan Ingram wrote: Better is this: data MalformedAddressException = MalformedAddressException String deriving (Show, Typeable) throwDynIO x = throwIO (DynException $ toDyn x) You are right. Anyway the DynException will not be needed in the future

[Haskell-cafe] Strongly Typed Memory Areas

2008-09-18 Thread John Van Enk
Was Iavor/Mark's paper ever implemented as a GHC extension? Strongly Typed Memory Areas http://galois.com/down/2006_ID_Strongly.pdf -- /jve ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: Float instance of 'read'

2008-09-18 Thread Paulo Tanimoto
Hi, Mauricio, sorry for hijacking your thread. : ) I have one question about handling or parsing decimal places. I noticed that Haskell doesn't accept values starting with just the point, e.g., .50 or .01. I suppose that's abuse of notation in the first place (and I'm guilty of it), but I

RE: [Haskell-cafe] readFile and closing a file

2008-09-18 Thread Henning Thielemann
On Wed, 17 Sep 2008, Mitchell, Neil wrote: Hi Henning, I tend to use openFile, hGetContents, hClose - your initial readFile like call should be openFile/hGetContents, which gives you a lazy stream, and on a parse error call hClose. Yes, this seems to be the right way. This weakness should

Re: [Haskell-cafe] Real World HAppS: Cabalized, Self-Demoing HAppS Tutorial (Version 3)

2008-09-18 Thread Thomas Hartman
The latest darcs version of what? I don't remember putting that into my tutorial... t. 2008/9/17 Marc Weber [EMAIL PROTECTED]: On Tue, Sep 16, 2008 at 11:32:04PM +0200, Martin Huschenbett wrote: Hi all, taking a look at this tutorial under Windows Vista I ran into a problem: You should

[Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Jonathan Cast
On Thu, 2008-09-18 at 10:33 +0100, Simon Marlow wrote: Jonathan Cast wrote: An OS thread (Linux/Plan 9) stores: * Stack (definitely a stack pointer and stored registers ( 40 bytes on i686) and includes a special set of page tables on Plan 9) * FD set (even if it's the same as the

[Haskell-cafe] HStringTemplate to generate html tables

2008-09-18 Thread Thomas Hartman
I am trying to use HStringTemplate for generating html tables, for use in http://happstutorial.com:5001 The best I could do is below. Seems awfully kludgy. Can someone suggest a better way, which keeps me inside the StringTemplate way of doing things? (Eg, no suggestions to use HTML.* libraries,

[Haskell-cafe] Re: XML (HXML) parsing :: GHC 6.8.3 space leak from 2000

2008-09-18 Thread Lev Walkin
Simon Marlow wrote: Lev Walkin wrote: I wondered why would a contemporary GHC 6.8.3 exhibit such a leak? After all, the technique was known in 2000 (and afir by Wadler in '87) and one would assume Joe English's reference to most other Haskell systems ought to mean GHC. Thanks for this nice

[Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Marco Túlio Gontijo e Silva
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

[Haskell-cafe] A round of golf

2008-09-18 Thread Creighton Hogg
Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the console, the number of lines in a file. Off the top of my head, I came up with this which worked fine with files that had 100k lines: main = do path - liftM head $

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Judah Jacobson
On Thu, Sep 18, 2008 at 9:46 AM, Marco Túlio Gontijo e Silva [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] readFile and closing a file

2008-09-18 Thread Bryan O'Sullivan
On Wed, Sep 17, 2008 at 6:21 AM, David Roundy [EMAIL PROTECTED] wrote: Eventually the garbage collector should close the file, I believe. That's true, but eventually could be long enough to mean never in practice. It's safest to assume that finalizers will not run at all, never mind in a

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Kurt Hutchinson
On Thu, Sep 18, 2008 at 1:02 PM, Creighton Hogg [EMAIL PROTECTED] wrote: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the console, the number of lines in a file. Off the top of my head, I came up with this which

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Bryan O'Sullivan
On Thu, Sep 18, 2008 at 10:02 AM, Creighton Hogg [EMAIL PROTECTED] wrote: If this makes anyone cringe or cry you're doing it wrong, I'd actually like to hear it. Yes, that made me cry :-) Your code seems very convoluted, and quite successfully hides what it's really trying to do. Here's a

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Don Stewart
wchogg: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the console, the number of lines in a file. Off the top of my head, I came up with this which worked fine with files that had 100k lines: main = do path

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Adam Langley
On Thu, Sep 18, 2008 at 10:05 AM, Judah Jacobson [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Marco Túlio Gontijo e Silva
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.

Re: [Haskell-cafe] readFile and closing a file

2008-09-18 Thread David Roundy
On Thu, Sep 18, 2008 at 05:38:51PM +0200, Henning Thielemann wrote: On Wed, 17 Sep 2008, Mitchell, Neil wrote: I tend to use openFile, hGetContents, hClose - your initial readFile like call should be openFile/hGetContents, which gives you a lazy stream, and on a parse error call hClose. Yes,

[Haskell-cafe] Library design question

2008-09-18 Thread Andre Nathan
Hello I'm trying to write a simple graph library for a project of mine (actually, I'm porting it from OCaml) but I've got a design question right in the beginning. My Graph type is the following. data Graph a b = Graph { adjacencies :: Map Int (a, (Map Int b)) , numVertices :: Int

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Creighton Hogg
On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the console, the number of lines in a file. Off the top of my head, I came up with this

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Adam Langley
On Thu, Sep 18, 2008 at 11:38 AM, Marco Túlio Gontijo e Silva [EMAIL PROTECTED] wrote: Maybe it's better that they stay there, even with nobody maintaining them. Except that I feel shitty everytime someone someone emails me with questions or problems that I don't have the time to deal with.

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Don Stewart
wchogg: On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the console, the number of lines in a file. Off the top of my head, I

[Haskell-cafe] An interesting curiosity

2008-09-18 Thread Andrew Coppin
I'm currently reading a C++ tutorial. (Don't ask!) Of course, C++ is that crazy language where *assignment* is actually an *operator*. Sick, sick people... The tutorial pointed out that x = 4 is a legal assignment, but 4 = x is not. Obviously that would be silly. Now it occurs to me... in

[Haskell-cafe] a question about concurrent haskell

2008-09-18 Thread Manlio Perillo
Hi. I have a question about concurrent Haskell in GHC. Suppose I want to write a native pure Haskell PostgreSQL client. I have done this for Python (using Twisted): http://hg.mperillo.ath.cx/twisted/pglib/ and I would like to do this in Haskell, as an exercise. The main problem is with

Re: [Haskell-cafe] a question about concurrent haskell

2008-09-18 Thread Andrew Coppin
Manlio Perillo wrote: The GHC concurrent Haskell does not have a function to resume a given thread (as found, as an example, in Lua). It does, however, provide the MVar, which can be used to make a thread block until some data is inserted into the MVar by another thread.

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Manlio Perillo
Simon Marlow ha scritto: Jonathan Cast wrote: On Wed, 2008-09-17 at 13:44 -0700, Evan Laforge wrote: systems that don't use an existing user-space thread library (such as Concurrent Haskell or libthread [1]) emulate user-space threads by keeping a pool of processors and re-using them (e.g.,

Re: [Haskell-cafe] a question about concurrent haskell

2008-09-18 Thread Manlio Perillo
Andrew Coppin ha scritto: Manlio Perillo wrote: The GHC concurrent Haskell does not have a function to resume a given thread (as found, as an example, in Lua). It does, however, provide the MVar, which can be used to make a thread block until some data is inserted into the MVar by another

Re: [Haskell-cafe] Library design question

2008-09-18 Thread minh thu
2008/9/18 Andre Nathan [EMAIL PROTECTED]: Hello I'm trying to write a simple graph library for a project of mine (actually, I'm porting it from OCaml) but I've got a design question right in the beginning. My Graph type is the following. data Graph a b = Graph { adjacencies :: Map

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Marco Túlio Gontijo e Silva
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:

Re: [Haskell-cafe] Library design question

2008-09-18 Thread Henning Thielemann
On Thu, 18 Sep 2008, Andre Nathan wrote: The issue I hit was when writing the function to add a vertex to the graph. Since I need to update the vertex counter, I've used the state monad: addVertex :: Int - a - State (Graph a b) () addVertex vertex label = do g - get let adj =

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Evan Laforge
All of this works of course because in Haskell, = is not an assignment, it's a definition, and the RHS is not a variable, it's a pattern. And 4 is a perfectly legitimate pattern. Now, if only I could find a use for all this that borders on useful...! ;-) I like this one: let {1 + 1 = 3; 3 +

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread minh thu
2008/9/18 Evan Laforge [EMAIL PROTECTED]: All of this works of course because in Haskell, = is not an assignment, it's a definition, and the RHS is not a variable, it's a pattern. And 4 is a perfectly legitimate pattern. Now, if only I could find a use for all this that borders on useful...!

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Creighton Hogg
On Thu, Sep 18, 2008 at 1:55 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: snip This makes me cry. import System.Environment import qualified Data.ByteString.Lazy.Char8 as B main = do [f] -

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Don Stewart
wchogg: To ask an overly general question, if lazy bytestring makes a nice provider for incremental processing are there reasons to _not_ reach for that as my default when processing large files? At the moment, it would always be my first choice. Consider,

Re: [Haskell-cafe] a question about concurrent haskell

2008-09-18 Thread Don Stewart
manlio_perillo: Hi. I have a question about concurrent Haskell in GHC. Suppose I want to write a native pure Haskell PostgreSQL client. I have done this for Python (using Twisted): http://hg.mperillo.ath.cx/twisted/pglib/ and I would like to do this in Haskell, as an exercise. The

Re: [Haskell-cafe] a question about concurrent haskell

2008-09-18 Thread Bulat Ziganshin
Hello Manlio, Thursday, September 18, 2008, 11:01:10 PM, you wrote: you just need to handle it in a message-passing way. this type of problem (serializing access to unique resource) is rather common, for example it's used in GUI libs. std way is to create thread that will do actual work in

Re: [Haskell-cafe] Re: Python's big challenges, Haskell's big advantages?

2008-09-18 Thread Brandon S. Allbery KF8NH
On Sep 18, 2008, at 15:10 , Manlio Perillo wrote: Allocation areas are per-CPU, not per-thread. A Concurrent Haskell thread consists of a TSO (thread state object, currently 11 machine words), and a stack, which we currently start with 1KB and grow on demand. How is this implemented? I

[Haskell-cafe] Re: control-timeout with gtk

2008-09-18 Thread Dominic Steinitz
Adam Langley agl at imperialviolet.org writes: be removed. Anyone who wants to maintain any of them should grab it now. The repos are all at http://darcs.imperialviolet.org On the chopping block: binary-strict Adam, I don't particularly want to maintain this as I have negative amounts

[Haskell-cafe] Hackage and HaXml situation

2008-09-18 Thread John Goerzen
Hi everyone, We've got a bit of a problem in the community regarding HaXml. This has been brought up before, but never definitively resolved, and it's causing more and more trouble. Over at the HaXml homepage [1], it is stated that 1.13.3 is the most recent stable version of HaXml. I believe

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Jason Dagit
On Thu, Sep 18, 2008 at 12:31 PM, Creighton Hogg [EMAIL PROTECTED] wrote: On Thu, Sep 18, 2008 at 1:55 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: snip This makes me cry. import System.Environment import

Re: [Haskell-cafe] control-timeout with gtk

2008-09-18 Thread Jason Dagit
On Thu, Sep 18, 2008 at 11:30 AM, Adam Langley [EMAIL PROTECTED] wrote: On Thu, Sep 18, 2008 at 10:05 AM, Judah Jacobson [EMAIL PROTECTED] wrote: 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

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Don Stewart
dagit: On Thu, Sep 18, 2008 at 12:31 PM, Creighton Hogg [EMAIL PROTECTED] wrote: On Thu, Sep 18, 2008 at 1:55 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: snip This makes me cry. import

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Dan Piponi
On Thu, Sep 18, 2008 at 11:59 AM, Andrew Coppin [EMAIL PROTECTED] wrote: foo :: Int - Maybe Int foo x = do 4 - return x return (2*x) Now, if only I could find a use for all this that borders on useful...! ;-) It seems a lot less weird when you write something like: [x | (x,0) - map

Re: [Haskell-cafe] Library design question

2008-09-18 Thread Andre Nathan
On Thu, 2008-09-18 at 21:15 +0200, Henning Thielemann wrote: Think of the state monad as processing a graph in-place. Which graph is addressed is declared when running the State monad using runState or evalState. Interesting. Is it good practice then to do something like type GraphM a b =

Re: [Haskell-cafe] Library design question

2008-09-18 Thread Andre Nathan
On Thu, 2008-09-18 at 21:13 +0200, minh thu wrote: If you need the one inside the State monad, you can reuse the new version of addVertex. You mean making the graph creation functions (which will call addVertex/Edge) use the State monad instead? Interesting idea... what I really wanted was to

Re: [Haskell-cafe] Library design question

2008-09-18 Thread Henning Thielemann
On Thu, 18 Sep 2008, Andre Nathan wrote: On Thu, 2008-09-18 at 21:15 +0200, Henning Thielemann wrote: Think of the state monad as processing a graph in-place. Which graph is addressed is declared when running the State monad using runState or evalState. Interesting. Is it good practice then

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Creighton Hogg
On Thu, Sep 18, 2008 at 1:55 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: On Thu, Sep 18, 2008 at 1:29 PM, Don Stewart [EMAIL PROTECTED] wrote: wchogg: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program that would spit out, to the

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Don Stewart
wchogg: Hi Don, I have a bit more of a followup, actually. You make use of the built in bytestring consumer count, which itself is built upon the foldlChunks function which is only exported in the ByteString.Lazy.Internal. If I want to make my own efficient bytestring consumer, is that

[Haskell-cafe] Re: HStringTemplate to generate html tables

2008-09-18 Thread Sterling Clover
Hmm... an untested suggestion... table $cells:{ row | tr$row:{ cell | td$cell$/td}$/tr}$ /table (i.e. nested iteration) or to encompass the table call inside, $cells:{ row | tr$row:{ cell | td$cell$/td}$/tr}:{table$it$/table}$ Regards, Sterl. On Thu, Sep 18, 2008 at 8:16 AM, Thomas Hartman

[Haskell-cafe] Specifying a function type in a where clause.

2008-09-18 Thread Rob deFriesse
I would like to know why I'm getting a particular compile time error message. In this program, I am specifying a function type on /combs'/ in the where clause: module Main where import List (delete) combs :: Eq a = [a] - Int - [[a]] combs l 1 = map (\x - [x]) l combs l n = foldl

Re: [Haskell-cafe] Hackage and HaXml situation

2008-09-18 Thread Marc Weber
In your particular problem there is another way: Ask the distributors to ship both HaXmL versions.. (Most systems will install one only by default (an update supersedes the older one :-( ) But most distributions do let you install two or more versions (?) I think the way to go is beeing able to

Re: [Haskell-cafe] Specifying a function type in a where clause.

2008-09-18 Thread Daniel Fischer
Am Freitag, 19. September 2008 00:33 schrieb Rob deFriesse: I would like to know why I'm getting a particular compile time error message. In this program, I am specifying a function type on /combs'/ in the where clause: module Main where import List (delete) combs :: Eq a =

Re: [Haskell-cafe] Hackage and HaXml situation

2008-09-18 Thread Duncan Coutts
On Thu, 2008-09-18 at 15:32 -0500, John Goerzen wrote: Hi everyone, We've got a bit of a problem in the community regarding HaXml. This has been brought up before, but never definitively resolved, and it's causing more and more trouble. Over at the HaXml homepage [1], it is stated that

Re: [Haskell-cafe] Library design question

2008-09-18 Thread Duncan Coutts
On Thu, 2008-09-18 at 15:43 -0300, Andre Nathan wrote: My Graph type is the following. data Graph a b = Graph { adjacencies :: Map Int (a, (Map Int b)) , numVertices :: Int , numEdges:: Int } addVertex :: Int - a - State (Graph a b) () addVertex vertex label =

Re: [Haskell-cafe] Specifying a function type in a where clause.

2008-09-18 Thread Ryan Ingram
The Haskell98 solution is to use asTypeOf to document types in helper functions combs' acc x = let sl = delete (x `asTypeOf` head l) l in ... Using ScopedTypeVariables is much nicer, though. -- ryan On Thu, Sep 18, 2008 at 3:55 PM, Daniel Fischer [EMAIL PROTECTED] wrote: Am Freitag, 19.

Re: [Haskell-cafe] Hackage and HaXml situation

2008-09-18 Thread John Goerzen
Marc Weber wrote: In your particular problem there is another way: Ask the distributors to ship both HaXmL versions.. (Most systems will install one only by default (an update supersedes the older one :-( ) But most distributions do let you install two or more versions (?) Yes, most

Re: [Haskell-cafe] Specifying a function type in a where clause.

2008-09-18 Thread Ryan Ingram
Also, in Haskell98 you can also use this hack to document coerce the typechecker: combs' acc x | const False (acc `asTypeOf` [l]) = undefined `asTypeOf` [l] combs' acc x | const False (x `asTypeOf` head l) = undefined combs' acc x = ... definition as before The compiler should remove the const

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Lennart Augustsson
Without any fancy byte strings: main = do name:_ - getArgs file - readFile name print $ length $ lines file On Thu, Sep 18, 2008 at 6:02 PM, Creighton Hogg [EMAIL PROTECTED] wrote: Hey Haskell, So for a fairly inane reason, I ended up taking a couple of minutes and writing a program

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Robert Greayer
--- On Thu, 9/18/08, Creighton Hogg [EMAIL PROTECTED] wrote: If this makes anyone cringe or cry you're doing it wrong, I'd actually like to hear it. Just to make everyone cry: main = getArgs = \(x:_) - system (wc -l ++ x) ___

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Steve Schafer
On Thu, 18 Sep 2008 19:59:51 +0100, you wrote: Of course, C++ is that crazy language where *assignment* is actually an *operator*. Sick, sick people... That's really not all that strange. An (infix) operator is just a function with funny syntax, and assignment is a function (the identity

[Haskell-cafe] Re: Strongly Typed Memory Areas

2008-09-18 Thread oleg
John Van Enk wrote: Was Iavor/Mark's paper ever implemented as a GHC extension? Strongly Typed Memory Areas It turns out most of the functionality is already available in Haskell: Lightweight static resources, for safe embedded and systems programming

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Steven Shaw
2008/9/19 Evan Laforge [EMAIL PROTECTED] let {1 + 1 = 3; 3 + 1 = 3} in 1 + 1 + 1 Which gives 3. Perhaps even more confusing is: let {1 + 1 = 3; 3 + 1 = 3} in 3 + 1 + 1 which gives 3 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread Donnie Jones
Hello, More fun for all of us to enjoy: http://www.haskell.org/haskellwiki/Obfuscation __ Donnie On Thu, Sep 18, 2008 at 11:01 PM, Steven Shaw [EMAIL PROTECTED] wrote: 2008/9/19 Evan Laforge [EMAIL PROTECTED] let {1 + 1 = 3; 3 + 1 = 3} in 1 + 1 + 1 Which gives 3. Perhaps even more

Re: [Haskell-cafe] An interesting curiosity

2008-09-18 Thread sam lee
I think it's because + is left associative. and pattern matching is top to bottom. 1 + 1 + 1 = (1 + 1) + 1 = found match: 1 + 1 = 3 = 3 + 1 = found match: 3 + 1 = 3 = 3 On Thu, Sep 18, 2008 at 11:01 PM, Steven Shaw [EMAIL PROTECTED] wrote: 2008/9/19 Evan Laforge [EMAIL PROTECTED] let {1 + 1 =

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Daniel Fischer
Am Freitag, 19. September 2008 03:14 schrieb Robert Greayer: --- On Thu, 9/18/08, Creighton Hogg [EMAIL PROTECTED] wrote: If this makes anyone cringe or cry you're doing it wrong, I'd actually like to hear it. Just to make everyone cry: main = getArgs = \(x:_) - system (wc -l ++ x)

Re: [Haskell-cafe] A round of golf

2008-09-18 Thread Derek Elkins
On Fri, 2008-09-19 at 06:38 +0200, Daniel Fischer wrote: Am Freitag, 19. September 2008 03:14 schrieb Robert Greayer: --- On Thu, 9/18/08, Creighton Hogg [EMAIL PROTECTED] wrote: If this makes anyone cringe or cry you're doing it wrong, I'd actually like to hear it. Just to make