Skip to main content

Questions tagged [interfaces]

Use this tag for questions about interfaces as a nominal typing feature, declared types that primarily contain method headers and that other classes or types can incorporate. Do not use for questions about user interfaces.

5 votes
3 answers
1k views

I am investigating ways to add some form of abstract data types to a toy language. I was reading Graydon Hoare's The Rust I Wanted Had No Future, in which he talks about existential types. I have not ...
Jonas's user avatar
  • 715
4 votes
4 answers
558 views

In an object oriented language with single inheritance, there is often the concept "interface", separate from classes, as a replacement of what would otherwise require multiple inheritance. ...
user23013's user avatar
  • 3,314
7 votes
1 answer
463 views

A problem I sometimes run into when using a language like TypeScript or C# is how they lack a perfect analogue to Haskell's typeclasses. Let's use Haskell's Functor ...
Kilian Kilmister's user avatar
11 votes
1 answer
988 views

Many languages have some form of expressing "user-defined duck typing": defining a type by its behavior, rather than anything about the structure or data of an instance of the type itself. ...
apropos's user avatar
  • 1,295
9 votes
2 answers
1k views

For example, Python has lists, sets and dictionaries as language-level primitives that can be constructed using syntactic sugar [1,2,3], {'a': 1, 'b': 2} while Java ...
kouta-kun's user avatar
  • 1,747
11 votes
3 answers
2k views

In Rust, structs and enums may implement any number of traits, which specify certain functions. When a struct/enum implements a trait, this is where the functions are defined: ...
rydwolf's user avatar
  • 4,870