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: explaining effects (Alexander Berntsen)
2. Re: explaining effects (emacstheviking)
3. Re: explaining effects (mike h)
4. Re: Extend instance for List (Kim-Ee Yeoh)
----------------------------------------------------------------------
Message: 1
Date: Tue, 15 Dec 2015 09:55:44 +0100
From: Alexander Berntsen <[email protected]>
To: [email protected]
Subject: Re: [Haskell-beginners] explaining effects
Message-ID: <[email protected]>
Content-Type: text/plain; charset=windows-1252
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 12/12/15 14:38, Daniel Bergey wrote:
> Why do you prefer "effect" to "side effect"?
FWIW, I say "effect" rather than "side effect" when talking about
Haskell, because in Haskell effects happen when you want them, not as
an unforeseen side-effect as a result of the complexity inherent to
the source code.
It is often said that having an effect is "difficult" in Haskell. But
really, it's just that if you are launching missiles in Haskell, *you
actually mean to*. It didn't happen because you wanted to increment i
and then "oops, stuff happened".
- --
Alexander
[email protected]
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJWb9WQAAoJENQqWdRUGk8BinMQAIzlf+zL00pjSfu/nkx8W59D
IeGbGCWV8zG74963SmCJP70UzamysWs20my+XL7B8UnzbPY/1mKTDK56P/rI+Vbn
+YUzWqNWDEuu8g37ATNrOyy99TyX+murkO10KnrYl9aVsOu4IK5in5dR95AKqouC
f+NOD6LC29OWX+IfSzGajtmAlRra0yfn7C2x99TktL0+f+GpNHgdaY73SrYeqTaV
rV8YF05pnAkHBI7wlXG3b5lwt9Zwhuiy7JLmaSZU1PrZM05/MQBXdiI7ShJafLvm
GT8H6RgnnVmudRZYsVKK38mBU+GGiQ2J6VqUXBkCXbrxIB1Z0unNb6puw+nb6xNm
1jDM8DTzJZDD2H+sruZdI/R4wAcviVG79j/Kr6q5uraLkpylXo8w08w4MWKDeAL7
AX8Nv5OrdS9D9Ol9O6I1Tk3UGODQtkso5lo/M1LBT3KX6zCj7b1IZUw51sMLFmfY
gOl4oFXG0Sn4+iVWNFE69li8Bx05EI7H/YK3B4hJyftsKsV3upMHIoruN1fHUVO4
kBhX5A676X1EIIWp2WDvix0Tl7F8KM05abD280+bGdDH3GRqKSaew5fpJmhZ7Qc3
Nxad8vMZoNPXaODf/jGIpZ1v4wcbKwwicjD4xZJeB8MQpCcAWkxTm3izoY2ZpzNm
6aO62BltRu2CNYcxYEhW
=crfn
-----END PGP SIGNATURE-----
------------------------------
Message: 2
Date: Tue, 15 Dec 2015 09:15:19 +0000
From: emacstheviking <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] explaining effects
Message-ID:
<caeieuujk6gkush0_b2-bonb6q9zazzkxt1tfn_c9uo+ywkb...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
good answer! Having worked on a lot of embedded microprocessor systems
over the years... that's exactly the kind of thing you don't want and
sometimes all too easy to do by mistake when writing C or assembler!
Good answer!
:)
On 15 December 2015 at 08:55, Alexander Berntsen <[email protected]>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA512
>
> On 12/12/15 14:38, Daniel Bergey wrote:
> > Why do you prefer "effect" to "side effect"?
> FWIW, I say "effect" rather than "side effect" when talking about
> Haskell, because in Haskell effects happen when you want them, not as
> an unforeseen side-effect as a result of the complexity inherent to
> the source code.
>
> It is often said that having an effect is "difficult" in Haskell. But
> really, it's just that if you are launching missiles in Haskell, *you
> actually mean to*. It didn't happen because you wanted to increment i
> and then "oops, stuff happened".
>
> - --
> Alexander
> [email protected]
> https://secure.plaimi.net/~alexander
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
>
> iQIcBAEBCgAGBQJWb9WQAAoJENQqWdRUGk8BinMQAIzlf+zL00pjSfu/nkx8W59D
> IeGbGCWV8zG74963SmCJP70UzamysWs20my+XL7B8UnzbPY/1mKTDK56P/rI+Vbn
> +YUzWqNWDEuu8g37ATNrOyy99TyX+murkO10KnrYl9aVsOu4IK5in5dR95AKqouC
> f+NOD6LC29OWX+IfSzGajtmAlRra0yfn7C2x99TktL0+f+GpNHgdaY73SrYeqTaV
> rV8YF05pnAkHBI7wlXG3b5lwt9Zwhuiy7JLmaSZU1PrZM05/MQBXdiI7ShJafLvm
> GT8H6RgnnVmudRZYsVKK38mBU+GGiQ2J6VqUXBkCXbrxIB1Z0unNb6puw+nb6xNm
> 1jDM8DTzJZDD2H+sruZdI/R4wAcviVG79j/Kr6q5uraLkpylXo8w08w4MWKDeAL7
> AX8Nv5OrdS9D9Ol9O6I1Tk3UGODQtkso5lo/M1LBT3KX6zCj7b1IZUw51sMLFmfY
> gOl4oFXG0Sn4+iVWNFE69li8Bx05EI7H/YK3B4hJyftsKsV3upMHIoruN1fHUVO4
> kBhX5A676X1EIIWp2WDvix0Tl7F8KM05abD280+bGdDH3GRqKSaew5fpJmhZ7Qc3
> Nxad8vMZoNPXaODf/jGIpZ1v4wcbKwwicjD4xZJeB8MQpCcAWkxTm3izoY2ZpzNm
> 6aO62BltRu2CNYcxYEhW
> =crfn
> -----END PGP SIGNATURE-----
> _______________________________________________
> 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/20151215/e7d22eea/attachment-0001.html>
------------------------------
Message: 3
Date: Tue, 15 Dec 2015 09:44:14 +0000 (UTC)
From: mike h <[email protected]>
To: The Haskell-Beginners Mailing List - Discussion of primarily
beginner-level topics related to Haskell <[email protected]>
Subject: Re: [Haskell-beginners] explaining effects
Message-ID:
<[email protected]>
Content-Type: text/plain; charset="utf-8"
A good and witty answer :)
On Tuesday, 15 December 2015, 9:16, emacstheviking <[email protected]>
wrote:
good answer! ? Having worked on a lot of embedded microprocessor systems over
the years... that's exactly the kind of thing you don't want and sometimes all
too easy to do by mistake when writing C or assembler!
Good answer!
:)
On 15 December 2015 at 08:55, Alexander Berntsen <[email protected]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 12/12/15 14:38, Daniel Bergey wrote:
> Why do you prefer "effect" to "side effect"?
FWIW, I say "effect" rather than "side effect" when talking about
Haskell, because in Haskell effects happen when you want them, not as
an unforeseen side-effect as a result of the complexity inherent to
the source code.
It is often said that having an effect is "difficult" in Haskell. But
really, it's just that if you are launching missiles in Haskell, *you
actually mean to*. It didn't happen because you wanted to increment i
and then "oops, stuff happened".
- --
Alexander
[email protected]
https://secure.plaimi.net/~alexander
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJWb9WQAAoJENQqWdRUGk8BinMQAIzlf+zL00pjSfu/nkx8W59D
IeGbGCWV8zG74963SmCJP70UzamysWs20my+XL7B8UnzbPY/1mKTDK56P/rI+Vbn
+YUzWqNWDEuu8g37ATNrOyy99TyX+murkO10KnrYl9aVsOu4IK5in5dR95AKqouC
f+NOD6LC29OWX+IfSzGajtmAlRra0yfn7C2x99TktL0+f+GpNHgdaY73SrYeqTaV
rV8YF05pnAkHBI7wlXG3b5lwt9Zwhuiy7JLmaSZU1PrZM05/MQBXdiI7ShJafLvm
GT8H6RgnnVmudRZYsVKK38mBU+GGiQ2J6VqUXBkCXbrxIB1Z0unNb6puw+nb6xNm
1jDM8DTzJZDD2H+sruZdI/R4wAcviVG79j/Kr6q5uraLkpylXo8w08w4MWKDeAL7
AX8Nv5OrdS9D9Ol9O6I1Tk3UGODQtkso5lo/M1LBT3KX6zCj7b1IZUw51sMLFmfY
gOl4oFXG0Sn4+iVWNFE69li8Bx05EI7H/YK3B4hJyftsKsV3upMHIoruN1fHUVO4
kBhX5A676X1EIIWp2WDvix0Tl7F8KM05abD280+bGdDH3GRqKSaew5fpJmhZ7Qc3
Nxad8vMZoNPXaODf/jGIpZ1v4wcbKwwicjD4xZJeB8MQpCcAWkxTm3izoY2ZpzNm
6aO62BltRu2CNYcxYEhW
=crfn
-----END PGP SIGNATURE-----
_______________________________________________
Beginners mailing list
[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
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151215/4be901cf/attachment-0001.html>
------------------------------
Message: 4
Date: Tue, 15 Dec 2015 17:36:58 +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] Extend instance for List
Message-ID:
<CAPY+ZdTjvwZNt7=5RcAjyiLtmsgu8auoayWp9d=70yfaoav...@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
On Tue, Dec 15, 2015 at 12:43 AM, Graham Gill <[email protected]>
wrote:
I guessed that the correct Extend instance for List is needed for Comonad,
> but didn't have any intuition about it.
>
List is not comonadic. In this case, the function copure must be of type
[a] -> a, which must necessarily be partial.
(Non-empty lists, on the other hand, are comonadic.)
Graham's "Extend" -- I'll explain the scare quotes in a minute -- instance
for List obeys the associative law. So it's a valid instance but a bit
boring. The exercise asks for an interesting instance.
The way the NICTA course is structured, there's no mention of the
> dependence between "extend" and "copure" (equivalent to extract and
> duplicate I suppose) via the Comonad laws when considering Extend first by
> itself.
>
It's a bit terse, but you can find "class Extend f => Comonad f" in
Comonad.hs. After all, we're only looking at the exercises. The live
lecture version probably does talk about the dependence.
> I'm not knocking the NICTA course. I've found it useful. A quick paragraph
> or two as you've written, stuck into the source files as comments, would
> improve it.
>
Most folks are neutral about the course. If parts of it work for you,
great. If not, no worries. The whole comonadic business is a bit obscure
and some of the strongest haskell programmers don't bat an eyelid over not
knowing it.
p.s. "Extend" doesn't agree with the CT literature. See the paragraph that
starts "The dual problem is the problem of lifting a morphism" here:
http://ncatlab.org/nlab/show/extension
But calling it a "lift" or "lifting" will only add to the confusion since
monad transformers got first dibs on the terminology. Which is why you
sometimes see "coextend" or (for the flipped version) "cobind".
-- Kim-Ee
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://mail.haskell.org/pipermail/beginners/attachments/20151215/752d4736/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 29
*****************************************