concept assumption in category idris

appears as: ssumptions, assumption, assumptions, ssumption
Type-Driven Development with Idris

This is an excerpt from Manning's book Type-Driven Development with Idris.

In previous chapters, you’ve seen several functions with dependent types, particularly using Vect to express lengths of vectors in their types. This allows you to state assumptions about the form of inputs to a function in its type and guarantees about the form of its output. For example, you’ve seen zip, which pairs corresponding elements of vectors:

In this chapter, you’ll see how to express more-complex relationships between data using predicates. By expressing relationships between data in types, you can be explicit about the assumptions you’re making about the inputs to a function, and have those assumptions checked by the type checker when those functions are called. You can even think of these assumptions as expressing compile time contracts that other arguments must satisfy before anything can call the function.

In practice, you’ll often write functions that make assumptions about the form of some other data, having (hopefully!) checked those assumptions beforehand. Here are a few examples: