Code background grey, use special code-block for GHCi
This commit is contained in:
@@ -7,13 +7,13 @@ $S = \{2 \times x\ |\ x \in \mathbb{N},\ x \leq 10\}$
|
||||
\\
|
||||
How does this look in haskell?
|
||||
\pause
|
||||
\begin{haskellcode}
|
||||
\begin{haskellcode*}{bgcolor=mygrey,frame=single,numbers=none,label=GHCi}
|
||||
> [ 2 * x | x <- [1..10]]
|
||||
\end{haskellcode}
|
||||
\end{haskellcode*}
|
||||
\pause
|
||||
Now let's say we want all numbers between 50 and 100 that have the remainder 0 when divided by 12:
|
||||
\pause
|
||||
\begin{haskellcode}
|
||||
\begin{haskellcode*}{bgcolor=mygrey,frame=single,numbers=none,label=GHCi}
|
||||
> [x | x <- [50..100], mod x 12 == 0]
|
||||
\end{haskellcode}
|
||||
\end{haskellcode*}
|
||||
\code{x <- [50..100]} is the binding, while \code{mod x 12 == 0} is the predicate, separated by a comma. We can have multiple predicates.
|
||||
Reference in New Issue
Block a user