Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://www.haskell.org/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."
Today's Topics:
1. Re: A first try (Manfred Lotz)
2. Re: A first try (Clint Moore)
3. Re: A first try (Vesa Kaihlavirta)
4. Re: A first try (David Place)
5. Help (Stoyan Peev)
6. Re: Help (David Place)
7. Fwd: Help (Stoyan Peev)
8. Why aren't David Harley's QT bindings more popular?
(Michael Serra)
9. Re: Why aren't David Harley's QT bindings more popular?
(Krzysztof Skrz?tnicki)
----------------------------------------------------------------------
Message: 1
Date: Fri, 24 Jun 2011 20:10:12 +0200
From: Manfred Lotz <[email protected]>
Subject: Re: [Haskell-beginners] A first try
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII
Hi David,
On Fri, 24 Jun 2011 08:43:59 -0400
David Place <[email protected]> wrote:
> Hi, Panagiotis.
>
> The wc program is a good choice for a learning program, but it
> reveals a long-standing weakness in Haskell: Lazy-IO.
Is it really a weakness of Haskell or just something one has to get used
to it? That is a question I would like to get opinions from the experts!
It is for sure something a beginner stumbles upon. E.g. I (as a
beginner) stumbled upon Lazy IO but the guys out here helped me a
great deal to get over it, and I'm sure they will help me again
if I'll stumble again (which might happen).
--
Manfred
------------------------------
Message: 2
Date: Fri, 24 Jun 2011 11:32:22 -0700
From: Clint Moore <[email protected]>
Subject: Re: [Haskell-beginners] A first try
To: Manfred Lotz <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
On Fri, Jun 24, 2011 at 11:10 AM, Manfred Lotz <[email protected]> wrote:
> Hi David,
>
> On Fri, 24 Jun 2011 08:43:59 -0400
> David Place <[email protected]> wrote:
>
>> Hi, Panagiotis.
>>
>> The wc program is a good choice for a learning program, but it
>> reveals a long-standing weakness in Haskell: Lazy-IO.
>
>
> Is it really a weakness of Haskell or just something one has to get used
> to it? That is a question I would like to get opinions from the experts!
No, the only weakness (imo) with lazy io is a beginners understanding
of its implications. There are options, most notably iteratees. Lazy
IO, much like lazy evaluation, are definitely different than what you
might expect from other languages, but I think it's a huge mistake,
especially when you are just starting out, to categorize them as
weaknesses.
------------------------------
Message: 3
Date: Fri, 24 Jun 2011 21:49:46 +0300
From: Vesa Kaihlavirta <[email protected]>
Subject: Re: [Haskell-beginners] A first try
To: Manfred Lotz <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=UTF-8
> Is it really a weakness of Haskell or just something one has to get used
> to it? That is a question I would like to get opinions from the experts!
The problem is that everything you call out to may or may not be lazy,
and there is really no way to know it. For a programming language that
made great strides in safety in many other areas, this seems to me
like a huge oversight, perhaps even the number one mistake.
(I'm not an expert, but I've been with the language for a decade and
have completed a few Real Projects in it)
--vk
------------------------------
Message: 4
Date: Fri, 24 Jun 2011 15:26:19 -0400
From: David Place <[email protected]>
Subject: Re: [Haskell-beginners] A first try
To: Manfred Lotz <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Jun 24, 2011, at 2:10 PM, Manfred Lotz wrote:
> Is it really a weakness of Haskell or just something one has to get used
> to it? That is a question I would like to get opinions from the experts!
I would say that it is a weakness in the original handling of IO in Haskell.
The non-determinism of Lazy IO is just plain bad. The solution doesn't require
any extensions, though. It's just a different way of programming in Haskell.
> http://www.haskell.org/haskellwiki/Iteratee_I/O
____________________
David Place
Owner, Panpipes Ho! LLC
http://panpipesho.com
[email protected]
------------------------------
Message: 5
Date: Fri, 24 Jun 2011 22:50:40 +0300
From: Stoyan Peev <[email protected]>
Subject: [Haskell-beginners] Help
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hello all,
I am experiencing some issues to do my course task in university.
I have to write a calculator- function in Haskell. The function
argument is a list of strings and also form such list, as each string
of the argument made definite action:
- If the string has the form of an arithmetic _expression_ - calculate
this _expression_. The string result becomes part of the list-result.
If the _expression_ contains a variable which is not assigned value,
the result is displayed "undefined".
- If the string has the form- Name = value calculated from the last
_expression_ is assigned to the variable with the corresponding name
in the list, and in the result list is formed a string with type
- If there is not a calculated _expression_ to be assigned to form a
string "no value".
- If the string is non-blank, but there is a species different from
the above two case, form the string "error".
- If the string is empty, incl. when it contains only spaces, in the
result there is not form a string.
Expressions consist of integers without sign variables, operations +
(Addition), - (subtraction), * (multiplication) and / (divide) and
parentheses. Where no brackets, the operations are performed from left
to right, but * and / precede the + and -. Implementation of any
operation gives integer; in the division rejected the fractional part,
if any.
Variables have names of one letter - from the Latin small letter. In
the beginning, end or between the elements of each row can have spaces
- they are irrelevant to its correctness.
Example: the list-argument
["3 +7 / 2" "2 + x", "= s", "2 * s +4", "", "2 + +4 / 5]
function should provide a result-list
["6", "undefined", "s = 6", "16", "error"].
I say another person have the same task, but he didn't do anything. I
started doing this task myself but i get stuck in the middle. Then i
started searching for something that could help me and find out you :)
The code i have written so far uses the library file "Parsing.lhs"
but what i have written is taking those actions that i already
described, only for a string. I cannot modify it to work for list of
string, and complete the whole task.
I'll be glad to finish the task myself, but i am going to need some help.
Here is the code i have already written:
import Parsing
expr :: Parser Int
expr = do t <- term
do symbol "+"
e <- expr
return (t+e)
+++ do symbol "-"
e <- expr
return (t-e)
+++ return t
term :: Parser Int
term = do f <- factor
do symbol "*"
t <- term
return (f * t)
+++ do symbol "/"
t <- term
return (f-t)
+++ return f
factor :: Parser Int
factor = do symbol "("
e <- expr
symbol ")"
return e
+++ natural
eval :: String -> Int
eval xs = case (parse expr xs) of
[(n,[])] -> n
[(_,out)] -> error ("undefined")
[] -> error "error"
Thanks all in advance :)
--
Best Wishes
Stoyan Peev
------------------------------
Message: 6
Date: Fri, 24 Jun 2011 16:11:46 -0400
From: David Place <[email protected]>
Subject: Re: [Haskell-beginners] Help
To: Stoyan Peev <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Jun 24, 2011, at 3:50 PM, Stoyan Peev wrote:
> I'll be glad to finish the task myself, but i am going to need some help.
Do you have a specific question?
____________________
David Place
Owner, Panpipes Ho! LLC
http://panpipesho.com
[email protected]
------------------------------
Message: 7
Date: Fri, 24 Jun 2011 23:16:46 +0300
From: Stoyan Peev <[email protected]>
Subject: [Haskell-beginners] Fwd: Help
To: David Place <[email protected]>
Cc: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Yes, There are two way for me in this situation.
The first one is to write function in another file for string list,
that calls the parsing function, for every string in the list. But
since now i have been trying in a couple of days and i can't do it
successfully.
The second options is just to rewrite this function for list of
strings instead of just a string, but i couldn't do that either.
So my question is can anybody help me finish it in one of the two ways.
Thanks again!
On Fri, Jun 24, 2011 at 11:11 PM, David Place <[email protected]> wrote:
>
> On Jun 24, 2011, at 3:50 PM, Stoyan Peev wrote:
>
>> I'll be glad to finish the task myself, but i am going to need some help.
>
> Do you have a specific question?
>
> ____________________
> David Place
> Owner, Panpipes Ho! LLC
> http://panpipesho.com
> [email protected]
>
>
>
>
------------------------------
Message: 8
Date: Fri, 24 Jun 2011 16:31:40 -0500
From: Michael Serra <[email protected]>
Subject: [Haskell-beginners] Why aren't David Harley's QT bindings
more popular?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Hi all,
Recently I have been doing the usual beginner's search for the "best GUI
toolkit" available to Haskell, and today I installed David Harley's
qtHaskell bindings. I was surprised to find they were easy to install (on
Linux), and all the examples run flawlessly. So I have two related
questions: (1) has anyone out there used qtHaskell, and what was your
experience; (2) why do these bindings seem to be a less-popular option than
wxwidgets and gtk2hs? I understand qtHaskell is much newer than the others,
and so far its development appears to be a one-man operation; other than
these obvious explanations, is there a bigger reason people don't seem to be
using or discussing QT with Haskell? I would have thought working bindings
to such a useful framework would be a bigger deal.
- m. serra
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110624/35e9e367/attachment-0001.htm>
------------------------------
Message: 9
Date: Fri, 24 Jun 2011 23:48:30 +0200
From: Krzysztof Skrz?tnicki <[email protected]>
Subject: Re: [Haskell-beginners] Why aren't David Harley's QT bindings
more popular?
To: Michael Serra <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
For one thing it's not available on Hackage. This surely hurts visibility of
any Haskell package. It may be the reason it didn't receive so much
attention.
Best regards,
Krzysztof Skrz?tnicki
On Fri, Jun 24, 2011 at 23:31, Michael Serra <[email protected]> wrote:
> Hi all,
> Recently I have been doing the usual beginner's search for the "best GUI
> toolkit" available to Haskell, and today I installed David Harley's
> qtHaskell bindings. I was surprised to find they were easy to install (on
> Linux), and all the examples run flawlessly. So I have two related
> questions: (1) has anyone out there used qtHaskell, and what was your
> experience; (2) why do these bindings seem to be a less-popular option than
> wxwidgets and gtk2hs? I understand qtHaskell is much newer than the others,
> and so far its development appears to be a one-man operation; other than
> these obvious explanations, is there a bigger reason people don't seem to be
> using or discussing QT with Haskell? I would have thought working bindings
> to such a useful framework would be a bigger deal.
> - m. serra
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20110624/91fa6a0a/attachment.htm>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 36, Issue 62
*****************************************