\begin{slide}{Linq und Monaden: Semantik}

Haskell:
\begin{verbatim}
class Monad m where
    (>>=) :: m a -> (a -> m b) -> m b
[1 .. 5] >>= \ x -> [ 1 .. x ]
\end{verbatim}

Linq:  
\begin{verbatim}
using System.Linq;
public static IEnumerable<TResult> 
  SelectMany<TSource, TResult>(
    this IEnumerable<TSource> source,
    Func<TSource, IEnumerable<TResult>> selector)

Enumerable.Range(1,5)
    .SelectMany(x => Enumerable.Range(1,x)
\end{verbatim}
  
\end{slide}
