types working for you
play

Types Working For You Richard Dallaway, @d6y underscore.io Modern - PowerPoint PPT Presentation

Types Working For You Richard Dallaway, @d6y underscore.io Modern type system with lots of power Two Themes Straightforward Scala Types Working for Us Progression Part 1 Straightforward Scala Part 2 Functional Programming Part 3


  1. sealed trait Nat trait Succ[P <: Nat] extends Nat trait Zero extends Nat type One = Succ[Zero] type Two = Succ[One] implicitly[Succ[Zero] =:= One] implicitly[Succ[One] =:= Succ[Succ[Zero]]]

  2. sealed trait Nat trait Succ[P <: Nat] extends Nat trait Zero extends Nat type One = Succ[Zero] type Two = Succ[One] implicitly[Succ[Zero] =:= One] implicitly[Succ[One] =:= Succ[Succ[Zero]]]

  3. sealed trait Nat trait Succ[P <: Nat] extends Nat trait Zero extends Nat type One = Succ[Zero] type Two = Succ[One] implicitly[Succ[Zero] =:= Two] error: Cannot prove that Succ[Zero] =:= Two.

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend