Proceedings of the 26nd 2014 International Symposium on Implementation and Application of Functional Languages 2014
DOI: 10.1145/2746325.2746330
|View full text |Cite
|
Sign up to set email alerts
|

Church Encoding of Data Types Considered Harmful for Implementations

Abstract: From the λ-calculus it is known how to represent (recursive) data structures by ordinary λ-terms. Based on this idea one can represent algebraic data types in a functional programming language by higher-order functions. Using this encoding we only have to implement functions to achieve an implementation of the functional language with data structures. In this paper we compare the famous Church encoding of data types with the less familiar Scott and Parigot encodings.We show that one can use the encoding of dat… Show more

Help me understand this report

Search citation statements

Order By: Relevance

Paper Sections

Select...
2
1
1

Citation Types

0
4
0

Year Published

2016
2016
2020
2020

Publication Types

Select...
3
1
1

Relationship

0
5

Authors

Journals

citations
Cited by 6 publications
(4 citation statements)
references
References 34 publications
0
4
0
Order By: Relevance
“…Here the recursive occurrence of Nat has disappeared, replaced by an R. This is because while the Scott encoding corresponds to a pattern-match on a type, the Church encoding corresponds to a fold, so recursive occurrences have already been folded into the output type. This highlights the tradeoffs between the two encodings (see [19] for further discussion):…”
Section: Datatype Encodingsmentioning
confidence: 97%
See 1 more Smart Citation
“…Here the recursive occurrence of Nat has disappeared, replaced by an R. This is because while the Scott encoding corresponds to a pattern-match on a type, the Church encoding corresponds to a fold, so recursive occurrences have already been folded into the output type. This highlights the tradeoffs between the two encodings (see [19] for further discussion):…”
Section: Datatype Encodingsmentioning
confidence: 97%
“…Different approaches to encoding datatypes are compared in [19]. The authors provide a schematic formal description of Scott encoding, but ours is more thorough and includes complete handling of recursive types.…”
Section: Encoding Recursive Datatypesmentioning
confidence: 99%
“…s 1 (s 0 z). While in theory the space required for normal forms is exponential, in practice closure-based implementations of lambda calculus compute efficiently with Parigot encodings, as has been found in several studies (Koopman et al, 2014;Stump & Fu, 2016). And Parigot encodings can be typed in a normalizing extension of System F with positive-recursive types (cf.…”
Section: The Problems In More Detailmentioning
confidence: 99%
“…Because Haskell's directly supports only predicative polymorphism, newtype must be used to wrap higher rank types for instantiation of universally quantified type variables. A similar mechanism in Clean was used in a recent similar study (Koopman et al, 2014). We must use newtype even for the translations of non-recursive types like CNat, because of the restriction to predicative polymorphism.…”
Section: Experiments Using Haskellmentioning
confidence: 99%