This page is no longer maintained — Please continue to the home page at www.scala-lang.org

[ANN] Scalaz 6.0

17 replies
Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.

Scalaz [1] is a library for functional programming in Scala,
comprising Type Classes, purely functional data structures, general
purpose algorithms, and a minimal concurrency library.

The Scalaz team is proud to announce the release of Scalaz 6.0, for
Scala 2.8.1 and 2.9.0.1. For details of what's new, and links to the
downloads and API documentation, see the release notes [2].

Thanks to all the contributors for the myriad improvements in this
release; and to the users of the library who have provided feedback
and interesting discussions on the mailing lists.

BTW, I will be presenting a session on Scalaz at Scala eXchange [3] next week.

-jason

[1] http://scalaz.org
[2] http://code.google.com/p/scalaz/wiki/Scalaz6
[3] http://skillsmatter.com/event/scala/scala-exchange-2011

Martin S. Weber
Joined: 2008-12-23,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On 06/08/11 11:34, Jason Zaugg wrote:
> Scalaz [1] is a library for functional programming in Scala,
> comprising Type Classes, purely functional data structures, general
> purpose algorithms, and a minimal concurrency library.
>
> The Scalaz team is proud to announce the release of Scalaz 6.0, for
> Scala 2.8.1 and 2.9.0.1. For details of what's new, and links to the
> downloads and API documentation, see the release notes [2].

...which reminds me:

from http://code.google.com/p/scalaz/

"Type Classes
[...]
A Monoid type class and (so many!) implementations"

Uhm.. Is there any way to see from the scaladoc which implementations Monoid
has? In other words, I don't want to see the linear supertypes of a
class/trait in the scaladoc, I want to see its implementations. Something that
good old javadoc is doing for eeeeeeeeeeeeeeooooooooons.

I can't see it, please help me remove my blindness.

Thanks in advance,

-Martin

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On Wed, Jun 8, 2011 at 5:42 PM, Martin S. Weber wrote:
> On 06/08/11 11:34, Jason Zaugg wrote:
> Uhm.. Is there any way to see from the scaladoc which implementations Monoid
> has? In other words, I don't want to see the linear supertypes of a
> class/trait in the scaladoc, I want to see its implementations. Something
> that good old javadoc is doing for eeeeeeeeeeeeeeooooooooons.
>
> I can't see it, please help me remove my blindness.

Scaladoc does show "Known Subclasses", but for finding Monoid
instances this doesn't help. These are usually pieced together
implicitly by Monoid.monoid [1], from a Semigroup [2] and Zero [3].

I usually find it easiest to read the sources to look for these
things, we have hyperlinked versions online. [4]

-jason

[1] http://scalaz.github.com/scalaz/scalaz-2.9.0-1-6.0/doc/#scalaz.Monoid$
[2] http://scalaz.github.com/scalaz/scalaz-2.9.0-1-6.0/doc/#scalaz.Semigroup$
[3] http://scalaz.github.com/scalaz/scalaz-2.9.0-1-6.0/doc/#scalaz.Zero
[4] http://scalaz.github.com/scalaz/scalaz-2.9.0-1-6.0/doc.sxr/

dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On Wed, Jun 8, 2011 at 12:42, Martin S. Weber wrote:
> On 06/08/11 11:34, Jason Zaugg wrote:
>>
>> Scalaz [1] is a library for functional programming in Scala,
>> comprising Type Classes, purely functional data structures, general
>> purpose algorithms, and a minimal concurrency library.
>>
>> The Scalaz team is proud to announce the release of Scalaz 6.0, for
>> Scala 2.8.1 and 2.9.0.1. For details of what's new, and links to the
>> downloads and API documentation, see the release notes [2].
>
> ...which reminds me:
>
> from http://code.google.com/p/scalaz/
>
> "Type Classes
> [...]
> A Monoid type class and (so many!) implementations"
>
> Uhm.. Is there any way to see from the scaladoc which implementations Monoid
> has? In other words, I don't want to see the linear supertypes of a
> class/trait in the scaladoc, I want to see its implementations. Something
> that good old javadoc is doing for eeeeeeeeeeeeeeooooooooons.

