Cardano Plutus Pioneer Program: Lecture 4 Part 1 Overview | Maybe, Either, and Writer w/ Monads

This is an overview of lecture 4 in the Plutus Pioneer Program: https://www.youtube.com/watch?v=6Reuh0xZDjY

Lecture 4 covered a large amount of new ideas. So much that we will unpack it in 2 parts. In part 1, we will look at the first 1.5 hours of the lecture where we will walkthrough the code examples.

Specifically we will be looking at the Maybe and Either type. Then we will look at implementing a new Writer type.

Finally we will look at Monad’s and see how the above types can be defined as Monads.

One particular topic that was convered was the bind function of a Monad. I wish I clarified in the video, but what bind does is it:

“…takes a monadic value and a function that can transform the value, and returns a new monadic value.”

I only cover the topics in context of the code that was went thorugh the lecture and don’t do the topic justice. Please refer to these other helpful resources to understand Monads:
https://stackoverflow.com/questions/2704652/monad-in-plain-english-for-the-oop-programmer-with-no-fp-background
https://www.youtube.com/watch?v=IBB7JpbClo8

Resources:
Plutus Pioneer Github Repo: https://github.com/input-output-hk/plutus-pioneer-program

00:00 – Intro
00:39 – Side Effects
02:31 – IO
03:30 – Underlying IO implementation
04:43 – Maybe
08:46 – Maybe simplified code
17:14 – Either
21:48 – Either simplified code
26:08 – Custom Writer class
30:42 – Writer simplified code
39:29 – Monad definition
41:13 – Monad bind function
42:13 – Monad Benefits
44:56 – Creating a generic monad helper function
49:11 – Conclusion

(Visited 47 times, 1 visits today)

You might be interested in

LEAVE YOUR COMMENT

Your email address will not be published. Required fields are marked *

eos
EOS (EOS) 0,888834 3,17%
aave
Aave (AAVE) 59,80 3,63%
the-graph
The Graph (GRT) 0,060642 4,38%
kusama
Kusama (KSM) 25,31 4,67%
waves
Waves (WAVES) 2,26 0,10%
dash
Dash (DASH) 41,02 9,29%
bitcoin
Bitcoin (BTC) 15.899,87 1,99%
ethereum
Ethereum (ETH) 1.165,93 3,30%
cardano
Cardano (ADA) 0,300594 2,42%
tether
Tether (USDT) 0,964550 0,00%
xrp
XRP (XRP) 0,378438 2,27%
solana
Solana (SOL) 13,23 2,91%
polkadot
Polkadot (DOT) 5,07 2,65%
usd-coin
USD Coin (USDC) 0,964615 0,03%
dogecoin
Dogecoin (DOGE) 0,099802 10,01%
uniswap
Uniswap (UNI) 5,25 3,77%
terra-luna
Terra Luna Classic (LUNC) 0,000156 2,76%
litecoin
Litecoin (LTC) 73,82 7,72%
chainlink
Chainlink (LINK) 7,21 11,61%
bitcoin-cash
Bitcoin Cash (BCH) 108,03 3,89%
algorand
Algorand (ALGO) 0,232845 4,15%
matic-network
Polygon (MATIC) 0,811506 3,02%
stellar
Stellar (XLM) 0,085711 1,65%
cosmos
Cosmos Hub (ATOM) 9,80 4,71%
filecoin
Filecoin (FIL) 4,22 4,38%
tron
TRON (TRX) 0,051855 1,99%
ethereum-classic
Ethereum Classic (ETC) 19,03 4,90%
dai
Dai (DAI) 0,964544 0,36%
tezos
Tezos (XTZ) 0,958569 2,95%
monero
Monero (XMR) 133,83 3,34%