2 Simultaneous type renamings in Haskell

109 views Asked by At

we've been given the task to make a Dictionary, as a List of tuples with (String, String). The problem here is that I actually have no idea if I can rename String twice at the same time, since I want the tuple to look like this

(German, English)

Is it even possible to just make it look like this?

type German =  String
type English = String
type Dictionary = [(German, English)]

Or would there be any conflicts? It was kinda frustrating not finding a single entry about this, been almost 2 hours and not a single line of code stands right now :|

2

There are 2 answers

0
J. Abrahamson On BEST ANSWER

Yes, you can do that. You can't do the opposite

type German = String
type German = Int        -- conflicts here!
0
miau On

Of course you can, if you couldn't, you wouldn't be able to compile type German = String in the first place, as it's already been named ;-)