Difference between revisions of "PFP Laboratory 10"
Jump to navigation
Jump to search
(Created page with "== Monads == * In your prefered programming language, implement data type <syntaxhighlight lang="Haskell">bubbleSort :: Array Int Int -> Array Int Int</syntaxhighlight> <syn...") |
|||
Line 1: | Line 1: | ||
== Monads == | == Monads == | ||
− | * In your prefered programming language, implement data type | + | * In your prefered programming language, implement data type representing <code>Maybe</code>. |
− | < | + | * Implement functions '''bind''' and '''return''' as it is defined for monads. |
− | + | * Using implemented opertions, implement functions '''apply''' and '''fmap''' as it is define for <code>Applicative</code> and <code>Functor</code>. | |
− | |||
− | |||
− | </ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | </ | ||
− | < |
Latest revision as of 07:55, 22 November 2022
Monads
- In your prefered programming language, implement data type representing
Maybe
. - Implement functions bind and return as it is defined for monads.
- Using implemented opertions, implement functions apply and fmap as it is define for
Applicative
andFunctor
.