5 - Monad-Based Programming [ID:10751]
50 von 495 angezeigt

So let us start.

First thing before I forget, there are the exercises I mentioned last time and have published

the first exercise sheet.

It's on the web page.

Hopefully everyone has found it.

And you're supposed to work in triples, so group together.

What else?

Is there any questions about it?

I don't know if you just maybe have taken a look at it, if it looks clear, doable.

So there's the AHAskel exercise, which is the very last one, which indicates that eventually

we are going to prepare some ground for Haskell programming.

And since the deadline is the next week already, so this should happen in between.

And I hope that we can do it on next, so basically tomorrow.

So if you come with your laptops, this will be welcome, because we are going to do some

examples.

All right.

So and back to the lecture.

So first, some errata to the previous lecture.

I made a mistake by claiming that the rules for ifs are different for call by value and

call by name.

That was actually not true.

Sorry for that.

I've checked this.

Apparently there is some sort of laziness in the if construction, which is present both

in call by name and call by value.

And in call by name and call by value, we still have this effect that we evaluate the

condition to true.

I mean, if we evaluate the condition to true, then we do not care about the other program.

So we just evaluate p.

So this is more or less a minor thing, but there is a more serious thing where else we

have to have mistaken this time.

And well, first I recall the notion of a value as.

So it's one of the following options.

First option, it's this unique element of the union, of the terminal type.

I don't remember how I called it.

So it's this type which contains one element only.

So then there are numbers and there are booleans.

So this is a place where we get recursive because we'll say that values, a pair of values

where values are recursively defined.

And that I've probably forgotten this time.

So a lambda abstraction is also a value, which for the reason we discussed before that it's

so reusable and for technical reason it's very convenient in defining semantics.

And then, so this evaluation relation is defined in such a way that p is a arbitrary program

and c is a value in the sense of the above definition.

And I gave the rules for products which were something like this.

So if t reduces to c1, c2, then pr1 of t reduces to c1.

And under the same assumptions, assumption, pr2 reduces to c2.

So this is in call by value, call by value.

So I showed this rules last time they were correct.

But the situation was called by name is considerably more different because in call by name were

Teil einer Videoserie :

Zugänglich über

Offener Zugang

Dauer

01:27:24 Min

Aufnahmedatum

2015-04-28

Hochgeladen am

2019-04-24 13:39:03

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