I fail to see how spray's directives correspond to continuation passing style (CPS).
More specifically, a continuation is (a -> r) -> r
(in Haskell), but I cannot find where is this type ((a -> r) -> r
) when using spray directives (which have the type of Route->Route
where type Route = RequestContext => Unit
).
Nor Route->Route
neither type Route = RequestContext => Unit
do resemble (a -> r) -> r
, so how do directives relate to CPS ?
Could someone show how spray's directive correspond to continuation passing style ?