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: Noob question.(I'm trying 'http://learnyouahaskell.com'
tutorial) (Jack Henahan)
2. Re: Training tasks (Jack Henahan)
----------------------------------------------------------------------
Message: 1
Date: Mon, 16 Apr 2012 22:56:22 -0400
From: Jack Henahan <[email protected]>
Subject: Re: [Haskell-beginners] Noob question.(I'm trying
'http://learnyouahaskell.com' tutorial)
To: Mait <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Additionally, "take' :: (Ord b, bum b) => b -> [a] -> [a]" should be "take' ::
(Ord b, Num b) => b -> [a] -> [a]"
Jack Henahan
[email protected]
==
Computer science is no more about computers than astronomy is about telescopes.
-- Michael R. Fellows
==
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PublicKey.asc
Type: application/x-apple-msg-attachment
Size: 24255 bytes
Desc: not available
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120416/67f2e311/attachment-0001.bin>
-------------- next part --------------
On Apr 16, 2012, at 5:50 PM, Mait <[email protected]> wrote:
> ENV
>
> Ubuntu 12.04
> haskell-platform/precise uptodate 2012.1.0.0~debian
>
> ghci --version
> The Glorious Glasgow Haskell Compilation System, version 7.4.1
>
> I've tried all day with,
> 'Learn You a Haskell for Great Good!'
> http://learnyouahaskell.com/
>
> Very attractive book. I'm really enjoying this book.
>
> Anyway I have one question,
>
> Why I can't declare func type like books?
>
> I got always error about 'lacks an accompanying binding', like this,
>
> Prelude> :l baby.hs
> [1 of 1] Compiling Main ( baby.hs, interpreted )
>
> baby.hs:32:1:
> The type signature for take' lacks an accompanying binding
> Failed, modules loaded: none.
>
> Here is codepad link,
> http://codepad.org/ttZRBpkL
>
> Thanks.
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://www.haskell.org/mailman/listinfo/beginners
------------------------------
Message: 2
Date: Mon, 16 Apr 2012 23:18:43 -0400
From: Jack Henahan <[email protected]>
Subject: Re: [Haskell-beginners] Training tasks
To: Nikita Beloglazov <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="iso-8859-1"
sumOfSquares, sumOfSquares', sumOfSquares'' :: Int -> Int
sumOfSquares n = sum [x^2 | x <- [1..n]] -- list comprehensions
sumOfSquares' n = sum $ map (^2) [1..n] -- ($) for function application and
explicit use of map
sumOfSquares'' = sum . map (^2) . enumFromTo 1 -- pointfree style
sumOfSquares''' :: Int -> (Int -> r) -> r
sumOfSquares''' n k = k . sum $ map (^2) [1..n] -- A very contrived bit of
continuation passing style (k is the continuation)
I'll try to come up with more. I'm sure others on the list can come up with
more varied stuff.
Jack Henahan
[email protected]
==
Computer science is no more about computers than astronomy is about telescopes.
-- Michael R. Fellows
==
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PublicKey.asc
Type: application/x-apple-msg-attachment
Size: 24255 bytes
Desc: not available
URL:
<http://www.haskell.org/pipermail/beginners/attachments/20120416/b06da753/attachment.bin>
-------------- next part --------------
On Apr 16, 2012, at 12:46 PM, Nikita Beloglazov <[email protected]> wrote:
> Hi.
> I'm building website where people can try and "taste" new languages by
> solving small or mediums size tasks. Tasks are language specific and should
> show best features of the language. Website is not meant to teach new
> language but to give idea what is this language good for.
> Now I want to add Haskell. I need about 7-10 tasks for now. First three of
> four tasks are introductory, they should show/check basics of haskell. E.g.
> given n, return sum of squares of first n even numbers. Other tasks are more
> complicated and show advantages of functional programming in general or some
> specific haskell features.
> I don't have any experience with haskell and I need you help. Could you help
> me with ideas for tasks?
>
> Thank you,
> Nikita Beloglazov
> _______________________________________________
> 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 46, Issue 26
*****************************************