Re: [Haskell-cafe] Accumulating related XML nodes using HXT

2006-10-31 Thread Albert Lai
Daniel McAllansmith [EMAIL PROTECTED] writes: Hello. I have some html from which I want to extract records. Each record is represented within a number of tr nodes, and all records tr nodes are contained by the same parent node. This is very poorly written HTML. The original structure

Re: [Haskell-cafe] A type in search of a name...

2006-10-12 Thread Albert Lai
Brian Hulley [EMAIL PROTECTED] writes: You'll never believe it but I've been struggling last night and all of today to try and think up a name for the following type and I'm still nowhere near a solution: data ??? = VarId | VarSym | ConId | ConSym Perhaps Atom.

Re: [Haskell-cafe] Is Haskell a Keynesian language?

2006-10-12 Thread Albert Lai
Henning Thielemann [EMAIL PROTECTED] writes: Here is another approach of questionable classification of languages. :-) A lazy functional program is demand driven, an imperative program is supply driven. So is Haskell a Keynesian language and C++ a Say language? Great, now we can talk

[Haskell-cafe] Re: Haskell web forum

2006-09-21 Thread Albert Lai
: Thomas Conway ] Re: [Haskell-cafe] How can we detect and fix E [ 19: Albert Lai ] Re: [Haskell-cafe] Either e Monad E [ 19: Deokhwan Kim] [ 62: Bas van Dijk] E [ 47: [EMAIL PROTECTED] [Haskell-cafe] Re: Optimization problem [ 51: Ross Paterson

Re: [Haskell-cafe] Either e Monad

2006-09-19 Thread Albert Lai
Deokhwan Kim [EMAIL PROTECTED] writes: Where is the Monad instance declaration of Either e? It is in Control.Monad.Error as well. Strange: the doc doesn't state it. I found out in ghci using: :module +Control.Monad.Error :info Either The relevant result is: instance Error e = Monad (Either

Re: [Haskell-cafe] HaXml question

2006-08-31 Thread Albert Lai
Tim Newsham [EMAIL PROTECTED] writes: I thought this one would be easy but I'm starting to think its not. I am playing with HaXml and I want to transform an XML tree into another tree. The transforms are simple enough, but the kicker is that I want them to be stateful. In this example, the

Re: [Haskell-cafe] Why Not Haskell?

2006-08-08 Thread Albert Lai
Brian Hulley [EMAIL PROTECTED] writes: Also, the bottom line imho is that Haskell is a difficult language to understand, and this is compounded by the apparent cleverness of unreadable code like: c = (.) . (.) when a normal person would just write: c f g a b = f (g a b) All

Re: [Haskell-cafe] Re: Haskell-Cafe Digest, Vol 33, Issue 9

2006-05-11 Thread Albert Lai
Alberto G. Corona [EMAIL PROTECTED] writes: stmcache= newTVar 0 I will explain what this doesn't with an analogy. import Data.IORef notglobal = newIORef True main = do a - notglobal b - notglobal writeIORef a False x - readIORef b print x To better

Re: [Haskell-cafe] Haskell vs OCaml

2005-12-29 Thread Albert Lai
I particularly like OCaml's provision of subtyping. As a member of the ML family, it's module system is also quite formidable. Of course the imperative constructs are also pretty convenient when you just want to be quirky. But I miss the monad do-notation.

Re: [Haskell-cafe] Function application like a Unix pipe

2005-11-21 Thread Albert Lai
I offer a simpler, more direct, and pre-existing correspondence between a functional programming construct and unix pipes: http://www.vex.net/~trebla/weblog/pointfree.html Scherrer, Chad [EMAIL PROTECTED] writes: I'm still trying to settle on a feel for good programming style in Haskell.

Re: [Haskell-cafe] Newbie question on Haskell type

2005-10-16 Thread Albert Lai
Huong Nguyen [EMAIL PROTECTED] writes: newtype Parser a = Parser(String - [(a, String)]) [...] parse :: Parser a - String - [(a, String)] parse p cs = p cs \end{code} Try this instead: parse (Parser p) cs = p cs (You forgot to deconstruct! :) )

Re: [Haskell-cafe] a new Monad

2005-09-17 Thread Albert Lai
Malcolm Wallace [EMAIL PROTECTED] writes: Microsoft has announced the following: Developers can also expect a new scripting language for management applications, called Monad. If we embedded the Monad language, as a DSL, into Haskell using a Haskell monad, would we get to call it

Re: [Haskell-cafe] Best way to build strings?

2005-07-23 Thread Albert Lai
Andy Gimblett [EMAIL PROTECTED] writes: show (External p q) = ( ++ show p ++ [] ++ show q ++ ) but to me the extensive use of ++ is not particularly readable. [...] return (%s [] %s) % (self.p, self.q) which to me seems clearer, or at least easier to work out roughly what

[Haskell-cafe] Re: [Haskell] Going nuts

2005-04-20 Thread Albert Lai
Alexandre Weffort Thenorio [EMAIL PROTECTED] writes: outputLine keyno key orgFile = do part1 - getLeft keyno orgFile part2 - getRight keyno orgFile total - part1 ++ (strUpper key) ++ part2 ++ \n newHexFile - openFileEx newfile (BinaryMode WriteMode) hPutStrLn newHexFile

[Haskell-cafe] Re: [Haskell] Y in haskell?

2005-04-20 Thread Albert Lai
Bernard Pope [EMAIL PROTECTED] writes: I also meant to add that I think these solutions are not what Lloyd is after, because they rely on recursive equations, which I believe was avoided in Lloyd's SML code. Those recursive equations are avoided in SML because SML is eager - y f = f (y f)