3 ms·
> What are you talking about? Spray works hand-in-glove with the Scala type system; would, in fact, be impossible in a language without it. In the example you
by kasey_junk 12y ago
> What are you talking about? Spray works hand-in-glove with the Scala type system; would, in fact, be impossible in a language without it.
In the example you linked to:
https://github.com/spray/spray/blob/release/1.1/examples/spray-can/simple-http-server/src/main/scala/spray/examples/DemoService.scala#L19 https://github.com/spray/spray/blob/release/1.1/examples/spr...
The "main" function dispatch is not type safe (nor can it be given Spray's reliance on the current akka type model).
My experience is that anything that relies on akka ends up throwing out a huge majority of useful type safety because it is hard to minimize it. A bunch of the advantages you mention around AOP and not monkey patching are due to this.
- lmm 12y agoAh, my bad. https://github.com/spray/spray/tree/release/1.1/examples/spray-routing/on-spray-can/src/main/scala/spray/examples https://github.com/spray/spray/tree/release/1.1/examples/spr... (or even https://github.com/spray/spray/blob/release/1.1/examples/spray-routing/simple-routing-app/src/main/scala/spray/examples/Main.scala https://github.com/spray/spray/blob/release/1.1/examples/spr... if you want the very simple case) are better examples, that use the lovely type-safe routing DSL.