Let's compare the BoolProp ad in Haskell with the Agda version:
data BoolProp :: * -> * where -- ...
From a Haskell point of view, BoolProp is a unary type constructor (which roughly means: give me a specific type * , and I will give you a specific type).
In the BoolProp constructors BoolProp one would not make sense - this is not a type! You must first give it a type ( TRUE in the case of PTrue ).
In the Agda code, you indicate that BoolProp is in Set (something like * in Haskell). But your designers tell a different story.
ptrue : BoolProp true
When applying BoolProp to TRUE , you say that BoolProp should accept a Bool argument and return a Set (i.e. Bool → Set ). But you just said that BoolProp is in Set !
Obviously, since Bool → Set ≠ Set , Agda complains.
The correction is quite simple:
data BoolProp : Bool → Set where
And now, because BoolProp true : Set , everything is fine, and Agda is happy.
You could make the Haskell code a little nicer and you will immediately see the problem!
{-
Vitus
source share