Top "Polymorphism" questions

In computer science, polymorphism is a programming language feature that allows values of different data types to be handled in a uniform manner.

Existential vs. Universally quantified types in Haskell

What exactly is the difference between these? I think I understand how existential types work, they are like having a …

haskell polymorphism existential-type
How does one use polymorphism instead of instanceof? (And why?)

If we take the code below: Shape p1 = new Square(); Square c1; if(p1 instanceof Square) { c1 = (Square) p1; } What …

java polymorphism instanceof
Achieving polymorphism in functional programming

I'm currently enjoying the transition from an object oriented language to a functional language. It's a breath of fresh air, …

oop language-agnostic prototype functional-programming polymorphism
Understanding Fortran extends types and override

I am trying to understand the object-oriented concepts in Fortran 2003 standards (or later). I have some knowledge in C++ so …

inheritance polymorphism fortran overriding
Java Unchecked Overriding Return Type

I have a project that has the following components: public abstract class BaseThing { public abstract <T extends BaseThing> …

java generics polymorphism abstract-class return-type
Inheritance and Polymorphism in REST API Modeling

I have an object hierarchy that I want to expose through a REST API, and I want to discuss best …

rest api inheritance polymorphism api-design
Polymorphism in Protocol Buffers 3

The current design I am refactoring some exiting API code that returns a feed of events for a user. The …

polymorphism protocol-buffers microservices protobuf-3
Can I get polymorphic behavior without using virtual functions?

Because of my device I can't use virtual functions. Suppose I have: class Base { void doSomething() { } }; class Derived : public Base { …

c++ function polymorphism virtual overriding
Late Binding vs. Polymorphism - what is the difference?

I've seen both used interchangebly but do they really mean the same? From my understanding, Polymorphism stretches the fact that …

oop polymorphism late-binding
Can I pass an arbitrary function to another function in Scala?

I'm new to Scala, and being able to pass functions to other functions is pretty neat-- but can I pass …

function scala functional-programming polymorphism arity