implicits for Box.forall

56 views
Skip to first unread message

Vasya Novikov

unread,
Dec 17, 2013, 2:22:06 AM12/17/13
to lif...@googlegroups.com
Hi all!
It is currently impossible to use Box.forall(...) If one tries to use
it, the compiler would say:

[error] Note that implicit conversions are not applicable because they
are ambiguous:
[error] both method box2Iterable in trait BoxTrait of type [T](in:
net.liftweb.common.Box[T])Iterable[T]
[error] and method box2Option in trait BoxTrait of type [T](in:
net.liftweb.common.Box[T])Option[T]
[error] are possible conversion functions from myCustomVal.type to
?{def forall: ?}

I suggest to add this method to Box. (Method "exist" is already there
and works fine.)

The current workaround is:
myBox.toIterable.forall(...)

Antonio Salazar Cardozo

unread,
Dec 17, 2013, 12:55:00 PM12/17/13
to lif...@googlegroups.com, n1m5-goo...@yandex.ru
If you know it's a Box, why not use exists? They're functionally identical in the case of Boxes…
Thanks,
Antonio

Vasya Novikov

unread,
Dec 17, 2013, 1:53:43 PM12/17/13
to lif...@googlegroups.com
The code gets cleaner this way:

if (!myBox.exist(!_.hasSomething))

if (myBox.forall(_.hasSomething))


On 2013-12-17 21:55, Antonio Salazar Cardozo wrote:
> If you know it's a Box, why not use exists? They're functionally
> identical in the case of Boxes�
> Thanks,
> Antonio
>
> On Tuesday, December 17, 2013 2:22:06 AM UTC-5, Vasya Novikov wrote:
>
> Hi all!
> It is currently impossible to use Box.forall(...) If one tries to use
> it, the compiler would say:
>
> [error] Note that implicit conversions are not applicable because
> they
> are ambiguous:
> [error] both method box2Iterable in trait BoxTrait of type [T](in:
> net.liftweb.common.Box[T])Iterable[T]
> [error] and method box2Option in trait BoxTrait of type [T](in:
> net.liftweb.common.Box[T])Option[T]
> [error] are possible conversion functions from myCustomVal.type to
> ?{def forall: ?}
>
> I suggest to add this method to Box. (Method "exist" is already there
> and works fine.)
>
> The current workaround is:
> myBox.toIterable.forall(...)
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Vasya Novikov

unread,
Dec 17, 2013, 2:22:49 PM12/17/13
to lif...@googlegroups.com
Also,
Empty.forall(...) must always yield "true"
while
Empty.exist(...) must always yield "false"

Diego Medina

unread,
Dec 17, 2013, 2:37:50 PM12/17/13
to Lift
On Tue, Dec 17, 2013 at 1:53 PM, Vasya Novikov <n1m5-goo...@yandex.ru> wrote:
The code gets cleaner this way:

    if (!myBox.exist(!_.hasSomething))

why are you double negating ?

see


val option = Some("diego").forall(x  => x.startsWith("d")  )
val box = Full("diego").exists(x  => x.startsWith("d")  )

both return true

Thanks 


 

    if (myBox.forall(_.hasSomething))



On 2013-12-17 21:55, Antonio Salazar Cardozo wrote:
If you know it's a Box, why not use exists? They're functionally identical in the case of Boxes…
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com
http://fmpwizard.telegr.am

Diego Medina

unread,
Dec 17, 2013, 3:02:10 PM12/17/13
to Lift
and if you really want to use forall, you can tell Scala to ignore one of the implicit conversion, like here


basically, if you define a method that has the same name as the implicit, but you don't make it implicit, it will cause scalac to ignore the implicit conversion.

Thanks

  Diego

Vasya Novikov

unread,
Dec 18, 2013, 1:39:05 AM12/18/13
to lif...@googlegroups.com
If I don't double-negate -- I loose the behavior.
A box with a boolean can have 3 states: empty, full(true), full(false)

box.forall yields: true, true, false
box.exist yields: false, true, false
!box.exist yields: true, false, true
!box.exist(!) yields: true, true, false

So, you can't really emulate "forall" with "exist" until you use 2
negations. (Empty.forall returns true, Empty.exist returns false.)

About importing implicits -- thanks for the correction, that's a valid
option, too. Anyway, maybe adding such a method may not be a bad thing, too.

I'll make a pull-request if some of the commiters says "OK", of course.


On 2013-12-17 23:37, Diego Medina wrote:
>
>
>
> On Tue, Dec 17, 2013 at 1:53 PM, Vasya Novikov
> <n1m5-goo...@yandex.ru <mailto:n1m5-goo...@yandex.ru>> wrote:
>
> The code gets cleaner this way:
>
> if (!myBox.exist(!_.hasSomething))
>
>
> why are you double negating ?
>
> see
>
> http://www.scalakata.com/52b0a78ae4b0b1a1c4dbe2c6
>
> val option = Some("diego").forall(x => x.startsWith("d") )
> val box = Full("diego").exists(x => x.startsWith("d") )
>
> both return true
>
> Thanks
>
>
>
> if (myBox.forall(_.hasSomething))
>
>
>
> On 2013-12-17 21:55, Antonio Salazar Cardozo wrote:
>
> If you know it's a Box, why not use exists? They're
> functionally identical in the case of Boxes�
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.

Antonio Salazar Cardozo

unread,
Dec 18, 2013, 9:07:36 AM12/18/13
to lif...@googlegroups.com, n1m5-goo...@yandex.ru
Yep, valid, hadn't thought about it all the way through. If you can open that PR, it's a pretty targeted change. Please make sure to follow the instructions at the bottom of https://github.com/lift/framework/blob/master/CONTRIBUTING.md .
Thanks,
Antonio
>         <mailto:liftweb%2B...@googlegroups.com>.
>         For more options, visit https://groups.google.com/groups/opt_out.
>
>
>     --
>     --
>     Lift, the simply functional web framework: http://liftweb.net
>     Code: http://github.com/lift
>     Discussion: http://groups.google.com/group/liftweb
>     Stuck? Help us help you:
>     https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>     --- You received this message because you are subscribed to the
>     Google Groups "Lift" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to liftweb+u...@googlegroups.com

Vasya Novikov

unread,
Dec 23, 2013, 3:56:24 AM12/23/13
to lif...@googlegroups.com
Hello again. I wrote the `forall` method and some simple test. But the
thing is -- I can't work out how to launch tests. If I run the "test"
target -- the JVM gives OutOfMemory:


[info] Total for specification HtmlPropertiesSpec
[info] Finished in 58 ms
[info] 4 examples, 0 failure, 0 error
[info]
Exception in thread "pool-20-thread-2"
Exception: java.lang.OutOfMemoryError thrown from the
UncaughtExceptionHandler in thread "pool-20-thread-2"
[info] DB Specification
[info]
[info] DB should
[info] JsonParser Specification
[info]
[info] The JSON Parser should
[info] + parse very long strings without causing a stack overflow
[info] + multiple double quotes must parse
sbt appears to be exiting abnormally.
The log file for this session is at /tmp/sbt8304078204217520190.log
Exception in thread "main"
Exception: java.lang.OutOfMemoryError thrown from the
UncaughtExceptionHandler in thread "main"


I tried to increase SBT limits to 8Gb, but it did not help.
What should I do? Launch only the test
"net.liftweb.common.BoxSpec.scala"? (How?) P-R without testing?

The code compiles successfully (2.10.3 and 2.9.1).
https://github.com/vn971/framework/commit/0f9b9b5ffaff16d9c0fc1b2f9f813701e31e492f
> > functionally identical in the case of Boxes�
> <https://groups.google.com/groups/opt_out>.
> >
> >
> > --
> > --
> > Lift, the simply functional web framework: http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> > https://www.assembla.com/wiki/show/liftweb/Posting_example_code
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > --- You received this message because you are subscribed to the
> > Google Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails
> from it,
> > send an email to liftweb+u...@googlegroups.com
> > <mailto:liftweb%2B...@googlegroups.com>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
> >
> >
> >
> >
> > --
> > Diego Medina
> > Lift/Scala consultant
> > di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> > http://fmpwizard.telegr.am
> > --
> > --
> > Lift, the simply functional web framework: http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > ---
> > You received this message because you are subscribed to the Google
> > Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails from
> it, send
> > an email to liftweb+u...@googlegroups.com.
> > For more options, visit https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.

Diego Medina

