A route is defined as a [String, String] tuple. What is the most appropriate way to define type alias 'Route' as [String, String]? e.g.
defn same-route? ( x : [String,String], y : [String,String] ) -> True|False :
I would like to use
defn same-route? ( x : Route, y : Route ) -> True|False :
instead.
The standard way would be to define a
Routestruct that wraps the Strings:Inside
same-route?you can compare thestartandendfields.The preferred way to compare equality is to subtype
Equalableand implement theequal?method:==is a macro forequal?, so this enables the following code: