Is ghc 6.8.2 useful?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Is ghc 6.8.2 useful?

Erik de Castro Lopo-29
Hi all,

I'm using hoogle (http://www.haskell.org/hoogle/) as my main Haskell
documentations source, but I'm stuck on using ghc 6.8.2 and I keep
finding stuff listed in hoogle that isn't available in 6.8.2.

Is there any solution other than installing a more recent version of
ghc?

Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Education is an admirable thing, but it is well to remember from
time to time that nothing that is worth knowing can be taught."
--  Oscar Wilde
Reply | Threaded
Open this post in threaded view
|

Is ghc 6.8.2 useful?

Thomas Davie

On 22 Jan 2009, at 09:42, Erik de Castro Lopo wrote:

> Hi all,
>
> I'm using hoogle (http://www.haskell.org/hoogle/) as my main Haskell
> documentations source, but I'm stuck on using ghc 6.8.2 and I keep
> finding stuff listed in hoogle that isn't available in 6.8.2.
>
> Is there any solution other than installing a more recent version of
> ghc?

Are you sure that you're finding things that are unavailable in  
6.8.2?  There's been very little change to the APIs exposed to  
beginners since then.  It may be that you're not importing the module  
required, when hoogle gives you a result like this:

Data.Map insert :: Ord k => k -> a -> Map k a -> Map k a
containers
O(log n). Insert a new key and value in the map. If the key is already  
present in the map, the associated value is replaced with the supplied  
value. insert is equivalent to insertWith const.> insert 5  
'x' (fromList [(5,'a'), (3,'b')]) ==
you must use an import in your file to get access to it, as follows:

import Data.Map (insert)

or you can import the whole module like this:

import Data.Map

but this causes namespace polution, so it's not a great idea.  You can  
also import it so that you have to qualify all your uses of the  
functions:

import qualified Data.Map

f x y = Data.Map.insert 5 x y

-- or

import qualified Data.Map as M

f x y = M.insert 5 x y

Sorry if I just taught my granny to suck eggs.  If you are doing this  
and really are coming up against APIs that aren't in 6.8, then yes,  
you need to upgrade your compiler.  There's no real disadvantage to  
doing this though, except possibly that you lose support for one or  
two libraries that are taking a while to update (gtk2hs springs to  
mind).  You do however gain access to libraries that need newer  
compiler features (vector-space springs to mind).

Bob
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090122/7e2f4e2f/attachment.htm
Reply | Threaded
Open this post in threaded view
|

Is ghc 6.8.2 useful?

Erik de Castro Lopo-29
Thomas Davie wrote:

> Are you sure that you're finding things that are unavailable in  
> 6.8.2?

Specifically the things I found missing in just the last couple of
hours are:

    - module Text.Regex.Posix
    - functions readProcess/readProcessWithExitCode from System.Process
    - function exitSuccess from System.Exit

> There's been very little change to the APIs exposed to  
> beginners since then.

I must admit I am jumping in at the deep end, but I do have 4 years of
pretty extensive Ocaml coding under my belt.

> It may be that you're not importing the module  
> required

Haskell's modules are quite similar to Ocaml's but I'm pretty confident
I have this under control.

> Sorry if I just taught my granny to suck eggs.

I'm not your granny :-)

>  If you are doing this  
> and really are coming up against APIs that aren't in 6.8, then yes,  
> you need to upgrade your compiler.

I'll take that as an ACK.

> There's no real disadvantage to  
> doing this though, except possibly that you lose support for one or  
> two libraries that are taking a while to update (gtk2hs springs to  
> mind).

Ouch. I'm pretty attached to the debian packaging system on my Debian
and Ubuntu systems and really don't like to install non-packaged
binaries or source. On top of that I like to use existing libraries
whereever possible and that means installing these from source as
well.

I might have to look into cabal-debian.

Cheers,
Erik
--
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
Gambling(n): A discretionary tax on those asleep during high school
maths.
Reply | Threaded
Open this post in threaded view
|

Is ghc 6.8.2 useful?

sclv
The libraries as of 6.8.2 are here:
http://www.haskell.org/ghc/docs/6.8.2/html/libraries/

The regex library should be part of extralibs, which appears to come
standard with debian's ghc package. There are also better regex libraries
available from Hackage. There is indeed a new System.Process API, which you
may be able to install from hackage. Otherwise, for most purposes, the old
one works just fine. As for exitSuccess, as the documentation notes, it is
simply "exitWith ExitSuccess", so I wouldn't be too concerned at not being
able to use it.

In general 6.8.2 should be very useable still.

Cheers,
S.

On Thu, Jan 22, 2009 at 4:59 AM, Erik de Castro Lopo
<[hidden email]<mle%[hidden email]>
> wrote:

> Thomas Davie wrote:
>
> > Are you sure that you're finding things that are unavailable in
> > 6.8.2?
>
> Specifically the things I found missing in just the last couple of
> hours are:
>
>    - module Text.Regex.Posix
>    - functions readProcess/readProcessWithExitCode from System.Process
>    - function exitSuccess from System.Exit
>
> > There's been very little change to the APIs exposed to
> > beginners since then.
>
> I must admit I am jumping in at the deep end, but I do have 4 years of
> pretty extensive Ocaml coding under my belt.
>
> > It may be that you're not importing the module
> > required
>
> Haskell's modules are quite similar to Ocaml's but I'm pretty confident
> I have this under control.
>
> > Sorry if I just taught my granny to suck eggs.
>
> I'm not your granny :-)
>
> >  If you are doing this
> > and really are coming up against APIs that aren't in 6.8, then yes,
> > you need to upgrade your compiler.
>
> I'll take that as an ACK.
>
> > There's no real disadvantage to
> > doing this though, except possibly that you lose support for one or
> > two libraries that are taking a while to update (gtk2hs springs to
> > mind).
>
> Ouch. I'm pretty attached to the debian packaging system on my Debian
> and Ubuntu systems and really don't like to install non-packaged
> binaries or source. On top of that I like to use existing libraries
> whereever possible and that means installing these from source as
> well.
>
> I might have to look into cabal-debian.
>
> Cheers,
> Erik
> --
> -----------------------------------------------------------------
> Erik de Castro Lopo
> -----------------------------------------------------------------
> Gambling(n): A discretionary tax on those asleep during high school
> maths.
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/beginners/attachments/20090122/6b43ca84/attachment.htm