Context-Dependent Type Error Diagnosis for Functional Languages

نویسندگان

  • Alejandro Serrano
  • Jurriaan Hage
چکیده

Customizable type error diagnosis has been proposed as a solution to achieve domain-specific type error diagnosis for embedded domain specific languages. A proven approach is to phrase type inferencing as a constraint-solving problem, so that we can manipulate the order in which constraints are solved, and associate domain-specific type error messages with specific constraints to be communicated to the programmer in case type checking fails. A major challenge in this area lies in scaling this idea up uniformly to a fully-featured (functional) language, that is, languages that go beyond the polymorphic λ-calculus. In this paper, we show how within the general framework Constraint Handling Rules we can achieve such uniformity and generality, while at the same time providing the necessary type error customizability in a natural way. A proof-of-concept implementation is provided for a Haskell-like language, including support for type classes, GADTs and higher-ranked types. However, our approach applies to any language for which a constraint-based non-backtracking formulation of the type system is available.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type Error Customization in GHC (DRAFT)

Abstract Embedded domain speci€c languages (DSLs) are a common paŠern in the functional programming world, providing very high-level abstractions to programmer. Unfortunately, this abstraction is broken when type errors occur, leaking details of the DSL implementation. In this paper we present a set of techniques for customizing type error diagnosis in order to avoid this leaking. Œese techniqu...

متن کامل

EFL Learners’ Preferences for Error Correction and Its Relationship with Demotivation and Language Proficiency in the Iranian Context

The present study is an attempt to explore any significant relationships between learners’ preferences for error correction, demotivation, and language proficiency (LP). One hundred Iranian EFL students, including both males and females, studying at the departments of foreign languages of Shahid Bahonar University of Kerman and Tehran University took part in this study. In order to obtain the r...

متن کامل

Trellys: Dependently-typed Language Design

My research focuses on the design of statically-typed programming languages. Static type systems are a popular, cost-effective form of lightweight program verification. They provide a tractable and modular way for programmers to express properties that can be mechanically checked by the compiler. As a result, the compiler can rule out a wide variety of errors and provide more information to ref...

متن کامل

Dead Code Elimination through Dependent Types

Pattern matching is an important feature in various functional programming languages such as SML, Caml, Haskell, etc. In these languages, unreachable or redundant matching clauses, which can be regarded as a special form of dead code, are a rich source for program errors. Therefore, eliminating unreachable matching clauses at compile-time can signiicantly enhance program error detection. Furthe...

متن کامل

Better Type-Error Messages Through Lazy Typing

Producing precise and helpful error messages for type inference is still a challenge for implementations of functional languages. Current approaches often lack precision in terms of locating the origins of type errors. Moreover, suggestions for how to fix type errors that are offered by some tools are also often vague or incorrect. To address this problem we have developed a new approach to ide...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016