haskell-lectures/VL2_define_functions2.tex

8 lines
162 B
TeX

We use \code{where} to define a helper function:
\begin{haskellcode}
f :: Int -> Int
f x = x + (y 2)
where
y :: Int -> Int
y p = x + p
\end{haskellcode}