twitter / effectivescala Goto Github PK
View Code? Open in Web Editor NEWTwitter's Effective Scala Guide
Home Page: https://twitter.github.io/effectivescala
License: Other
Twitter's Effective Scala Guide
Home Page: https://twitter.github.io/effectivescala
License: Other
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
For web, specify your OS and browser version. For mobile, specify device, OS
and version. For libraries, what version of build tools are you using?
Additional context
Add any other context about the problem here.
---In this function:
def collect(results: List[Result] = Nil): Future[List[Result]]
---this line:
result :: results
---should be
Future.successful(result :: results)
in order to match function parameter type of Future.flatMap
Damn ClearType doesn't let me read Inconsolata on Windows 7 properly.
See what I mean? Could you use another font for the code? This would be a great.
Some suggestions:
There is no Spanish translation.
---this line:
collect() onSuccess { results =>
---should read
collect() onSuccess { case results =>
I would like to help Korean translation of the document.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Environment
For web, specify your OS and browser version. For mobile, specify device, OS
and version. For libraries, what version of build tools are you using?
Additional context
Add any other context about the problem here.
I found this snippet in the page
val chars = 'a' to 'z'
val perms = chars flatMap { a =>
chars flatMap { b =>
if (a != b) Seq("%c%c".format(a, b))
else Seq()
}
}
Could you expand on the legibility of the if
and else
as one-liners?
The github linguist thinks that your .mo files are written in the language Modelica,
see github-linguist/linguist#2486
This could be fixed in two ways: you could change the extension from .mo to something else or you could add a .gitattributes
file containing following line:
*.mo linguist-language=Markdown
If you want, I can send a Pull Request.
In the section about private[this]
, the example code for private
has the variable name x
, while the example for private[this]
omits it, so it is slightly inconsistent and sort of a compile error? Will attach a pull request.
Link to the section: http://twitter.github.io/effectivescala/#Object+oriented+programming-Visibility
Hi, I forked this and I was trying to build it on mac (OSX Yosemite). After I installed peg-markdown and run 'make' I get the following message: make: Nothing to be done for `all'.
How do I build this?
Thanks!
ImageMagick
make clean
to READMEpublish.sh
and references to pub
from Makefile
as it's defunctWithout imagemagick
installation:
GitHub/effectivescala(master⚡)» make all [16:53:28]
cat effectivescala.mo | bash proc.sh | bash toc.sh | bash fmt.sh | peg-markdown --smart --notes > effectivescala.html
/opt/homebrew/bin/pic2graph: line 102: convert: command not found
/opt/homebrew/bin/pic2graph: warning: falling back to old '-crop 0x0' trim method
/opt/homebrew/bin/pic2graph: line 118: convert: command not found
cat header.html.inc effectivescala.html footer.html.inc > index.html
cat effectivescala-ja.mo | bash proc.sh | bash toc.sh | bash fmt.sh | peg-markdown --smart --notes > effectivescala-ja.html
/opt/homebrew/bin/pic2graph: line 102: convert: command not found
/opt/homebrew/bin/pic2graph: warning: falling back to old '-crop 0x0' trim method
/opt/homebrew/bin/pic2graph: line 118: convert: command not found
cat header-jp.html.inc effectivescala-ja.html footer-jp.html.inc > index-ja.html
cat effectivescala-ru.mo | bash proc.sh | bash toc.sh | bash fmt.sh | peg-markdown --smart --notes > effectivescala-ru.html
/opt/homebrew/bin/pic2graph: line 102: convert: command not found
/opt/homebrew/bin/pic2graph: warning: falling back to old '-crop 0x0' trim method
/opt/homebrew/bin/pic2graph: line 118: convert: command not found
cat header-ru.html.inc effectivescala-ru.html footer-ru.html.inc > index-ru.html
cat effectivescala-cn.mo | bash proc.sh | bash toc.sh | bash fmt.sh | peg-markdown --smart --notes > effectivescala-cn.html
/opt/homebrew/bin/pic2graph: line 102: convert: command not found
/opt/homebrew/bin/pic2graph: warning: falling back to old '-crop 0x0' trim method
/opt/homebrew/bin/pic2graph: line 118: convert: command not found
cat header-cn.html.inc effectivescala-cn.html footer-cn.html.inc > index-cn.html
GitHub/effectivescala(master⚡)» which convert [16:53:30]
convert not found
After brew install imagemagick
GitHub/effectivescala(additional_tips)» which convert [17:11:45]
/opt/homebrew/bin/convert
make pub
errors:
GitHub/effectivescala(master)» make pub [17:08:04]
./publish.sh index.html index-ja.html index-ru.html index-cn.html coll.png
Cloning into '/tmp/effectivescala.27222'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
cp: /tmp/effectivescala.27222 is not a directory
./publish.sh: line 28: cd: /tmp/effectivescala.27222: No such file or directory
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
error: src refspec gh-pages does not match any
error: failed to push some refs to 'https://github.com/twitter/effectivescala.git'
make: *** [pub] Error 1
GitHub/effectivescala(master)» git status
# Effective Scala
This is the repository for the [Effective Scala](https://twitter.github.com/effectivescala/) document.
It is "typeset" in [markdown](https://daringfireball.net/projects/markdown/) using [PEG markdown](https://github.com/jgm/peg-markdown). It also requires the [GNU Troff suite (groff)](https://www.gnu.org/software/groff/) and it requires [ImageMagick](https://imagemagick.org/script/download.php) to use pic2graph convert (https://imagemagick.org/script/convert.php)
## Building
To clean the space:
`make clean`
To render the document:
`make`
or:
`make all`
## Contributing
Want to contribute and improve the guide? Have a bug or a question?
Please create an issue here on GitHub: https://github.com/twitter/effectivescala/issues
## License
Copyright 2012 Twitter, Inc.
Licensed under the CC-BY 3.0: https://creativecommons.org/licenses/by/3.0
I've made a full refactoring of the Functional Programming chapter for the russian readers:
Love. Peace. Scala
Опечатка на странице
http://twitter.github.com/scala_school/ru/index.html
Сопоставление с образцом и функкциональная композиция
In "Object oriented programming" section a link to the cake pattern is outdated now because a post has archived. A new link is http://jonasboner.com/real-world-scala-dependency-injection-di/
When discussing immutable/mutable collections, the package 'scala.collections' is referred to instead of 'scala.collection' - see lines 138, 421 and 423 of effectivescala.mo.
I would like to add a bit more details about the variance in the category "Type and Generics".
Specifically, a rule of thumb for when to use invariance, covariance and contravariance.
I think that the explanation provided for covariance and invariance is great but this section is missing an explanation on contravariance. I would like to contribute to this section and explain how and when to use it.
Qualifiying the names makes is obvious to the reader which variant is being used (e.g. "immutable.Map")
should read
Qualifiying the names makes it obvious to the reader which variant is being used (e.g. "immutable.Map")
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.