scalaz

warning: Creating default object from empty value in /opt/bitnami/apps/portal/htdocs/modules/taxonomy/taxonomy.pages.inc on line 34.

learning Scalaz: day 6

in

Hey there. There's an updated html5 book version, if you want.

Yesterday we looked at Monad typeclass, which introduces flatMap. We looked at how monadic chaining can add contexts to values. Because both Option and List already have flatMap in the standard library, it was more about changing the way we see things rather than introducing new code. We also reviewed for syntax as a way of chaining monadic operations.

for syntax again

learning Scalaz: day 5

in

Hey there. There's an updated html5 book version, if you want.

On day 4 we reviewed typeclass laws like Functor laws and used ScalaCheck to validate on arbitrary examples of a typeclass. We also looked at three different ways of using Option as Monoid, and looked at Foldable that can foldMap etc.

A fist full of Monads

We get to start a new chapter today on Learn You a Haskell for Great Good.

learning Scalaz: day 4

in

Hey there. There's an updated html5 book version, if you want.

Yesterday we reviewed kinds and types, explored Tagged type, and started looking at Semigroup and Monoid as a way of abstracting binary operations over various types.

I've gotten a few feedbacks. First, paulp suggested that I could use companion type like Option.type for our kind calculator. Using the updated version, we get the following:

scala> kind[Functor.type]

learning Scalaz: day 3

in

Hey there. There's an updated html5 book version, if you want.

Yesterday we started with Functor, which adds map operator, and ended with polymorphic sequenceA function that uses Pointed[F].point and Applicative ^(f1, f2) {_ :: _} syntax.

Kinds and some type-foo

learning Scalaz: day 2

in

Hey there. There's an updated html5 book version, if you want.

Yesterday we reviewed a few basic typeclasses from Scalaz like Equal by using Learn You a Haskell for Great Good as the guide. We also created our own CanTruthy typeclass.

Functor

LYAHFGG:

And now, we're going to take a look at the Functor typeclass, which is basically for things that can be mapped over.

learning Scalaz: day 1

in

Hey there. There's an updated html5 book version, if you want.

How many programming languages have been called Lisp in sheep's clothing? Java brought in GC to familiar C++ like grammar. Although there have been other languages with GC, in 1996 it felt like a big deal because it promised to become a viable alternative to C++. Eventually, people got used to not having to manage memory by hand. JavaScript and Ruby both have been called Lisp in sheep's clothing for their first-class functions and block syntax. The homoiconic nature of S-expression still makes Lisp-like languages interesting as it fits well to macros.

Recently languages are borrowing concepts from newer breed of functional languages. Type inference and pattern matching I am guessing goes back to ML. Eventually people will come to expect these features too. Given that Lisp came out in 1958 and ML in 1973, it seems to take decades for good ideas to catch on. For those cold decades, these languages were probably considered heretical or worse "not serious."

Looking back to our Scala community, it pains me to see people jeering at Scalaz. I'm not saying it's going to be the next big thing. I don't even know about it yet. But one thing for sure is that guys using it are serious about solving their problems. Or just as pedantic as the rest of the Scala community using pattern matching. Given that Haskell came out in 1990, the witch hunt may last a while, but I am going to keep an open mind.

Syndicate content