Title: Programming with Monads
When: January 8th @ 6:00 pm in CSC 3-49 (1 floor above our usual floor)
When you write a program, you probably want it to do things like talking to the Internet, displaying images, or even just reading and writing files and accepting input. It's hard to imagine how any of these could be encoded into pure mathematical functions which simply take an input, produce an output, and have no other side effects. So if you're programming in a pure functional language like Haskell, how do you write programs that do interesting things?
Somewhat surprisingly, it turns out that all of these
things and more can be embedded inside a pure functional language using a
concept called a "monad". In this talk I will describe what monads are
and how they are used. We will see how different monads correspond to
different notions of computation, including but not limited to
input/output and side effects. We will focus on the idea that a monad is
just a software design pattern that can be used to structure code in an
easy-to-use way.
There are no prerequisites for this talk. Some
background in functional programming would be useful, but I'll explain
the basics as I go along. I will be using Haskell, but you won't need
any prior knowledge of it to understand the material. Monads have become
so popular, in fact, that a quick Google search will turn up
implementations in languages like C++, Java, and Javascript. We will
discuss how monads and similar ideas are powerful tools to think about
and write better code in any language.
Slides: https://docs.google.com/file/d/0B5iw-UVgBBQRbHBSaC1EUEhBbDQ/edit PDF
Slides: https://docs.google.com/file/d/0B5iw-UVgBBQRbHBSaC1EUEhBbDQ/edit PDF
No comments:
Post a Comment