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 72 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,786999 0,17%
aave
Aave (AAVE) 87,16 2,79%
the-graph
The Graph (GRT) 0,260985 6,72%
kusama
Kusama (KSM) 28,05 8,84%
waves
Waves (WAVES) 2,35 4,16%
dash
Dash (DASH) 28,91 1,90%
bitcoin
Bitcoin (BTC) 60.750,50 2,48%
ethereum
Ethereum (ETH) 2.978,98 1,41%
cardano
Cardano (ADA) 0,447859 5,32%
tether
Tether (USDT) 0,934342 0,00%
xrp
XRP (XRP) 0,499062 3,34%
solana
Solana (SOL) 143,06 3,41%
polkadot
Polkadot (DOT) 6,63 4,02%
usd-coin
USDC (USDC) 0,935284 0,10%
dogecoin
Dogecoin (DOGE) 0,144845 4,20%
uniswap
Uniswap (UNI) 7,33 2,64%
terra-luna
Terra Luna Classic (LUNC) 0,000101 4,50%
litecoin
Litecoin (LTC) 79,58 0,10%
chainlink
Chainlink (LINK) 13,94 1,95%
bitcoin-cash
Bitcoin Cash (BCH) 454,61 4,79%
algorand
Algorand (ALGO) 0,204598 13,67%
matic-network
Polygon (MATIC) 0,674581 2,01%
stellar
Stellar (XLM) 0,108933 0,06%
cosmos
Cosmos Hub (ATOM) 8,02 1,99%
filecoin
Filecoin (FIL) 5,79 4,85%
tron
TRON (TRX) 0,106351 0,66%
ethereum-classic
Ethereum Classic (ETC) 25,29 3,96%
dai
Dai (DAI) 0,934001 0,08%
tezos
Tezos (XTZ) 0,960512 3,10%
monero
Monero (XMR) 113,00 1,97%