Type argument
A type argument is an argument supplied to a parameterized construct to specify a type or constrain the kinds of values it accepts.
Kotlin in Action, 2E
- How it is used
- Supplies concrete element, key, value, or result types when using Kotlin generic classes and functions.
- How deep it goes
- Defines syntax, inference, constraints, nullability, erasure, reification, and variance, with runnable collection and function examples.
- Examples
- Uses `List<String>`, `Map<String, Person>`, `slice<Char>`, constrained `max`, nullable `Processor`, and `filterIsInstance<String>`.
- What you can do after
- Apply it via Kotlin generic collections and functions, choosing explicit arguments, relying on inference, and respecting bounds and runtime erasure.
React in Depth
- How it is used
- Supplies intended types to generic TypeScript functions and React APIs when inference is inadequate.
- How deep it goes
- Works through inference, explicit unions, hook typing, and ref-argument order; flags generic-component wrappers without detailing their workaround.
- Examples
- Uses a middle-element function, nullable appointment state, an empty tag array, typed refs, and pagination over two item types.
- What you can do after
- Apply it via TypeScript and React to preserve intended types across generic functions, hooks, contexts, refs, and components.
Essential TypeScript 5, Third Edition
A generic type argument supplies a concrete type for a parameterized type's placeholder.
- How it is used
- Uses type arguments to specialize collections, database schemas, and HTTP result types for compiler checking.
- How deep it goes
- Works through explicit constructor arguments, inferred constructor and method arguments, and their resulting types.
- Examples
- Shows a numbered-key Map, person and product collections, a generic property accessor, and an Angular HTTP request.
- What you can do after
- Apply it via TypeScript generics to specify checked collection types and expected library result types.
Read how Essential TypeScript 5, Third Edition explains type argument →
F# in Action: A Revised Edition of Get Programming with F#
A generic type argument is a concrete type supplied for a parameterized generic type or function.
- How it is used
- Uses type arguments to construct generic collections and describe or invoke reusable functions.
- How deep it goes
- Explains explicit arguments, type holes, inference, automatic generalization, and the error produced by incompatible argument types.
- Examples
- Demonstrates ResizeArray, combineElements, mixed-type errors, and List.map from int list to string list.
- What you can do after
- Apply it via F# syntax, choose explicit annotations when inference lacks context, and read generic function signatures.
Read how F# in Action: A Revised Edition of Get Programming with F# explains type argument →
100 Go Mistakes and How to Avoid Them
A type argument is a concrete type supplied for a generic type parameter.
- How it is used
- Uses concrete types to instantiate generic functions and types while retaining compile-time type safety.
- How deep it goes
- Explains instantiation, explicit calls, and constraint failures, but stops short of detailed type-inference rules.
- Examples
- Demonstrates generic map-key extraction, explicit string arguments, invalid slice keys, and custom type constraints.
- What you can do after
- Apply generics by supplying valid concrete types to generic functions and recognizing constraint violations.
Read how 100 Go Mistakes and How to Avoid Them explains type argument →
Related concepts
- genericsused by · Generics are programming-language constructs that parameterize or generalize types and operations so they can apply to multiple concrete types or input forms.
- createContextconfigures · createContext is a library API function that creates a context object for providing and reading shared values among components.
- useStateused by · useState is a React Hook that provides a function component with a state value and a function for updating it.
- Mapconfigures · A map is an associative data structure that stores key-value pairs and supports retrieving values by key.
- varianceused by · Variance is a type-system rule describing how subtyping relationships between type arguments affect subtyping relationships between constructed generic types.
- type constraintconfigured by · A type constraint is a rule that restricts admissible types or type arguments by requiring specified relationships, structures, properties, or supported operations.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.




