Consider the following snippet:
import Data.List
%default total
x : Elem 1 [1, 2]
x = Here
type : Type
type = Elem 1 [1, 2]
y : type
y = Here
This gives an error:
When checking the right side of y: Type mismatch between Elem x (x :: xs) (Type here) and iType (expected type)
Type y
upon request:
type : Type
-----------
y : type
Is it possible to force type
evaluations during or before type assignment y
, so that type y
is equal Elem 1 [1, 2]
?
My use case is that I want to be able to define common predicates that return the correct conditions of a sentence for evidence, for example:
subset : List a -> List a -> Type
subset xs ys = (e : a) -> Elem e xs -> Elem e ys
thm_filter_subset : subset (filter p xs) xs
comco source
share