Skip to content

Commit 7a1e26c

Browse files
authored
Merge pull request #1851 from BalmungSan/patch-1
2 parents 00d459f + 712018e commit 7a1e26c

File tree

1 file changed

+32
-25
lines changed

1 file changed

+32
-25
lines changed

_overviews/FAQ/index.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ over again in Scala chat rooms and forums.
2222

2323
### Where can I ask Scala questions?
2424

25-
see our [Community page](https://scala-lang.org/community/)
25+
See our [Community page](https://scala-lang.org/community/).
2626

2727
### Should I learn Scala 2, or Scala 3?
2828

@@ -73,31 +73,37 @@ answers here, I think it's better to provide only short answers and
7373
links. if something needs more space to explain, there should be
7474
official documentation that addresses it, not just an FAQ answer -->
7575

76-
[answer]({{ site.baseurl }}/tutorials/FAQ/initialization-order.html)
76+
See [this]({{ site.baseurl }}/tutorials/FAQ/initialization-order.html).
7777

7878
### Which type of collection should I choose?
7979

80-
see the [Scala 2.13 Collections Guide](https://docs.scala-lang.org/overviews/collections-2.13/introduction.html)
80+
See the [Scala 2.13 Collections Guide](https://docs.scala-lang.org/overviews/collections-2.13/introduction.html).
8181

8282
### What are context bounds (`[T : Foo]`)?
8383

84-
[answer on Stack Overflow](https://stackoverflow.com/a/4467012)
84+
It's syntactic sugar for an `implicit` parameter of type `Foo[T]`.
8585

86-
### How does `yield` work?
86+
More details in this [Stack Overflow answer](https://stackoverflow.com/a/4467012).
8787

88-
[answer on Stack Overflow](https://stackoverflow.com/a/1059501)
88+
### How does `for / yield` work?
89+
90+
It is syntactic sugar for nested `map`, `flatMap`, and `withFilter` calls.
91+
92+
For an in-depth explanation
93+
see this [Stack Overflow answer](https://stackoverflow.com/a/1059501).
8994

9095
### What is the difference between view, stream and iterator?
9196

92-
[answer on Stack Overflow](https://stackoverflow.com/a/5159356)
97+
[Answer on Stack Overflow](https://stackoverflow.com/a/5159356).
9398

9499
### Can I chain or nest implicit conversions?
95100

96-
[answer on Stack Overflow](https://stackoverflow.com/a/5332804)
101+
Not really, but you can [make it work](https://stackoverflow.com/a/5332804).
102+
But note that implicit conversions are, in general, discouraged.
97103

98104
### Where does Scala look for implicits?
99105

100-
[answer on Stack Overflow](https://stackoverflow.com/a/5598107)
106+
See this [answer on Stack Overflow](https://stackoverflow.com/a/5598107).
101107

102108
### Why do primitive type parameters erase to `Object`?
103109

@@ -106,8 +112,8 @@ So for example, a `List[Int]` in Scala code will appear to Java as a
106112
appear as type parameters, but couldn't they appear as their boxed
107113
equivalents, such as `List[java.lang.Integer]`?
108114

109-
One would hope so, but doing it that way was tried and it proved
110-
impossible. [This SO question](https://stackoverflow.com/questions/11167430/why-are-primitive-types-such-as-int-erased-to-object-in-scala)
115+
One would hope so, but doing it that way was tried and it proved impossible.
116+
[This SO question](https://stackoverflow.com/questions/11167430/why-are-primitive-types-such-as-int-erased-to-object-in-scala)
111117
sadly lacks a concise explanation, but it does link to past discussions.
112118

113119
### What's the difference between methods and functions?
@@ -120,9 +126,9 @@ differ from a function value such as:
120126

121127
val square: Int => Int = x => x * x
122128

123-
[complete answer on Stack Overflow](https://stackoverflow.com/a/2530007/4111404)
129+
[Complete answer on Stack Overflow](https://stackoverflow.com/a/2530007/4111404).
124130

125-
[summary with practical differences](https://tpolecat.github.io/2014/06/09/methods-functions.html)
131+
[Summary with practical differences](https://tpolecat.github.io/2014/06/09/methods-functions.html).
126132

127133
### What's the difference between types and classes?
128134

@@ -133,33 +139,34 @@ Classes are primarily a runtime concept and are platform-dependent.
133139
At runtime on the JVM, every value is either a primitive value
134140
or an instance of exactly one class.
135141

136-
Some type information exists only at compile time, for multiple
137-
reasons, most notoriously [type
138-
erasure](https://en.wikipedia.org/wiki/Type_erasure).
142+
Some type information exists only at compile time,
143+
for multiple reasons, most notoriously
144+
[type erasure](https://en.wikipedia.org/wiki/Type_erasure).
139145

140146
For an in-depth treatment of types vs. classes, see the blog post
141147
["There are more types than classes"](https://typelevel.org/blog/2017/02/13/more-types-than-classes.html).
142148

143149
### How can a method in a superclass return a value of the “current” type?
144150

145-
Possible solutions include F-bounded polymorphism (familiar to Java programmers),
146-
type members, and the typeclass pattern.
147-
148-
[discussion of alternatives on Stack Overflow](https://stackoverflow.com/questions/59813323/advantages-of-f-bounded-polymorphism-over-typeclass-for-return-current-type-prob)
151+
Possible solutions include F-bounded polymorphism
152+
_(familiar to Java programmers)_, type members,
153+
and the [typeclass pattern](http://tpolecat.github.io/2013/10/12/typeclass.html).
149154

150-
[blog post](http://tpolecat.github.io/2015/04/29/f-bounds.html) arguing against F-bounds and in favor of typeclasses.
155+
This [blog post](http://tpolecat.github.io/2015/04/29/f-bounds.html)
156+
argues against F-bounds and in favor of typeclasses;
157+
see also [this Stack Overflow post](https://stackoverflow.com/questions/59813323/advantages-of-f-bounded-polymorphism-over-typeclass-for-return-current-type-prob) for some counterpoint.
151158

152159
### What does `<:<` mean?
153160

154161
It's a "type constraint", and it comes from the standard library,
155-
not from the language itself. See [this blog
156-
post](https://blog.bruchez.name/2015/11/generalized-type-constraints-in-scala.html).
162+
not from the language itself.
163+
See [this blog post](https://blog.bruchez.name/2015/11/generalized-type-constraints-in-scala.html).
157164

158165
### I dislike requiring callers to wrap optional arguments in `Some(...)`; is there a better way?
159166

160167
Not really. See [this answer on Stack Overflow](https://stackoverflow.com/a/65256691/4111404).
161168

162169
### Why is `implicit val` usually recommended over `implicit object`?
163170

164-
The latter has a singleton type, which is too specific. See [answer on Stack
165-
Overflow](https://stackoverflow.com/a/65258340/4111404).
171+
The latter has a singleton type, which is too specific.
172+
See [answer on Stack Overflow](https://stackoverflow.com/a/65258340/4111404).

0 commit comments

Comments
 (0)