Send Beginners mailing list submissions to
        beginners@haskell.org

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
        beginners-requ...@haskell.org

You can reach the person managing the list at
        beginners-ow...@haskell.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

   1.  Help!! (Jessica Baker)
   2. Re:  Help!! (aditya siram)
   3.  Beginners issue with 'Why Haskell matters'       example code
      (Michael Anckaert)
   4. Re:  Beginners issue with 'Why Haskell matters' example code
      (Arlen Cuss)


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

Message: 1
Date: Wed, 9 Mar 2011 16:00:05 +0000
From: Jessica Baker <jessicamayba...@gmail.com>
Subject: [Haskell-beginners] Help!!
To: beginners@haskell.org
Message-ID:
        <AANLkTimT=Vxa=3jssfh5mnok2jhzmjy1pech3mwj+...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

3.1 Step 1
Create a Haskell script le called crypt.hs and enter the code for he Caesar
cipher from
Section 5.5 of the text book (Hutton). Make sure you understand how all the
functions
work.

3.2 Step 2
Transform your script le (from Step 1) into a Haskell program that reads
text from the
standard input, encrypts the text using the Caesar cipher, and writes the
result to the
standard output. Your program should take a command-line argument that
species the
shift factor to be used. So, for example:
cat poem.txt | ./crypt 3
Eqvdqjxlqlqj wkh vnb
Hrz khdylob lw glhv
Iqwr wkh Whvw dzdb
Pdvw wrxfk dqg vljkw dqg vrxqg
Nr orqjhu wr eh irxqg
Hrz krshohvv xqghujurxqg
Fdoov wkh uhpruvhixo gdb

If the command-line argument is 0 (zero) then the program should crack the
code and
output the deciphered text. So, the following command pipeline should echo
the original
message:
cat poem.txt | ./crypt 3 | ./crypt 0
Ensanguining the sky
How heavily it dies
Into the West away
Past touch and sight and sound
No longer to be found
How hopeless underground
Falls the remorseful day
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110309/0393e956/attachment-0001.htm>

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

Message: 2
Date: Wed, 9 Mar 2011 10:23:14 -0600
From: aditya siram <aditya.si...@gmail.com>
Subject: Re: [Haskell-beginners] Help!!
To: jessicamayba...@gmail.com
Cc: beginners@haskell.org
Message-ID:
        <aanlktikb68caqa3ac+okrbzxvr_3ln6-vgf49mnwu...@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1

What do you have so far? Or how are you thinking of attacking the problem?
-deech

On Wed, Mar 9, 2011 at 10:00 AM, Jessica Baker
<jessicamayba...@gmail.com> wrote:
> 3.1 Step 1
> Create a Haskell script le called crypt.hs and enter the code for he Caesar
> cipher from
> Section 5.5 of the text book (Hutton). Make sure you understand how all the
> functions
> work.
>
> 3.2 Step 2
> Transform your script le (from Step 1) into a Haskell program that reads
> text from the
> standard input, encrypts the text using the Caesar cipher, and writes the
> result to the
> standard output. Your program should take a command-line argument that speci
> es the
> shift factor to be used. So, for example:
> cat poem.txt | ./crypt 3
> Eqvdqjxlqlqj wkh vnb
> Hrz khdylob lw glhv
> Iqwr wkh Whvw dzdb
> Pdvw wrxfk dqg vljkw dqg vrxqg
> Nr orqjhu wr eh irxqg
> Hrz krshohvv xqghujurxqg
> Fdoov wkh uhpruvhixo gdb
>
> If the command-line argument is 0 (zero) then the program should crack the
> code and
> output the deciphered text. So, the following command pipeline should echo
> the original
> message:
> cat poem.txt | ./crypt 3 | ./crypt 0
> Ensanguining the sky
> How heavily it dies
> Into the West away
> Past touch and sight and sound
> No longer to be found
> How hopeless underground
> Falls the remorseful day
>
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>



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

Message: 3
Date: Thu, 10 Mar 2011 08:46:12 +0100
From: Michael Anckaert <michael.ancka...@sinax.be>
Subject: [Haskell-beginners] Beginners issue with 'Why Haskell
        matters'        example code
To: beginners@haskell.org
Message-ID:
        <AANLkTi=Kt559_PBfd+5wGLHhCuOqK-rEWZ7Uzw4Tg=9...@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hey everyone

I'm new on the list here and just started out learning Haskell and
functional programming. I have over 12 years experience programming in
various languages, from C to Python.

I started out with the Why Haskell matters paper (
http://haskell.org/haskellwiki/Why_Haskell_Matters) and ran into a problem
with the code below. It's discussed in the paper but when I save it to
test.hs and load it into ghci, I get the following output:

------------------------
[1 of 1] Compiling Main             ( test.hs, interpreted )

test.hs:6:22: parse error on input `='
Failed, modules loaded: none.

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

Could someone give a pointer on where my error lies?

qsort [] = []
qsort (x:xs) = qsort less ++ [x] ++ qsort more
    where less = filter (<x) xs
        more = filter (>=x) xs

-- 
Kind regards
Michael Anckaert <michael.ancka...@sinax.be>
http://www.sinax.be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110310/cbb7bfae/attachment-0001.htm>

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

Message: 4
Date: Thu, 10 Mar 2011 18:54:29 +1100
From: Arlen Cuss <cel...@sairyx.org>
Subject: Re: [Haskell-beginners] Beginners issue with 'Why Haskell
        matters' example code
To: Michael Anckaert <michael.ancka...@sinax.be>
Cc: beginners@haskell.org
Message-ID: <1299743669.18455.1.camel@asu>
Content-Type: text/plain; charset="utf-8"

Hi Michael,

Is line 6 the "    more = filter (>= x) xs" line? Try lining up the word
'more' with the word 'less' above it - and if you can't seem to get it
to work, try making sure you're using all spaces and not tabs to indent!

HTH,
Arlen

On Thu, 2011-03-10 at 08:46 +0100, Michael Anckaert wrote:
> Hey everyone
> 
> I'm new on the list here and just started out learning Haskell and
> functional programming. I have over 12 years experience programming in
> various languages, from C to Python. 
> 
> I started out with the Why Haskell matters paper
> (http://haskell.org/haskellwiki/Why_Haskell_Matters) and ran into a
> problem with the code below. It's discussed in the paper but when I
> save it to test.hs and load it into ghci, I get the following output:
> 
> ------------------------
> [1 of 1] Compiling Main             ( test.hs, interpreted )
> 
> test.hs:6:22: parse error on input `='
> Failed, modules loaded: none.
> 
> ------------------------
> 
> Could someone give a pointer on where my error lies?
> 
> qsort [] = []
> qsort (x:xs) = qsort less ++ [x] ++ qsort more
>     where less = filter (<x) xs
>         more = filter (>=x) xs
> 
> -- 
> Kind regards
> Michael Anckaert <michael.ancka...@sinax.be>
> http://www.sinax.be
> _______________________________________________
> Beginners mailing list
> Beginners@haskell.org
> http://www.haskell.org/mailman/listinfo/beginners


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: 
<http://www.haskell.org/pipermail/beginners/attachments/20110310/a751b740/attachment-0001.pgp>

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

_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners


End of Beginners Digest, Vol 33, Issue 11
*****************************************

Reply via email to