▁that ▁constructor ▁ ▁has ▁ar ity ▁. ▁ ▁Scott ▁encoding ▁ ▁The ▁Scott ▁encoding ▁of ▁constructor ▁ ▁of ▁the ▁data ▁type ▁D ▁is ▁ ▁M og ensen – Sc ott ▁encoding ▁▁ ▁M og ensen ▁extends ▁Scott ▁encoding ▁to ▁encode ▁any ▁un ty ped ▁lambda ▁term ▁as ▁data . ▁ ▁This ▁allows ▁a ▁lambda ▁term ▁to ▁be ▁represented ▁as ▁data , ▁within ▁a ▁L ambda ▁calculus ▁meta ▁program . ▁ ▁The ▁meta ▁function ▁m se ▁converts ▁a ▁lambda ▁term ▁into ▁the ▁corresponding ▁data ▁representation ▁of ▁the ▁lambda ▁term ; ▁ ▁The ▁" lambda ▁term " ▁is ▁represented ▁as ▁a ▁tag ged ▁union ▁with ▁three ▁cases : ▁ ▁Con structor ▁a ▁- ▁a ▁variable ▁( ar ity ▁ 1 , ▁not ▁recursive ) ▁ ▁Con structor ▁b ▁- ▁function ▁application ▁( ar ity ▁ 2 , ▁recursive ▁in ▁both ▁arguments ), ▁ ▁Con structor ▁c ▁- ▁lambda - ab stra ction ▁( ar ity ▁ 1 , ▁recursive ). ▁ ▁For ▁example , ▁ ▁Com parison ▁to ▁the ▁Church ▁encoding ▁ ▁The ▁Scott ▁encoding ▁coinc ides ▁with ▁the ▁Church ▁encoding ▁for ▁bo ole ans . ▁ ▁Church ▁encoding ▁of ▁pairs ▁may ▁be ▁generalized ▁to ▁arbitrary ▁data ▁types ▁by ▁encoding ▁ ▁of ▁D ▁above ▁as ▁▁▁ ▁compare ▁this ▁to ▁the ▁M og ensen ▁Scott ▁encoding , ▁▁▁ ▁With ▁this ▁general ization , ▁the ▁Scott ▁and ▁Church ▁enc od ings ▁co inci de ▁on ▁all ▁enumer ated ▁dat at ypes ▁( such ▁as ▁the ▁boolean ▁dat atype ) ▁because ▁each ▁constructor ▁is ▁a ▁constant ▁( no