Type Driven Development @ BoosterConf 2013

16
Type driven development Maciek Próchniak

description

Type Driven Development @ BoosterConf 2013

Transcript of Type Driven Development @ BoosterConf 2013

Page 1: Type Driven Development @ BoosterConf 2013

Type driven development

Maciek Próchniak

Page 2: Type Driven Development @ BoosterConf 2013

How to prevent bugs?

● Tests● Defensive programming● Tests● Contracts● Tests

Page 3: Type Driven Development @ BoosterConf 2013

Guerilla defensive programming

Page 4: Type Driven Development @ BoosterConf 2013

Typesafe stronghold

... strings and nulls shall not overcome

Page 5: Type Driven Development @ BoosterConf 2013

Value classes

Page 6: Type Driven Development @ BoosterConf 2013

Option[A]

Page 7: Type Driven Development @ BoosterConf 2013

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

Validation[A]

Page 9: Type Driven Development @ BoosterConf 2013

IO[A]

Page 10: Type Driven Development @ BoosterConf 2013

Typesafe database

Page 11: Type Driven Development @ BoosterConf 2013

Dependent types?

Page 12: Type Driven Development @ BoosterConf 2013

Sized[Iterable[A],N]

Page 13: Type Driven Development @ BoosterConf 2013

Ultimate challenge...

Page 14: Type Driven Development @ BoosterConf 2013

Ultimate code...

Page 15: Type Driven Development @ BoosterConf 2013

Value classes

Option

Dependent types

IOMonad

Validation

Slick macros

Scala Scalaz

Slick Shapeless

Page 16: Type Driven Development @ BoosterConf 2013

takk :)

http://[email protected]

http://github.com/mproch