Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by ux266478

2 months ago

Both of these things respectively are just pattern matches and monads, just not user-definable ones.

1 comment

ux266478

Reply

xigoi  2 months ago

On the other hand, it’s more ergonomic and readable because you don’t need to declare a new name.

  if name != nil:
    echo name

versus

  case name
  of Some(unwrappedName):
    echo unwrappedName

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities