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
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.
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
Thomas Davie [EMAIL PROTECTED] writes:
The evil code and CPSness were actually intended to be completely
separate entities. I needed (and to a lesser extent now still need),
examples that are (a) very higher order, and (b) evil and hard to
understand the runtime behaviour of.
Generally code
: 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
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
Till Mossakowski [EMAIL PROTECTED] writes:
Could someone summarize the pros and cons of
HXT versus HaXml versus HSX?
From my perspective (therefore perhaps important but hardly
comprehensive), HXT vs HaXml:
HXT provides arrows. The con is you have to learn arrows. The pro is
the arrows
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
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
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
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.
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.
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! :) )
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
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
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
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)
Simon Marlow [EMAIL PROTECTED] writes:
One reason, I think, is lazy I/O(*). It's to stop you accidentally
[...]
(*) kill it! die! die!
So you want
main = readFile /dev/zero return ()
to terminate violantly rather than terminate peacefully? :)
Seriously, I understand that the IO monad is
David Sabel [EMAIL PROTECTED] writes:
{-# NOINLINE b #-}
b x = if even x then unsafePerformIO getChar else bot
bot = bot
main = do
putChar (b 4)
putChar (b 6)
I am not a compiler implementer (or lawyer, for that matter :)
But I propose this guess. First, both even
The doc RPM package for Red Hat 7.3 suffers the same problem as the
SuSE one. Could someone please give a hand-holding guide so that we
can fix it ourselves? Please? Please?
___
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
Ashley Yakeley [EMAIL PROTECTED] writes:
Prelude 0 * 2
0
We can generalize this.
import Monad
double_your_monad_in_30_days :: (MonadPlus M) = M a
double_your_monad_in_30_days = mzero `mplus` mzero
___
Glasgow-haskell-users mailing list
[EMAIL
[EMAIL PROTECTED] (Ketil Z. Malde) writes:
I'm not sure what the point would be, if they are in the
distributions anyway? Isn't it better to install them by apt-get or
up2date or whatever? (In fact, I had almost thought manually
downloading packages a thing of the past, but then the IT
Simon Marlow [EMAIL PROTECTED] writes:
On the other hand, you'd need something like mingw for OS/2 - does
such a beast exist?
The substring emx refers to an OS/2 version of gcc and libraries
that make OS/2 look really like Unix from the programmer's point of
view. (It probably even pre-dates
I had looked into the source code of IArray a bit. Like you have
found, (!) is not a class method. In fact, none of the claimed class
methods in the doc is a class method, and no class method of IArray is
documented. Instead, IArray class methods seem to pertain to
implementation details (I
testfunc = do
r - newSTRef ('x',0)
foo r
bar r
(c,n) - readSTRef r
return n
Jorge Adriano [EMAIL PROTECTED] writes:
Yeap, I could do it like this myself :)
The whole problem is with passing the 'r' as a parameter, which is
Theodore Norvell [EMAIL PROTECTED] writes:
Jorge's question raised a question in my mind. The IOExts
module has many of the same features as the ST module, why
are there two ways to do the same thing? Is the ST module
only there for legacy purposes?
My user view is that I appreciate the
Mike Gunter [EMAIL PROTECTED] writes:
Why is executable size a barrier? 1.64 megabytes (that's the size of
the executable I built with GHC most recently) of disk space costs less
than half a cent.
I don't like this argument. Can I go to a computer store, pay a cent,
and get a hard disk
Andre W B Furtado [EMAIL PROTECTED] writes:
[...]
For example, suppose function doSomeStuffWith returns its own parameter.
Using a 1.5MB file in this case, the Haskell program ends in almost 5
seconds, while the C program ends in less than 0.5 seconds... Is my Haskell
program too bad
Consider goal-directed theorem prover (or proof checker). Two existing
samples are in Lawrence Paulson's ML for the Working Programmer, and
yours truly's http://www.cs.utoronto.ca/~trebla/fp/prover/index.html
The advantage of mine is it illustrates monads. The advantage of Paulson's
is it
Volker Stolz [EMAIL PROTECTED] writes:
ghc[i] was built from source. The Solaris binary provided on the GHC-
download page works fine. I'll investigate FreeBSD as soon as I get home.
Feel free to ask for more details regarding machine setup/compilation.
I guess a standard question would be:
I try to build ghc 4.08.2 with parallelism turned on, i.e., GhcLibsWays=mp.
At ghc/rts/parallel/HLComms.c line 550:
GarbageCollect(GetRoots);
it barfs because the new GarbageCollect() function expects a boolean
parameter after the first parameter. (See ghc/rts/Storage.h for example.)
Is
Albert Lai [EMAIL PROTECTED] writes:
I try to build ghc 4.08.2 with parallelism turned on, i.e., GhcLibsWays=mp.
At ghc/rts/parallel/HLComms.c line 550:
GarbageCollect(GetRoots);
it barfs because the new GarbageCollect() function expects a boolean
parameter after the first parameter
I installed ghc 4.08.2 binaries for sparc solaris (and those for intel
linux, too), then tried compiling a sample program (the fibonacci one
in the user guide) with ghc -parallel. The compiler complained:
Could not find interface file for `Prelude'
in the directories ./*.hi
33 matches
Mail list logo