You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

15 lines
1.5 KiB

  1. \ifger{Sie ähneln sich stark, aber sind unterschiedliche Konstrukte.}{These look almost the same, but they are different constructs.} \hinline{where} \ifger{ist an das pattern matching (hier \hinline{f x ...=}) der Funktion gebunden und hat auch Zugriff auf Funktionsteile, die nicht syntaktische Ausdrücke sind, z.b.:}{is bound to the pattern matching \hinline{f x ...=} and may also have access to parts of a function that are not syntactically expressions, e.g.:}
  2. \begin{haskellcode}
  3. f x
  4. | cond1 x = a
  5. | cond2 x = g a
  6. | otherwise = f (h x a)
  7. where
  8. a = w x
  9. \end{haskellcode}
  10. \ifger{während dies mit \hinline{let} so nicht möglich ist. Dieses ist hingegen ein echter Ausdruck und kann überall dort benutzt werden, wo Ausdrücke erlaubt sind (z.b. innerhalb von \emph{Monaden}, dazu später mehr).}{While that is not possible with \hinline{let}, which is an actual expression and can be used whenever expressions are allowed (e.g. inside \emph{Monads}, we'll know more about these in a few weeks).}
  11. \vspace{\baselineskip}
  12. \\
  13. \ifger{Es gibt hier noch ein paar weitere Feinheiten\footnote{\url{https://wiki.haskell.org/Let_vs._Where}}, aber generell ist es einfach nur Geschmackssache.}{There are a few more intricacies\footnote{\url{https://wiki.haskell.org/Let_vs._Where}}, but most of the time this is just style consideration.}
  14. \pause
  15. \ifger{Wie müssten wir die Funktion umschreiben um \hinline{let} zu benutzen?}{How would we have to rewrite the function in order to use \hinline{let}?}