パラメータ多相(parametric) 型のパラメータ化。静的。 length :: [a] -> Int length [] = 0 length (x:xs) = 1 + length xs C++のテンプレート Javaのジェネリックス アドホック多相(ad-hoc) 型によって、異なる振る舞いを示す。静的。 class Shape a where display :: a -> String data Triangle = Triangle deriving Show instance Shape Triangle where display _ = " * \n" ++ " * * \n" ++ "*****\n" data Rectangle = Rectangle deriving Show instance Shape Rectangle where display _ =