SlideShare ist ein Scribd-Unternehmen logo
1 von 36
1.
2.
3.
4.
5.
6.
7.
8.
https://github.com/vpavkin/
recursive-implicit-proofs-talk
Ordering[A]
implicit val intOrdering = new
Ordering[Int] {…}
def sortBy[B](f: A => B) (implicit ord:
Ordering[B])
//or
def sortBy[B: Ordering](f: A => B)
implicit val intOrdering = …
implicit def optOrdering[T:Ordering] =
new Ordering[Option[T]] { … }
// Ok
implicitly[Ordering[Option[Int]]]
// Can’t prove
implicitly[Ordering[Option[String]]]
// type A = Int
implicit val intOrdering: Ordering[Int] = …
// type B = Option[A]
implicit def optOrdering[A]
(implicit ev: Ordering[A]): Ordering[Option[A]] = …
// type C = (A, B)
implicit def tuple2Ordering[A, B]
(implicit A: Ordering[A],
B: Ordering[B]): Ordering[(A, B)] = …
implicit def contravariantOrdering[A, B]
(implicit C: Converts[A, B],
O: Ordering[B]): Ordering[A] =
implicit def ordered[C <% Comparable[C]]: Ordering[C] = …
implicit def comparatorToOrdering[C]
(implicit cmp: Comparator[C]): Ordering[C] = …
A => C
+
B => C
Avoid ambiguous implicits!
You can’t ask for an absence of implicit
1 -> Container(Option(Container("a")))
(Int, Container[Option[Container[String]]])
String Container[String] Option[Container[String]]
Container[Option[Container[String]]] (Int, Container[Option[Container[String]]])
A A => B
Ord[T] => Ord[Container[T]]
A => B
Ord[T] => Ord[Option[T]]
A => B
Ord[T] => Ord[Container[T]]
A & B => C
Ord[A] & Ord[B] => Ord[(A,B)]
Int
A
Scala List shapeless.HList
Root type List HList
Cons
case class ::[A](
head: A,
tail: List[A])
case class ::[H, T <: HList](
head: H,
tail: T)
Nil Nil (singleton) HNil (singleton)
Type of
1 :: Nil
::[Int] Int :: HNil
Type of
1 :: “a” :: Nil
::[Any] Int :: String :: HNil
Type of
1 :: “a” :: true ::
Nil
::[Any] Int :: String :: Boolean :: HNil
•
•
•
•
•
final class HListOps[L <: HList](l : L) {
def at[N <: Nat](implicit at: At[L, N]): at.Out = at(l)
}
•
•
•
•
•
case class Person(name: String, age:Int)  String :: Int :: HNil
(Int, Boolean)  Int :: Boolean :: HNil
•
•
2nd most important property (along with keeping precise types):
OddProduct[Int :: String :: Boolean :: Int :: Int :: HNil]
Int :: HNil Boolean :: Int :: Int :: HNil
Int :: String:: Boolean :: Int :: Int :: HNil
A => B
Odd[T <: HList] => Odd[H1 :: H2 :: T]
A => B
Odd[T <: HList] => Odd[H1 :: H2 :: T]
A
Odd[T :: HNil]
Recursive step – resolving to the same implicit def
Generic.Aux[T, Repr] – Isomorphism, that
allows us to get Repr from T and vice versa.
Repr – some generic representation of T
Property[Repr] – our Property is proved for
type Repr.
We can (almost always) derive the
Property[T] by converting to/from Repr
and using Property[Repr]
Hint:
Repr here is going to be
an HList
Looks similar to
A & B => C.
Let’s encode the proof!
Person(name: String, age: Int)
Int :: HNil
A & B => C
Show[A] & Show[B] => Show[A :: B]
Int
A
Show[Int]
HNil
A
Show[HNil]
String
A
Show[String]
String :: Int :: HNil
A & B => C
Show[A] & Show[B] => Show[A :: B]
Generic.Aux[Person, String :: Int :: HNil]
A (macro)
Generic[T]
Person
A & B => C
Show[R] & Generic.Aux[T,R] => Show[T]
1.
2.
3.
4.
5.
1.
2.
3.
4.
5.
6.
Recursive implicit proofs with Shapeless HLists

Weitere ähnliche Inhalte

Was ist angesagt?

Делаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе ShapelessДелаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе Shapeless
Вадим Челышов
 

Was ist angesagt? (20)

Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020Monoids, Monoids, Monoids - ScalaLove 2020
Monoids, Monoids, Monoids - ScalaLove 2020
 
devLink - What's New in C# 4?
devLink - What's New in C# 4?devLink - What's New in C# 4?
devLink - What's New in C# 4?
 
Descriptors
DescriptorsDescriptors
Descriptors
 
