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:  question about list processing (Dennis Raddle)
   2. Re:  question about list processing (David McBride)
   3.  Best MD5 module? (Dan Stromberg)
   4. Re:  Best MD5 module? (Patrick Mylund Nielsen)
   5. Re:  Why this order of parameters (Kim-Ee Yeoh)
   6. Re:  Best MD5 module? (Dan Stromberg)


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

Message: 1
Date: Thu, 12 Nov 2015 13:00:04 -0800
From: Dennis Raddle <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] question about list processing
Message-ID:
        <cakxlvoqynxdxhmvoidcbqcsny2spevp7po7dfa2yrsj672g...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Thu, Nov 12, 2015 at 6:32 AM, David McBride <[email protected]> wrote:

> There was some real controversy over this change.  People were strongly
> opposed to the change for exactly the reason you gave (among others), that
> it is hard for beginners.  However, there was enough momentum that it went
> through, and now things like fmap and length work on a wide variety of data
> types.  You can google ftp haskell controversy for more info.
>
>



Thanks, David. As far as instances of Functor, Applicative, and Monad, so
far I've mostly used lists and Maybe. I've never taken specific advantage
of Traversable.

Could you suggest a new type for me to explore? I mean something that could
have instances in any of the above classes, one or all.

I only use Haskell for an occasional hobby project so despite having
started five years ago, I consider myself a beginner. My project involves
playing music by transforming a musical score into MIDI commands and
sending them to a software synthesizer. As far as library types, I mostly
use Map, lists, and Maybe. These are all I have needed to look for patterns
in lists or Maps of notes. But I'm sure I'm missing out on something.

D
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151112/67ba7557/attachment-0001.html>

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

Message: 2
Date: Thu, 12 Nov 2015 16:12:56 -0500
From: David McBride <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] question about list processing
Message-ID:
        <CAN+Tr41b3-XB=ktdhj3beo8stfj1tpjavtwemonnvtozdyf...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

It is mostly just things like:

Prelude.length (Data.Map.fromList [(1,"1"),(2,"2")])

Prelude.foldr (+) 0 (Data.Set.fromList [1,2,3,4,5])

Prelude.null Nothing
Prelude.null (Just 2)

Just watch out for some gotchas:

minimum (1,2)

On Thu, Nov 12, 2015 at 4:00 PM, Dennis Raddle <[email protected]>
wrote:

>
>
> On Thu, Nov 12, 2015 at 6:32 AM, David McBride <[email protected]> wrote:
>
>> There was some real controversy over this change.  People were strongly
>> opposed to the change for exactly the reason you gave (among others), that
>> it is hard for beginners.  However, there was enough momentum that it went
>> through, and now things like fmap and length work on a wide variety of data
>> types.  You can google ftp haskell controversy for more info.
>>
>>
>
>
>
> Thanks, David. As far as instances of Functor, Applicative, and Monad, so
> far I've mostly used lists and Maybe. I've never taken specific advantage
> of Traversable.
>
> Could you suggest a new type for me to explore? I mean something that
> could have instances in any of the above classes, one or all.
>
> I only use Haskell for an occasional hobby project so despite having
> started five years ago, I consider myself a beginner. My project involves
> playing music by transforming a musical score into MIDI commands and
> sending them to a software synthesizer. As far as library types, I mostly
> use Map, lists, and Maybe. These are all I have needed to look for patterns
> in lists or Maps of notes. But I'm sure I'm missing out on something.
>
> D
>
>
> _______________________________________________
> 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/20151112/5c652b30/attachment-0001.html>

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

Message: 3
Date: Thu, 12 Nov 2015 14:30:28 -0800
From: Dan Stromberg <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Best MD5 module?
Message-ID:
        <caovkw55nk+rcwaaul0cbm9zwzzu0vwag+kwfdvocll1uhft...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Hi again folks.

What's the best module for doing an MD5 hash?

More specifically, I want to hash the first few dozen K of a file, and then
the entire file - to get two different hashes.

