Skip to content

Refactoring signature #925

Description

@mezpusz

Shell::Signature is painful and error-prone to use, make it better. We could do the following things to make it better:

  • Remove setType and pass OperatorType directly when creating a symbol. This removes the need for the weird fnType, predType, typeConType triplet. Currently being implemented in require-symbol-operatortype.
  • Have a unified domain for all symbol types. This should be straightforward to do, we just have some edge cases where we have to enumerate functions/predicates/typecons, so we have to additionally maintain some structures storing these. The benefit of this is that a tremendous amount of branching can be removed from the code, having getSymbol instead of getFunction, getPredicate and getTypeCon, and of course, that debugging becomes much easier because symbols map one-to-one to unsigneds, so no more "not sure what this symbol is".
  • Have some kind of nicer, builder interface for all the makeIntroduced, makeSkolem, etc. and maybe also for getting the functor itself, so the addFunction and immediate getFunction patterns could disappear. (suggested by @MichaelRawson)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions