I'm trying to write the following ML code as Coq code: (This ML code comes from the book "computational category theory" by Ryheard and Burstall)
datatype ’a Set_Arrow =
set_arrow of (’a Set)*(’a->’a)*(’a Set)
fun set_s(set_arrow(a,_,_)) = a
This is what I came up with:
Definition setArrow := (Set, Set -> Set, Set).
Definition setSource (arrow: setArrow ): Set :=
match arrow with
|(a,b,c) => a
end.
and this is the error that came up:
Error: The term "setArrow" has type "(Type * Type * Type)%type"
which should be Set, Prop or Type.
I don't know why this error appears but I think is due to the way I constructed the tuple. I've been reading the documentation regarding tuples and how to construct new non-inductive datatypes in Coq, but I haven't found how to properly do it.