Coder Social home page Coder Social logo

cats-monads's Introduction

Essential Scala Code

Sandbox project for the exercises in the book Scala with Cats. Based on the cats-seed.g8 template by Underscore.

Copyright Omar Ahmed. Licensed CC0 1.0.

Gitter

Getting Started

You will need to have Git, Java 8, and SBT installed. You will also need an internet connection to run the exercises. All other dependencies are either included with the repo or downloaded on demand during compilation.

Start SBT using the sbt command to enter SBT's interactive mode (> prompt):

$ sbt
[info] Loading global plugins from <DIRECTORY>
[info] Loading project definition from <DIRECTORY>
[info] Set current project to <PROJECT_NAME>

>

From the SBT prompt you can run the code in Main.scala:

> run
[info] Updating {file:<DIRECTORY>}cats-sandbox...
[info] Resolving jline#jline;2.14.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to <DIRECTORY>...
[info] Running sandbox.Main
Hello Cats!
[success]

You can also start a Scala console (scala> prompt) to play with small snippets of code:

> console
[info] Starting scala interpreter...
[info]
Welcome to Scala 2.12.3 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_112).
Type in expressions for evaluation. Or try :help.

scala> import cats._, cats.implicits._, cats.data._
import cats._
import cats.implicits._
import cats.data._

scala> "Hello " |+| "Cats!"
res0: String = Hello Cats!

scala>

Press Ctrl+D to quit the Scala console and return to SBT interactive mode.

Press Ctrl+D again to quit SBT interactive mode and return to your shell.

Notes on Editors and IDEs

If you don't have a particular preference for a Scala editor or IDE, we strongly recommend you do the exercises for this course using the Atom editor and a Linux or OS X terminal. See the instructions below to get started.

If you want to use Scala IDE for Eclipse, we recommend using sbteclipse. Follow the instructions on the sbteclipse web page to install it as a global SBT plugin.

If you want to use IntelliJ IDEA, follow the instructions for Importing an SBT Project in the IntelliJ online documentation.

Asking Questions

If you want to discuss the content or exercises with the authors, join us in our chat room on Gitter.

cats-monads

cats-monads's People

Contributors

nebtrx avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.