Type Driven Development @ BoosterConf 2013
16
Type driven development Maciek Próchniak
-
Upload
maciek-prochniak -
Category
Software
-
view
58 -
download
0
description
Type Driven Development @ BoosterConf 2013
Transcript of Type Driven Development @ BoosterConf 2013
![Page 1: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/1.jpg)
Type driven development
Maciek Próchniak
![Page 2: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/2.jpg)
How to prevent bugs?
● Tests● Defensive programming● Tests● Contracts● Tests
![Page 3: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/3.jpg)
Guerilla defensive programming
![Page 4: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/4.jpg)
Typesafe stronghold
... strings and nulls shall not overcome
![Page 5: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/5.jpg)
Value classes
![Page 6: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/6.jpg)
Option[A]
![Page 7: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/7.jpg)
Validation?... an applicative functor on a partially applied disjoint union type constructor with semigroup error elements so what's the big deal?!
- Tony Morris
![Page 8: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/8.jpg)
Validation[A]
![Page 9: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/9.jpg)
IO[A]
![Page 10: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/10.jpg)
Typesafe database
![Page 11: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/11.jpg)
Dependent types?
![Page 12: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/12.jpg)
Sized[Iterable[A],N]
![Page 13: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/13.jpg)
Ultimate challenge...
![Page 14: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/14.jpg)
Ultimate code...
![Page 15: Type Driven Development @ BoosterConf 2013](https://reader033.fdocuments.us/reader033/viewer/2022051817/547d9913b47959ca508b499d/html5/thumbnails/15.jpg)
Value classes
Option
Dependent types
IOMonad
Validation
Slick macros
Scala Scalaz
Slick Shapeless