Skip to content

Latest commit

 

History

History
19 lines (14 loc) · 939 Bytes

README.md

File metadata and controls

19 lines (14 loc) · 939 Bytes

Description

The most flexible way to implement functor in Scala is to define it as typeclass. 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.

How to Run

First sources should be compiled to .jar file using scalac command:

scalac *.scala -d Functor.jar

Next the examples can be executed by their fully qualified name(either functor.Main1 or functor.Main2):

scala -cp Functor.jar functor.Main1

Another way to run examples is to use build tools like: sbt, gradle or maven

Helpful resources