Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

20 linhas
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?