[Haskell-cafe] semantics of type synonym

Stefan Holdermans stefan at cs.uu.nl
Tue Dec 29 10:48:59 EST 2009


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


More information about the Haskell-Cafe mailing list