Skip to content

Commit 5301689

Browse files
author
wqlin
committed
🎉🎉🎉 Finish Chinese translation
0 parents  commit 5301689

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+23868
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
_site
2+
*.iml
3+
_cache
4+
.idea

CONTRIBUTING.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
如何贡献?
2+
========
3+
4+
这很简单?
5+
6+
你可以选择在 github 上开一个 issue,写下你想要添加或者改变的(或者想要更深入讨论的)。或者你可以马上创建一个 pull request 记录你的修改建议。
7+
8+
9+
在提交之前请确保这个项目可以正常编译!你可以通过允许 `make` 命令编译这个项目。
10+
如果你想了解更多有关这个文档使用的语言和工具(asciidoctor),请阅读下一小节。
11+
12+
PS: 请_不_要将 `index.html` 包含在你的 pull requests 中,因为当你的 pull request 被接受后它会 *.adoc 文件自动生成。:-)
13+
14+
我应该安装什么软件才能贡献
15+
=========================
16+
17+
* Ruby >= 1.9.3
18+
* bundle (通过 `gem install bundler` 安装)
19+
* Make
20+
* Asciidoctor (通过 `bundle install` 安装)
21+
22+
asciidoctor 的语法是什么?
23+
==================================
24+
请使用这个语法参考网站:http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
25+
26+
27+
我如何能构建 index.html?
28+
==========================
29+
30+
这篇文档使用了一个叫做 "ASCIIDoctor" 的 ASCIIDoc - 这是他们的网站:
31+
http://asciidoctor.org/
32+
33+
简单来说,它和 markdown 非常类似,所以你只要看看文件就可以用直觉理解了;-)
34+
35+
要构建这篇文档,你可以:
36+
37+
```
38+
cd scala-types-of-types
39+
40+
bundle install
41+
make
42+
```
43+
44+
这就可以了。这会产生所有的目标文件。
45+
46+
许可
47+
=========
48+
49+
通过贡献文本/项目/图片/任何东西到这个项目,表示你同意这个仓库的许可(creative commons),详情请查看这个仓库的 LICENSE 文件。

Gemfile

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
source 'https://rubygems.org'
2+
gem 'asciidoctor'
3+
gem 'pygments.rb'

