20 - Monad-Based Programming [ID:10766]
50 von 513 angezeigt

So we've moved the previous week to Thursday as a great

show we let's this

at 16 and there is a room which is

this one you know what I think it's it must be good one

okay so let's go on I've introduced this I O monad last time and gave a small

example and so the intuition about this I O monad is somewhat similar to the

intuition about the state on it because you can imagine that this I O monad has

some underlying state which is the state of the world where word includes

everything behind the Haskell program and more concretely we can internalize

this concept inside Haskell so we can do monad based computation with respect to

some state where state is something defined internally so this produces

state monad which is defined like this TS is equal to S to which we run this

test right so so what this means is that a computation over a program or such

monad is the monad with a state and in particular so what would be the way to

understand it all right so first I need to say where this monad is defined

because we have the different categories and different categories support

different monads so for example to define monoid this monoid or module

monad we just need a monad with products and here this not sufficient because we

need to make you somehow interpret the thing so a different way to write this

down is also like this which is which may look more suitable because this

distinguish this a bit from this sort of notation and avoids the confusion

with morphisms and exponentials because this is an object of a category while

we use this notation also to didn't to refer to morphisms and morphisms objects

are different things so to interpret this thing we really need to have objects

like this so we need a notion an internal notion of a function space so I

use this notation this and this interchangeably and I assume that it's

understood that there is a different this difference and we we distinguish

these things things properly but right having this in mind state monads can be

interpreted only over a categories which support exponentiation so it means we

can have an internal notion of functor space and this is the case with set for

example because the set of functions is a set again so it's an object and it's a

case of CPUs CPUs because the set of continuous function between two CPUs

again a CPU so it's also an object so this works in sets CPUs and

so more generally in so-called Cartesian closed categories so we've seen

Cartesian categories these are with products and Cartesian closed as the one

with products and this exponentiation I don't explain formally what this means I

just give them the intuitive idea that these are precisely the one where we can

sensibly interpret this exponents I don't know if we maybe introduce it later

if we have time and I see this is relevant for something else but

presently you can just imagine that we do the state monad over sets and this is

what I propose you to do in the exercise this so this first exercise is largely

about the state monad and it's proposed to do it over sets only but this would

likely work with other categories too okay and then here I need to say how my

monad structure is defined so I need to say what eta is for example eta x as

something going from s to no something going from x to x times s s so here

that's that's now this arrow means the the more the morphism arrow right because

each is a is a natural transformation which a instantiate takes so this must be

a morphism in this sense this arrow is not the same as this arrow so we often

use them interchangeably because everyone understands the subtlety behind and I

here emphasize display by using this notation so to distinguish but it just

Teil einer Videoserie :

Zugänglich über

Offener Zugang

Dauer

01:26:23 Min

Aufnahmedatum

2015-06-30

Hochgeladen am

2019-04-25 16:19:02

Sprache

en-US

The course provides a background to various topics of the theory of programming. As a guiding paradigm monad-based functional programming is chosen. The idea of the course is to provide clear computational insights to various concepts of computer science and to practice these by concrete implementations in suitable programming languages such as Haskell.

Lernziele und Kompetenzen:

 

Fachkompetenz Wissen Students demonstrate an understanding of the role of computational monads in the context of functional programming and as a semantic tool for programming and system specification; Students reproduce the main definitions and results on monads, monad combination, and further categorical constructions end explain them from a programming perspective. Anwenden Students use the monad-based approach to formalise examples involving various kinds of computational effects as monads. Students use monads for practical programming in programming languages, such as Haskell. Analysieren Students identify various computational effects as monads and provide an appropriate treatment of problems from various semantic domains (probabilistic, nondeterministic, concurrent), possibly providing a monad-based software implementation. Selbstkompetenz Students will be regularly provided with small challenges in form of exercises to be able to have a gradual progress with the lecture material.    

Tags

functional monads programming haskell equational reasoning
Einbetten
Wordpress FAU Plugin
iFrame
Teilen