Monads

From bibbleWiki
Revision as of 01:45, 10 February 2025 by Iwiseman (talk | contribs) (Created page with "=Introduction= Heard about this with a friend and never really revisited it. With my attention at home on Rust, thought I might write something down =The Maybe Monad= Well possibly the Option monad for me. To make one of these you need <syntaxhighlight lang="hs"> return :: a => Maybe a >>= : Maybe a </syntaxhighlight> =What's the Point= *Same idea works for other effects *Supports pure programming with effects *Use of effects explicit in types *Functions that work for...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Introduction

Heard about this with a friend and never really revisited it. With my attention at home on Rust, thought I might write something down

The Maybe Monad

Well possibly the Option monad for me. To make one of these you need

return :: a => Maybe a
>>= : Maybe a


What's the Point

  • Same idea works for other effects
  • Supports pure programming with effects
  • Use of effects explicit in types
  • Functions that work for any effect