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: let expression (Daniel Fischer)
2. Re: HackageDB - How to browse by development status
(Stephen Tetley)
3. consing an element to a list inside a file ([email protected])
4. Re: ghc problem (Brent Yorgey)
5. Re: consing an element to a list inside a file (Brent Yorgey)
6. Re: consing an element to a list inside a file ([email protected])
7. Re: consing an element to a list inside a file ([email protected])
8. Re: consing an element to a list inside a file (Daniel Fischer)
9. HackageDB - How to browse by development status (Gabi)
10. Re: ghc problem (jean verdier)
----------------------------------------------------------------------
Message: 1
Date: Wed, 10 Feb 2010 21:32:16 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] let expression
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
Am Mittwoch 10 Februar 2010 21:16:31 schrieb John Moore:
> Hi All,
> Trying to get this to work, keeps telling me there a parse
> error on right in the let expression. Can anyone see where the problem
> is and be able to explain it to me.
>
> evalStep d (Let n e1 e2)
> = case e1 of
> (Val a) -> case e2 of
> (Val b)-> Val (Let e1 e2)
> left -> Let e1 (evalStep d e2)
> right -> Let (evalStep d e1) e2
Here?
Indentation. The patterns for the inner case-expression must be indented
further than those for the outer (and all patterns in one case-expression
must be indented to the same level).
>
>
> evaluate :: Dict-> [Expression] -> Expression -> IO()
> evaluate d(x:xs) e = do
> putStrLn (show e)
> putStrLn "Do another step (y/n) or rollback (r)? :"
> c <- getLine
> case c of
> "y" -> let e'= (evalStep d e)in evaluate d (e:x:xs) e'-- build up
> history
>
> "r" -> case (x:xs) of
> (x:xs)-> evaluate d xs x
> []-> do { putStrLn "Empty"
> ;evaluate d(x:xs) e
> }
> "n" -> putStrLn $ "Ok you said no :" ++ c
>
>
> John
------------------------------
Message: 2
Date: Wed, 10 Feb 2010 20:39:44 +0000
From: Stephen Tetley <[email protected]>
Subject: Re: [Haskell-beginners] HackageDB - How to browse by
development status
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hi Gabi
Unfortunately 'stability' is only an optional field in cabal files, so
some projects will display it but others don't.
Roel van Dijk has a nice project that allows you to see reverse
dependencies for packages in HackageDB and this gives you a popularity
rank. As a rule of thumb, a package won't be very popular if it is
unstable...
http://www.haskell.org/pipermail/haskell-cafe/2009-October/067765.html
http://bifunctor.homelinux.net/~roel/hackage/packages/hackage.html
http://bifunctor.homelinux.net/~roel/hackage/packages/archive/revdeps-list.html
You can judge inactivity by last release, but some great packages
'just work' so don't need updating.
Best wishes
Stephen
------------------------------
Message: 3
Date: Wed, 10 Feb 2010 21:52:48 +0100
From: [email protected]
Subject: [Haskell-beginners] consing an element to a list inside a
file
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Hi,
I want to add an element to a list inside a haskell file:
mylist = [1,2,3,4]
0:mylist
in Prelude it works fine, but when I do it in a file I get the error:
parse error (possibly incorrect indentation)
Failed, modules loaded: none.
in a line after this two that doesn't exist
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/atbrowser
------------------------------
Message: 4
Date: Wed, 10 Feb 2010 15:54:32 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] ghc problem
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
This is clearly a GHC bug of some sort. Have you tried looking for
this error on the GHC bug tracker? It's possible it's already been
fixed in a newer version of GHC.Otherwise, I suggest emailing the GHC
user mailing list.
-Brent
On Wed, Feb 10, 2010 at 10:52:24AM +0100, jean verdier wrote:
> Trying to compile sources gives me:
>
> ghc: internal error: evacuate(static): strange closure type 34
> (GHC version 6.10.4 for i386_unknown_linux)
> Please report this as a GHC bug:
> http://www.haskell.org/ghc/reportabug
>
> This already occured to me some times before and a cleanup and recompile
> would work. This time i am stuck as i can't compile anymore. The ghc
> version i use is the 6.10.4 from the ghc home page binary distribution i
> think.
>
> uname -a gives :
> Linux localhost.localdomain 2.6.29.4-167.fc11.i586 #1 SMP Wed May 27
> 17:14:37 EDT 2009 i686 athlon i386 GNU/Linux
>
> The command line is:
> ghc -fwarn-incomplete-patterns -fno-warn-unused-binds
> -fno-warn-unused-matches -fno-warn-unused-imports
> -fno-warn-missing-signatures -fno-glasgow-exts -Werror
> -outputdir /tmp/mfk/build -package ghc -i/tmp/mfk/gensrc --make
> common/MFK/Common/SrcGen.hs common/MFK/Common/Conf.hs
>
> Any hints ?
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 5
Date: Wed, 10 Feb 2010 16:00:35 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] consing an element to a list inside a
file
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii
On Wed, Feb 10, 2010 at 09:52:48PM +0100, [email protected] wrote:
> Hi,
> I want to add an element to a list inside a haskell file:
> mylist = [1,2,3,4]
> 0:mylist
> in Prelude it works fine, but when I do it in a file I get the error:
> parse error (possibly incorrect indentation)
> Failed, modules loaded: none.
> in a line after this two that doesn't exist
A Haskell file is simply a list of declarations, i.e. definitions of
data types, classes, and functions. You cannot just have an
expression by itself in a Haskell file. You can write expressions at
a ghci prompt (which I assume is what you meant) because that is what
ghci is for: evaluating expressions.
Why do you want 0:mylist by itself in a Haskell file? What is its
purpose? Note that it will not modify the value of mylist (indeed,
you *cannot* modify the value of mylist once it has been defined).
-Brent
------------------------------
Message: 6
Date: Wed, 10 Feb 2010 22:06:23 +0100
From: [email protected]
Subject: Re: [Haskell-beginners] consing an element to a list inside a
file
To: Brent Yorgey <[email protected]>, [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
It's just a part of a more complex exercise
I have to read an input of the user. After that he can decide if he wants to
add another input. If not, all inputs the user did should be printed on the
screen. So I want to add each input to a list and print the list at the end.
-------- Original-Nachricht --------
> Datum: Wed, 10 Feb 2010 16:00:35 -0500
> Von: Brent Yorgey <[email protected]>
> An: [email protected]
> Betreff: Re: [Haskell-beginners] consing an element to a list inside a file
> On Wed, Feb 10, 2010 at 09:52:48PM +0100, [email protected] wrote:
> > Hi,
> > I want to add an element to a list inside a haskell file:
> > mylist = [1,2,3,4]
> > 0:mylist
> > in Prelude it works fine, but when I do it in a file I get the error:
> > parse error (possibly incorrect indentation)
> > Failed, modules loaded: none.
> > in a line after this two that doesn't exist
>
> A Haskell file is simply a list of declarations, i.e. definitions of
> data types, classes, and functions. You cannot just have an
> expression by itself in a Haskell file. You can write expressions at
> a ghci prompt (which I assume is what you meant) because that is what
> ghci is for: evaluating expressions.
>
> Why do you want 0:mylist by itself in a Haskell file? What is its
> purpose? Note that it will not modify the value of mylist (indeed,
> you *cannot* modify the value of mylist once it has been defined).
>
> -Brent
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
------------------------------
Message: 7
Date: Wed, 10 Feb 2010 22:06:23 +0100
From: [email protected]
Subject: Re: [Haskell-beginners] consing an element to a list inside a
file
To: Brent Yorgey <[email protected]>, [email protected]
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
It's just a part of a more complex exercise
I have to read an input of the user. After that he can decide if he wants to
add another input. If not, all inputs the user did should be printed on the
screen. So I want to add each input to a list and print the list at the end.
-------- Original-Nachricht --------
> Datum: Wed, 10 Feb 2010 16:00:35 -0500
> Von: Brent Yorgey <[email protected]>
> An: [email protected]
> Betreff: Re: [Haskell-beginners] consing an element to a list inside a file
> On Wed, Feb 10, 2010 at 09:52:48PM +0100, [email protected] wrote:
> > Hi,
> > I want to add an element to a list inside a haskell file:
> > mylist = [1,2,3,4]
> > 0:mylist
> > in Prelude it works fine, but when I do it in a file I get the error:
> > parse error (possibly incorrect indentation)
> > Failed, modules loaded: none.
> > in a line after this two that doesn't exist
>
> A Haskell file is simply a list of declarations, i.e. definitions of
> data types, classes, and functions. You cannot just have an
> expression by itself in a Haskell file. You can write expressions at
> a ghci prompt (which I assume is what you meant) because that is what
> ghci is for: evaluating expressions.
>
> Why do you want 0:mylist by itself in a Haskell file? What is its
> purpose? Note that it will not modify the value of mylist (indeed,
> you *cannot* modify the value of mylist once it has been defined).
>
> -Brent
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01
------------------------------
Message: 8
Date: Wed, 10 Feb 2010 22:21:13 +0100
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] consing an element to a list inside a
file
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
Am Mittwoch 10 Februar 2010 21:52:48 schrieb [email protected]:
> Hi,
> I want to add an element to a list inside a haskell file:
> mylist = [1,2,3,4]
> 0:mylist
> in Prelude it works fine, but when I do it in a file I get the error:
> parse error (possibly incorrect indentation)
> Failed, modules loaded: none.
> in a line after this two that doesn't exist
0:mylist
is a plain value. At the ghci or hugs prompt, if you enter an expression
(4, 3*7+5, [0 .. 10],...), that means "evaluate the expression and print
the result" (unless it's a value of type IO a, then it means "execute this
action").
In a source file, you write definitions,
name = expression to be bound to name
func arg1 arg2 = body
etc.
You can have pattern bindings in a source file,
(a,b) = ([0 .. 100],True)
-- defines a and b
0:mylist = map (`mod` 7) [14 .. 100]
-- defines mylist as [1,2,3,4,5,6,0,1,...,1,2]
0:myotherlist = [4,5,6]
{- will fail with
ghci> myotherlist
*** Exception: PatTest.hs:4:0-22: Irrefutable pattern failed for pattern 0
: myotherlist
when demanded
-}
, so that's what the parser expected, a '=' and an expression which defines
mylist.
Since it didn't find a '=' on the same line, it tried the next (where it
found end of file, another definition or whatever) where it reported the
parse error.
Probably you wanted
mysecondlist = 0:mylist
?
------------------------------
Message: 9
Date: Thu, 11 Feb 2010 08:58:54 +0200
From: Gabi <[email protected]>
Subject: [Haskell-beginners] HackageDB - How to browse by development
status
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Thanks Stephen
This is really useful link.
At least now I can guess what package is "popular" what is esoteric.
--
Regards,
Gabi
http://bugspy.net
------------------------------
Message: 10
Date: Thu, 11 Feb 2010 08:56:19 +0100
From: jean verdier <[email protected]>
Subject: Re: [Haskell-beginners] ghc problem
To: Brent Yorgey <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="UTF-8"
Thx for your reply.
I've switched back to the yum version (6.10.3) and it works. The problem
was too mysterious with the 6.10.4 i had and it does not seem common so
i might have done something stupid at some point with my install.
Tried to find a bug and got
Oopsâ¦
Trac detected an internal error:
OperationalError: database is locked
So i guess i'll stick with the yumed 6.10.3 :)
On Wed, 2010-02-10 at 15:54 -0500, Brent Yorgey wrote:
> This is clearly a GHC bug of some sort. Have you tried looking for
> this error on the GHC bug tracker? It's possible it's already been
> fixed in a newer version of GHC.Otherwise, I suggest emailing the GHC
> user mailing list.
>
> -Brent
>
>
> On Wed, Feb 10, 2010 at 10:52:24AM +0100, jean verdier wrote:
> > Trying to compile sources gives me:
> >
> > ghc: internal error: evacuate(static): strange closure type 34
> > (GHC version 6.10.4 for i386_unknown_linux)
> > Please report this as a GHC bug:
> > http://www.haskell.org/ghc/reportabug
> >
> > This already occured to me some times before and a cleanup and recompile
> > would work. This time i am stuck as i can't compile anymore. The ghc
> > version i use is the 6.10.4 from the ghc home page binary distribution i
> > think.
> >
> > uname -a gives :
> > Linux localhost.localdomain 2.6.29.4-167.fc11.i586 #1 SMP Wed May 27
> > 17:14:37 EDT 2009 i686 athlon i386 GNU/Linux
> >
> > The command line is:
> > ghc -fwarn-incomplete-patterns -fno-warn-unused-binds
> > -fno-warn-unused-matches -fno-warn-unused-imports
> > -fno-warn-missing-signatures -fno-glasgow-exts -Werror
> > -outputdir /tmp/mfk/build -package ghc -i/tmp/mfk/gensrc --make
> > common/MFK/Common/SrcGen.hs common/MFK/Common/Conf.hs
> >
> > Any hints ?
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 20, Issue 20
*****************************************