Haskell笔记 (7)—— 类型


Haskell requires type names to start with an uppercase letter, and variable names must start with a lowercase letter.


> let C = "foo"

<interactive>:20:5: Not in scope: data constructor ‘C’
> let c = "foo"
> c
> :type c
c :: [Char]


The combination of :: and the type after it is called a type signature.


> :type 'a'
'a' :: Char

:: Char就被称之为type signature



电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.