20. HC20 ‐ Haskell Chapter 20 Practical Tasks: Monad - wimsio/universities GitHub Wiki
- HC20T1: Create a function
safeDivide
that performs safe division using the Maybe
monad.
- HC20T2: Implement a function
sequenceMaybe
that converts a list of Maybe
values into a Maybe
of list.
- HC20T3: Create a logging calculator using the
Writer
monad to keep track of all operations.
- HC20T4: Implement a function
countChars
that counts occurrences of a character in a string using the State
monad.
- HC20T5: Use the
Reader
monad to create a configuration-based system for greeting users.
- HC20T6: Implement a function
doubleMonad
that combines two monads: Maybe
and List
.
- HC20T7: Create a function
findFirst
that uses the Either
monad to handle errors when finding an element in a list.
- HC20T8: Build a parser that parses simple expressions using the
Parser
monad.
- HC20T9: Implement a function
replicateMonad
that replicates a value using the Identity
monad.
- HC20T10: Implement a nested monad transformer that combines
StateT
and MaybeT
.
- HC20T11: Write a function
randomWalk
using the State
monad that simulates a random walk on a 2D grid.
- HC20T12: Use the
IO
monad to read a file and display its contents line-by-line.
- HC20T13: Create a function
fibonacciMemo
using the State
monad to memoize Fibonacci calculations.
- HC20T14: Implement a monadic function
mapMFilter
that maps and filters elements using a monad.
- HC20T15: Write a function
treeSum
that computes the sum of elements in a binary tree using a custom monad.
- HC20T16: Define a function
retryIO
that retries an IO operation up to a specified number of attempts using the IO
monad.
- HC20T17: Implement a function
validatePassword
that performs multiple checks using the Either
monad to return validation errors.
- HC20T18: Create a
MaybeT
monad transformer to combine Maybe
and IO
for user input validation.
- HC20T19: Implement a
Writer
monad-based logging system that tracks function calls and their arguments.
- HC20T20: Write a function
batchProcessing
that chains multiple monadic actions together using >>=
(bind).
Finished. Congratulations! Get your progress token here