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: Fwd: tower hanoi problem (Joel Neely)
2. Hello + Testing Framework (fr33domlover)
3. Re: Hello + Testing Framework (Michael Orlitzky)
4. how to check the format of a string ? (Roelof Wobben)
5. Re: how to check the format of a string ? (Benjamin Edwards)
6. Re: how to check the format of a string ? (Roelof Wobben)
7. Re: how to check the format of a string ?
(Sumit Sahrawat, Maths & Computing, IIT (BHU))
----------------------------------------------------------------------
Message: 1
Date: Sun, 22 Feb 2015 07:49:11 -0600
From: Joel Neely <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Fwd: tower hanoi problem
Message-ID:
<CAEEzXAg++SVocqkQgKycktfUyiDZGea9Eond2nhNZ=l+if8...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Nice!
Just out of curiosity...
I have no trouble accepting that the zipWith3 approach is more idiomatic,
but it doesn't appear (to my eye) significantly shorter or significantly
more obvious. So are the tradeoffs primarily cultural, or is there another
issue that I'm missing?
Thanks,
-jn-
On Sat, Feb 21, 2015 at 12:04 PM, Chadda? Fouch? <[email protected]>
wrote:
> On Sat, Feb 21, 2015 at 4:50 PM, Joel Neely <[email protected]> wrote:
>
>>
>> smooth :: Fractional n => [n] -> [n]
>> smooth (a:z@(b:c:_)) = (a + b + c) / 3 : smooth z
>> smooth _ = []
>>
>>
>>
> In Haskell, I would write this with higher-order functions though :
>
> smooth xs = zipWith3 (\a b c -> (a+b+c)/3) xs (drop 1 xs) (drop 2 xs)
>
> --
> Jeda?
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
--
Beauty of style and harmony and grace and good rhythm depend on simplicity.
- Plato
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150222/9ecf494d/attachment-0001.html>
------------------------------
Message: 2
Date: Sun, 22 Feb 2015 18:26:42 +0200
From: fr33domlover <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] Hello + Testing Framework
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
First of all, hello! I'm a fresh Haskell beginner and this is my first message
to Haskell MLs.
I recently began a tiny dummy project. Its code is minimal and its purpose it
to help me learn all the common developer tasks that aren't coding: debugging,
releasing, testing and so on. Especially organizing the project repository,
before I start "real" things.
My first problem was choosing a test framework and integrating it with `cabal
test`. There's a lot of info, sometimes contradicting due to changes in recent
years. Anyway I'll just blog about this later and now get to the point. I chose
Tasty as my test framework.
In the cabal user guide I read about the test-suite type "detailed-0.9" being
preferred for new projects. Later after choosing Tasty I started adding basic
support to my dummy project, and in the cabal integration section I see it says
to use the older "exitcode-stdio-1.0".
I also don't see a clear way to use detailed, because Tasty supplies its
"defaultMain" function meant to generate an executable. But I just tool a brief
look, not touched internals of Tasty at all.
The question: Should I use deatiled-0.9? If yes, how? Or should I just use
exitcode-stdio-1.0 as the Tasty manual says?
Thanks in advance!
---
fr33domlover <http://www.rel4tion.org/people/fr33domlover>
GPG key ID: 63E5E57D (size: 4096)
GPG key fingerprint: 6FEE C222 7323 EF85 A49D 5487 5252 C5C8 63E5 E57D
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150222/53ffc5ff/attachment.sig>
------------------------------
Message: 3
Date: Sun, 22 Feb 2015 11:39:33 -0500
From: Michael Orlitzky <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] Hello + Testing Framework
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
On 02/22/2015 11:26 AM, fr33domlover wrote:
>
> In the cabal user guide I read about the test-suite type "detailed-0.9" being
> preferred for new projects. Later after choosing Tasty I started adding basic
> support to my dummy project, and in the cabal integration section I see it
> says
> to use the older "exitcode-stdio-1.0".
>
> I also don't see a clear way to use detailed, because Tasty supplies its
> "defaultMain" function meant to generate an executable. But I just tool a
> brief
> look, not touched internals of Tasty at all.
>
No one uses the detailed-0.9 interface, and there's not a single working
example anywhere so no one ever will. Just stick with exitcode-stdio-1.0
and tasty (which works great, by the way).
The recommendation in the users guide is wishful thinking.
------------------------------
Message: 4
Date: Sun, 22 Feb 2015 19:50:11 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] how to check the format of a string ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252; format=flowed
Hello,
Im still busy with CIS 194
Now im facing this problem.
There is a log file of strings.
Most of them are of this format char Number [chars]
What is the best way to check if the string has this format ?
Regex or another way ?
Roelof
------------------------------
Message: 5
Date: Sun, 22 Feb 2015 19:14:51 +0000
From: Benjamin Edwards <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] how to check the format of a string ?
Message-ID:
<CAN6k4niJczampuoPdemg=dp5qwl0n0g+vdak4luoavmzc81...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
If the format is sufficiently simple a regex can be a very neat way to
express the idea. Mostly people use parser combinators. Have a look at
parsec / attoparsec on hackage.
Ben
On Sun Feb 22 2015 at 18:50:18 Roelof Wobben <[email protected]> wrote:
> Hello,
>
> Im still busy with CIS 194
>
> Now im facing this problem.
>
> There is a log file of strings.
>
> Most of them are of this format char Number [chars]
>
> What is the best way to check if the string has this format ?
>
> Regex or another way ?
>
> Roelof
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150222/7a1e69c1/attachment-0001.html>
------------------------------
Message: 6
Date: Sun, 22 Feb 2015 20:22:55 +0100
From: Roelof Wobben <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] how to check the format of a string ?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150222/d39e5480/attachment-0001.html>
------------------------------
Message: 7
Date: Mon, 23 Feb 2015 00:55:54 +0530
From: "Sumit Sahrawat, Maths & Computing, IIT (BHU)"
<[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] how to check the format of a string ?
Message-ID:
<cajbew8nsmzrbwnzwselvjsna8bdsorzmu7bmaev79abgcxs...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
The exercise was meant to be done without using any library. Try it out, it
will work.
A parser combinator library, such as parsec or attoparsec is better learnt
after you have some idea of monads, which is the last topic cis194 deals
with.
But, if it interests you, keep going. Parsec might be a better option as it
has been there for a longer amount of time, and thus has more learning
resources.
Hope this helps.
On 23 February 2015 at 00:52, Roelof Wobben <[email protected]> wrote:
> Thanks,
>
> Found this tutorial which works with log files like I have to do :
> https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/text-manipulation/attoparsec
>
> Roelof
>
>
>
> Benjamin Edwards schreef op 22-2-2015 om 20:14:
>
> If the format is sufficiently simple a regex can be a very neat way to
> express the idea. Mostly people use parser combinators. Have a look at
> parsec / attoparsec on hackage.
>
> Ben
>
> On Sun Feb 22 2015 at 18:50:18 Roelof Wobben <[email protected]> wrote:
>
>> Hello,
>>
>> Im still busy with CIS 194
>>
>> Now im facing this problem.
>>
>> There is a log file of strings.
>>
>> Most of them are of this format char Number [chars]
>>
>> What is the best way to check if the string has this format ?
>>
>> Regex or another way ?
>>
>> Roelof
>>
>> _______________________________________________
>> Beginners mailing list
>> [email protected]
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing
> [email protected]http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> [email protected]
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
--
Regards
Sumit Sahrawat
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20150223/dc170331/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 80, Issue 62
*****************************************