Re: [pl-seminar] Monad monologue on Monday


Date: Tue, 4 Jun 2019 00:52:11 +0000
From: JOHN CYPHERT <jcyphert@xxxxxxxx>
Subject: Re: [pl-seminar] Monad monologue on Monday

Hi Everyone,


There were requests to send out the code I used for examples today. Attached to this email are three haskell files.

  - The first shows the logging and maybe examples

  - The second shows how the list monad can be used for nondeterminism

  - The third one shows how monads can handle state


I have added comments, but I think the last two examples can be confusing at first glance. If you have any questions just let me know.


John


From: Pl-seminar <pl-seminar-bounces@xxxxxxxxxxx> on behalf of JOHN CYPHERT <pl-seminar-bounces@xxxxxxxxxxx>
Sent: Friday, May 31, 2019 4:19:31 PM
To: pl-seminar@xxxxxxxxxxx
Subject: [pl-seminar] Monad monologue on Monday
 

Hi, all,


I plan to continue to talk about monads on Monday Jun 3 in 3310 at noon.


Here's my plan for Monday

 - I want to talk more about the use of monads in programming. Last time I defined a monad as a functor, with 2 parametric polymorphic functions: return and join. This is a fine definition, but it is not the standard programming one. I will give 2 more definitions for a monad to give a connection to the standard programming way of defining monads. 

 - I will show that a do block in haskell is syntactic sugar for monadic operations.

 - I hinted that to truly be a monad, monadic laws need to be satisfied. I will give and try to motivate these monadic laws.

 - We'll then try and make things a little categorical by generalizing the design pattern monads solve in programming to the Kliesli category.

 - I would then like to briefly give the formal categorical definition of a monad.

 - I think there will be some time left. Rather than start a new thread about monads, I would like to use this time to give more practical programming examples, such as ways of handling non-determinism, state, IO, etc. with monads.


If anyone has any questions let me know.

John

Attachment: loggerAndMaybe
Description: loggerAndMaybe

Attachment: nondeterminism
Description: nondeterminism

Attachment: stateMonad
Description: stateMonad

[← Prev in Thread] Current Thread [Next in Thread→]