Found 5 articles tagged with #type-system

Swift AnyObject, AnyClass, Any, and `any`

Swift has special types to work with nonspecific types, useful in certain scenarios because they provide a lot of flexibility in working with different types of data.

Duck Typing in JavaScript

Duck typing is a concept in programming that is often used in dynamic programming languages such as JavaScript, Python, and Ruby. It is a….

How to Mimic Nominal Typing in TypeScript

You can overcome drawbacks of structural typing in TypeScript by creating nominal types with a little bit of extra code.

TypeScript Structural Typing

If the type is shaped like a duck, it is a duck. If a goose has all the same attributes as a duck, then it also is a duck.

Swift Opaque Types

This feature gives you the flexibility to return and preserve the identity of any type, related but different from protocols and generics.