https://github.com/funfunfine/scalearn
The project I am learning Scala with.
https://github.com/funfunfine/scalearn
Last synced: about 1 year ago
JSON representation
The project I am learning Scala with.
- Host: GitHub
- URL: https://github.com/funfunfine/scalearn
- Owner: FunFunFine
- Created: 2019-11-15T15:15:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-03T19:18:34.000Z (over 6 years ago)
- Last Synced: 2025-03-02T11:34:29.345Z (over 1 year ago)
- Language: Scala
- Size: 23.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Scala with Cats Code
Sandbox project for the exercises in the book [Scala with Cats][book].
Based on the [cats-seed.g8][cats-seed] template by [Underscore][underscore].
Copyright funfine. Licensed [CC0 1.0][license].
[][gitter]
## Getting Started
You will need to have Git, Java 8, and [SBT][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):
```bash
$ sbt
[info] Loading global plugins from
[info] Loading project definition from
[info] Set current project to
>
```
From the SBT prompt you can run the code in `Main.scala`:
```bash
> run
[info] Updating {file:}cats-sandbox...
[info] Resolving jline#jline;2.14.4 ...
[info] Done updating.
[info] Compiling 1 Scala source to ...
[info] Running sandbox.Main
Hello Cats!
[success]
```
You can also start a *Scala console* (`scala>` prompt)
to play with small snippets of code:
```bash
> 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][atom] editor and a Linux or OS X terminal.
See the instructions below to get started.
If you want to use [Scala IDE][scala-ide] for Eclipse,
we recommend using [sbteclipse][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][intellij-setup]
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][gitter].
[cats-seed]: https://github.com/underscoreio/cats-seed.g8
[underscore]: https://underscore.io
[book]: https://underscore.io/books/advanced-scala
[license]: https://creativecommons.org/publicdomain/zero/1.0/
[sbt]: http://scala-sbt.org
[gitter]: https://gitter.im/underscoreio/scala?utm_source=essential-scala-readme&utm_medium=badge&utm_campaign=essential-scala
[atom]: https://atom.io
[scala-ide]: http://scala-ide.org
[sbteclipse]: https://github.com/typesafehub/sbteclipse
[intellij-idea]: https://www.jetbrains.com/idea
[intellij-setup]: https://www.jetbrains.com/help/idea/2016.1/getting-started-with-sbt.html#import_project