On Mon, Mar 14, 2005 at 07:38:09PM -0600, John Goerzen wrote:
I've got some gzip (and Ian Lynagh's Inflate) code that breaks under
the new hugs with:
handle: IO.getContents: protocol error (invalid character encoding)
What is going on, and how can I fix it?
A Haskell 98 Handle is a
Hi
folks,
I have a parser
problem. I have a basic calculator program (Graham Hutton's from Nottingham)
which contains the following code:
-- Define a parser
to handle the inputexpr :: Parser Intexpr = do t -
term
do symbol
"+"
e -
expr
return (t + e) +++
return t
term :: Parser
On Tue, 15 Mar 2005, Nicola Whitehead wrote:
Hi folks,
I have a parser problem. I have a basic calculator program (Graham Hutton's
from Nottingham) which contains the following code:
-- Define a parser to handle the input
expr :: Parser Int
expr = do t - term
do symbol +
On Tue, 15 Mar 2005, Nicola Whitehead wrote:
(snip)
term :: Parser Int
term = do f - factor
do symbol *
e - expr
return (f * t)
+++ return f
(snip)
symbol and natural are defined elsewhere and work fine, but when I compile it
I get
Henning Thielemann wrote:
I' searching for a function which sorts the numbers and determines the
parity of the number of inversions. I assume that there are elegant and
fast algorithms for this problem (n * log n time steps), e.g. a merge
sort algorithm.
This is a rather nice little problem. I
On 15 Mar 2005, at 12:38, Mark Carroll wrote:
Variables (although why they're
called that in Haskell I'm not sure)
Because the value that they denote can vary between different calls of
the same function?
Jules
___
Haskell-Cafe mailing list
On Tue, Mar 15, 2005 at 10:44:28AM +, Ross Paterson wrote:
On Mon, Mar 14, 2005 at 07:38:09PM -0600, John Goerzen wrote:
I've got some gzip (and Ian Lynagh's Inflate) code that breaks under
the new hugs with:
handle: IO.getContents: protocol error (invalid character encoding)
On Tue, Mar 15, 2005 at 08:12:48AM -0600, John Goerzen wrote:
[...] but Hugs is now much stricter, because character streams now
use the encoding determined by the current locale (for the C locale, that
means ASCII only).
Hmm, this seems to be completely undocumented.
It's mentioned in
On Tue, 15 Mar 2005, Ben Rudiak-Gould wrote:
Henning Thielemann wrote:
I' searching for a function which sorts the numbers and determines the
parity of the number of inversions. I assume that there are elegant and
fast algorithms for this problem (n * log n time steps), e.g. a merge sort
Good day all,
I am attempting to display html pages using wxHaskell's HtmlWindow
functions. I am hoping that it is indeed possible for me to do just that
and that I haven't misunderstood what HtmlWindow is used for.
My code so far will create a frame, a button and an HtmlWindow and other
Curiouser and
curiouser...
expr ::
Parser Intexpr = do t -
term do symbol
"+"e
- expr return (t +
e) +++ return t
solves the undefined
variable problem but introduces a new 'Last operator in do {...} must be an
_expression_' error, which then disappears if I explicitly return
e
expr
expr :: Parser Int
expr = do t - term
do symbol +
e - expr
return e
return (t + e)
+++ return t-
't' is not in scope at the arrow. t only exists inside the
do block, and your code parses like this
( do t - return (t+e) ) +++
perhaps like this:
expr = do t - term
(do symbol +
e - expr
return (t+e)
)
+++
(return t)
although I think you may also want a 'try' before the first alternative.
No, that still gives the same undefined variable error.
On Tue, Mar 15, 2005 at 03:44:55PM -, Nicola Whitehead wrote:
perhaps like this:
expr = do t - term
(do symbol +
e - expr
return (t+e)
)
+++
(return t)
although I think you may also want a 'try' before the
The layout of your code is very important when writing haskell code:
Your code :
expr = do t - term
do symbol +
e - expr
return e
return (t + e)
+++ return t
is equivalent to:
expr = do { t - term
; do { symbol +
; e -
Thanks folks!
Writing it in a lispy manner seems to work. I see what Arthur means about the
layout - I think I'm still thinking too much in C. :)
Nik
Dr Nik FreydĂs Whitehead
University of Akureyri, Iceland
*
Having the moral
Hi,
When I use the
htmlWindowLoadPage hw ./test.html
function, everything works fine and I see the content of the test.html page.
Cheers
Patrick
On Tuesday 15 March 2005 15:51, David Owen wrote:
Good day all,
I am attempting to display html pages using wxHaskell's HtmlWindow
term :: Parser Int
term = do f - factor
do symbol "*"
e - expr
return (f * t)--- replace t with e
+++ return f
I hope that helps,
Carter Schonwald
___
Haskell-Cafe
On Tue, Mar 15, 2005 at 10:44:28AM +, Ross Paterson wrote:
On Mon, Mar 14, 2005 at 07:38:09PM -0600, John Goerzen wrote:
I've got some gzip (and Ian Lynagh's Inflate) code that breaks under
the new hugs with:
handle: IO.getContents: protocol error (invalid character encoding)
19 matches
Mail list logo