Principled Error Handling with FP
Principled Error Handling with FPPrincipled Error Handling with FP
Principled Error Handling with FP
 
Core csharp and net quick reference
Core csharp and net quick referenceCore csharp and net quick reference
Core csharp and net quick reference
 
Testing in the World of Functional Programming
Testing in the World of Functional ProgrammingTesting in the World of Functional Programming
Testing in the World of Functional Programming
 
Generics and Inference
Generics and InferenceGenerics and Inference
Generics and Inference
 
F# intro
F# introF# intro
F# intro
 
One Monad to Rule Them All
One Monad to Rule Them AllOne Monad to Rule Them All
One Monad to Rule Them All
 
Fp in scala part 1
Fp in scala part 1Fp in scala part 1
Fp in scala part 1
 
Abstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded TypesAbstracting over Execution with Higher Kinded Types
Abstracting over Execution with Higher Kinded Types
 
Monoids, monoids, monoids
Monoids, monoids, monoidsMonoids, monoids, monoids
Monoids, monoids, monoids
 
Fp in scala with adts part 2
Fp in scala with adts part 2Fp in scala with adts part 2
Fp in scala with adts part 2
 
The Swift Compiler and Standard Library
The Swift Compiler and Standard LibraryThe Swift Compiler and Standard Library
The Swift Compiler and Standard Library
 
Python легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачиPython легко и просто. Красиво решаем повседневные задачи
Python легко и просто. Красиво решаем повседневные задачи
 
FParsec Hands On - F#unctional Londoners 2014
FParsec Hands On -  F#unctional Londoners 2014FParsec Hands On -  F#unctional Londoners 2014
FParsec Hands On - F#unctional Londoners 2014
 
Python-02| Input, Output & Import
Python-02| Input, Output & ImportPython-02| Input, Output & Import
Python-02| Input, Output & Import
 
Intro python-object-protocol
Intro python-object-protocolIntro python-object-protocol
Intro python-object-protocol
 
Делаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе ShapelessДелаем пользовательское Api на базе Shapeless
Делаем пользовательское Api на базе Shapeless
 
Functor, Apply, Applicative And Monad
Functor, Apply, Applicative And MonadFunctor, Apply, Applicative And Monad
Functor, Apply, Applicative And Monad
 

Andere mochten auch

Ways To Give- Delaware & Lehigh- Delaware & Lehigh
Ways To Give- Delaware & Lehigh- Delaware & LehighWays To Give- Delaware & Lehigh- Delaware & Lehigh
Ways To Give- Delaware & Lehigh- Delaware & Lehigh
Cathy Canevari
 
Hotel el tollo
Hotel el tolloHotel el tollo
Hotel el tollo
HotelTollo
 
Bowser jr. presentation
Bowser jr. presentationBowser jr. presentation
Bowser jr. presentation
pikaori
 
High Wizardry in the Land of Scala
High Wizardry in the Land of ScalaHigh Wizardry in the Land of Scala
High Wizardry in the Land of Scala
djspiewak
 

Andere mochten auch (20)

Beyond Scala Lens
Beyond Scala LensBeyond Scala Lens
Beyond Scala Lens
 
Scala lens: An introduction
Scala lens: An introductionScala lens: An introduction
Scala lens: An introduction
 
Ways To Give- Delaware & Lehigh- Delaware & Lehigh
Ways To Give- Delaware & Lehigh- Delaware & LehighWays To Give- Delaware & Lehigh- Delaware & Lehigh
Ways To Give- Delaware & Lehigh- Delaware & Lehigh
 
Castelul Bran
Castelul BranCastelul Bran
Castelul Bran
 
Echipele de proiect şi temele acestora
Echipele de proiect şi temele acestoraEchipele de proiect şi temele acestora
Echipele de proiect şi temele acestora
 
Golden eye gifts
Golden eye giftsGolden eye gifts
Golden eye gifts
 
Hotel el tollo
Hotel el tolloHotel el tollo
Hotel el tollo
 
Bowser jr. presentation
Bowser jr. presentationBowser jr. presentation
Bowser jr. presentation
 
Practically Functional
Practically FunctionalPractically Functional
Practically Functional
 
Catálogo 4-2016 de Oriflame España
Catálogo 4-2016 de Oriflame EspañaCatálogo 4-2016 de Oriflame España
Catálogo 4-2016 de Oriflame España
 
Catálogo Oriflame 14 / 2015
Catálogo  Oriflame 14 / 2015 Catálogo  Oriflame 14 / 2015
Catálogo Oriflame 14 / 2015
 
Demystifying Shapeless
Demystifying Shapeless Demystifying Shapeless
Demystifying Shapeless
 
Catálogo 17 Oriflame España
Catálogo 17 Oriflame EspañaCatálogo 17 Oriflame España
Catálogo 17 Oriflame España
 
