free-theorem

In Idris, can I prove free theorems, e.g. the only (total) function of type `forall t. t -> t` is `id`?

和自甴很熟 提交于 2019-12-12 10:30:05
问题 For sufficiently polymorphic types, parametricity can uniquely determine the function itself (see Wadler's Theorems for free! for details). For example, the only total function with type forall t. t -> t is the identity function id . Is it possible to state and prove this in Idris? (And if it can't be proven inside Idris, is it true anyway?) The following is my attempt (I know that function equality is not a primitive concept in Idris, so I assert that any function of generic type t -> t