Move section to next slide
This commit is contained in:
@@ -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}
|
||||
Reference in New Issue
Block a user