And so is Scaladoc. I find it curious that it doesn't show any
implementation -- probably because they are all anonymous classes. I'd
look at the implicits defined by scalaz.Scalaz.

hseeberger
Joined: 2008-12-27,
User offline. Last seen 1 year 25 weeks ago.
Re: [scalaz] [ANN] Scalaz 6.0
Congrats! Great stuff.What a pity I will miss your talk (Scala eXchange).
Heiko

On 8 June 2011 17:34, Jason Zaugg <jzaugg@gmail.com> wrote:
Scalaz [1] is a library for functional programming in Scala,
comprising Type Classes, purely functional data structures, general
purpose algorithms, and a minimal concurrency library.

The Scalaz team is proud to announce the release of Scalaz 6.0, for
Scala 2.8.1 and 2.9.0.1. For details of what's new, and links to the
downloads and API documentation, see the release notes [2].

Thanks to all the contributors for the myriad improvements in this
release; and to the users of the library who have provided feedback
and interesting discussions on the mailing lists.

BTW, I will be presenting a session on Scalaz at Scala eXchange [3] next week.

-jason

[1] http://scalaz.org
[2] http://code.google.com/p/scalaz/wiki/Scalaz6
[3] http://skillsmatter.com/event/scala/scala-exchange-2011

--
You received this message because you are subscribed to the Google Groups "scalaz" group.
To post to this group, send email to scalaz@googlegroups.com.
To unsubscribe from this group, send email to 2Bunsubscribe [at] googlegroups [dot] com" rel="nofollow">scalaz+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scalaz?hl=en.




--

Heiko SeebergerTwitter: hseeberger
Blog: heikoseeberger.name
Company: Typesafe - Enterprise-Grade Scala from the Experts

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: [scalaz] [ANN] Scalaz 6.0


On 8 June 2011 18:45, Heiko Seeberger <heiko.seeberger@googlemail.com> wrote:
Congrats! Great stuff.What a pity I will miss your talk (Scala eXchange).
Heiko


What! You wont be there?
 


On 8 June 2011 17:34, Jason Zaugg <jzaugg@gmail.com> wrote:
Scalaz [1] is a library for functional programming in Scala,
comprising Type Classes, purely functional data structures, general
purpose algorithms, and a minimal concurrency library.

The Scalaz team is proud to announce the release of Scalaz 6.0, for
Scala 2.8.1 and 2.9.0.1. For details of what's new, and links to the
downloads and API documentation, see the release notes [2].

Thanks to all the contributors for the myriad improvements in this
release; and to the users of the library who have provided feedback
and interesting discussions on the mailing lists.

BTW, I will be presenting a session on Scalaz at Scala eXchange [3] next week.

-jason

[1] http://scalaz.org
[2] http://code.google.com/p/scalaz/wiki/Scalaz6
[3] http://skillsmatter.com/event/scala/scala-exchange-2011

--
You received this message because you are subscribed to the Google Groups "scalaz" group.
To post to this group, send email to scalaz@googlegroups.com.
To unsubscribe from this group, send email to 2Bunsubscribe [at] googlegroups [dot] com" target="_blank" rel="nofollow">scalaz+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/scalaz?hl=en.




--

Heiko SeebergerTwitter: hseeberger
Blog: heikoseeberger.name
Company: Typesafe - Enterprise-Grade Scala from the Experts

Ben Hutchison 3
Joined: 2009-11-02,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On Thu, Jun 9, 2011 at 1:42 AM, Martin S. Weber wrote:
> "Type Classes
> [...]
> A Monoid type class and (so many!) implementations"
>
> Uhm.. Is there any way to see from the scaladoc which implementations Monoid
> has? In other words, I don't want to see the linear supertypes of a
> class/trait in the scaladoc, I want to see its implementations.

Thats a good point. In typeclass-based code, typeclass instances are
close analogs to subclasses in object-oriented code.

Just as Scaladoc lists only "all known subclasses" in a given body of
code, surely it would be possible (in theory) to find and list "all
known typeclass instances" accessible from static/object scopes in
some given code?

-Ben

Ittay Dror 2
Joined: 2010-05-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

