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 :|

有帮助吗?

解决方案

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

type German = String
type German = Int        -- conflicts here!

其他提示

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 ;-)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top