liveBook · Manning

Function type

A function type specifies the types of inputs and result that a callable value accepts and produces.

How 5 Manning books explain it

Kotlin in Action, 2E

A function type describes the parameter types and return type of callable values.

How it is used
Enables higher-order functions that receive, store, and return behavior as lambda or function-reference values.
How deep it goes
Explains syntax, invocation, nullability placement, named parameters, returned functions, and predicate-based reuse; defers lambda performance to inline functions.
Examples
Uses arithmetic operations, a String filter, shipping-cost selection, contact filtering, and site-visit duration queries.
What you can do after
Build it from scratch by declaring function-typed variables, parameters, and returns, then passing or invoking lambdas.

Read how Kotlin in Action, 2E explains function type →

Type-Driven Development with Idris

A function type specifies the types of a function's inputs and result.

How it is used
Uses function types to declare function inputs and results and to identify checks needed when handling external input.
How deep it goes
Defines input-to-output signatures and works through a simple function and a dependent vector signature.
Examples
Uses `double : Int -> Int`, REPL evaluations, and `zip` over equal-length vectors.
What you can do after
Build an Idris function from an input-to-result signature and test its evaluations in the REPL.

Read how Type-Driven Development with Idris explains function type →

Learn Haskell by Example

A function type specifies the input and output types of a function value.

How it is used
Uses function types to document definitions, check operator compatibility, and shape practical encryption and synthesizer components.
How deep it goes
Explains unary and curried function types, lambda notation, syntactic sugar, and operator-driven type errors without covering deeper type-system internals.
Examples
Uses square and add definitions, mixed Int and Double multiplication, character rotation, and Event-to-Signal oscillators.
What you can do after
Evaluate and write Haskell signatures for unary, multi-argument, and function-valued definitions while diagnosing simple type mismatches.

Read how Learn Haskell by Example explains function type →

Geometry for Programmers

A function type specifies the kinds of inputs and outputs a function accepts, including its domain and codomain.

How it is used
Frames geometric modeling functions by matching mathematical domains and codomains with programming input and output types.
How deep it goes
Defines domains and codomains, then distinguishes transformations and vector fields, without developing their later chapters’ mechanics.
Examples
Uses translation of a square in ℝ² and vector-field illustrations to ground abstract function types.
What you can do after
Evaluate/understand geometric functions by identifying their input spaces, output spaces, and per-input values.

Read how Geometry for Programmers explains function type →

100 Go Mistakes and How to Avoid Them

A function type is a Go type whose values are functions with a specified parameter and result signature.

How it is used
Uses function types to inject time dependencies and make unit tests deterministic.
How deep it goes
Defines a named function type, wires production and test implementations, and contrasts function injection with global state and explicit arguments.
Examples
Uses Cache, time.Now, TrimOlderThan, fixed timestamps, and a fake func() time.Time implementation.
What you can do after
Build deterministic time-dependent tests by injecting a function that returns a controlled timestamp.

Read how 100 Go Mistakes and How to Avoid Them explains function type →

Also covered in

What to know first

Related concepts

Questions about function type

What is function type?

A function type specifies the types of inputs and result that a callable value accepts and produces.

Which Manning books explain function type?

Kotlin in Action, 2E, Type-Driven Development with Idris, Learn Haskell by Example, Geometry for Programmers and 100 Go Mistakes and How to Avoid Them.

What should I know before learning function type?

Manning books that teach function type usually introduce type inference, lambda and function first.

What is the difference between function type and extension function type?

A function type specifies the types of inputs and result that a callable value accepts and produces. An extension function type is a Kotlin function type that specifies a receiver type before the parameter types, allowing values of that type to invoke the callable using extension-function syntax.

What is function type a kind of?

Function type is a kind of data type. A data type classifies values by their permitted forms or representations and the operations or interpretations applicable to them.

What are the parts of function type?

Function type includes variable in type.

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.