Name | Project | |
---|---|---|
Paolo | antonio.mateo@47deg.com | @AntonioMateoGomez |
Juan Carlos GarcĂa Ruiz | jcgbuzon@gmail.com | @JCGhub |
Javier Osuna Herrera | javier.osunaherrera@gmail.com | @javosuher |
Carlos Gallardo Polanco | carlosgallardopolanco@gmail.com | @gpcarlos |
David Corral | david.corral@uca.es | @DavidCorral94 |
Ana GĂłmez | angoglez@gmail.com | angoglez |
Jose Gutiérrez | gutiory@gmail.com | @gutiory |
Juan de la Cruz GarcĂa | jcruzgar@gmail.com | jdlcgarcia |
Daniel Peralta | dani.peralta.de@gmail.com | @DaniPeralta |
Ignacio González Sainz | ignacio.glez.s@gmail.com | @ignaciogs |
JosĂ© JoaquĂn Arias GĂłmez-Calcerrada | tatinarias@hotmail.com | @empiremay |
Hi all!
If you have received this email is because you have been selected to attend the first sponsored Scala Training by 47Degrees Academy. So, congratulations for that.
As you probably know, the entire course will actually be just six intensive sessions, so we expect you all to be fully motivated and ready to learn a huge of passionating concepts.
The content:
- Mon. 28th May: Environment, SBT, Scala.
- Wed. 30th May: Scala - Stdlib.
- Fri. 1st June: FP Principles: Semigroup, Monoid, Applicative, Monad.
- Mon. 4th June: REST API - Http4s + Circe.
- Wed. 6th June: DB Doobie Postgres - Concepts. Relational DB, NoSQL.
- Fri. 8th June: Project - Testing + altogether + Deployment.
What do we expect from you guys, during this course?
- Just motivation, commitment, and happiness.
What do we expect from you to have ready next Monday?
- SBT (Scala Build Tool) installed
- IntelliJ IDEA Community installed:
- A valid GitHub account.
How is the course to work?
Well, it's our first edition and probably we will learn along with you all. We are not an actual academy, we are consultants, so we want to teach you how a real project works. That means that we won't pay attention just to the code exclusively, but also we'll focus the course on the methodology as well. If we use strict version-control procedures, English communication, agile methodologies for planning, etc. why don't to take all these valuable capabilities into account in a training?
So next Monday I will extend more information about all these details, but in summary, you will have your own repository where the advances need to be merged through Pull Request with its valid code review, we will use Slack to communicate each other (in English), etc.
That's all for now.
We start with the basic Scala Hello World:
sbt new scala/scala-seed.g8
We can name the app as my-tasks
:
A minimal Scala project.
name [Scala Seed Project]: my-tasks
Template applied in ./my-tasks
After creating a new public repository in GitHub, we can:
cd my-tasks
git init
git add *
git commit -m "first commit"
git remote add origin git@github.com:<org>/<repo>.git
git push -u origin master
Run:
sbt run
We'll have [info] Running example.Hello
and hello
as result.
We can even run the tests:
sbt test
...
[info] HelloSpec:
[info] The Hello object
[info] - should say hello
[info] Run completed in 882 milliseconds.
[info] Total number of tests run: 1
[info] Suites: completed 1, aborted 0
[info] Tests: succeeded 1, failed 0, canceled 0, ignored 0, pending 0
[info] All tests passed.
Let's invite other team-mate to collaborate (and the teacher as well).
Requirements:
- Install Java 8
- Install plugin in IntelliJ: SBT
Open IntelliJ IDEA and add the project. Explain some concepts:
- Sbt shell
- Running tests in IntelliJ
- Version Control
- Add .gitignore
- Issues
- Branches naming convention
- PR specs
Create new package called exercises
.
Road map:
- Types: Classes, Objects, Case classes, Traits, Tuples, Literals and Option
- Collections: List, Maps, Sets, Ranges, Sequences, Array, Iterables, Traversable
- Statements: Pattern Matching, For-expression, Implicit.
- Functions: Higher Order Functions, Partially Applied Functions, Partial Functions, Infix/Postfix Operation, Byname Parameters, Repeated Params.
Create a new package called types
in exercises
(also in test).
- Create new object called
classes
inexercises.types
- Create a new suite called
ClassesSpec
intest.exercises.types
- Commit
- Create new object called
objects
inexercises.types
- Create a new suite called
ObjectsSpec
intest.exercises.types
- Commit
- Create new object called
caseclasses
inexercises.types
- Create a new suite called
CaseClassesSpec
intest.exercises.types
- Commit
- Create new object called
traits
inexercises.types
- Create a new suite called
TraitsSpec
intest.exercises.types
- Commit
- Create a new suite called
TuplesSpec
intest.exercises.types
- Commit
- Create a new suite called
LiteralsSpec
intest.exercises.types
- Commit
- Create new object called
options
inexercises.types
- Create a new suite called
OptionsSpec
intest.exercises.types
- Commit
Create a new package called collections
in exercises
(also in test).
- Create new object called
lists
inexercises.collections
- Create a new suite called
ListsSpec
intest.exercises.collections
- Commit
- Create a new suite called
MapsSpec
intest.exercises.collections
- Commit
- Create a new suite called
SetsSpec
intest.exercises.collections
- Commit
- Create a new suite called
RangesSpec
intest.exercises.collections
- Commit
- Create a new suite called
SequencesSpec
intest.exercises.collections
- Commit
- Create a new suite called
IterablesSpec
intest.exercises.collections
- Commit
- Create a new suite called
TraversablesSpec
intest.exercises.collections
- Commit
Create a new package called statements
in exercises
(only in test).
- Create a new suite called
PatternMatchingSpec
intest.exercises.statements
- Commit
- Create a new suite called
ForExpressionsSpec
intest.exercises.statements
- Commit
- Create a new suite called
ImplicitsSpec
intest.exercises.statements
- Commit
Create a new package called functions
in exercises
(only in test).
- Create a new suite called
HighOrderFunctionsSpec
intest.exercises.functions
- Commit
- Create a new suite called
PartiallyAppliedFunctionsSpec
intest.exercises.functions
- Commit
- Create a new suite called
PartialFunctionsSpec
intest.exercises.functions
- Commit
- Create a new suite called
InfixPrefixandPostfixOperatorsSpec
intest.exercises.functions
- Commit
- Create a new suite called
ByNameParameterSpec
intest.exercises.functions
- Commit
- Create new object called
RepeatedParametersHelper
inexercises.functions
- Create a new suite called
RepeatedParametersSpec
intest.exercises.functions
- Commit
- Exposed the problem: Ignoring side effects
- Created the Maybe date type to wrap non existing values
- We need to be able to combine
- Added the Combinator typeclass.
- Added its instances for
Int
andMaybe
- Added its implicits instances
- And some syntax
- Exposed another problem: We need to handle the content
- Added the Transformer typeclass.
- Added its instances for
Maybe
- Added its implicits instances
- And some syntax
- Exposed another problem: We need to lift values
- Exposed another problem: We need to compute operations sequentially
- Shown the same solution using:
scala.Option
instead ofMaybe
Some
instead ofYes
None
instead ofNo
cats.Semigroup
instead ofCombinator
cats.Functor
instead ofTransformer
cats.Applicative
instead ofLifter
cats.Monad
instead ofFlattener