Send Beginners mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
http://mail.haskell.org/cgi-bin/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: Getting "Discrete Mathematics Using a Computer" code to
run (Henk-Jan van Tuyl)
2. Spec with QuickCheck generationg list of list of the same
length (Ondrej Nekola)
3. Re: tower hanoi problem (YCH)
----------------------------------------------------------------------
Message: 1
Date: Sun, 15 Feb 2015 11:06:08 +0100
From: "Henk-Jan van Tuyl" <[email protected]>
To: [email protected], "Lawrence Bottorff" <[email protected]>
Subject: Re: [Haskell-beginners] Getting "Discrete Mathematics Using a
Computer" code to run
Message-ID: <op.xt3fonr8pz0j5l@alquantor>
Content-Type: text/plain; charset=iso-8859-15; format=flowed;
delsp=yes
On Sat, 14 Feb 2015 23:30:13 +0100, Lawrence Bottorff <[email protected]>
wrote:
> .../Discrete/Stdm02142015.lhs:1036:40-46:
> Not in scope: `catch'
>
> .../Discrete/Stdm02142015.lhs:1048:40-46:
> Not in scope: `catch'
> Failed, modules loaded: none.
>
> This is on ghci 7.6.3
The function "catch" is removed from Prelude, you need to add the line:
import Control.Exception
Regards,
Henk-Jan van Tuyl
--
Folding@home
What if you could share your unused computer power to help find a cure? In
just 5 minutes you can join the world's biggest networked computer and get
us closer sooner. Watch the video.
http://folding.stanford.edu/
http://Van.Tuyl.eu/
http://members.chello.nl/hjgtuyl/tourdemonad.html
Haskell programming
--
------------------------------
Message: 2
Date: Sun, 15 Feb 2015 11:52:12 +0100
From: Ondrej Nekola <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Spec with QuickCheck generationg list of
list of the same length
Message-ID: <[email protected]>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
I am playing with Test.Hspec and Test.QuickCheck and I am traying to
implement KMeans algorithm as a training. I use very simple
representation of vectors: type LVector=[Double]
I have no problems to write testcases with some concreate examples of
input and expected output:
it "sum of vectors is computed field by field" $ do
(*sumVect* [[1.0, 2.0], [3.0, 4.0], [4, 5]]) `shouldBe` [8.0, 11.0]
or simple properties based tests:
it "zeroVector contains just zeroes" $
property (\(Positive d) -> [] == filter (/= 0.0) (*zeroVector*d) )
but I get sticked, when I try to create QuickCheck test, for example for
the first case (*sumVect*). How can I generate list of lists, where all
the included lists are of the same length?
Link for some tutorial *) can be, I believe, enough but I would be glad
for any help.
Thanks
Ondra @satai Nekola
[email protected]
*) Maybe I have not trained my google good enough yet, but lack of
tutorials describing more than the most basic usecase is probably the
most problematic point in re-learning Haskell so far.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150215/d7eccaaa/attachment-0001.html>
------------------------------
Message: 3
Date: Sun, 15 Feb 2015 20:08:29 +0900
From: YCH <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] tower hanoi problem
Message-ID:
<CAPtM4gmh3aHe0guaNGULgq=2929QoJmb=rhcsdor6wbpqr+...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
On Sun, Feb 15, 2015 at 5:51 PM, Roelof Wobben <[email protected]> wrote:
> YCH schreef op 15-2-2015 om 9:45:
>>
>> How about if I say "Actually target was c not b and here is one more
>> disc. I put it on a. Now you should move all to c"
>>
>>
>
> Hanoi 1 a b c
>
> A -> C
>
> Hanoi 2 a b c
>
> A -> B
> A -> C
> B -> C
>
> Hanoi 3 a b c
>
> A -> C -- Compare these three lines to 'hanoi 2 ...'.
> A -> B -- If you could find pattern here,
> C -> B -- you can swap these lines to 'hanoi 2 ...'.
> A -> C
> B -> A
> B -> C
> A -> C
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 80, Issue 29
*****************************************