Proceedings of the 2015 ACM SIGPLAN Symposium on Haskell 2015
DOI: 10.1145/2804302.2804314
|View full text |Cite
|
Sign up to set email alerts
|

Injective type families for Haskell

Abstract: Haskell, as implemented by the Glasgow Haskell Compiler (GHC), allows expressive type-level programming. The most popular typelevel programming extension is TypeFamilies, which allows users to write functions on types. Yet, using type functions can cripple type inference in certain situations. In particular, lack of injectivity in type functions means that GHC can never infer an instantiation of a type variable appearing only under type functions.In this paper, we describe a small modification to GHC that allo… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
1
1
1
1

Citation Types

0
16
0

Year Published

2015
2015
2019
2019

Publication Types

Select...
5
1

Relationship

4
2

Authors

Journals

citations
Cited by 18 publications
(16 citation statements)
references
References 16 publications
0
16
0
Order By: Relevance
“…For example, suppose that the database representation of Email in the example above is also DbText: Happily, the details of these variations are not important for this paper, and we stick only to associated type families, declared within a class. 3 Haskell aficionados will know that the user can declare a type family to be injective [Stolarek et al 2015]. But they cannot be generative, so from the perspective of this paper, declaring injectivity adds nothing.…”
Section: Injectivity and Generativitymentioning
confidence: 99%
See 1 more Smart Citation
“…For example, suppose that the database representation of Email in the example above is also DbText: Happily, the details of these variations are not important for this paper, and we stick only to associated type families, declared within a class. 3 Haskell aficionados will know that the user can declare a type family to be injective [Stolarek et al 2015]. But they cannot be generative, so from the perspective of this paper, declaring injectivity adds nothing.…”
Section: Injectivity and Generativitymentioning
confidence: 99%
“…Indeed, we could track injectivity and generativity separately by having dedicated arrows for both. This would enable abstraction over injective type families [Stolarek et al 2015], but the practical applicability of such a scheme seems limited considering the additional complexity and notational burden it would incur.…”
Section: The Solution: Unsaturated Type Familiesmentioning
confidence: 99%
“…We would expect that if the duals of two session types are equal, then the session types themselves are equal as well. Injective type families (Stolarek et al 2015) can express such cases; duality could be characterized by the following type family: type family Dual s = r | r → s where the s → r annotation denotes the injectivity of duality. e compiler validates that the injectivity condition is upheld by the type family's de ning equations.…”
Section: Type Families In Haskellmentioning
confidence: 99%
“…Recent work has focused on extending the expressiveness of type families themselves. introduced closed type families, which allow overlapping equations in type family de nitions, and Stolarek et al (2015) introduced injective type families, recovering additional equalities from applications of injective type families. ese features, particularly closed type families, have seen signi cant practical application.…”
Section: Related Workmentioning
confidence: 99%
See 1 more Smart Citation