A typeclass instance is always a subclass of the typeclass trait. So why
isn't it listed in scaladoc?

Ittay

Ben Hutchison wrote:

> On Thu, Jun 9, 2011 at 1:42 AM, Martin S. Weber wrote:
>> "Type Classes
>> [...]
>> A Monoid type class and (so many!) implementations"
>>
>> Uhm.. Is there any way to see from the scaladoc which implementations Monoid
>> has? In other words, I don't want to see the linear supertypes of a
>> class/trait in the scaladoc, I want to see its implementations.
> Thats a good point. In typeclass-based code, typeclass instances are
> close analogs to subclasses in object-oriented code.
>
> Just as Scaladoc lists only "all known subclasses" in a given body of
> code, surely it would be possible (in theory) to find and list "all
> known typeclass instances" accessible from static/object scopes in
> some given code?
>
> -Ben

Ben Hutchison 3
Joined: 2009-11-02,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On Thu, Jun 9, 2011 at 4:00 PM, Ittay Dror wrote:
> A typeclass instance is always a subclass of the typeclass trait. So why
> isn't it listed in scaladoc?

Yes, it will be listed, but not in the most useful place.

Eg Typeclass Equiv[Foo] is a subclass of Equiv, but so is Equiv[Bar].

But its when you have a Foo that you want to know all instances of
Equiv defined for Foos. Ie From Foo, find any/all Equiv[Foo], and from
Bar, find any/all Equiv[Bar].

-Ben

Ittay Dror 2
Joined: 2010-05-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

I tried seeing all subclasses of Monoid and scaladoc doesn't list any

Ben Hutchison wrote:

> On Thu, Jun 9, 2011 at 4:00 PM, Ittay Dror wrote:
>> A typeclass instance is always a subclass of the typeclass trait. So why
>> isn't it listed in scaladoc?
> Yes, it will be listed, but not in the most useful place.
>
> Eg Typeclass Equiv[Foo] is a subclass of Equiv, but so is Equiv[Bar].
>
> But its when you have a Foo that you want to know all instances of
> Equiv defined for Foos. Ie From Foo, find any/all Equiv[Foo], and from
> Bar, find any/all Equiv[Bar].
>
> -Ben

Tony Morris 2
Joined: 2009-03-20,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On 09/06/11 17:03, Ittay Dror wrote:
> I tried seeing all subclasses of Monoid and scaladoc doesn't list any
>
> Ben Hutchison wrote:
>
>> On Thu, Jun 9, 2011 at 4:00 PM, Ittay Dror wrote:
>>> A typeclass instance is always a subclass of the typeclass trait. So
>>> why
>>> isn't it listed in scaladoc?
>> Yes, it will be listed, but not in the most useful place.
>>
>> Eg Typeclass Equiv[Foo] is a subclass of Equiv, but so is Equiv[Bar].
>>
>> But its when you have a Foo that you want to know all instances of
>> Equiv defined for Foos. Ie From Foo, find any/all Equiv[Foo], and from
>> Bar, find any/all Equiv[Bar].
>>
>> -Ben
Consider:

implicit def x[a]: Monoid[List[A]] = new Monoid[List[A]] {
...
}

