José Miguel Vilaça <[EMAIL PROTECTED]> writes:
> I had used some code which worked fine on GHC 6.4 and now it dont compile
> on GHC 6.6.
I am unable to reproduce your problem. It is saddening that everyone
neglects to provide self-contained code for others to reproduce the
alleged problems.
I
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 nodes, and all records
>
> nodes are contained by the same parent node.
This is very poorly written HTML. The original struct
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 t
"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.
: 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 (Eith
Deokhwan Kim <[EMAIL PROTECTED]> writes:
> What is the practical meaning of monad laws?
>
> 1. (return x) >>= f == f x
> 2. m >>= return == m
> 3. (m >>= f) >>= g == m >> (\x -> f x >>= g)
I offer to re-write the laws in do-notation. (Please view with a
fixed-width (non-proportional) font
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 exampl
"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
"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 b
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.
___
> wc :: String -> (Int, Int, Int)
> wc file = ( length (lines file)
> , length (words file)
> , length file
> )
Most people tend to think that imperative programming novices don't
even start their obvious solutions from something as inefficient as
this. Wel
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
> Hask
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
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 ou
"Scott J." <[EMAIL PROTECTED]> writes:
> what's wrong with the code of test1 below. Ghci does complain with
> an error message that I don't understand.
> test1 = \f ::(forall a. a -> a) -> (f True,f 'a')
test1 = \(f :: forall a. a -> a) -> (f True,f 'a')
__
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)
"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)
> hPu
19 matches
Mail list logo