Skip to content

Commit e336086

Browse files
committed
Clean up documentation
1 parent fba6a10 commit e336086

File tree

2 files changed

+18
-29
lines changed

2 files changed

+18
-29
lines changed

doc/libraries_ref_guide/LibDoc/Prelude.tex

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3531,17 +3531,6 @@ \subsubsection{Tuples}
35313531
\end{tabular}
35323532
\end{center}
35333533

3534-
{\bf Examples}
3535-
3536-
\begin{verbatim}
3537-
Tuple2#( Bool, int ) foo = tuple2( True, 25 );
3538-
Bool field1 = tpl_1( foo ); // this is value 1 in the list
3539-
int field2 = tpl_2( foo ); // this is value 2 in the list
3540-
foo = tuple2( !field1, field2 );
3541-
\end{verbatim}
3542-
3543-
\paragraph{TupleSize}
3544-
35453534
\te{TupleSize} provides a way to determine the number of elements in a tuple
35463535
at the type level. The size is represented as a numeric type parameter.
35473536

@@ -3577,8 +3566,6 @@ \subsubsection{Tuples}
35773566
\end{tabular}
35783567
\end{center}
35793568

3580-
\paragraph{AppendTuple}
3581-
35823569
\te{AppendTuple} provides a way to join two tuples of arbitrary size into a single larger
35833570
tuple, and to split a tuple back into two parts.
35843571

@@ -3591,7 +3578,7 @@ \subsubsection{Tuples}
35913578

35923579
\begin{libverbatim}
35933580
typeclass AppendTuple #(type a, type b, type c)
3594-
dependencies (a b determines c);
3581+
dependencies ((a, b) determines c);
35953582
function c appendTuple(a x, b y);
35963583
function Tuple2#(a, b) splitTuple(c x);
35973584
endtypeclass
@@ -3627,6 +3614,11 @@ \subsubsection{Tuples}
36273614
{\bf Examples}
36283615

36293616
\begin{verbatim}
3617+
Tuple2#( Bool, int ) foo = tuple2( True, 25 );
3618+
Bool field1 = tpl_1( foo ); // this is value 1 in the list
3619+
int field2 = tpl_2( foo ); // this is value 2 in the list
3620+
foo = tuple2( !field1, field2 );
3621+
36303622
// Appending a 2-tuple and a 3-tuple to create a 5-tuple
36313623
Tuple2#(Bool, Int#(8)) t1 = tuple2(True, 42);
36323624
Tuple3#(String, Bit#(4), UInt#(16)) t2 = tuple3("test", 4'hA, 100);
@@ -3641,7 +3633,7 @@ \subsubsection{Tuples}
36413633
Tuple2#(Tuple2#(Bool, Int#(8)), Tuple2#(String, Bit#(4))) parts =
36423634
splitTuple(t4);
36433635
3644-
// Appending with unit type
3636+
// Appending with unit type (void)
36453637
Tuple2#(Bool, Int#(8)) t5 = tuple2(False, 0);
36463638
Tuple2#(Bool, Int#(8)) t6 = appendTuple(t5, ?); // same as t5
36473639
Tuple2#(Bool, Int#(8)) t7 = appendTuple(?, t5); // same as t5

doc/libraries_ref_guide/LibDoc/Vector.tex

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2273,8 +2273,6 @@ \subsubsection{Converting to and from Vectors}
22732273
\hline
22742274
\end{tabular}
22752275
2276-
\paragraph{ConcatTuple}
2277-
22782276
The \te{ConcatTuple} type class provides functions to convert between a Vector
22792277
of tuples and a single flattened tuple. When you have a Vector where each
22802278
element is a tuple (or can be viewed as a tuple), \te{concatTuple} flattens
@@ -2291,7 +2289,7 @@ \subsubsection{Converting to and from Vectors}
22912289
22922290
\begin{libverbatim}
22932291
typeclass ConcatTuple #(numeric type n, type a, type b)
2294-
dependencies (n a determines b);
2292+
dependencies ((n, a) determines b);
22952293
function b concatTuple(Vector#(n, a) v);
22962294
function Vector#(n, a) unconcatTuple(b x);
22972295
endtypeclass
@@ -2301,7 +2299,7 @@ \subsubsection{Converting to and from Vectors}
23012299
\begin{itemize}
23022300
\item A vector of size 0 converts to/from the unit type \te{void}
23032301
\item A vector of size 1 converts to/from a single element
2304-
\item Larger vectors convert by flattening: each element is appended to
2302+
\item Larger vectors convert by appending each element tuple to
23052303
form a larger tuple
23062304
\end{itemize}
23072305
@@ -2330,7 +2328,15 @@ \subsubsection{Converting to and from Vectors}
23302328
\hline
23312329
\end{tabular}
23322330
2333-
{\bf Example - ConcatTuple}
2331+
{\bf Examples - Lists}
2332+
2333+
Convert the vector \te{my\_vector} to a list named \te{my\_list}.
2334+
\begin{libverbatim}
2335+
Vector#(5,Int#(13)) my_vector;
2336+
List#(Int#(13)) my_list = toList(my_vector);
2337+
\end{libverbatim}
2338+
2339+
{\bf Examples - Tuples}
23342340
23352341
Flatten a vector of 3 pairs (2-tuples) into a single 6-tuple:
23362342
\begin{libverbatim}
@@ -2386,15 +2392,6 @@ \subsubsection{Converting to and from Vectors}
23862392
\end{libverbatim}
23872393
23882394
2389-
{\bf Example - Converting to and from Vectors}
2390-
2391-
Convert the vector \te{my\_vector} to a list named \te{my\_list}.
2392-
\begin{libverbatim}
2393-
Vector#(5,Int#(13)) my_vector;
2394-
List#(Int#(13)) my_list = toList(my_vector);
2395-
\end{libverbatim}
2396-
2397-
23982395
\subsubsection{ListN}
23992396
24002397
\index{ListN@\te{ListN} (type)}

0 commit comments

Comments
 (0)