I'm seeing at least 3 modules for it:
https://hackage.haskhell.org/package/cryptohash-0.11.6/docs/Crypto-Hash-MD5.html
https://hackage.haskell.org/package/pureMD5-2.1.2.1/docs/Data-Digest-Pure-MD5.html
https://hackage.haskell.org/package/MissingH-1.3.0.1/docs/Data-Hash-MD5.html

Which is best?

Thanks!

-- 
Dan Stromberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151112/f99c8daf/attachment-0001.html>

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

Message: 4
Date: Thu, 12 Nov 2015 22:37:11 +0000
From: Patrick Mylund Nielsen <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Best MD5 module?
Message-ID:
        <CAEw2jfzgNB=sacraokvyfqq+ejtkwmm0qwc9nkltbfo6jod...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Thu, Nov 12, 2015 at 5:30 PM Dan Stromberg <[email protected]> wrote:

>
> What's the best module for doing an MD5 hash?
>
> More specifically, I want to hash the first few dozen K of a file, and
> then the entire file - to get two different hashes.
>

I would use the one from cryptohash if you're looking for performance,
however I must stress that using MD5 for anything "new" is almost certainly
a bad idea. If you aren't doing this for compatibility reasons, you should
use something else, like BLAKE2: https://blake2.net/

You might also be interested in https://hackage.haskell.org/package/saltine
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151112/c66c6fa1/attachment-0001.html>

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

Message: 5
Date: Fri, 13 Nov 2015 08:08:41 +0700
From: Kim-Ee Yeoh <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Why this order of parameters
Message-ID:
        <CAPY+ZdS9Z3sxE8jGPS5+bsHHGHVs0OFbMANyz7=k20l1svp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Fri, Nov 13, 2015 at 12:49 AM, Martin Vlk <[email protected]> wrote:

> I'm curious if this could be for the sake of making the types of the two
> functions (foldr/foldl) different? E.g. so that you can tell from the
> type what function it is.
>

No, that would be foolish. One doesn't simply make the types different to
distinguish them.

Suppose the elements are already naturally foldable. Then foldr and foldl
have the same type signature:

foldl, foldr :: (a -> a -> a) -> a -> [a] -> a

But sometimes they are only foldable qua another type. Call it r. If you
work through Harald's reasoning, you'll arrive at:

foldr :: (a -> r -> r) -> r -> [a] -> r
foldl :: (r -> a -> r) -> r -> [a] -> r

-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151113/fcaebf8f/attachment-0001.html>

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

Message: 6
Date: Thu, 12 Nov 2015 21:17:10 -0800
From: Dan Stromberg <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
        beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] Best MD5 module?
Message-ID:
        <caovkw566phmcqeikd_5ixvq7ttnwzg9b_xkgwqdhlhsdw1t...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

On Thu, Nov 12, 2015 at 2:37 PM, Patrick Mylund Nielsen <
[email protected]> wrote:

> On Thu, Nov 12, 2015 at 5:30 PM Dan Stromberg <[email protected]> wrote:
>
>>
>> What's the best module for doing an MD5 hash?
>>
>> More specifically, I want to hash the first few dozen K of a file, and
>> then the entire file - to get two different hashes.
>>
>
> I would use the one from cryptohash if you're looking for performance,
> however I must stress that using MD5 for anything "new" is almost certainly
> a bad idea. If you aren't doing this for compatibility reasons, you should
> use something else, like BLAKE2: https://blake2.net/
>
> You might also be interested in
> https://hackage.haskell.org/package/saltine
>

My use of MD5 is strictly non-cryptographic.  It is in a limited sense for
compatibility with other software - but it's more about doing the same
algorithm in multiple languages for the sake of comparison.

I'll look at  cryptohash.

Thanks.

Dan Stromberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.haskell.org/pipermail/beginners/attachments/20151112/bdd44e34/attachment.html>

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

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


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

End of Beginners Digest, Vol 89, Issue 22
*****************************************

Reply via email to