From b43b9e245665f5e10b1bd1b5dfefbb6ce317f8d4 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 20 Apr 2015 20:12:09 +0200 Subject: [PATCH] Move section to next slide --- VL1/content/VL1_ADT3.tex | 8 -------- VL1/content/VL1_ADT4.tex | 8 ++++++++ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/VL1/content/VL1_ADT3.tex b/VL1/content/VL1_ADT3.tex index f923cd7..39374d6 100644 --- a/VL1/content/VL1_ADT3.tex +++ b/VL1/content/VL1_ADT3.tex @@ -11,12 +11,4 @@ So constructors are just \emph{functions}! And they can have arguments, just lik NoError :: Int -> MaybeInt > :t Error Error :: String -> MaybeInt -\end{haskellcode} -\pause -And now we can do sanity checks: -\begin{haskellcode} -calcSomething :: Int -> MaybeInt -calcSomething x - | x < 100 = NoError (x * 5) - | otherwise = Error "Int out of range!" \end{haskellcode} \ No newline at end of file diff --git a/VL1/content/VL1_ADT4.tex b/VL1/content/VL1_ADT4.tex index 97eaa19..f528c27 100644 --- a/VL1/content/VL1_ADT4.tex +++ b/VL1/content/VL1_ADT4.tex @@ -1,3 +1,11 @@ +And now we can do sanity checks: +\begin{haskellcode} +calcSomething :: Int -> MaybeInt +calcSomething x + | x < 100 = NoError (x * 5) + | otherwise = Error "Int out of range!" +\end{haskellcode} +\pause And pattern match on it as well: \begin{haskellcode} addIntToList :: MaybeInt -> [Int]