The invention relates to compounds of the formula or a pharmaceutically acceptable salt thereof, wherein R, R1 through R7 and Ar are as defined herein. These compounds are useful as inhibitors of phosphodiesterase 10 (PDE10A) which are useful in treating central nervous system diseases such as psychosis and also in treating, for example, obesity, type II diabetes, metabolic syndrome, glucose intolerance, pain and ophthalmic diseases.本發明係關於下式之化合物或其醫藥學上可接受之鹽,其中R、R1至R7及Ar係如本文中所定義。此等化合物適用作磷酸二酯酶10(PDE10A)抑制劑,其適用於治療中樞神經系統疾病,諸如精神病,且亦適用於治療例如肥胖症、II型糖尿病、代謝症候群、葡萄糖失耐症、疼痛及眼科疾病。