haskell-cafe@haskell.org
[Top] [All Lists]

Re: [Haskell-cafe] semantics of type synonym

Subject: Re: [Haskell-cafe] semantics of type synonym
From: Stefan Holdermans
Date: Tue, 29 Dec 2009 16:48:59 +0100
Patrick,

It seems that I need to distinguish between a theory for Haskell and a
given implementation (GHCi).


What do you mean by this?

Obviously I get two different types
Wrong. You get exactly the same type, it's just that GHCi detected that you have a fancy name for this type, so it gives you that name. It's not type system, it's just GHCi.

Are you saying there is just one type? (not two isomorphic types because
there is only one of them with two names)

Indeed. To create a new type isomorphic to an existing type, have a look at newtype declarations. (http://www.haskell.org/onlinereport/decls.html , §4.2).

Why are the GHCi commands :t "ww" and :t getName("ww") not a valid type
checks?

I am not sure what you mean by this.

Cheers,

  Stefan
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@xxxxxxxxxxx
http://www.haskell.org/mailman/listinfo/haskell-cafe

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