+fun will_be_action (t, _) =
+ case t of
+ TArrow (_, t') => will_be_action t'
+ | TAction _ => true
+ | TNested _ => true
+ | TUnif (_, ref (SOME t')) => will_be_action t'
+ | _ => false
+
+fun get_first_arg (t, _) =
+ case t of
+ TArrow (t', _) => t'
+ | TUnif (_, ref (SOME t')) => get_first_arg t'
+ | _ => raise Fail "get_first_arg failed!"
+
+fun hint te =
+ case te of
+ WrongType (_, _, (TBase "string", _), (TBase "your_domain", _), _) =>
+ SOME "Did you forget to request permission to configure this domain? See:\n\thttps://members.hcoop.net/portal/domain"
+ | WrongType (_, (EString dom, _), (TBase "string", _), (TBase "domain", _), _) =>
+ if CharVector.exists Char.isUpper dom then
+ SOME "Uppercase letters aren't allowed in domain strings."
+ else
+ NONE
+ | _ => NONE
+
+fun describe_type_error' loc te =