Skip to content
0:00 / 0:00

#monads#capabilities#scala

HOPE 2021 - Representing Monads with Capabilities

ACM SIGPLAN

11K subscribers • 61 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.

Advanced. Deep dive for people who know the field.

1.5K views5 years ago1 recommendation

Programming languagesComputer scienceFunctional programmingComputation and complexityLanguage design and type systems

An academic presentation on representing monads using capabilities to simplify effect handling in programming languages.

icfp21.sigplan.org/details/hope-2021-papers/11/Representing-…

Why it's here

1 person recommends this

u/ais04in r/scala • Recommends

Representing Monads with Capabilities

u/Il_totorein r/scala • Mentions

Iron v1.2.0 is out | Happy new year This is a post introducing the new changes of Iron v1.2.0. # What is Iron ? Iron is a type constraints (or type refinement) library for Scala 3. It uses Dotty's inline and opaque types to evaluate constraints at compile-time. Here is a simple example: ```scala def log(x: Double > 0d): RefinedDouble = x.map(Math.log) log(-1d) //Compile-time error ``` # Features of 1.2.0 Release 1.2.0 brings two key features: an imperative-styled DSL and constraints relations/consequences. ## Imperative DSL Iron brings a new imperative-styled DSL directly inspired by Martin Odersky's Representing Monad with Capabilities (HOPE 2021). Here is the "imperative" for…

u/justinhjin r/scala • Mentions

On “I love Scala but I can't stand:”

I think this (parent) is the most interesting comment in the thread even though it is hidden for me by down votes. For-comprehension is a pain point for even seasoned Scala developers and many come from other languages where async await is used a lot and very successfully. There is some interesting work on this (that requires loom) link to this video https://github.com/lampepfl/monadic-reflection

u/Il_totorein r/scala • Mentions

On “I love Scala but I can't stand:”

In this minimal example, I'd say there pretty equivalent and both readables. The problem of for-comprehensions appears when composing different monads or when you start to mix monad-less/imperative code with your monadic one. Also I made the example a bit verbose to make it more easy to understand. It can be shrinked to: def foo(): FutureFoo = async { Foo(await(asyncA), await(asyncB)) } However, note that the example above doesn't "colorize" the function meaning you can use a function written with async/await capability in a for-comprehension or whatever you want instead. Here is a talk of Odesky about this topic.