haskell-lectures/VL2/content/VL2_currying7.tex

12 lines
670 B
TeX
Raw Normal View History

2015-05-01 18:59:12 +00:00
\ifger{Wie am Anfang dieses Kapitels bereits gesagt sind diese beiden Funktionen sehr ähnlich:}{As said in the beginning of this section, these two look pretty similar:}
\begin{haskellcode}
f :: Int -> Int -> Int
f :: (Int, Int) -> Int
\end{haskellcode}
2015-04-23 20:57:25 +00:00
\ifger{Da wir jetzt wissen, dass man von der einen Form in die andere und zurück konvertieren kann, müssten wir dann nicht auch Funktionen dafür haben? Haben wir:}{And we now know that we can convert from one to another. Of course haskell also provides us two functions to do that, here we go:}
\begin{haskellcode}
curry :: ((a, b) -> c) -> a -> b -> c
uncurry :: (a -> b -> c) -> (a, b) -> c
\end{haskellcode}