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. how to get started? (Abhijit Patel)
2. Re: More type errors I'm having trouble with (Dan Stromberg)
3. Re: how to get started? (Magnus Therning)
4. Netwire and event accumulator (Mart?n Villagra)
5. Re: More type errors I'm having trouble with (Kim-Ee Yeoh)
6. Re: More type errors I'm having trouble with (Dan Stromberg)
7. Re: More type errors I'm having trouble with (Kim-Ee Yeoh)
----------------------------------------------------------------------
Message: 1
Date: Wed, 9 Dec 2015 23:23:28 +0530
From: Abhijit Patel <[email protected]>
To: [email protected]
Subject: [Haskell-beginners] how to get started?
Message-ID:
<CAEr_=iXwr_tuzeGcpDzTCUtZbsnWWHK=dVbL3U+oKh=u5uh...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
i want to start contributing for the haskell community how and from where
should i start?
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151209/f7309b3f/attachment-0001.html>
------------------------------
Message: 2
Date: Wed, 9 Dec 2015 13:19: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: Re: [Haskell-beginners] More type errors I'm having trouble
with
Message-ID:
<CAOvKW54ayDDqMTbQF2w2Hp1kF92peP=+nnho5cr3ppqkdxw...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi.
On Fri, Dec 4, 2015 at 12:35 AM, Daniel Trstenjak <
[email protected]> wrote:
>
>
> Looking at your code, it's easier not to put the `IO String` computation
> of the hash into a tuple, but first compute all hashes:
>
> hashes <- sequence (map Md5s.prefix_md5 filenames)
>
>
> And if you want the hash and the filename grouped in a tuple:
>
> zip filenames hashes
What if I want to be able to deal gracefully with files that aren't
readable, whether due to permissions issues or I/O errors? I agree that
zip'ing is easier, but is it as robust?
Thanks.
--
Dan Stromberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151209/d0cc3795/attachment-0001.html>
------------------------------
Message: 3
Date: Wed, 09 Dec 2015 22:51:48 +0100
From: Magnus Therning <[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 get started?
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"
Abhijit Patel writes:
> i want to start contributing for the haskell community how and from where
> should i start?
While learning you can improve the Wiki articles and any other resources
you use. Also, if you are the kind of person who experiments with libs
to work out how to use them, then you can submit those experiments as
examples to be included in the libs' documentation.
/M
--
Magnus Therning OpenPGP: 0xAB4DFBA4
email: [email protected] jabber: [email protected]
twitter: magthe http://therning.org/magnus
If our ideas of intellectual property are wrong, we must change them,
improve them and return them to their original purpose. When
intellectual property rules diminish the supply of new ideas, they
steal from all of us.
-- Andrew Brown, November 19, 2005, The Guardian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 162 bytes
Desc: not available
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151209/5b669c8e/attachment-0001.sig>
------------------------------
Message: 4
Date: Wed, 9 Dec 2015 21:38:36 -0300
From: Mart?n Villagra <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: [Haskell-beginners] Netwire and event accumulator
Message-ID:
<cae7weajfeewhpbujgjedru6odikqj04qxnkjz4am41wdahp...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi. I'm trying to do a simulation using Netwire 5 and SDL but as I've just
started with Netwire I'm not sure if I'm doing it correctly regarding the
input events. Suppose I have a game which consists in moving a single pixel
around the screen. To make this game, I created these simple wires:
readEvent :: Wire s e IO a SDL.Event
(SDL.Event can be SDL.NoEvent or an event just like Netwire's events, so I
guess they can be easily converted)
inputLogic :: Wire s m SDL.Event Position
(it keeps the position as an internal state and updates it according to the
event)
render :: Wire s e IO Position ( )
(just writes the pixel to the screen)
And finally the game can be expressed using Arrow notation as:
readEvent>>>inputLogic>>>render
It works. But the thing here is that events like mouse movement are
generated way faster than frames. To solve this, inputLogic should read all
the input events until there are none and only then render the frame. I'm
unable to do this using Wires. I've tried to make some kind of loop with
ArrowLoop but I failed. I did came up with this solution, creating
different wires:
readEvents :: Wire s e IO a [SDL.Event]
(it populates the list until there are no more events)
inputLogic' :: Wire s m [SDL.Event] Position
And the game is:
readEvents>>>inputLogic'>>>render
Which does the expected behaviour but it doesn't seem a good approach to
me. These new wires aren't as basic as the first ones. Is this the best way
to do it? Does anybody has a better idea?
Any advice will be considerably appreciated.
Mart?n
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151209/92a39349/attachment-0001.html>
------------------------------
Message: 5
Date: Thu, 10 Dec 2015 07:57:49 +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] More type errors I'm having trouble
with
Message-ID:
<CAPY+ZdQPRrqV9hLTJJ9rTXjYn0MjHKopo3dj9f7HKxYYfVY=f...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Thu, Dec 10, 2015 at 4:19 AM, Dan Stromberg <[email protected]> wrote:
What if I want to be able to deal gracefully with files that aren't
> readable, whether due to permissions issues or I/O errors? I agree that
> zip'ing is easier, but is it as robust?
Making sense of this question requires an apples-to-apples comparison.
Observe that the original code doesn't deal with read errors either.
In fact, the replies in this thread have done only two things.
They've fixed the typecheck error.
And they've offered idiomatic -- but semantically identical -- rewritings
that read-fault in the exact same way as the original code.
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151210/a417b836/attachment-0001.html>
------------------------------
Message: 6
Date: Wed, 9 Dec 2015 17:35:07 -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] More type errors I'm having trouble
with
Message-ID:
<CAOvKW57==exi2HP8bcU=D2xmeaSAwMdMOutSy=g2crqoztu...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Wed, Dec 9, 2015 at 4:57 PM, Kim-Ee Yeoh <[email protected]> wrote:
>
>
> On Thu, Dec 10, 2015 at 4:19 AM, Dan Stromberg <[email protected]> wrote:
>
> What if I want to be able to deal gracefully with files that aren't
>> readable, whether due to permissions issues or I/O errors? I agree that
>> zip'ing is easier, but is it as robust?
>
>
> Making sense of this question requires an apples-to-apples comparison.
> Observe that the original code doesn't deal with read errors either.
>
> In fact, the replies in this thread have done only two things.
>
> They've fixed the typecheck error.
>
> And they've offered idiomatic -- but semantically identical -- rewritings
> that read-fault in the exact same way as the original code.
>
Yes, sure.
My thought was that going over the list of filenames+sizes and adding
prefix hashes where available, would be easier to make robust, than
attempting to get prefix hashes for all and zipping the results.
Is that not correct?
Should I use a Maybe to deal with files that don't hash, so there will
always be a one-to-one correspondence, allowing a zip?
Thanks.
--
Dan Stromberg
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151209/36213e30/attachment-0001.html>
------------------------------
Message: 7
Date: Thu, 10 Dec 2015 09:39:30 +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] More type errors I'm having trouble
with
Message-ID:
<CAPY+ZdRH9rgZDsK5t7jydBPFW=MvdVqwMC52GERAKWcv_k8=j...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Thu, Dec 10, 2015 at 8:35 AM, Dan Stromberg <[email protected]> wrote:
My thought was that going over the list of filenames+sizes and adding
> prefix hashes where available, would be easier to make robust, than
> attempting to get prefix hashes for all and zipping the results.
>
> Is that not correct?
>
No, that's not correct. And the reason is that zipping is a pure
computation (to use the jargon).
The errors can only come from file I/O.
Tupling incrementally and tupling all at once (namely, zipping) result in
identical values.
Neither can fault unless the code goes out of its way into un-idiomatic,
un-Haskelly territory.
> Should I use a Maybe to deal with files that don't hash, so there will
> always be a one-to-one correspondence, allowing a zip?
>
Yes, to be precise, instead of a function :: FilePath -> IO String that
could possibly throw IO exceptions, you'd write a FilePath -> IO (Maybe
String) that's exception-free because it catches them.
Thanks.
>
Anytime.
>
> --
> Dan Stromberg
>
> _______________________________________________
> 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/20151210/d5c6f411/attachment.html>
------------------------------
Subject: Digest Footer
_______________________________________________
Beginners mailing list
[email protected]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
------------------------------
End of Beginners Digest, Vol 90, Issue 15
*****************************************