[email protected]
[Top] [All Lists]

[Haskell-cafe] semantics of type synonym

Subject: [Haskell-cafe] semantics of type synonym
From: pbrowne
Date: Tue, 29 Dec 2009 14:47:55 +0000
I am studying the underlying semantics behind Haskell and to what degree
those semantics are actually implemented. I need to clarify what a *type
synonym* actual means in relation to Haskell's logic (or formal
semantics). I used the following type synonym:

type Name = String
getName(n) = n

I checked the types with two tests:
-- test 1
:t "ww"
"ww" :: [Char]

-- test 2
:t getName("ww")
getName("ww") :: Name

Obviously I get two different types.
In the case of the function Haskells type system seems to pick up enough
information to determine that âwwâ is a Name.
But I am not sure what is happening with the literal "ww" in the first test.


Haskell-Cafe mailing list
[email protected]

<Prev in Thread] Current Thread [Next in Thread>