You're never going to see this "subclass" of Monoid, but you could come
to know that there exists an implicit value of the type Monoid[List] in
scope. One way to do this would be, at the REPL >
implicitly[Monoid[List[A]] // does this type-check?

It would be nice to know from where the implicit came from and I suppose
that is what -Xlog-implicits is for.

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: [ANN] Scalaz 6.0 || scaladoc

On Thu, Jun 9, 2011 at 9:06 AM, Tony Morris wrote:
> It would be nice to know from where the implicit came from and I suppose
> that is what -Xlog-implicits is for.

I use:

scala -Xprint:typer -e 'implicitly[Monoid[List[String]]'

REPL integration for this would be outstanding.

-jason

Ittay Dror 2
Joined: 2010-05-05,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

Tony Morris wrote:

> On 09/06/11 17:03, Ittay Dror wrote:
>> I tried seeing all subclasses of Monoid and scaladoc doesn't list any
>>
>> Ben Hutchison wrote:
>>
>>> On Thu, Jun 9, 2011 at 4:00 PM, Ittay Dror wrote:
>>>> A typeclass instance is always a subclass of the typeclass trait. So
>>>> why
>>>> isn't it listed in scaladoc?
>>> Yes, it will be listed, but not in the most useful place.
>>>
>>> Eg Typeclass Equiv[Foo] is a subclass of Equiv, but so is Equiv[Bar].
>>>
>>> But its when you have a Foo that you want to know all instances of
>>> Equiv defined for Foos. Ie From Foo, find any/all Equiv[Foo], and from
>>> Bar, find any/all Equiv[Bar].
>>>
>>> -Ben
> Consider:
>
> implicit def x[a]: Monoid[List[A]] = new Monoid[List[A]] {
> ...
> }
Doesn't this mean there's an anonymous subclass of Monoid?

Maybe I assumed wrongly that scaladoc does things different than
javadoc. If so, perhaps it can be modified to use the presentation
compiler. Then it could get all subclasses of a class and maybe also
instances for context bounds.

Ittay

> You're never going to see this "subclass" of Monoid, but you could come
> to know that there exists an implicit value of the type Monoid[List] in
> scope. One way to do this would be, at the REPL>
> implicitly[Monoid[List[A]] // does this type-check?
>
> It would be nice to know from where the implicit came from and I suppose
> that is what -Xlog-implicits is for.
>
>

Kevin Wright 2
Joined: 2010-05-30,
User offline. Last seen 26 weeks 4 days ago.
Re: [ANN] Scalaz 6.0 || scaladoc


On 9 June 2011 09:51, Ittay Dror <ittay.dror@gmail.com> wrote:


Tony Morris wrote:

On 09/06/11 17:03, Ittay Dror wrote:
I tried seeing all subclasses of Monoid and scaladoc doesn't list any

Ben Hutchison wrote:

On Thu, Jun 9, 2011 at 4:00 PM, Ittay Dror<ittay.dror@gmail.com>   wrote:
A typeclass instance is always a subclass of the typeclass trait. So
why
isn't it listed in scaladoc?
Yes, it will be listed, but not in the most useful place.

Eg Typeclass Equiv[Foo] is a subclass of Equiv, but so is Equiv[Bar].

But its when you have a Foo that you want to know all instances of
Equiv defined for Foos. Ie From Foo, find any/all Equiv[Foo], and from
Bar, find any/all Equiv[Bar].

-Ben
Consider:

implicit def x[a]: Monoid[List[A]] = new Monoid[List[A]] {
    ...
}
Doesn't this mean there's an anonymous subclass of Monoid?

Maybe I assumed wrongly that scaladoc does things different than javadoc. If so, perhaps it can be modified to use the presentation compiler. Then it could get all subclasses of a class and maybe also instances for context bounds.


Oh yes... The ability to show anonymous subclasses in Scaladoc would be amazingly useful.
 
Ittay

You're never going to see this "subclass" of Monoid, but you could come
to know that there exists an implicit value of the type Monoid[List] in
scope. One way to do this would be, at the REPL>
implicitly[Monoid[List[A]] // does this type-check?

It would be nice to know from where the implicit came from and I suppose
that is what -Xlog-implicits is for.





--
Kevin Wright

gtalk / msn : kev.lee.wright@gmail.comkev.lee.wright@gmail.commail: kevin.wright@scalatechnology.com
vibe / skype: kev.lee.wrightquora: http://www.quora.com/Kevin-Wright
twitter: @thecoda

"My point today is that, if we wish to count lines of code, we should not regard them as "lines produced" but as "lines spent": the current conventional wisdom is so foolish as to book that count on the wrong side of the ledger" ~ Dijkstra
Matthew Pocock 3
Joined: 2010-07-30,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc
Consider:

implicit def x[a]: Monoid[List[A]] = new Monoid[List[A]] {
    ...
}
Doesn't this mean there's an anonymous subclass of Monoid?


An interesting more general case would be:
implicit def x[A, X[_]](implicit ma: Monoid[A]): Monoid[X[A]]  = new Monoid[X[A]] { ... }
for some restricted X.
I'm not sure how you would document this, or even where, in the scaladoc/javadoc paradigm. Perhaps on Monoid, or the restriction of X. I'm not sure how this could be even tackled without something like a scala hoogle integrated with the scaladoc.
Matthew
--
Matthew Pocockmailto: turingatemyhamster@gmail.comgchat: turingatemyhamster@gmail.com msn: matthew_pocock@yahoo.co.ukirc.freenode.net: drdozer(0191) 2566550
Ben Hutchison 3
Joined: 2009-11-02,
User offline. Last seen 42 years 45 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

Some clarification & elaboration follows...

On Thu, Jun 9, 2011 at 2:42 PM, Ben Hutchison wrote:
In typeclass-based code, typeclass instances are
> close analogs to subclasses in object-oriented code.

The above statement was penned in haste and contains an error: rather,
typeclass instances are
analogs to *superclasses* (or mixin traits) in object-oriented code.

For example, if I have an instance Monoid[Foo], there is an
(imperfect) analogy to mixing in a Monoid trait to my Foo class in the
OO- style of composition. I.e. In both cases, I can operate upon over
Foo using the operations defined by Monoid.

>
> Just as Scaladoc lists only "all known subclasses" in a given body of
> code, surely it would be possible (in theory) to find and list "all
> known typeclass instances" accessible from static/object scopes in
> some given code?

As it was probably unclear, by "static/object scope" above, I meant
"global scope". Ie typeclass instances defined in scala objects, and
thus accessible without being in any particular sub-context.

Anyway, on consideration, I think the problem of documenting
typeclasses is rather different to subclasses. Typeclasses are
available within some context or scope, whereas a subclass is always a
subclass regardless of scope. When one asks "what typeclasses are
defined?", the question is posed relative to a location in code, as
its affected by current package, imports and enclosing expressions.

This means, in terms of Scaladoc, that we cant give /one/ complete
answer to what typeclasses are available for a given type, as the
answer varies from line to line in the code. Probably though,
reporting all those importable from a global scope would still be very
useful.

-Ben

DaveScala
Joined: 2011-03-18,
User offline. Last seen 1 year 21 weeks ago.
Re: [ANN] Scalaz 6.0 || scaladoc

Great library. I also like the support for math symbols although REPL
and the Windows 7 Console is not displaying them well.
In the REPL I have for the "kleisli" (star symbol ☆) a question mark
(?) and in the Windows console when I copy this utf-8 character it
looks like a small square.
This also happens with the "any" (∃) symbol. I know there is an issue
with Windows displaying certain utf-8 characters well, but is it
possible to make the REPL display them right? The displayed question
mark in the REPL is accepted by the REPL so it is just a displaying
thing.

package kleisli2
import scalaz._
import scalaz.Scalaz._

object Main extends App {

val f = ☆((n: Int) => if (n % 2 == 0) None else Some((n +
1).toString))
val g = ☆((s: String) => if (List(3, 7) ∃ (_ == s.length)) None
else Some("[" + s + "]"))
val h = ☆((s: String) => if (s == "[8]") None else Some("<" + s +
">"))

// Kleisli composition
(List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map (f >=> g >=> h
apply _)) assert_=== List(None, None, None, None, None, None, None,
Some("<[1000]>"), None)

println((List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map (f >=>
g >=> h apply _)))
println((List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map ((f
>=> g) >=> h apply _)))
println((List(7, 78, 98, 99, 100, 102, 998, 999, 10000) map (f >=>
(g >=> h) apply _)))
println("should all be equal")
println("List(None, None, None, None, None, None, None,
Some(<[1000]>), None)")
}

Jason Zaugg
Joined: 2009-05-18,
User offline. Last seen 38 weeks 5 days ago.
Re: Re: [ANN] Scalaz 6.0 || scaladoc

On Thu, Jun 9, 2011 at 2:16 PM, Dave wrote:
> Great library. I also like the support for math symbols although REPL
> and the Windows 7 Console is not displaying them well.

I've never had any luck using non-ASCII characters in Windows XP
console, or java terminal programs launched within.

-jason

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland