Softwerkskammer

 

#Kapitel 3 - Zusammenfassung Teil 2

Hier folgt die Zusammenfassung der zweiten Hälfte des dritten Kapitels von "Real World Haskell".

#Parameterized Types

  • introduce type variables into a type declaration
data Maybe a = Just a 
             | Nothing

​- a is a type variable (like Java generics)

  • Maybe is a polymorphic/generic type
  • Maybe's with different type variables are distinct types: Maybe Int != Maybe Bool