Questions tagged [polymorphisms]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
48 views

Is it possible to write a fully-decidable type system for the J language?

I'm experimenting with the J array language, a dynamically-typed array language with mutable assignment, subtyping, and function overloading (just like traditional APL). It is unclear to me whether ...
5
votes
3answers
82 views

How exactly do we define parametric polymorphism?

My naive distinction between parametric polymorphism and ad-hoc polymorphism, is that: In parametric polymorphism, the type is given as a variable: (pseudocode) Function f: <.Type T> T $\to$...
5
votes
0answers
69 views

Which languages, if any, implemented parametric polymorphism before ML?

In particular, was there any kind of implementation at the time Christopher Strachey wrote Fundamental Concepts in Programming Languages? In that work, Strachey lists Ad Hoc and Parametric ...
6
votes
1answer
137 views

Relationship between Higher Kinded Polymorphism, type inference, and Currying

On Hacker News there is an interesting exchange about the async\await RFC for Rust. The author of the proposal withoutboats is responding to a comment about the ...
2
votes
1answer
99 views

How to implement polymorphism in a turing complete environment?

I'm currently programming in an unnamed turing complete language which has support for pointers, primitive data types, structures, closures, and garbage collection, among other things. I'm trying to ...
6
votes
3answers
905 views

Is subtype polymorphism a kind of ad hoc polymorphism?

"Ad-hoc polymorphism is obtained when a function works, or appears to work, on several different types (which may not exhibit a common structure) and may behave in unrelated ways for each type." – ...
4
votes
1answer
72 views

What's the advantage of “value restriction” over its alternatives?

What is the motivation to pick "value restriction" over other candidates? Examples of alternatives: Enclosing pureness into the function type, for example: ...
7
votes
2answers
636 views

Higher-ranked polymorphism without explicit application or subtyping?

So, I'm familiar with two main strategies of having higher-ranked polymorphism in a language: System-F style polymorphism, where functions are explicitly typed, and instantiation happens explicitly ...
0
votes
2answers
149 views

Can String be a subtype of Character in a programming language?

Could a programming language be designed so that there is an inheritance relationship between string and character (both of ...
3
votes
1answer
177 views

how type checking fails?

I was doing a type checking example in system f sub on paper to understand how it works. according to Pierce's book Types and Programming Languages, numbers and their types are following in system f ...
1
vote
1answer
48 views

Can a $k$-ary relation have polymorphisms of arity greater than $k$?

To quote Hubie Chen's A Rendezvous of Logic, Complexity, and Algebra (2009) on constraint satisfaction and complexity, An operation $f : D^m \to D$ is a polymorphism of a relation $R \subseteq D^k$ ...