unread,
Dec 23, 2013, 9:57:07 AM12/23/13
to Lift
how did you increase the memory on sbt? 8GB should be plenty to run the test (unless you are doing ++test.

What we normally do is only run test  from sbt, and then you may want  restart sbt and then use

++2.10.0

to switch to another scala version and then run test again, to make sure it works there too (and again for all the versions we build lift, which you can find on the build.sbt file.

Thanks

  Diego 



To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com

Vasya Novikov

unread,
Dec 23, 2013, 1:56:39 PM12/23/13
to lif...@googlegroups.com
Diego, thank you very much! Indeed there was an issue with SBT
configuration. (The config was not read.)
> <mailto:n1m5-goo...@yandex.ru <mailto:n1m5-goo...@yandex.ru>>>
> <mailto:liftweb%2Bu...@googlegroups.com>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> >
> >
> > --
> > --
> > Lift, the simply functional web framework:
> http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> >
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > --- You received this message because you are
> subscribed to the
> > Google Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails
> from it,
> > send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bu...@googlegroups.com>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> >
> >
> >
> >
> > --
> > Diego Medina
> > Lift/Scala consultant
> > di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> > http://fmpwizard.telegr.am
> > --
> > --
> > Lift, the simply functional web framework:
> http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> >
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > ---
> > You received this message because you are subscribed to
> the Google
> > Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails
> from
> it, send
> > an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bu...@googlegroups.com>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Diego Medina

unread,
Dec 23, 2013, 2:00:21 PM12/23/13
to Lift
Glad it is running  now


        it, send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>.

        For more options, visit https://groups.google.com/groups/opt_out.


    --     --     Lift, the simply functional web framework: http://liftweb.net
    Code: http://github.com/lift
    Discussion: http://groups.google.com/group/liftweb
    Stuck? Help us help you:
    https://www.assembla.com/wiki/show/liftweb/Posting_example_code

    --- You received this message because you are subscribed to the
    Google Groups "Lift" group.
    To unsubscribe from this group and stop receiving emails from it,

    For more options, visit https://groups.google.com/groups/opt_out.




--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com <mailto:di...@fmpwizard.com>

http://fmpwizard.telegr.am
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com

Vasya Novikov

unread,
Dec 23, 2013, 2:34:36 PM12/23/13
to lif...@googlegroups.com
All tests successfully pass, with 2.10.0, 2.9.1, 2.9.1-1, 2.9.2.

I made a pull request: https://github.com/lift/framework/pull/1502


On 2013-12-23 18:57, Diego Medina wrote:
> <mailto:n1m5-goo...@yandex.ru <mailto:n1m5-goo...@yandex.ru>>>
> <mailto:liftweb%2Bu...@googlegroups.com>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> >
> >
> > --
> > --
> > Lift, the simply functional web framework:
> http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> >
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > --- You received this message because you are
> subscribed to the
> > Google Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails
> from it,
> > send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bu...@googlegroups.com>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> >
> >
> >
> >
> > --
> > Diego Medina
> > Lift/Scala consultant
> > di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> > http://fmpwizard.telegr.am
> > --
> > --
> > Lift, the simply functional web framework:
> http://liftweb.net
> > Code: http://github.com/lift
> > Discussion: http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> >
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > ---
> > You received this message because you are subscribed to
> the Google
> > Groups "Lift" group.
> > To unsubscribe from this group and stop receiving emails
> from
> it, send
> > an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bu...@googlegroups.com>.
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Diego Medina

unread,
Dec 23, 2013, 2:40:54 PM12/23/13
to Lift
great, now, how do you normally handle this case:

"return true if the Box is empty, or if Box's value satisfies the predicate"

I know this is how forall in scala also works, but if I pass a predicate and the box is empty and I get true, isn't that kind of unexpected?

Thanks




        it, send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>.

        For more options, visit https://groups.google.com/groups/opt_out.


    --     --     Lift, the simply functional web framework: http://liftweb.net
    Code: http://github.com/lift
    Discussion: http://groups.google.com/group/liftweb
    Stuck? Help us help you:
    https://www.assembla.com/wiki/show/liftweb/Posting_example_code

    --- You received this message because you are subscribed to the
    Google Groups "Lift" group.
    To unsubscribe from this group and stop receiving emails from it,

    For more options, visit https://groups.google.com/groups/opt_out.




--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com <mailto:di...@fmpwizard.com>

http://fmpwizard.telegr.am
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com

Vasya Novikov

unread,
Dec 23, 2013, 3:36:20 PM12/23/13
to lif...@googlegroups.com
I'd say it's okay and should be exactly so.
I take it as it is in math. "All crocodiles on moon are red" is true.
"All crocodiles on moon are blue" is also true. Or, generally speaking,
an empty set of elements satisfies all predicates.

The more intriguing thing is Failure().forall. One should understand
that using "forall" on an empty collection returns "true" on purpose.
But if that's TOO surprising -- it's OK for me to take back the PR.
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>
> <mailto:liftweb%252B...@googlegroups.com
> <mailto:liftweb%25252B...@googlegroups.com>>>.
>
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
> >
> >
> > --
> > --
> > Lift, the simply functional web framework:
> http://liftweb.net
> > Code: http://github.com/lift
> > Discussion:
> http://groups.google.com/group/liftweb
> <http://groups.google.com/group/liftweb>
> > Stuck? Help us help you:
> >
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> <https://www.assembla.com/wiki/show/liftweb/Posting_example_code>
> >
> > --- You received this message because you are
> subscribed to the
> > Google Groups "Lift" group.
> > To unsubscribe from this group and stop
> receiving emails
> from it,
> > send an email to
> liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bu...@googlegroups.com>
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>>
> > <mailto:liftweb%2B...@googlegroups.com
> <mailto:liftweb%252B...@googlegroups.com>
> <mailto:liftweb%252B...@googlegroups.com
> <mailto:liftweb%25252B...@googlegroups.com>>>.
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>>.
>
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
> -- -- Lift, the simply functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails from
> it, send an email to
> liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>
> <mailto:liftweb%2Bunsu...@googlegroups.com
> <mailto:liftweb%252Buns...@googlegroups.com>>.
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails
> from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>
> <mailto:liftweb%2Bunsu...@googlegroups.com
> <mailto:liftweb%252Buns...@googlegroups.com>>.
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.

Diego Medina

unread,
Dec 23, 2013, 3:46:08 PM12/23/13
to Lift
On Mon, Dec 23, 2013 at 3:36 PM, Vasya Novikov <n1m5-goo...@yandex.ru> wrote:
I'd say it's okay and should be exactly so.


Maybe my previous email wasn't clear. I didn't mean to question the PR or how you implemented it. 
 
I take it as it is in math. "All crocodiles on moon are red" is true. "All crocodiles on moon are blue" is also true. Or, generally speaking, an empty set of elements satisfies all predicates.


Let's try a different question, can you give a real use case where you use forall and having an Empty box is the same as having a Full box with the elements that you expect?

I was very surprised when I did

val x: Option[int] = None

x.forall(_ > 10)

and have that be true

Because the way I see it is, if my option is None, then it is not greater than 10, it is nothing. So, I definitely cannot use forall for validation, so I wonder where do people use forall

Thanks

  Diego

 

The more intriguing thing is Failure().forall. One should understand that using "forall" on an empty collection returns "true" on purpose. But if that's TOO surprising -- it's OK for me to take back the PR.


From Lift's point of view, a Failure is an Empty box with an explanation of why it is empty, so both should behave  the same way.

Thanks


 


On 2013-12-23 23:40, Diego Medina wrote:
great, now, how do you normally handle this case:

"return true if the Box is empty, or if Box's value satisfies the predicate"

I know this is how forall in scala also works, but if I pass a predicate and the box is empty and I get true, isn't that kind of unexpected?

Thanks




On Mon, Dec 23, 2013 at 2:34 PM, Vasya Novikov <n1m5-goo...@yandex.ru <mailto:n1m5-googlegroups@yandex.ru>> wrote:

    All tests successfully pass, with 2.10.0, 2.9.1, 2.9.1-1, 2.9.2.

    I made a pull request: https://github.com/lift/framework/pull/1502



    On 2013-12-23 18:57, Diego Medina wrote:

        how did you increase the memory on sbt? 8GB should be plenty
        to run the test (unless you are doing ++test.

        What we normally do is only run test  from sbt, and then you
        may want  restart sbt and then use

        ++2.10.0

        to switch to another scala version and then run test again, to
        make sure it works there too (and again for all the versions
        we build lift, which you can find on the build.sbt file.

        Thanks

          Diego



        On Mon, Dec 23, 2013 at 3:56 AM, Vasya Novikov
        <n1m5-goo...@yandex.ru
        <mailto:n1m5-googlegroups@yandex.ru>
        <mailto:n1m5-googlegroups@yandex.ru


                For more options, visit
        https://groups.google.com/groups/opt_out.


            --     --     Lift, the simply functional web framework:
        http://liftweb.net
            Code: http://github.com/lift
            Discussion: http://groups.google.com/group/liftweb
            Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

            --- You received this message because you are subscribed
        to the
            Google Groups "Lift" group.
            To unsubscribe from this group and stop receiving emails
        from it,
            send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>
            <mailto:liftweb%2Bunsubscribe@googlegroups.com
        <mailto:liftweb%252Bunsubscribe@googlegroups.com>>.


            For more options, visit
        https://groups.google.com/groups/opt_out.




        --         Diego Medina
        Lift/Scala consultant
        di...@fmpwizard.com <mailto:di...@fmpwizard.com>
        <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>


        http://fmpwizard.telegr.am
        --         --         Lift, the simply functional web framework: http://liftweb.net
        Code: http://github.com/lift
        Discussion: http://groups.google.com/group/liftweb
        Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

        ---
        You received this message because you are subscribed to the
        Google Groups "Lift" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>.

        For more options, visit https://groups.google.com/groups/opt_out.


    --     --     Lift, the simply functional web framework: http://liftweb.net
    Code: http://github.com/lift
    Discussion: http://groups.google.com/group/liftweb
    Stuck? Help us help you:
    https://www.assembla.com/wiki/show/liftweb/Posting_example_code

    --- You received this message because you are subscribed to the
    Google Groups "Lift" group.
    To unsubscribe from this group and stop receiving emails from it,

    For more options, visit https://groups.google.com/groups/opt_out.




--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com <mailto:di...@fmpwizard.com>
http://fmpwizard.telegr.am
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com

Vasya Novikov

unread,
Dec 24, 2013, 1:21:43 AM12/24/13
to lif...@googlegroups.com
My use case which made me start the topic:

* I have a cookie which "can hold" a date
* I want to set a new cookie, if it would not be older than the old one.

What I do now:
if (S.cookie.toOption.forall(_ isOlder newDate)) { ... set new date }

In the same time, `S.cookie.exist(_ isOlder newDate)` would not allow an
empty (previous) cookie.
> <mailto:n1m5-goo...@yandex.ru>
> <mailto:n1m5-goo...@yandex.ru
> <mailto:n1m5-goo...@yandex.ru>>> wrote:
>
> All tests successfully pass, with 2.10.0, 2.9.1, 2.9.1-1,
> 2.9.2.
>
> I made a pull request:
> https://github.com/lift/framework/pull/1502
>
>
>
> On 2013-12-23 18:57, Diego Medina wrote:
>
> how did you increase the memory on sbt? 8GB should be
> plenty
> to run the test (unless you are doing ++test.
>
> What we normally do is only run test from sbt, and
> then you
> may want restart sbt and then use
>
> ++2.10.0
>
> to switch to another scala version and then run test
> again, to
> make sure it works there too (and again for all the
> versions
> we build lift, which you can find on the build.sbt file.
>
> Thanks
>
> Diego
>
>
>
> On Mon, Dec 23, 2013 at 3:56 AM, Vasya Novikov
> <n1m5-goo...@yandex.ru
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>>>
> <mailto:liftweb%252B...@googlegroups.com
> <mailto:liftweb%25252B...@googlegroups.com>
> <mailto:liftweb%25252B...@googlegroups.com
> <mailto:liftweb%2525252B...@googlegroups.com>>>>.
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>>>
> <mailto:liftweb%252B...@googlegroups.com
> <mailto:liftweb%25252B...@googlegroups.com>
> <mailto:liftweb%25252B...@googlegroups.com
> <mailto:liftweb%2525252B...@googlegroups.com>>>>.
> <mailto:liftweb%2Bu...@googlegroups.com
> <mailto:liftweb%252Bu...@googlegroups.com>
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>>>.
>
>
> > For more options, visit
> https://groups.google.com/groups/opt_out
> <https://groups.google.com/groups/opt_out>.
>
>
> -- -- Lift, the simply
> functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails from
> it, send an email to
> <mailto:liftweb%2Bunsu...@googlegroups.com
> <mailto:liftweb%252Buns...@googlegroups.com>
> <mailto:liftweb%252Buns...@googlegroups.com
> <mailto:liftweb%25252Bun...@googlegroups.com>>>.
>
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web
> framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails
> from it,
> send an email to
> <mailto:liftweb%2Bunsu...@googlegroups.com
> <mailto:liftweb%252Buns...@googlegroups.com>
> <mailto:liftweb%252Buns...@googlegroups.com
> <mailto:liftweb%25252Bun...@googlegroups.com>>>.
>
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> -- Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>>>
>
>
> http://fmpwizard.telegr.am
> -- -- Lift, the simply functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails from
> it, send an email to
> <mailto:liftweb%252Buns...@googlegroups.com>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails
> from it,
> <mailto:liftweb%252Buns...@googlegroups.com>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.

Diego Medina

unread,
Dec 24, 2013, 1:25:00 AM12/24/13
to Lift
thanks for the example, 


        <mailto:n1m5-googlegroups@yandex.ru>
        <mailto:n1m5-googlegroups@yandex.ru

        <mailto:n1m5-googlegroups@yandex.ru>>> wrote:

            All tests successfully pass, with 2.10.0, 2.9.1, 2.9.1-1,
        2.9.2.

            I made a pull request:
        https://github.com/lift/framework/pull/1502



            On 2013-12-23 18:57, Diego Medina wrote:

                how did you increase the memory on sbt? 8GB should be
        plenty
                to run the test (unless you are doing ++test.

                What we normally do is only run test  from sbt, and
        then you
                may want  restart sbt and then use

                ++2.10.0

                to switch to another scala version and then run test
        again, to
                make sure it works there too (and again for all the
        versions
                we build lift, which you can find on the build.sbt file.

                Thanks

                  Diego



                On Mon, Dec 23, 2013 at 3:56 AM, Vasya Novikov
                <n1m5-goo...@yandex.ru
        <mailto:n1m5-googlegroups@yandex.ru>
                <mailto:n1m5-googlegroups@yandex.ru
        <mailto:n1m5-googlegroups@yandex.ru>>
                <mailto:n1m5-googlegroups@yandex.ru
        <mailto:n1m5-googlegroups@yandex.ru>

                <mailto:n1m5-googlegroups@yandex.ru
                        <mailto:liftweb%2Bunsubscribe@googlegroups.com
        <mailto:liftweb%252Bunsubscribe@googlegroups.com>
                <mailto:liftweb%252Bunsubscribe@googlegroups.com
        <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>.



                        For more options, visit
        https://groups.google.com/groups/opt_out.


                    --     --     Lift, the simply functional web
        framework:
        http://liftweb.net
                    Code: http://github.com/lift
                    Discussion: http://groups.google.com/group/liftweb
                    Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

                    --- You received this message because you are
        subscribed
                to the
                    Google Groups "Lift" group.
                    To unsubscribe from this group and stop receiving
        emails
                from it,
                    send an email to
                    <mailto:liftweb%2Bunsubscribe@googlegroups.com
        <mailto:liftweb%252Bunsubscribe@googlegroups.com>
                <mailto:liftweb%252Bunsubscribe@googlegroups.com
        <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>.



                    For more options, visit
        https://groups.google.com/groups/opt_out.




                --         Diego Medina
                Lift/Scala consultant
        di...@fmpwizard.com <mailto:di...@fmpwizard.com>
        <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
                <mailto:di...@fmpwizard.com
        <mailto:di...@fmpwizard.com> <mailto:di...@fmpwizard.com
        <mailto:di...@fmpwizard.com>>>


        http://fmpwizard.telegr.am
                --         --         Lift, the simply functional web
        framework: http://liftweb.net
                Code: http://github.com/lift
                Discussion: http://groups.google.com/group/liftweb
                Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

                ---
                You received this message because you are subscribed
        to the
                Google Groups "Lift" group.
                To unsubscribe from this group and stop receiving
        emails from
                it, send an email to

                For more options, visit
        https://groups.google.com/groups/opt_out.


            --     --     Lift, the simply functional web framework:
        http://liftweb.net
            Code: http://github.com/lift
            Discussion: http://groups.google.com/group/liftweb
            Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

            --- You received this message because you are subscribed
        to the
            Google Groups "Lift" group.
            To unsubscribe from this group and stop receiving emails
        from it,
            send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>
            <mailto:liftweb%2Bunsubscribe@googlegroups.com
        <mailto:liftweb%252Bunsubscribe@googlegroups.com>>.

            For more options, visit
        https://groups.google.com/groups/opt_out.




        --         Diego Medina
        Lift/Scala consultant
        di...@fmpwizard.com <mailto:di...@fmpwizard.com>
        <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
        http://fmpwizard.telegr.am
        --         --         Lift, the simply functional web framework: http://liftweb.net
        Code: http://github.com/lift
        Discussion: http://groups.google.com/group/liftweb
        Stuck? Help us help you:
        https://www.assembla.com/wiki/show/liftweb/Posting_example_code

        ---
        You received this message because you are subscribed to the
        Google Groups "Lift" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to liftweb+unsubscribe@googlegroups.com
        <mailto:liftweb%2Bunsubscribe@googlegroups.com>.

        For more options, visit https://groups.google.com/groups/opt_out.


    --     --     Lift, the simply functional web framework: http://liftweb.net
    Code: http://github.com/lift
    Discussion: http://groups.google.com/group/liftweb
    Stuck? Help us help you:
    https://www.assembla.com/wiki/show/liftweb/Posting_example_code

    --- You received this message because you are subscribed to the
    Google Groups "Lift" group.
    To unsubscribe from this group and stop receiving emails from it,

    For more options, visit https://groups.google.com/groups/opt_out.




--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com <mailto:di...@fmpwizard.com>
http://fmpwizard.telegr.am
--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

---
You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

--
--
Lift, the simply functional web framework: http://liftweb.net
Code: http://github.com/lift
Discussion: http://groups.google.com/group/liftweb
Stuck? Help us help you: https://www.assembla.com/wiki/show/liftweb/Posting_example_code

--- You received this message because you are subscribed to the Google Groups "Lift" group.
To unsubscribe from this group and stop receiving emails from it, send an email to liftweb+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.



--
Diego Medina
Lift/Scala consultant
di...@fmpwizard.com

Vasya Novikov

unread,
Jan 15, 2014, 12:26:21 PM1/15/14
to lif...@googlegroups.com
What about the `forall` method and some clean-ups?.. Are they rejected /
approved / postponed ?


On 2013-12-24 10:25, Diego Medina wrote:
> thanks for the example,
>
>
> On Tue, Dec 24, 2013 at 1:21 AM, Vasya Novikov
> <n1m5-goo...@yandex.ru <mailto:n1m5-goo...@yandex.ru>> wrote:
>
> My use case which made me start the topic:
>
> * I have a cookie which "can hold" a date
> * I want to set a new cookie, if it would not be older than the
> old one.
>
> What I do now:
> if (S.cookie.toOption.forall(_ isOlder newDate)) { ... set new
> date }
>
> In the same time, `S.cookie.exist(_ isOlder newDate)` would not
> allow an empty (previous) cookie.
>
>
> On 2013-12-24 00:46, Diego Medina wrote:
>
>
>
>
> On Mon, Dec 23, 2013 at 3:36 PM, Vasya Novikov
> <n1m5-goo...@yandex.ru
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>
> <mailto:liftweb%25252Bu...@googlegroups.com
> <mailto:liftweb%2525252Bu...@googlegroups.com>>>>
> <mailto:liftweb%25252B...@googlegroups.com
> <mailto:liftweb%2525252B...@googlegroups.com>
> <mailto:liftweb%2525252B...@googlegroups.com
> <mailto:liftweb%252525252B...@googlegroups.com>>>>>.
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>
> <mailto:liftweb%25252Bu...@googlegroups.com
> <mailto:liftweb%2525252Bu...@googlegroups.com>>>>
> <mailto:liftweb%25252B...@googlegroups.com
> <mailto:liftweb%2525252B...@googlegroups.com>
> <mailto:liftweb%2525252B...@googlegroups.com
> <mailto:liftweb%252525252B...@googlegroups.com>>>>>.
> <mailto:liftweb%252Bu...@googlegroups.com
> <mailto:liftweb%25252Bu...@googlegroups.com>
> <mailto:liftweb%25252Bu...@googlegroups.com
> <mailto:liftweb%2525252Bu...@googlegroups.com>>>>.
>
>
>
> > For more options, visit
> https://groups.google.com/groups/opt_out
>
> <https://groups.google.com/groups/opt_out>.
>
>
> -- -- Lift, the simply
> functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion:
> http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and
> stop receiving
> emails from
> it, send an email to
> <mailto:liftweb%252Buns...@googlegroups.com
> <mailto:liftweb%25252Bun...@googlegroups.com>
> <mailto:liftweb%25252Bun...@googlegroups.com
> <mailto:liftweb%2525252Bu...@googlegroups.com>>>>.
>
>
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web
> framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion:
> http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop
> receiving
> emails
> from it,
> send an email to
> <mailto:liftweb%252Buns...@googlegroups.com
> <mailto:liftweb%25252Bun...@googlegroups.com>
> <mailto:liftweb%25252Bun...@googlegroups.com
> <mailto:liftweb%2525252Bu...@googlegroups.com>>>>.
>
>
>
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> -- Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>>>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>>>>
>
>
> http://fmpwizard.telegr.am
> -- -- Lift, the simply
> functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails from
> it, send an email to
> <mailto:liftweb%25252Bun...@googlegroups.com>>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web
> framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are
> subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails
> from it,
> send an email to
> <mailto:liftweb%25252Bun...@googlegroups.com>>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> -- Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com> <mailto:di...@fmpwizard.com
> <mailto:di...@fmpwizard.com>>>
> http://fmpwizard.telegr.am
> -- -- Lift, the simply functional web
> framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving
> emails from
> it, send an email to
> <mailto:liftweb%252Buns...@googlegroups.com>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
> -- -- Lift, the simply functional web framework:
> http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed
> to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails
> from it,
> <mailto:liftweb%252Buns...@googlegroups.com>>.
> For more options, visit
> https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> --- You received this message because you are subscribed to the
> Google Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to liftweb+u...@googlegroups.com
> <mailto:liftweb%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
>
> --
> Diego Medina
> Lift/Scala consultant
> di...@fmpwizard.com <mailto:di...@fmpwizard.com>
> http://fmpwizard.telegr.am
> --
> --
> Lift, the simply functional web framework: http://liftweb.net
> Code: http://github.com/lift
> Discussion: http://groups.google.com/group/liftweb
> Stuck? Help us help you:
> https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
> ---
> You received this message because you are subscribed to the Google
> Groups "Lift" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to liftweb+u...@googlegroups.com.

Antonio Salazar Cardozo

unread,
Jan 15, 2014, 2:59:20 PM1/15/14
to lif...@googlegroups.com, n1m5-goo...@yandex.ru
I'll have a look this evening.
Thanks,
Antonio
>         <mailto:liftweb%2B...@googlegroups.com>
>                 <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>
>                         <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>
>                                
>         <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>
>                        
>
>
>
>                                 For more options, visit
>         https://groups.google.com/groups/opt_out.
>
>
>                             --     --     Lift, the simply functional web
>                 framework:
>         http://liftweb.net
>                             Code: http://github.com/lift
>                             Discussion:
>         http://groups.google.com/group/liftweb
>                             Stuck? Help us help you:
>         https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>                             --- You received this message because you are
>                 subscribed
>                         to the
>                             Google Groups "Lift" group.
>                             To unsubscribe from this group and stop
>         receiving
>                 emails
>                         from it,
>                             send an email to
>         liftweb+u...@googlegroups.com
>         <mailto:liftweb%2B...@googlegroups.com>
>                 <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>
>                         <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>
>                            
>         <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>
>                        
>         <mailto:liftweb%2B...@googlegroups.com>
>                 <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>
>                         <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>.
>                         For more options, visit
>         https://groups.google.com/groups/opt_out.
>
>
>                     --     --     Lift, the simply functional web
>         framework:
>         http://liftweb.net
>                     Code: http://github.com/lift
>                     Discussion: http://groups.google.com/group/liftweb
>                     Stuck? Help us help you:
>         https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>                     --- You received this message because you are
>         subscribed
>                 to the
>                     Google Groups "Lift" group.
>                     To unsubscribe from this group and stop receiving
>         emails
>                 from it,
>                     send an email to
>         liftweb+u...@googlegroups.com
>         <mailto:liftweb%2B...@googlegroups.com>
>                 <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>
>                     <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>
>                 <mailto:liftweb%252Bunsubscribe@googlegroups.com
>         <mailto:liftweb%25252Bunsubscribe@googlegroups.com>>>.
>                     For more options, visit
>         https://groups.google.com/groups/opt_out.
>
>
>
>
>                 --         Diego Medina
>                 Lift/Scala consultant
>         di...@fmpwizard.com <mailto:di...@fmpwizard.com>
>         <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
>                 <mailto:di...@fmpwizard.com
>         <mailto:di...@fmpwizard.com> <mailto:di...@fmpwizard.com
>         <mailto:di...@fmpwizard.com>>>
>         http://fmpwizard.telegr.am
>                 --         --         Lift, the simply functional web
>         framework: http://liftweb.net
>                 Code: http://github.com/lift
>                 Discussion: http://groups.google.com/group/liftweb
>                 Stuck? Help us help you:
>         https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>                 ---
>                 You received this message because you are subscribed
>         to the
>                 Google Groups "Lift" group.
>                 To unsubscribe from this group and stop receiving
>         emails from
>                 it, send an email to
>         liftweb+u...@googlegroups.com
>         <mailto:liftweb%2B...@googlegroups.com>
>                 <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>.
>                 For more options, visit
>         https://groups.google.com/groups/opt_out.
>
>
>             --     --     Lift, the simply functional web framework:
>         http://liftweb.net
>             Code: http://github.com/lift
>             Discussion: http://groups.google.com/group/liftweb
>             Stuck? Help us help you:
>         https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>             --- You received this message because you are subscribed
>         to the
>             Google Groups "Lift" group.
>             To unsubscribe from this group and stop receiving emails
>         from it,
>             send an email to liftweb+u...@googlegroups.com
>         <mailto:liftweb%2B...@googlegroups.com>
>             <mailto:liftweb%2B...@googlegroups.com
>         <mailto:liftweb%252Bunsubscribe@googlegroups.com>>.
>             For more options, visit
>         https://groups.google.com/groups/opt_out.
>
>
>
>
>         --
>         Diego Medina
>         Lift/Scala consultant
>         di...@fmpwizard.com <mailto:di...@fmpwizard.com>
>         <mailto:di...@fmpwizard.com <mailto:di...@fmpwizard.com>>
>         http://fmpwizard.telegr.am
>         --
>         --
>         Lift, the simply functional web framework: http://liftweb.net
>         Code: http://github.com/lift
>         Discussion: http://groups.google.com/group/liftweb
>         Stuck? Help us help you:
>         https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>         ---
>         You received this message because you are subscribed to the
>         Google Groups "Lift" group.
>         To unsubscribe from this group and stop receiving emails from
>         it, send an email to liftweb+u...@googlegroups.com
>         <mailto:liftweb%2B...@googlegroups.com>.
>         For more options, visit https://groups.google.com/groups/opt_out.
>
>
>     --
>     --
>     Lift, the simply functional web framework: http://liftweb.net
>     Code: http://github.com/lift
>     Discussion: http://groups.google.com/group/liftweb
>     Stuck? Help us help you:
>     https://www.assembla.com/wiki/show/liftweb/Posting_example_code
>
>     --- You received this message because you are subscribed to the
>     Google Groups "Lift" group.
>     To unsubscribe from this group and stop receiving emails from it,
>     send an email to liftweb+u...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages