links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
318 stars 42 forks source link

Remove string typing #554

Open jstolarek opened 5 years ago

jstolarek commented 5 years ago

There is quite a lot of string typing in Links source code. evalir.ml has pattern matches in the likes of:

    | `PrimitiveFunction ("new", _), [] -> ...
    | `PrimitiveFunction ("newAP", _), [loc] -> ...
    | `PrimitiveFunction ("newClientAP", _), [] -> ...

Another example are "wild" and "hear" in a row specification. And there is probably more. We should have proper datatypes instead.

jstolarek commented 5 years ago

In unify:

let occurs_check var t =
  match Settings.get_value infer_recursive_types with
    | "all" -> true
    | "guarded" -> is_guarded var t
    | "positive" -> not (is_negative var t)
frank-emrich commented 5 years ago

I think your second example is a slightly different issue: Those settings with only a limited range of possible values should be translated to a proper datatype, rather than being strings. This may be part of a general cleanup of the settings (cf. #537 ).

jstolarek commented 5 years ago

Yes, it probably is part of #537 but I wanted to record that here nevertheless. Just for future reference.