Proceedings of the 20th ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation 2011
DOI: 10.1145/1929501.1929524
|View full text |Cite
|
Sign up to set email alerts
|

Type classes in functional logic programming

Abstract: Type classes provide a clean, modular and elegant way of writing overloaded functions. Functional logic programming languages (FLP in short) like Toy or Curry have adopted the Damas-Milner type system, so it seems natural to adopt also type classes in FLP. However, type classes has been barely introduced in FLP. A reason for this lack of success is that the usual translation of type classes using dictionaries presents some problems in FLP like the absence of expected answers due to a bad interaction of diction… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1
1

Citation Types

0
5
0

Year Published

2012
2012
2019
2019

Publication Types

Select...
3
2
1

Relationship

3
3

Authors

Journals

citations
Cited by 7 publications
(5 citation statements)
references
References 26 publications
(54 reference statements)
0
5
0
Order By: Relevance
“…A first step towards the specification of the translation of type classes has been already developed in Martin-Martin (2011). -Despite of the lack of principal types, some work on type inference can be done, in the spirit of Schrijvers et al (2009).…”
Section: Discussionmentioning
confidence: 99%
See 1 more Smart Citation
“…A first step towards the specification of the translation of type classes has been already developed in Martin-Martin (2011). -Despite of the lack of principal types, some work on type inference can be done, in the spirit of Schrijvers et al (2009).…”
Section: Discussionmentioning
confidence: 99%
“…Type classes are usually implemented by means of a source-to-source transformation that introduces extra parameters -called dictionaries -to overloaded functions (Hall et al 1996;Wadler and Blott 1989). However, this classical translation produces a problem of missing answers when applied to FLP due to a bad interaction between non-determinism and the call-time choice semantics (Lux 2009;Martin-Martin 2011). Using type-indexed functions and type witnesses -a representation of types as values -it is possible to develop a type-passing translation for type classes similar to Thatté (1994) that solves this problem and whose translated programs are well-typed in the proposed liberal type system.…”
Section: Type-indexed Functionsmentioning
confidence: 99%
“…This is not a principle restriction of our approach but due to the current type system of Curry. If the base language supports overloading (like Haskell or an extension of Curry with type classes [23]), the preprocessor can generate a call to an overloaded CDBI operation. Another option is a complete re-implementation of the type inference of the base language in the SQL preprocessor (as done in [25]).…”
Section: Structure Of the Implementationmentioning
confidence: 99%
“…Type classes are usually implemented by means of a source-to-source transformation that introduces extra parameters-called dictionaries-to overloaded functions (Wadler and Blott, 1989;Hall et al, 1996). However, this classical translation produces a problem of missing answers when applied to FLP due to a bad interaction between non-determinism and the call-time choice semantics (Lux, 2009;Martin-Martin, 2011). Using type-indexed functions and type witnesses-a representation of types as values-it is possible to develop a type-passing translation for type classes similar to (Thatté, 1994) that solves this problem and whose translated programs are well-typed in the proposed liberal type system.…”
Section: Type-indexed Functionsmentioning
confidence: 99%