Yes, I thought it was a scala limitation, I've never seen it in 3 years of 
scala programming... but you never know ;)

Cheers
G
On Saturday, 30 May 2015 14:26:33 UTC+2, Konrad Malawski wrote:
>
> That's a Scala limitation - it's not possible to introduce two separate 
> implicit values in one line AFAIK.
> When you say `implicit ...` it makes that *one* *value* implicit (the 
> tuple), not both of these - it has no way of looking inside the tuple 
> basically.
>
> Devs on scala-internals may have more say on this topic, but I don't 
> recall this to be worked on.
>
> -- 
> Cheers,
> Konrad 'ktoso’ Malawski
> Akka <http://akka.io> @ Typesafe <http://typesafe.com>
>
> On 30 May 2015 at 09:16:10, Giovanni Alberto Caporaletti (
> [email protected] <javascript:>) wrote:
>
> Thanks Konrad, 
> I already have a lot of custom directives, but what I was wondering is if 
> there's a way to make them both implicit.
> Maybe this is a more general scala question, like: how can I make all the 
> parameters of a lambda implicit, because "{ implicit x=> ... }" works while 
> "{ implicit (x,y) => ...}" doesn't .
>
> Cheers
> G
>
>
> On Friday, 29 May 2015 19:07:08 UTC+2, Konrad Malawski wrote: 
>>
>> Hi Giovanni, 
>> Firstly, sorry we don't have docs on this yet, but they are coming soon! 
>> ( check this with a higher version number soon 
>> http://doc.akka.io/docs/akka-stream-and-http-experimental/1.0-M2/scala/http/custom-directives.html
>>  
>> <http://www.google.com/url?q=http%3A%2F%2Fdoc.akka.io%2Fdocs%2Fakka-stream-and-http-experimental%2F1.0-M2%2Fscala%2Fhttp%2Fcustom-directives.html&sa=D&sntz=1&usg=AFQjCNFO_CFkEoGTA8VJJ8Voe4yjJRtSRQ>
>>  
>> )
>>
>> Both these directives are implemented in terms of the extract directrive,
>> by digging a bit through the sources you'll notice the patterns :-)
>>
>> Something among the lines:
>>
>> def extractBoth: Directive[(ExecutionContext, FlowMaterializer)] =
>>   textract(rc => (rc.executionContext, rc.flowMaterializer))
>>
>>   extractBoth { (ec, mat) =>
>>     // ec.execute()
>>     // mat.materialize()
>>   } 
>>
>>
>> Should do the trick.
>> Happy hakking!
>>  
>> On Mon, May 18, 2015 at 8:10 PM, Giovanni Alberto Caporaletti <
>> [email protected]> wrote:
>>
>>> Hi everyone, 
>>>
>>> I often need to have both the materializer and the execution context in 
>>> scope in my routes.
>>>
>>> Is there a more compact way of doing this?
>>>  
>>> extractFlowMaterializer { implicit mat =>
>>>   extractExecutionContext { implicit ec =>
>>>
>>> or
>>>
>>>  extractFlowMaterializer { implicit mat =>
>>>   implicit val ec = mat.executionContext
>>>
>>>
>>>
>>> I tried something like (extractFlowMaterializer & 
>>> extractExecutionContext) { implicit (mat, val) => ... but it doesn't work
>>>
>>>
>>>
>>> thanks
>>> G
>>>  --
>>> >>>>>>>>>> Read the docs: http://akka.io/docs/
>>> >>>>>>>>>> Check the FAQ: 
>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>> >>>>>>>>>> Search the archives: 
>>> https://groups.google.com/group/akka-user
>>> ---
>>> You received this message because you are subscribed to the Google 
>>> Groups "Akka User List" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/akka-user.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>  
>>
>>
>> --
>>      Cheers,
>> Konrad 'ktoso' Malawski
>>  Akka <http://akka.io/> @ Typesafe <http://typesafe.com/>
>>       
>  --
> >>>>>>>>>> Read the docs: http://akka.io/docs/
> >>>>>>>>>> Check the FAQ: 
> http://doc.akka.io/docs/akka/current/additional/faq.html
> >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
> ---
> You received this message because you are subscribed to the Google Groups 
> "Akka User List" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> Visit this group at http://groups.google.com/group/akka-user.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to