Your browser doesn't support the features required by impress.js, so you are presented with a simplified version of this presentation.

For the best experience please use the latest Chrome, Safari or Firefox browser.


Twitter: @possiblywrong

Bitbucket: dconlon

Let's see where types can take us...

> ./prog --name Robert Paulson --age 65

> ./prog --host -p 8080

import kadai.cmdopts._

object Example extends App {
  case class Name(fst: String, sur: String)

  object CFG extends CmdOpts(args) {
       // name has type Option[Name]
       lazy val name = opt("--name", (x: String, y:String) => Name(x, y))


implicit resolution

Compiler give me something that has this shape/type!

HList / Heterogeneous List

The progeny of TupleX and List[_].

hlister: FnHListerAux[F, H => R]

Takes a function and returns a new function that can be applied to an HList rather than an argument tuple.

trait Function1[-T1, +R] extends AnyRef

length: LengthAux[H, N]

Simply a witness for the length of the HList.

toHList: FromTraversable[H]

A function to convert a traversable into an HList.

toHList: Option[H]
(x:String, y:String) => Name(x,y)
Arg HList type, String :: String :: HNil

arity: ToInt[N]

A function that returns a single integer.


Use a spacebar or arrow keys to navigate