Laatste wijzigingen
[matthijs/master-project/haskell-symposium-talk.git] / PolyAlu.lhs
index 0d99ca7fb382816d39ae51c3bd1773c3cfbf1f6b..5ff0a60e38c6e29aa109192429d1af9b2b67d626 100644 (file)
@@ -12,10 +12,10 @@ import qualified Prelude as P
 \subsection{Introduction}
 \frame
 {
-\frametitle{Small Use Case}
+\frametitle{Small Use Case}\pause
 \begin{itemize}
-  \item Small Polymorphic, Higher-Order CPU
-  \item Each function is turned into a hardware component
+  \item Small Polymorphic, Higher-Order CPU\pause
+  \item Each function is turned into a hardware component\pause
   \item Use of state will be simple
 \end{itemize}
 }\note[itemize]{
@@ -27,7 +27,7 @@ import qualified Prelude as P
 
 \frame
 {
-\frametitle{Imports}
+\frametitle{Imports}\pause
 Import all the built-in types, such as vectors and integers:
 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
 \begin{code}
@@ -49,7 +49,7 @@ import CLasH.Translator.Annotations
 \subsection{Type Definitions}
 \frame
 {
-\frametitle{Type definitions}
+\frametitle{Type definitions}\pause
 First we define some ALU types:
 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
 \begin{code}
@@ -82,11 +82,11 @@ type Word           =   SizedInt D12
 \subsection{Frameworks for Operations}
 \frame
 {
-\frametitle{Operations}
+\frametitle{Operations}\pause
 We make a primitive operation:
 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
 \begin{code}
-primOp :: {-"{\color<3>[rgb]{1,0,0}"-}(a -> a -> a){-"}"-} -> Op s a
+primOp :: {-"{\color<4>[rgb]{1,0,0}"-}(a -> a -> a){-"}"-} -> Op s a
 primOp f a b = a `f` a
 \end{code}
 \end{beamercolorbox}\pause
@@ -94,12 +94,12 @@ primOp f a b = a `f` a
 We make a vector operation:
 \begin{beamercolorbox}[sep=-2.5ex,rounded=true,shadow=true,vmode]{codebox}
 \begin{code}
-vectOp :: {-"{\color<3>[rgb]{1,0,0}"-}(a -> a -> a){-"}"-} -> Op s a
-vectOp f a b = {-"{\color<3>[rgb]{1,0,0}"-}foldl{-"}"-} f a b
+vectOp :: {-"{\color<4>[rgb]{1,0,0}"-}(a -> a -> a){-"}"-} -> Op s a
+vectOp f a b = {-"{\color<4>[rgb]{1,0,0}"-}foldl{-"}"-} f a b
 \end{code}
 \end{beamercolorbox}
 \begin{itemize}
-\uncover<3->{\item We support Higher-Order Functionality}
+\uncover<4->{\item We support Higher-Order Functionality}
 \end{itemize}
 }\note[itemize]{
 \item These are just frameworks for 'real' operations
@@ -122,7 +122,7 @@ alu op1 op2 {-"{\color<2>[rgb]{1,0,0}"-}High{-"}"-}   a b = op2 a b
 \end{code}
 \end{beamercolorbox}
 \begin{itemize}
-\uncover<2->{\item We support Patter Matching}
+\uncover<2->{\item We support Pattern Matching}
 \end{itemize}
 }\note[itemize]{
 \item Alu is both higher-order, and polymorphic
@@ -195,9 +195,9 @@ initstate = State (copy (0 :: Word))
 ANN(program TestInput)
 program :: [(Opcode, Word, Vector D4 Word, RangedWord D9, RangedWord D9, Bit)]
 program =
-  [ (Low, 4, copy (0::Word), 0, 0, High) -- Write 4 to Reg0, out = 0
-  , (Low, 3, copy (0::Word), 0, 1, High) -- Write 3 to Reg1, out = Reg0 + Reg0 = 8
-  , (High,0, copy (3::Word), 1, 0, Low)  -- No Write       , out = 15
+  [ (Low, 4, copy (0), 0, 0, High) -- Write 4 to Reg0, out = 0
+  , (Low, 3, copy (0), 0, 1, High) -- Write 3 to Reg1, out = 8
+  , (High,0, copy (3), 1, 0, Low)  -- No Write       , out = 15
   ]
 
 run func state [] = []