Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

20 wiersze
674 B

  1. And now we are going to write functions to use it:
  2. \begin{haskellcode}
  3. isListEmpty :: List t -> Bool
  4. isListEmpty Emtpy = True
  5. isListEmpty x = False
  6. \end{haskellcode}
  7. \pause
  8. We can even have more generic stuff like:
  9. \begin{haskellcode}
  10. f :: a -> b
  11. \end{haskellcode}
  12. Whatever the function does... it gets something of one type and returns something of another type (it could be the same type, but doesn't need to). That's all we know.
  13. \vspace{\baselineskip}
  14. \\
  15. \pause
  16. Similarly, remember the function \hinline{head} which gives us the first element of a list? The type signature actually looks like this:
  17. \begin{haskellcode}
  18. head :: [a] -> a
  19. \end{haskellcode}
  20. Makes sense?