Catálogo 14 Oriflame - Más en rincondeika.es
Catálogo 14 Oriflame - Más en rincondeika.esCatálogo 14 Oriflame - Más en rincondeika.es
Catálogo 14 Oriflame - Más en rincondeika.es
 
Естетотерапія
ЕстетотерапіяЕстетотерапія
Естетотерапія
 
"How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics."How about no grep and zabbix?". ELK based alerts and metrics.
"How about no grep and zabbix?". ELK based alerts and metrics.
 
High Wizardry in the Land of Scala
High Wizardry in the Land of ScalaHigh Wizardry in the Land of Scala
High Wizardry in the Land of Scala
 
Megan Crewe-mai las-o moale cu fantomele
Megan Crewe-mai las-o moale cu fantomeleMegan Crewe-mai las-o moale cu fantomele
Megan Crewe-mai las-o moale cu fantomele
 
Julie garwood foc si gheata-buchannan renard7
Julie garwood foc si gheata-buchannan renard7Julie garwood foc si gheata-buchannan renard7
Julie garwood foc si gheata-buchannan renard7
 
Christina-Lauren-Expertul-seducator Vol 3
Christina-Lauren-Expertul-seducator Vol 3Christina-Lauren-Expertul-seducator Vol 3
Christina-Lauren-Expertul-seducator Vol 3
 

Ähnlich wie Recursive implicit proofs with Shapeless HLists

JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
PROIDEA
 
Types by Adform Research
Types by Adform ResearchTypes by Adform Research
Types by Adform Research
Vasil Remeniuk
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
Vasil Remeniuk
 

Ähnlich wie Recursive implicit proofs with Shapeless HLists (8)

JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
 
Scala implicits
Scala implicitsScala implicits
Scala implicits
 
ECMA 入门
ECMA 入门ECMA 入门
ECMA 入门
 
Tip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python TypingTip Top Typing - A Look at Python Typing
Tip Top Typing - A Look at Python Typing
 
Monads and friends demystified
Monads and friends demystifiedMonads and friends demystified
Monads and friends demystified
 
Types by Adform Research
Types by Adform ResearchTypes by Adform Research
Types by Adform Research
 
Type classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritanceType classes 101 - classification beyond inheritance
Type classes 101 - classification beyond inheritance
 
Algebraic Data Types and Origami Patterns
Algebraic Data Types and Origami PatternsAlgebraic Data Types and Origami Patterns
Algebraic Data Types and Origami Patterns
 