Gemfile.lock

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
asciidoctor (0.1.4)
5+
posix-spawn (0.3.6)
6+
pygments.rb (0.5.2)
7+
posix-spawn (~> 0.3.6)
8+
yajl-ruby (~> 1.1.0)
9+
yajl-ruby (1.1.0)
10+
11+
PLATFORMS
12+
ruby
13+
14+
DEPENDENCIES
15+
asciidoctor
16+
pygments.rb

Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
all:
2+
bundle exec asciidoctor -a linkcss -a stylesheet=foundation.css -a stylesdir=stylesheets index.adoc

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
概述
2+
====
3+
4+
本文是 [wqlin](https://github.com/wqlin) 翻译的 [Scala's types of types](http://ktoso.github.io/scala-types-of-types/) 译文。
5+
6+
7+
Scala 中不同种类的类型
8+
======================
9+
10+
这篇文章旨在用通熟易懂的方式在一篇博文中解释 Scala 中所有与类型相关的东西,这样子你就可以停止讨论"哦,这里还有一篇很棒的关于 ... 类型的博客"。
11+
12+
非常欢迎贡献,请查看 [CONTRIBUTING.md](CONTRIBUTING.md) 了解如何开始。
13+
14+
15+
在线阅读
16+
===========
17+
18+
你可以在线阅读这篇文章: https://wqlin.github.io/scala-types-of-types/
19+
20+
许可
21+
=======
22+
23+
这个仓库的所有内容都基于 **Creative Commons 4.0 BY-SA International License**
24+
所以它看起来像自由软件...但并不是软件。[可在这里阅读完整的许可](http://creativecommons.org/licenses/by-sa/4.0/deed.en)
25+
26+
![Free Cultural Works](http://creativecommons.org/images/deed/seal.png)

TODO

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
------ SERGIO COMMENTS --------
2+
3+
In general
4+
- Consider grouping type types into "big boxes" - is it possible to split types into groups of types?
5+
- I can go tomorrow over the things below.
6+
7+
Page 2
8+
- I think the the use of inferred on the example can be a bit muddied:
9+
"// without Type Annotation, the type is inferred to be `Thing`
10+
val inferred = getThing"
11+
Maybe an example of a different domain?
12+
"trait Dog
13+
def getDog = new Dog
14+
// without Type Annotation, the type of laika is inferred to be `Dog`
15+
val laika = getDog"
16+
17+
- "Related hint: Including Type Annotations speeds up compilation, also it's generally nice to see the return type of a method." -> I would personally put these two ideas in the next paragraph, saying something like "Best practices are ... for ... reasons"
18+
19+
Page 3
20+
- "typesystem" or "type system"?
21+
- Java primitive list is missing char
22+
23+
Page 4
24+
- I really like the style of the example at the beginning of this page, the comments clarly showing what´s going on under the bonnet.
25+
- "This way, by having a smart compiler and treating everything as an object in this common hierarchy we're able to get away from the "but primitives are different" edge-cases, at least at the level of our Scala source code - the compiler takes care of it for us." -> I think this is too hard to read due to length, consider breaking it down. Also, I would say "but primitives are different" sounds a bit whiny, I would remove the "but".
26+
27+
Page 6
28+
- I would talk about calling type with the verbose option before the example, as in "by using :type again on it with the verbose option to get some extra info..."
29+
- Last phrase I would remove the "I" and make the subject of the phrase the example ("This example nicely exemplifies the core functionality...")
30+
31+
Page 7
32+
- Maybe break "Coming back to the subject why the common Type for our if statement with an AnyVal on one code block and a null on the other one was Any and not something else" down into two?
33+
- "obviously" as an adverb is modifying the verb "implemented", which I´m not sure if it´s what you are going for. Maybe substitute for "As it is obvious, since it is..."?
34+
- "How it might look like in your code is explained by the bellow example:" -> I would join with the previous paragraph and revert it: "You can see how the code would look on the below example"
35+
- On type variance, I would try to elaborate a bit more at the beginning - don't make paragraphs with a single line.
36+
37+
Page 8
38+
- "One being "any collection", where we'll use a List[A] as our example, and functions." -> Don´t understand the "and functions" at the end.
39+
- "Scala..., which..., under..." -> I feel this phrase has bad rythm, try not make it a bit more fluid: "Scala has Traits, which in other languages -such as Ruby- are known with the name of Mixins"
40+
- "First..." -> maybe it´s a good idea to explain what a trait is before going on into detail?
41+
42+
Page 9
43+
- "diamond problem" or "The Diamond Problem"
44+
- A reader could ask, why are we not sure? Also, the usage of "Basically" feels colloquial. "Basically "The Diamond Problem" is a situation during multiple inheritance where we're not sure to what we want to refer to."
45+
46+
Page 10
47+
- "This introduces an ambiguity when calling the common method in D , did we inherit the version of the method from C or from B ?" -> Make point of view homogeneous.
48+
- What is "In Scala's case the case with only one overriding method is very simple - the override wins." referring to?
49+
- "always (and deterministically) able to determine what will be called" -> "always able to deterministically identify which method implementation will be called"
50+
- On the examples, I would do away with the asserts, make it more like the previous ones.
51+
52+
Page 11
53+
- "So for example in our case ( D1 ), the superclass of C is B." -> What about poor D2? You could say smthing such as "and viceversa fro D2" to keep symmetry.
54+
55+
Page 12
56+
- "Using this trick the ### definition now suddenly "makes sense!" -> Disagree, have no idea what just happened :P Explain more!
57+
- "Let's now go deeper into the..." -> I would remove the "taking the readers along" metaphor, it is very difficult to maintain on a long and technically deep text.
58+
59+
Page 14
60+
- All text under Type constructor I found difficult to parse.
61+
62+
Page 15
63+
- "used this trick before" -> did we? Link back to section maybe?
64+
65+
Page 16
66+
- "why this us so nice interesting... [example] ...And we can do the" -> you didn´t tell the reader why it was so nice/interesting, something like ¨Look at the type of the parameter..."
67+
- I would join the example for stop to the start one and expand on the case for either (smthing like "What if you need to accept parameters in a subset of states...")
68+
69+
Page 17
70+
- Love the example, but don´t understand "//takes a java.io.File (implements Closeable)"
71+
- "Another fact " -> "An important fact"
72+
- "investitage the generated bytecode for scala (or java) classes, by using :javap in the Scala REPL, so you can check it out yourself." -> "investigate" and remove commas.
73+
74+
Page 18
75+
- Repeated the performance warning, either remove or lampshade/excuse the repeat.
76+
77+
Page 20
78+
- On existential types, I feel the example is difficult to understand on its own, and the explanation expects a lot from the reader.
79+
- "We know though that List is a type constructor, * -> *" -> do we? I would try to expand on this paragraph and make it more accessible.
80+
81+
Page 21
82+
- You said the "M" word! Scary! Is it possible to have a more pedestrian example?
83+
84+
Page 23
85+
- This sounds a bit weird -> "You can try it out (it's copy paste ready) in your Scala 2.10+ REPL - if you don't have one at hand: yeah, the output would be:" -> just say somehting like "The output would be"
86+
87+
Page 24
88+
- "Yeah, you figured it out already I guess." -> Well no, I didn´t...
89+
90+
------- END OF SERGIO COMMENTS -------
91+
92+
----------- BAMBUCZA -------------
93+
Łukasz Dubiel @ 01:06
94+
Nie wiem czy w momencie kiedy tłumaczysz trochę curring nie przydałby się rysunek do tego
95+
brakuje calli przy type projection
96+
tzn pobrałeś wartości do vali
97+
98+
ktoso @ 01:07
99+
hm, jakies defy chcesz tam?
100+
101+
Łukasz Dubiel @ 01:07
102+
wiesz jak wcześniej miałeś, że typy się nie zgadzają to tutaj by już mogły
103+
104+
ktoso @ 01:07
105+
oh ok
106+
107+
----------- END OF BAMBUCZA -------------
108+
109+
------------------ DAN -------------
110+
111+
structurals need more of an intro
112+
113+
----------- END OF DAN -------------
114+
115+
116+
------------- JOSH SECTION --------------
117+
a higher kind is not exactly a type constructor. A type constructor enables higher kinds - in methods for example.
118+
119+
show how List[_] gets desugared into forSome, show also that we can abstract over that value
120+
121+
`type of object` section can be made longer - it's actually how the compiler looks up all the types.
122+
On the object of java.lang#String it looks for String. // projection or path dependent here? actually
123+
124+
Expand section on type level - include >: and <: and those.
125+
------------- END OF JOSH SECTION --------------

_config.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
markdown: redcarpet
2+
redcarpet:
3+
extensions: ["no_intra_emphasis", "fenced_code_blocks", "autolink", "strikethrough", "superscript", "with_toc_data"]
4+
pygments: true
5+
baseurl: /scala-types-of-types

0 commit comments

Comments
 (0)