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:  Type Operator (Brent Yorgey)
   2.  System.Process and ghc 6.8.2 (Erik de Castro Lopo)
   3. Re:  System.Process and ghc 6.8.2 (Erik de Castro Lopo)
   4.  Is ghc 6.8.2 useful? (Erik de Castro Lopo)
   5. Re:  Is ghc 6.8.2 useful? (Thomas Davie)
   6. Re:  Is ghc 6.8.2 useful? (Erik de Castro Lopo)
   7. Re:  System.Process and ghc 6.8.2 (Conrad Meyer)
   8. Re:  System.Process and ghc 6.8.2 (Erik de Castro Lopo)


----------------------------------------------------------------------

Message: 1
Date: Wed, 21 Jan 2009 22:07:00 -0500
From: Brent Yorgey <[email protected]>
Subject: Re: [Haskell-beginners] Type Operator
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=us-ascii

On Wed, Jan 21, 2009 at 11:51:26PM +0100, Daniel Fischer wrote:
> I think you can't.
> If it's possible, the best option would be to change the order of type 
> parameters of Sample. If that's not possible, you can define
> 
>   newtype FSample b a = FS (Sample a b)
> 
> and make that an instance of Monad.

Right, Haskell doesn't allow partially applied type synonyms, but
partially applied newtypes are fine.  It will just be a bit annoying
having the FS constructor tags everywhere.  Switching the order of the
parameters to Sample would be the best option.

> Somebody remind me, why does Haskell not have type-lambdas?

Because type-lambdas would require higher-order unification during
type checking, which is in general undecidable.  Without type lambdas,
if you have to unify two type applications like

  f a == m b

then you know that f == m and a == b.  But with type lambdas this
might not be the case.  For example, you could have f == \x -> [x], a
= Int, m = \x -> x, and b = [Int].

-Brent


------------------------------

Message: 2
Date: Thu, 22 Jan 2009 17:25:39 +1100
From: Erik de Castro Lopo <[email protected]>
Subject: [Haskell-beginners] System.Process and ghc 6.8.2
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Hi all,

I'm using ghc/ghci 6.8.2 and looking at the System.Process module.

Hoogle lists functions like readProcess and readProcessWithExitCode but
they don't seem to exist. Is 6.8.2 too early?

Cheers,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Christianity has a nasty habit of ignoring the major problems of
our time, including overpopulation and exhaustion of resources,
because  they aren't mentioned in the Bible."
-- Paula L. Craig


------------------------------

Message: 3
Date: Thu, 22 Jan 2009 17:43:16 +1100
From: Erik de Castro Lopo <[email protected]>
Subject: Re: [Haskell-beginners] System.Process and ghc 6.8.2
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Erik de Castro Lopo wrote:

> Hoogle lists functions like readProcess and readProcessWithExitCode but
> they don't seem to exist. Is 6.8.2 too early?

It seems the answer is yes, 6.8.2 is too early.

Now trying to create reimplement readProcess in terms of runInteractiveProcess.

Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"All great truths begin as blasphemies."
-- George Bernard Shaw


------------------------------

Message: 4
Date: Thu, 22 Jan 2009 19:42:44 +1100
From: Erik de Castro Lopo <[email protected]>
Subject: [Haskell-beginners] Is ghc 6.8.2 useful?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

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


------------------------------

Message: 5
Date: Thu, 22 Jan 2009 10:39:10 +0100
From: Thomas Davie <[email protected]>
Subject: Re: [Haskell-beginners] Is ghc 6.8.2 useful?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"


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-0001.htm

------------------------------

Message: 6
Date: Thu, 22 Jan 2009 20:59:25 +1100
From: Erik de Castro Lopo <[email protected]>
Subject: Re: [Haskell-beginners] Is ghc 6.8.2 useful?
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

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.


------------------------------

Message: 7
Date: Thu, 22 Jan 2009 14:00:42 -0800
From: Conrad Meyer <[email protected]>
Subject: Re: [Haskell-beginners] System.Process and ghc 6.8.2
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain;  charset="iso-8859-1"

On Wednesday 21 January 2009 10:43:16 pm Erik de Castro Lopo wrote:
> Erik de Castro Lopo wrote:
> > Hoogle lists functions like readProcess and readProcessWithExitCode but
> > they don't seem to exist. Is 6.8.2 too early?
>
> It seems the answer is yes, 6.8.2 is too early.
>
> Now trying to create reimplement readProcess in terms of
> runInteractiveProcess.
>
> Erik

Why do this extra work instead of simply upgrading to 6.8.3?

-- 
Conrad Meyer <[email protected]>




------------------------------

Message: 8
Date: Fri, 23 Jan 2009 09:28:41 +1100
From: Erik de Castro Lopo <[email protected]>
Subject: Re: [Haskell-beginners] System.Process and ghc 6.8.2
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=US-ASCII

Conrad Meyer wrote:

> Why do this extra work instead of simply upgrading to 6.8.3?

Mainly because 6.8.2 is installed on my Ubuntu system using a
pre-compiled package (including a bunch of pre-compiled libraries).
I much prefer to use the the native packaging system because most
of the time it works so much better than anything else.

Also, the "extra work" became a few minor tweaks to this code:

    http://www.cse.unsw.edu.au/~dons/code/newpopen/System/Process/Run.hs

Cheers,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"Using Java as a general purpose application development language
is like going big game hunting armed with Nerf weapons."
-- Author Unknown


------------------------------

_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 7, Issue 15
****************************************

Reply via email to