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. haskell code to html (I. J. Kennedy)
2. Re: haskell code to html (Daniel Fischer)
3. Figuring out errors (Edward Z. Yang)
4. Re: Utter Newbie - simple problems, output - GHC vs GHCi
(Magnus Therning)
5. Using FiniteMap in ghci (KwangYul Seo)
6. Re: Using FiniteMap in ghci (Chadda? Fouch?)
7. Re: Using FiniteMap in ghci (KwangYul Seo)
8. Re: Using FiniteMap in ghci (Daniel Fischer)
9. function - argument termination problem (??????? ????????????)
10. Re: function - argument termination problem (Rahul Kapoor)
11. Re: function - argument termination problem (Magnus Therning)
----------------------------------------------------------------------
Message: 1
Date: Mon, 31 Aug 2009 21:08:01 -0500
From: "I. J. Kennedy" <[email protected]>
Subject: [Haskell-beginners] haskell code to html
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
Is there a decent utility out there for syntax coloring haskell code?(haskell
to html)
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20090831/9e81a648/attachment-0001.html
------------------------------
Message: 2
Date: Tue, 1 Sep 2009 04:18:44 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] haskell code to html
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-15"
Am Dienstag 01 September 2009 04:08:01 schrieb I. J. Kennedy:
> Is there a decent utility out there for syntax coloring haskell
> code?(haskell to html)
HsColour:
http://hackage.haskell.org/package/hscolour
cabal update && cabal install hscolour
if you have a working cabal binary (if you haven't, you should get yourself one)
------------------------------
Message: 3
Date: Mon, 31 Aug 2009 23:02:10 -0400
From: "Edward Z. Yang" <[email protected]>
Subject: [Haskell-beginners] Figuring out errors
To: beginners <[email protected]>
Message-ID: <1251773361-sup-1...@javelin>
Content-Type: text/plain; charset=UTF-8
Hello all,
I've been looking at [1] and trying to make tops and bottoms
(pardon the pun) of error handling in Haskell. I am still
uncertain of what to do.
I recognize that there are different areas of code that
may have different requirements for errors:
* Pure code that is simple enough can probably get away
with returning Maybe a
* Pure code that has multiple failure modes (the canonical
example is parsing) should return a Either e a. The type
of e is a little difficult: many standard libraries seem
to use String, but coming from Python this seems analogous
to the long deprecated "string exceptions", which are quick
and easy but not long-term maintainable due to lack of an
easy way to match for them. This leads naturally into
Either MyError, which is supported using throwError and
catchError.
* However, [1] specifically warns against using this technique
in the IO monad, and I need a way to short circuit execution
when a crucial pure operation fails (in Python, this would have just
been an uncaught exception). This suggests using ErrorT on
IO, however, [1] also claims that this is generally not a good
idea, and suggests to use throwDyn (which actually looks like
it's been renamed to throw)
* Unfortunately, when I've tried to use this technique, I've
run up against the fact that throw is implemented using bottom,
so if I do a throw in a pure function, the exception might
not actually surface up until I'm, say, attempting to print
its return value to IO. Denizens on #haskell have instructed
me to treat bottom as the bane of existence and opt for
stacking ErrorT on IO (it would be nice to know if this was
a good idea or bad idea)
At which point, I am most thoroughly confused. Pointers, please!
Cheers,
Edward
[1]
http://www.randomhacks.net/articles/2007/03/10/haskell-8-ways-to-report-errors
------------------------------
Message: 4
Date: Wed, 2 Sep 2009 07:39:34 +0200
From: Magnus Therning <[email protected]>
Subject: Re: [Haskell-beginners] Utter Newbie - simple problems,
output - GHC vs GHCi
To: Nigel Rantor <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
On Mon, Aug 31, 2009 at 12:32 AM, Nigel Rantor<[email protected]> wrote:
> Magnus Therning wrote:
>> On Sun, Aug 30, 2009 at 11:09 PM, Nigel Rantor<[email protected]> wrote:
>>>
>>> length( filter( Char.isLower "LoweR" ) )
>>
>> try this instead
>>
>> length (filter Char.isLower "LoweR")
>>
>> `filter` takes two arguments.
>
> Thank you, I have been flip-flopping between having no parentheses and
> lots...I think I get it now.
>
> I owe you a beer.
>
> This will, however, probably not be my last post...
I'm most often in Cambridge, but do find myself in London
occasionally. Adding more beers to the first one is nothing I shy
away from :-)
/M
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnusï¼ therningï¼org Jabber: magnusï¼ therningï¼org
http://therning.org/magnus identi.ca|twitter: magthe
------------------------------
Message: 5
Date: Wed, 2 Sep 2009 20:21:43 +0900
From: KwangYul Seo <[email protected]>
Subject: [Haskell-beginners] Using FiniteMap in ghci
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
Hello,
I tried to load FiniteMap module in ghci and encountered an error message
like the following:
Prelude> import FiniteMap
Could not find module `FiniteMap':
it is a member of package ghc-6.8.2, which is hidden
The error message says that it is hidden. How can I use the FiniteMap?
Regards,
Kwang Yul Seo
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.haskell.org/pipermail/beginners/attachments/20090902/1823774e/attachment-0001.html
------------------------------
Message: 6
Date: Wed, 2 Sep 2009 14:02:28 +0200
From: Chadda? Fouch? <[email protected]>
Subject: Re: [Haskell-beginners] Using FiniteMap in ghci
To: KwangYul Seo <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
On Wed, Sep 2, 2009 at 1:21 PM, KwangYul Seo<[email protected]> wrote:
> The error message says that it is hidden. How can I use the FiniteMap?
FiniteMap has been superceded by Data.Map, this is probably what you
want to use (or Data.IntMap if your keys are Int).
--
Jedaï
------------------------------
Message: 7
Date: Wed, 2 Sep 2009 21:34:42 +0900
From: KwangYul Seo <[email protected]>
Subject: Re: [Haskell-beginners] Using FiniteMap in ghci
To: Chadda? Fouch? <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Oh, I see. Thanks.
I was playing with code from Yet Another Haskell Tutorial, and it uses
FiniteMap there. I think the tutorial needs to be updated too.
Regards,
Kwang Yul Seo
On Wed, Sep 2, 2009 at 9:02 PM, Chaddaï Fouché <[email protected]>
wrote:
>
> On Wed, Sep 2, 2009 at 1:21 PM, KwangYul Seo<[email protected]> wrote:
> > The error message says that it is hidden. How can I use the FiniteMap?
>
> FiniteMap has been superceded by Data.Map, this is probably what you
> want to use (or Data.IntMap if your keys are Int).
>
> --
> Jedaï
------------------------------
Message: 8
Date: Wed, 2 Sep 2009 15:18:38 +0200
From: Daniel Fischer <[email protected]>
Subject: Re: [Haskell-beginners] Using FiniteMap in ghci
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-15"
Am Mittwoch 02 September 2009 13:21:43 schrieb KwangYul Seo:
> Hello,
>
> I tried to load FiniteMap module in ghci and encountered an error message
> like the following:
>
> Prelude> import FiniteMap
> Could not find module `FiniteMap':
> it is a member of package ghc-6.8.2, which is hidden
>
> The error message says that it is hidden. How can I use the FiniteMap?
>
> Regards,
> Kwang Yul Seo
As Chaddai said, it's obsolete and superceded by Data.Map and Data.IntMap.
But the names and types of some functions have been changed, if you don't want
to change
the tutorial code so that it works with the new modules, you can
ghc-pkg expose ghc-6.8.2
then work with FiniteMap and afterwards
ghc-pkg hide ghc-6.8.2
------------------------------
Message: 9
Date: Wed, 2 Sep 2009 18:48:27 +0300
From: ??????? ???????????? <[email protected]>
Subject: [Haskell-beginners] function - argument termination problem
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
Hello,
Is it possible to implement in haskell a function f (A) such that if A
does not ever terminate then f always terminates, and if A always
terminates then f does not ever terminate? I've been thinking it for a
while, with no results unfortunately. the actual problem is that i can
think of no way to force both ifs: a function that always terminates
independently from its argument could be f (a) = 1, and a function
that does not terminate even if its argument terminates could be: f
(a) = f (a + 1), but i can't figure out a "hybrid" version... Is there
any idea on this?
Thanks in advance :-),
yannis
------------------------------
Message: 10
Date: Wed, 2 Sep 2009 11:54:30 -0400
From: Rahul Kapoor <[email protected]>
Subject: Re: [Haskell-beginners] function - argument termination
problem
To: ??????? ???????????? <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=ISO-8859-1
> Is it possible to implement in haskell a function f (A) such that if A
> does not ever terminate then f always terminates, and if A always
> terminates then f does not ever terminate?
Is the argument A itself another function?
If so, such a function does not exist.
See http://en.wikipedia.org/wiki/Halting_problem for more details.
Rahul
------------------------------
Message: 11
Date: Wed, 2 Sep 2009 17:56:41 +0200
From: Magnus Therning <[email protected]>
Subject: Re: [Haskell-beginners] function - argument termination
problem
To: ??????? ???????????? <[email protected]>
Cc: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
2009/9/2 ÎÎ¹Î¬Î½Î½Î·Ï ÎανÏζοÏ
ÏάÏÎ¿Ï <[email protected]>:
> Hello,
>
> Is it possible to implement in haskell a function f (A) such that if A
> does not ever terminate then f always terminates, and if A always
> terminates then f does not ever terminate? I've been thinking it for a
> while, with no results unfortunately. the actual problem is that i can
> think of no way to force both ifs: a function that always terminates
> independently from its argument could be f (a) = 1, and a function
> that does not terminate even if its argument terminates could be: f
> (a) = f (a + 1), but i can't figure out a "hybrid" version... Is there
> any idea on this?
>
> Thanks in advance :-),
Isn't this the halting problem?
/M
--
Magnus Therning (OpenPGP: 0xAB4DFBA4)
magnusï¼ therningï¼org Jabber: magnusï¼ therningï¼org
http://therning.org/magnus identi.ca|twitter: magthe
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 15, Issue 1
****************************************