You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The most flexible way to implement functor in Scala is to define it as typeclass.
3
+
Good example of such behaviour is Cats and Scalaz libraries that supply developer with different typeclasses. This libraries include Functor too, but in much more complicated and mature form than in this example.
4
+
5
+
## How to Run
6
+
First sources should be compiled to `.jar` file using `scalac` command:
7
+
> scalac *.scala -d Functor.jar
8
+
9
+
Next the examples can be executed by their fully qualified name(either `functor.Main1` or `functor.Main2`):
10
+
11
+
> scala -cp Functor.jar functor.Main1
12
+
13
+
Another way to run examples is to use build tools like: sbt, gradle or maven
14
+
15
+
## Helpful resources
16
+
*[Functor in Cats](https://typelevel.org/cats/typeclasses/functor.html)
17
+
*[Functor in Scalaz](http://eed3si9n.com/learning-scalaz/Functor.html)
0 commit comments