Skip to content
0:00 / 0:00

#scala3#opaquetypes#monoids

Ep 8: Compose Yourself with Scala 3's Opaque Types

Functional Justin

847 subscribers • 2 videos on Hallway

YouTube
  • Recommended by 1 person: 1 in engineering communities.
  • Presented by Justin Heyes-Jones

Intermediate. Assumes working knowledge.

834 views5 years ago1 recommendation

Programming languagesSoftware designScalaFunctional programming

Justin Heyes-Jones demonstrates how to build Monoid and Semigroup type classes in Scala 3 using opaque types.

In this video I build type classes for Monoids and Semigroups using Scala 3, then show how we can make simple instances like adding integers, how to make an instance for a "newtype" that multiplies integers (using Scala 3's new opaque types for that), and finally a more complex instance that composes two maps together. See also: There is no blog post with this video but I wrote a blog about Monoids a couple of years ago, describing how they were used to handle all the purchasing of items in a mobile video game... justinhj.github.io/2019/06/10/monoids-for-production.html See "the red book" but also Runar's post below: manning.com/books/functional-programming-in-scala apocalisp.wordpress.com/2010/06/14/on-monoids/ Scala stuff by me Video editing by Jamie Intro music "Functional Justin Intro 1" by me ©2020-20021 Justin Heyes-Jones All Rights Reserved

Why it's here

1 person recommends this

What people say. Recommended as a practical guide to implementing type classes and opaque types in Scala 3.

u/justinhjin r/scala • Recommends

New video: Compose yourself with Scala 3's opaque types In this video, how to do type class selection with opaque types, implementing Semigroups and Monoids from scratch. How to combine nested structures, it's monoids all the way down. Hope some people find this interesting :D [video