concept valid function in category idris

appears as: valid function
Type-Driven Development with Idris

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

  • Refine— Trying an expression search on ?insSort_rhs_2 is, unfortunately, less effective:
    insSort : Vect n elem -> Vect n elem
    insSort [] = []
    insSort (x :: xs) = x :: xs
    Although Idris knows how long the vector should be, and it has local variables of the correct types, the overall type of insSort isn’t precise enough for Idris to fill in the hole with the program you intend.

    Expression search

    As this example demonstrates, although expression search can often lead you to a valid function, it’s not a substitute for understanding how the program works! You need to understand the algorithm, but you can use expression search to help fill in the details.


  • As this example demonstrates, although expression search can often lead you to a valid function, it’s not a substitute for understanding how the program works! You need to understand the algorithm, but you can use expression search to help fill in the details.