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: Looking for some guidance to installing GHCI on MAC
(Wes Morgan)
2. Processing individual csv line (Shakthi Kannan)
3. Re: Looking for some guidance to installing GHCI on MAC
(JETkoten)
----------------------------------------------------------------------
Message: 1
Date: Sun, 23 Jan 2011 16:53:55 -0500
From: Wes Morgan <[email protected]>
Subject: Re: [Haskell-beginners] Looking for some guidance to
installing GHCI on MAC
To: patricklynch <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"
On Sunday, January 23, 2011 at 5:20 PM, patricklynch wrote:
> ...i tried the March 2010 installation on the MAC and I get the same
> result...if there is a requirement for Xcode, shouldn't it be listed in the
> Installation Instructions... I tried another installation but it too
> required Xcode...
>
>
It is listed as a requirement, see here under Requirements:
https://github.com/mxcl/homebrew/wiki/installation
In fact, that page states that the recommended installation script will attempt
to install Xcode for you. So that's probably where it was asking for an Apple
Developer ID, which is free, $0, not $99, not $1, free.
>
>
> ...again, I was able to install GHC on a PC and was able to install HUGs on
> the Mac...
>
> ...really frustrating... I'm not going to pay Apple $99, so I may have to
> give up on the Mac for a while - bummer...
>
>
Let me reiterate one more time: *You do NOT need to pay Apple any amount of
money to install Homebrew or GHC or Xcode.* I have all three installed and I
haven't paid Apple a dime for my Developer ID that allowed me to download Xcode.
Go here to register a free Apple Developer ID that will allow you to download
Xcode: http://developer.apple.com/programs/register/
Notice the reassuring "Free" right next to the button. It's free. Really.
>
>
> -----Original Message-----
> From: patricklynch [mailto:[email protected]]
> Sent: Sunday, January 23, 2011 4:44 PM
> To: 'Antoine Latter'
> Cc: 'Wes Morgan'; '[email protected]'
> Subject: RE: [Haskell-beginners] Looking for some guidance to installing
> GHCI on MAC
>
> ...sorry for being a 'klutz' - but I'm new to the mac too...
> ...i'm guessing that I have Xcode installed...i see an X icon that has an
> X11 label - when I click it, it displays nothing...bummer...
> ...since I was able to install Hugs I'm guessing that Xcode is
> installed...however, I have no way of knowing if this is true...and Apple
> wants $99 for a Developer fee, bummer...I was not given an installation
> disk...
>
> I went to the site: haskage.haskell.org\platform\mac.html...
> It gives me a three step installation procedure...
> ...the 1st deletes any previous installation of GHC - this worked...
> ...the 2nd gets me to a screen that states Standard install on "Macintosh
> HD"; with a message: click Install...{however, the Install Button can not be
> clicked}...this is as far as I can get...
>
> -----Original Message-----
> From: Antoine Latter [mailto:[email protected]]
> Sent: Sunday, January 23, 2011 2:55 PM
> To: patricklynch
> Cc: Wes Morgan; [email protected]
> Subject: Re: [Haskell-beginners] Looking for some guidance to installing
> GHCI on MAC
>
> The problem I had at first with the Haskell Platform installer was
> that I didn't have Xcode installed.
>
> This should be on one of the OS X install discs, I think. You can also
> download it from Apple:
>
> http://developer.apple.com/technologies/xcode.html
>
> It might be easier if you could send us the error message you're getting.
>
> Antoine
>
> On Sun, Jan 23, 2011 at 2:18 PM, patricklynch <[email protected]>
> wrote:
>
> > ...i tried to use the installation for Mac at Haskell.org, but it gives me
> > an error message [something like: call your software vendor]...
> >
> > ...i tried the Homebrew, see email below, but it wants my Apple Developer
> > id...i don't have one...
> >
> > ...i installed it on my pc and all it took was a single keystroke...
> > ...i installed Hugs on my Mac without any problem..
> >
> > ...i'd appreciate any help, I really need to work with ghc on my mac
> >
> > Go Jets
> >
> > -----Original Message-----
> > From: [email protected] [mailto:[email protected]]
> > On Behalf Of Wes Morgan
> > Sent: Sunday, January 23, 2011 7:36 AM
> > To: [email protected]
> > Subject: Re: [Haskell-beginners] Looking for some guidance to installing
> > GHCI on MAC
> >
> > I just used Homebrew (http://mxcl.github.com/homebrew/). Once that's
> > installed, 'brew install ghc' gets you GHC, GHCi, cabal, etc.
> >
> > Wes
> >
> > On Jan 23, 2011, at 6:00 AM, "[email protected]"
> > <[email protected]> wrote:
> >
> >
> > > Re: [Haskell-beginners] Looking for some guidance to
> > > installing GHCI on MAC
> > >
> > >
> >
> > _______________________________________________
> > Beginners mailing list
> > [email protected]
> > http://www.haskell.org/mailman/listinfo/beginners
> >
> >
> > _______________________________________________
> > 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/20110123/f45e5412/attachment-0001.htm>
------------------------------
Message: 2
Date: Mon, 24 Jan 2011 15:44:29 +0530
From: Shakthi Kannan <[email protected]>
Subject: [Haskell-beginners] Processing individual csv line
To: [email protected]
Message-ID:
<[email protected]>
Content-Type: text/plain; charset=UTF-8
Hi,
I am trying to parse a .csv file and process the individual lines.
Here is some code snippet (based on RWH Chapter 16 [1]):
=== test.hs ===
import Text.ParserCombinators.Parsec
import System.Environment (getArgs)
parseCSV :: String -> Either ParseError [[String]]
parseCSV input = parse csvFile "(unknown)" input
main = do
do c <- getContents
case parse csvFile "(stdin)" c of
Left e -> do putStrLn "Error parsing input:"
print e
Right r -> mapM_ print r
=== END ===
Given an input file foo.csv:
a,b,c
d,e,f
g,h,i
and running the above test.hs using:
$ runghc test.hs < foo.csv
I get the following output:
["a,b,c"]
["d,e,f"]
["g,h,i"]
Instead of using mapM_ print r, how can I obtain and pass each of the
above lists (for example, ["a,b,c"]) to another function for
processing?
Appreciate any inputs,
Thanks!
SK
[1] RWH. Using Parsec. http://book.realworldhaskell.org/read/using-parsec.html
--
Shakthi Kannan
http://www.shakthimaan.com
------------------------------
Message: 3
Date: Mon, 24 Jan 2011 05:37:19 -0500
From: JETkoten <[email protected]>
Subject: Re: [Haskell-beginners] Looking for some guidance to
installing GHCI on MAC
To: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Xcode is needed on the Mac to install *anything* that's not already a
ready made (pre-compiled binary) program. Once you've got Xcode
installed, it really does get easier!
It is different than the PC because the Mac is using Xcode to convert
the GHC and other Haskell platform files from the source code that
people can read to a complied binary program that the computer can read
and that can run on your Mac. On the PC what you downloaded and
installed was already compiled before you downloaded it.
Once you get your free developer.apple.com account you then look for the
link for Xcode and pick the one for your version of OSX (10.4 or 10.5 or
10.6).
Download the file and when it finishes you can just double click it on
the download window and it'll run the installer, or at least take you to
the downloaded installer in whatever folder it is in so you can then
double click installer file and make it run. I forget which way it works
right now, but one of those will work.
It'll then have you agree to the software license, and ask for your
system password.
Write it in, then wait a while for it to finish. It'll tell you when
it's done... and after that you can try to install the Haskell platform
again and it should work.
This is the beginner list: "Here, there is no such thing as a 'stupid
question.'" Any other problems with your install? Post them back to the
list. You don't have to give up on it... keep at it and people here will
help you through.
On 1/23/11 5:20 PM, patricklynch wrote:
> ...i tried the March 2010 installation on the MAC and I get the same
> result...if there is a requirement for Xcode, shouldn't it be listed in the
> Installation Instructions... I tried another installation but it too
> required Xcode...
>
> ...again, I was able to install GHC on a PC and was able to install HUGs on
> the Mac...
>
> ...really frustrating... I'm not going to pay Apple $99, so I may have to
> give up on the Mac for a while - bummer...
>
> -----Original Message-----
> From: patricklynch [mailto:[email protected]]
> Sent: Sunday, January 23, 2011 4:44 PM
> To: 'Antoine Latter'
> Cc: 'Wes Morgan'; '[email protected]'
> Subject: RE: [Haskell-beginners] Looking for some guidance to installing
> GHCI on MAC
>
> ...sorry for being a 'klutz' - but I'm new to the mac too...
> ...i'm guessing that I have Xcode installed...i see an X icon that has an
> X11 label - when I click it, it displays nothing...bummer...
> ...since I was able to install Hugs I'm guessing that Xcode is
> installed...however, I have no way of knowing if this is true...and Apple
> wants $99 for a Developer fee, bummer...I was not given an installation
> disk...
>
> I went to the site: haskage.haskell.org\platform\mac.html...
> It gives me a three step installation procedure...
> ...the 1st deletes any previous installation of GHC - this worked...
> ...the 2nd gets me to a screen that states Standard install on "Macintosh
> HD"; with a message: click Install...{however, the Install Button can not be
> clicked}...this is as far as I can get...
>
> -----Original Message-----
> From: Antoine Latter [mailto:[email protected]]
> Sent: Sunday, January 23, 2011 2:55 PM
> To: patricklynch
> Cc: Wes Morgan; [email protected]
> Subject: Re: [Haskell-beginners] Looking for some guidance to installing
> GHCI on MAC
>
> The problem I had at first with the Haskell Platform installer was
> that I didn't have Xcode installed.
>
> This should be on one of the OS X install discs, I think. You can also
> download it from Apple:
>
> http://developer.apple.com/technologies/xcode.html
>
> It might be easier if you could send us the error message you're getting.
>
> Antoine
>
> On Sun, Jan 23, 2011 at 2:18 PM, patricklynch<[email protected]>
> wrote:
>> ...i tried to use the installation for Mac at Haskell.org, but it gives me
>> an error message [something like: call your software vendor]...
>>
>> ...i tried the Homebrew, see email below, but it wants my Apple Developer
>> id...i don't have one...
>>
>> ...i installed it on my pc and all it took was a single keystroke...
>> ...i installed Hugs on my Mac without any problem..
>>
>> ...i'd appreciate any help, I really need to work with ghc on my mac
>>
>> Go Jets
>>
>> -----Original Message-----
>> From: [email protected] [mailto:[email protected]]
>> On Behalf Of Wes Morgan
>> Sent: Sunday, January 23, 2011 7:36 AM
>> To: [email protected]
>> Subject: Re: [Haskell-beginners] Looking for some guidance to installing
>> GHCI on MAC
>>
>> I just used Homebrew (http://mxcl.github.com/homebrew/). Once that's
>> installed, 'brew install ghc' gets you GHC, GHCi, cabal, etc.
>>
>> Wes
>>
>> On Jan 23, 2011, at 6:00 AM, "[email protected]"
>> <[email protected]> wrote:
>>
>>> Re: [Haskell-beginners] Looking for some guidance to
>>> installing GHCI on MAC
>> _______________________________________________
>> 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
>
------------------------------
_______________________________________________
Beginners mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/beginners
End of Beginners Digest, Vol 31, Issue 25
*****************************************