2 ms·
Be careful, that's just one way of looking at things. See https://lispcast.com/church-vs-curry-types/ https://lispcast.com/church-vs-curry-types/ or https://en
by eru 5y ago
Be careful, that's just one way of looking at things. See https://lispcast.com/church-vs-curry-types/ https://lispcast.com/church-vs-curry-types/ or https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus#Intrinsic_vs._extrinsic_interpretations https://en.wikipedia.org/wiki/Simply_typed_lambda_calculus#I...
> A type is a (possibly infinite) subset of all the possible values that can be provided as input to a program, or all the possible results a program can produce.
What you are describing are 'extrinsic types. There are also 'intrinsic types'.
Btw, types don't have to be sets at all. (Nor are they all isomorphic to sets. Some types describe things bigger than sets.)
- nicoburns 5y agoFor anyone trying to understand the difference between extrinsic and intrinsic definitions of sets, consider the set of birds. Intrinsic definition: "Birds are a group of warm-blooded vertebrates constituting the class Aves, characterised by feathers, toothless beaked jaws, the laying of hard-shelled eggs, a high metabolic rate, a four-chambered heart, and a strong yet lightweight skeleton." Extrinsic definition: "Birds are the set made up of: Sparrows, Pigeons, Robins, Hummingbirds, Hawks, Eagles, Parrots, Penguins, Ducks, etc..."
- eru 5y agoHmm, I'm not sure anyone who doesn't already know will be helped by this analogy? Though not sure whether Wikipedia does a better job: > An intrinsic/Church-style semantics only assigns meaning to well-typed terms, or more precisely, assigns meaning directly to typing derivations. This has the effect that terms differing only by type annotations can nonetheless be assigned different meanings. [...] In contrast, an extrinsic/Curry-style semantics assigns meaning to terms regardless of typing, as they would be interpreted in an untyped language. > The distinction between intrinsic and extrinsic semantics is sometimes associated with the presence or absence of annotations on lambda abstractions, but strictly speaking this usage is imprecise. It is possible to define a Curry-style semantics on annotated terms simply by ignoring the types (i.e., through type erasure), as it is possible to give a Church-style semantics on unannotated terms when the types can be deduced from context (i.e., through type inference). The essential difference between intrinsic and extrinsic approaches is just whether the typing rules are viewed as defining the language, or as a formalism for verifying properties of a more primitive underlying language. Most of the different semantic interpretations discussed below can be seen through either a Church or Curry perspective.