Kürzlich hochgeladen

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Kürzlich hochgeladen (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...How to Choose the Right Laravel Development Partner in New York City_compress...
How to Choose the Right Laravel Development Partner in New York City_compress...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 

Recursive implicit proofs with Shapeless HLists

  • 1.
  • 4.
  • 5.
  • 6.
  • 7. Ordering[A] implicit val intOrdering = new Ordering[Int] {…}
  • 8. def sortBy[B](f: A => B) (implicit ord: Ordering[B]) //or def sortBy[B: Ordering](f: A => B) implicit val intOrdering = … implicit def optOrdering[T:Ordering] = new Ordering[Option[T]] { … } // Ok implicitly[Ordering[Option[Int]]] // Can’t prove implicitly[Ordering[Option[String]]]
  • 9.
  • 10.
  • 11. // type A = Int implicit val intOrdering: Ordering[Int] = …
  • 12. // type B = Option[A] implicit def optOrdering[A] (implicit ev: Ordering[A]): Ordering[Option[A]] = …
  • 13. // type C = (A, B) implicit def tuple2Ordering[A, B] (implicit A: Ordering[A], B: Ordering[B]): Ordering[(A, B)] = … implicit def contravariantOrdering[A, B] (implicit C: Converts[A, B], O: Ordering[B]): Ordering[A] =
  • 14. implicit def ordered[C <% Comparable[C]]: Ordering[C] = … implicit def comparatorToOrdering[C] (implicit cmp: Comparator[C]): Ordering[C] = … A => C + B => C Avoid ambiguous implicits!
  • 15. You can’t ask for an absence of implicit
  • 16. 1 -> Container(Option(Container("a"))) (Int, Container[Option[Container[String]]]) String Container[String] Option[Container[String]] Container[Option[Container[String]]] (Int, Container[Option[Container[String]]]) A A => B Ord[T] => Ord[Container[T]] A => B Ord[T] => Ord[Option[T]] A => B Ord[T] => Ord[Container[T]] A & B => C Ord[A] & Ord[B] => Ord[(A,B)] Int A
  • 17.
  • 18. Scala List shapeless.HList Root type List HList Cons case class ::[A]( head: A, tail: List[A]) case class ::[H, T <: HList]( head: H, tail: T) Nil Nil (singleton) HNil (singleton) Type of 1 :: Nil ::[Int] Int :: HNil Type of 1 :: “a” :: Nil ::[Any] Int :: String :: HNil Type of 1 :: “a” :: true :: Nil ::[Any] Int :: String :: Boolean :: HNil
  • 20. final class HListOps[L <: HList](l : L) { def at[N <: Nat](implicit at: At[L, N]): at.Out = at(l) } • • • • •
  • 21. case class Person(name: String, age:Int)  String :: Int :: HNil (Int, Boolean)  Int :: Boolean :: HNil • • 2nd most important property (along with keeping precise types):
  • 22.
  • 23.
  • 24.
  • 25. OddProduct[Int :: String :: Boolean :: Int :: Int :: HNil] Int :: HNil Boolean :: Int :: Int :: HNil Int :: String:: Boolean :: Int :: Int :: HNil A => B Odd[T <: HList] => Odd[H1 :: H2 :: T] A => B Odd[T <: HList] => Odd[H1 :: H2 :: T] A Odd[T :: HNil] Recursive step – resolving to the same implicit def
  • 26.
  • 27.
  • 28. Generic.Aux[T, Repr] – Isomorphism, that allows us to get Repr from T and vice versa. Repr – some generic representation of T Property[Repr] – our Property is proved for type Repr. We can (almost always) derive the Property[T] by converting to/from Repr and using Property[Repr] Hint: Repr here is going to be an HList Looks similar to A & B => C. Let’s encode the proof!
  • 29.
  • 30. Person(name: String, age: Int) Int :: HNil A & B => C Show[A] & Show[B] => Show[A :: B] Int A Show[Int] HNil A Show[HNil] String A Show[String] String :: Int :: HNil A & B => C Show[A] & Show[B] => Show[A :: B] Generic.Aux[Person, String :: Int :: HNil] A (macro) Generic[T] Person A & B => C Show[R] & Generic.Aux[T,R] => Show[T]
  • 31.
  • 33.
  • 34.

Hinweis der Redaktion

  1. Excited to see so many smart people here We’re going to play with the dark side of Scala that opens lots of opportunities and powerful tecniques. There will always be debates, whether it’s applicable to real-life programming or not, but I’ve already seen it being applied with big success and I believe that haters are just afraid to admit they can’t or don’t want to deeper understand the type system
  2. Nothing new from the technical side – just another point of view which shows real beauty of implicits. Also this section prepares the “proof”-oriented mind set, that will help with the rest of the talk
  3. Theorem here is very very complex – it’s the set of all requirements to our system So in reality we decompose it in a set of smaller pieces and constructing proofs for each piece.
  4. Compile time and runtime proofs. Runtime is a difference – when: compile-time proof is impossible (external inputs) or impractical (typesystem weakness)
  5. All of these are just simple introductory thoughts to seed the idea. We will formalize this system a little later and see how exactly you build mathematical proof primitives with implicits
  6. Don’t forget to show the implicit resolution with Shift+Cmd+P Say that recursion is important feature, that is required for HList based proofs
  7. Will go through basic building blocks, the primitives of proof construction. We’ll also see some differences that arise in the process of comparison
  8. Basic axiom that doesn’t require any other conditions
  9. By chaining several of such blocks we can build proofs of arbitrary length
  10. This one is not restricted to 2 elements – we can require as many conditions as we want to produce a new property
  11. This one is not used often: Only one single proof can be available for any call – having 2 or more is not allowed. This means you must be sure, that if you have several proof rules for the same type, maximum 1 is active in every particular context.
  12. Talk about the reverse order that compiler takes to find the proof
  13. Some of you are familiar with basics of HLists, but to be consistent and sure that everyone is able to understand the following material, I’ll give a short review.
  14. HList difference: Cons has 2 type parameters which allows to store precise type of the tail. In the end HList doesn’t lose any type information at all.
  15. Pure means it doesn’t carry any helpful methods along – only some fact about the type. You won’t see this kind of typeclasses very often, though they can be used. for example to build proofs for phantom types. Show implicit chain for 5 elements Show proof step by step
  16. Pure means it doesn’t carry any helpful methods along – only some fact about the type. You won’t see this kind of typeclasses very often, though they can be used. for example to build proofs for phantom types. Show implicit chain for 5 elements Show proof step by step
  17. Talk about the reverse order that compiler takes to find the proof Talk about similarity between recursive HList proofs and math induction
  18. Talk about the reverse order that compiler takes to find the proof
  19. Generic definition Generic.Aux definition Example without Aux
  20. Generic definition Generic.Aux definition Example without Aux
  21. Generic definition Generic.Aux definition Example without Aux