summaryrefslogtreecommitdiff
path: root/09-implicit-parameters-and-views.md
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@typesafe.com>2014-03-11 17:48:36 -0700
committerAdriaan Moors <adriaan.moors@typesafe.com>2014-03-11 17:48:36 -0700
commit09c957bef7b063353add3c04a9e0568aeed1eb30 (patch)
treefc71567e3e1ec486783c7fdf792080f3a4ca0a73 /09-implicit-parameters-and-views.md
parent9fb82769f4cdc51198a7252e117a2a3828e7b00e (diff)
downloadscala-09c957bef7b063353add3c04a9e0568aeed1eb30.tar.gz
scala-09c957bef7b063353add3c04a9e0568aeed1eb30.tar.bz2
scala-09c957bef7b063353add3c04a9e0568aeed1eb30.zip
github markdown: use ###### for definitions and notes
Diffstat (limited to '09-implicit-parameters-and-views.md')
-rw-r--r--09-implicit-parameters-and-views.md30
1 files changed, 10 insertions, 20 deletions
diff --git a/09-implicit-parameters-and-views.md b/09-implicit-parameters-and-views.md
index e4b8b5956c..a88ebbc069 100644
--- a/09-implicit-parameters-and-views.md
+++ b/09-implicit-parameters-and-views.md
@@ -188,28 +188,19 @@ common element and $T$ is more complex than $U$.
The set of _top-level type constructors_ $\mathit{ttcs}(T)$ of a type $T$ depends on the form of
the type:
-> For a type designator, \
-> $\mathit{ttcs}(p.c) ~=~ \{c\}$; \
-> For a parameterized type, \
-> $\mathit{ttcs}(p.c[\mathit{targs}]) ~=~ \{c\}$; \
-> For a singleton type, \
-> $\mathit{ttcs}(p.type) ~=~ \mathit{ttcs}(T)$, provided $p$ has type $T$;\
-> For a compound type, \
-> `$\mathit{ttcs}(T_1$ with $\ldots$ with $T_n)$` $~=~ \mathit{ttcs}(T_1) \cup \ldots \cup \mathit{ttcs}(T_n)$.
+- For a type designator, $\mathit{ttcs}(p.c) ~=~ \{c\}$;
+- For a parameterized type, $\mathit{ttcs}(p.c[\mathit{targs}]) ~=~ \{c\}$;
+- For a singleton type, $\mathit{ttcs}(p.type) ~=~ \mathit{ttcs}(T)$, provided $p$ has type $T$;
+- For a compound type, `$\mathit{ttcs}(T_1$ with $\ldots$ with $T_n)$` $~=~ \mathit{ttcs}(T_1) \cup \ldots \cup \mathit{ttcs}(T_n)$.
The _complexity_ $\mathit{complexity}(T)$ of a core type is an integer which also depends on the form of
the type:
-> For a type designator, \
-> $\mathit{complexity}(p.c) ~=~ 1 + \mathit{complexity}(p)$ \
-> For a parameterized type, \
-> $\mathit{complexity}(p.c[\mathit{targs}]) ~=~ 1 + \Sigma \mathit{complexity}(\mathit{targs})$ \
-> For a singleton type denoting a package $p$, \
-> $\mathit{complexity}(p.type) ~=~ 0$ \
-> For any other singleton type, \
-> $\mathit{complexity}(p.type) ~=~ 1 + \mathit{complexity}(T)$, provided $p$ has type $T$; \
-> For a compound type, \
-> `$\mathit{complexity}(T_1$ with $\ldots$ with $T_n)$` $= \Sigma\mathit{complexity}(T_i)$
+- For a type designator, $\mathit{complexity}(p.c) ~=~ 1 + \mathit{complexity}(p)$
+- For a parameterized type, $\mathit{complexity}(p.c[\mathit{targs}]) ~=~ 1 + \Sigma \mathit{complexity}(\mathit{targs})$
+- For a singleton type denoting a package $p$, $\mathit{complexity}(p.type) ~=~ 0$
+- For any other singleton type, $\mathit{complexity}(p.type) ~=~ 1 + \mathit{complexity}(T)$, provided $p$ has type $T$;
+- For a compound type, `$\mathit{complexity}(T_1$ with $\ldots$ with $T_n)$` $= \Sigma\mathit{complexity}(T_i)$
###### Example
@@ -257,8 +248,7 @@ defined by an implicit value which has function type
`$S$=>$T$` or `(=>$S$)=>$T$` or by a method convertible to a value of that
type.
-Views are applied in three situations.
-
+Views are applied in three situations:
1. If an expression $e$ is of type $T$, and $T$ does not conform to the
expression's expected type $\mathit{pt}$. In this case an implicit $v$ is