Skip to main content

All Questions

Tagged with
2 votes
1 answer
560 views

What is the advantage of Option/Maybe Monad over Functor?

I understand the advantage of IO monad and List Monad over Functor, however, I don't understand the advantage of Option/Maybe Monad over Functor. Is that simply the integration of types of the ...
SmoothTraderKen's user avatar
6 votes
3 answers
1k views

How are Functors useful?

We know that any generic type F[_] withmap method, which complies to some laws, is a functor. For instance, List[_], Option[_], and F[A] = Env => A are functors. I am just wondering if this functor ...
Michael's user avatar
  • 42.2k
7 votes
2 answers
974 views

Why is there no "Functor" trait in Scala? [closed]

In Scala, the generic classes such as Future, Option and List all have methods map and flatMap. As I understand, all of them are like Functors in Haskell. I was just wondering why there isn't a ...
Hanfei Sun's user avatar
  • 47.2k
62 votes
3 answers
4k views

Sets, Functors and Eq confusion

A discussion came up at work recently about Sets, which in Scala support the zip method and how this can lead to bugs, e.g. scala> val words = Set("one", "two", "three") scala> words zip (words ...
Chris Taylor's user avatar
  • 47.4k
7 votes
1 answer
800 views

example uses scalaz.Lens's modf, modp and xmap

There are number of great tutorials and posts out there covering the more straightforward of Lens's methods, e.g. Cleaner way to update nested structures; can anyone provide example uses for these ...
Joffer's user avatar
  • 1,939
4 votes
5 answers
478 views

What are the exact applications of Functor, PointedFunctor, ApplicativeFunctor and Monad? [closed]

I have been studying Scala (and Haskell by extension) for some time now and I'm totally captured by their type system and functional paradigm. Quite recently I stumbled upon "Type Level Programming" ...
Ashkan Kh. Nazary's user avatar
7 votes
2 answers
1k views

how to translate Haskell into Scalaz?

One of my high school students and I are going to try to do a port of Haskell's Parsec parser combinator library into Scala. (It has the advantage over Scala's built-in parsing library that you can ...
Todd O'Bryan's user avatar
  • 2,260