haskell-lectures/VL1/content/VL1_ADT4.tex
Julian Ospald f36590c9f4
Restructure files, make the latex code more modular
Also added a few more section to make beamer and article more
compatible.
2015-04-20 17:38:58 +02:00

7 lines
286 B
TeX

And pattern match on it as well:
\begin{haskellcode}
addIntToList :: MaybeInt -> [Int]
addIntToList (NoError x) = [x]
addIntToList (Error str) = []
\end{haskellcode}
So if we got an error, we just return an empty list, otherwise we return a list with the \code{Int} as its only element.