X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fmaster-project%2Freport.git;a=blobdiff_plain;f=Chapters%2FPrototype.tex;h=7c4d2096f85e7b84fe63865d7d1194759c7734c3;hp=7d99104629c0ecbe92d76829b30fa0637dc69874;hb=cf0bb91410c4d6fa5869ecfbb7508c1560173ac2;hpb=ecb1b7d79982a225260129766fb3c97a62bd22e1 diff --git a/Chapters/Prototype.tex b/Chapters/Prototype.tex index 7d99104..7c4d209 100644 --- a/Chapters/Prototype.tex +++ b/Chapters/Prototype.tex @@ -516,12 +516,12 @@ A case expression evaluates its scrutinee, which should have an algebraic datatype, into weak head normal form (\small{WHNF}) and - (optionally) binds it to \lam{bndr}. Every alternative lists a - single constructor (\lam{C0 ... Cn}). Based on the actual - constructor of the scrutinee, the corresponding alternative is - chosen. The binders in the chosen alternative (\lam{bndr0,0 .... - bndr0,m} are bound to the actual arguments to the constructor in - the scrutinee. + (optionally) binds it to \lam{bndr}. If bndr is wild, \refdef{wild + binders} it is left out. Every alternative lists a single constructor + (\lam{C0 ... Cn}). Based on the actual constructor of the scrutinee, the + corresponding alternative is chosen. The binders in the chosen + alternative (\lam{bndr0,0 .... bndr0,m} are bound to the actual + arguments to the constructor in the scrutinee. This is best illustrated with an example. Assume there is an algebraic datatype declared as follows\footnote{This @@ -825,9 +825,8 @@ \stopdesc Using this set of types, all types in basic Haskell can be represented. - \todo{Overview of polymorphism with more examples (or move examples - here)}. + here)} \section[sec:prototype:statetype]{State annotations in Haskell} As noted in \in{section}[sec:description:stateann], Cλash needs some @@ -1063,6 +1062,10 @@ (state) variables} and \emph{substate variables}, which will be defined in the rules themselves. + These rules describe everything that can be done with state + variables and state-containing variables. Everything else is + invalid. + \startdesc{State variables can appear as an argument.} \startlambda avg = λi.λspacked. ... @@ -1393,9 +1396,9 @@ \stopbuffer \placeexample[][ex:AccStateVHDL]{\VHDL\ generated for acc from \in{example}[ex:AvgState]} - {\typebuffer[AccStateVHDL]} + {\typebuffervhdl{AccStateVHDL}} \placeexample[][ex:AvgStateVHDL]{\VHDL\ generated for avg from \in{example}[ex:AvgState]} - {\typebuffer[AvgStateVHDL]} + {\typebuffervhdl{AvgStateVHDL}} % \subsection{Initial state} % How to specify the initial state? Cannot be done inside a hardware % function, since the initial state is its own state argument for the first