Skip to content

refactor query system with GADTs #33

@vogler

Description

@vogler

The query system uses a variant type for the question and a polymorphic variant type for the result.

Problem Every query has only a subset of valid return variants. This information is not encoded in the type, i.e., every question might return any result.

Idea Use GADTs. Problem Subtyping (r can't be covariant): code, issue.

Idea Get rid of need for subtyping (the result type seems partially redundant anyway):

type 'd r = Result of 'd | Top | Bot
let rec query : type d. d t -> d r = ...

Metadata

Metadata

Assignees

Labels

cleanupRefactoring, clean-upperformanceAnalysis time, memory usagetype-safetyType-safety improvements

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions