Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
att
GitHub Repository: att/ast
Path: blob/master/src/cmd/bzip/data/sample1.ref
1810 views
����;� TeX output 1995.07.01:1517������g�\����3��2�\����ܚ��\Np���Kffffcmbx14�Bey���on�d�L�Prot��wot�yp�8�e�Imp���lem�en���t�a��>t�ions:���͍�f�>P���o���lymorphi��cc�L�Pro��!ject�ion�An���alys�8�i�s�����E.for�L�Glasgo���w�Hask�ell��"�%���3��"V

cmbx10�Julian��TSew��9ard���������<x

cmtt10�[email protected]���i���xz�%o���		cmr9�Depart��9m�en���t�Tof�Compu��t���e�	�r�Science�����%Vi���ct��or�'xia�TUniv��9e�	�r��s� �it�y�of�Manc�h�e�A�s��t���e�	�r������ZOxford�TRoad,�Manc��9h�e�A�s��t���e�	�r�TM13�9PL,�UK.��mk����Hs��&t�:		cmbx9�A��h�b�Ks��tract.���x��Buildin��g�d�eect��9iv�e�a�b�Ns��tract�in���t���e�	�rpret�e�r��s�d�require�A�s�careful�a���t-����Hs�t���en���t��9ion�R�t��o�b�A�ot��Th�t�h��9eory�an�d�en��gin�ee�	�r�'xin�g�R�i� �s�Nsue�A�s.�Th�e�t��Th�eory�of�a�b�Ns��tract����Hs�in���t���e�	�rpret��9a���t�ion���i� �s�w��9ell�d�؇ev�elo�p� �e�A�d,�bu��t�t��Th�e�en��gin�ee�	�r�'xin�g���s� �id�؇e�h�as�f� �allen�b�e-����Hs�hin��9d�q�som�ewh�a���t,�an�u��nfort�u�n��a���t���e�q�ev�en���t�giv�en�t��Th�a���t�a�b�Ns��tract�in���t���e�	�rpret�a���t�ion�i� �s����Hs�p�A�ot���en���t��9ially���a�k�ey�t���ec�hno��logy�for�d�؇eclara���t�iv�e�lan��guage�compila���t�ion.�Thi� �s����Hs�pap� �e�	�r��sh��o��9ws�t��Th�e�t��Thinkin��g�b� �e��>hin�d�t��Th�e�d�؇e�A�s� �ign�an�d�imp��lem�en���t�a���t�ion�of�a����Hs�r��s�t-ord�؇e�	�r,���p�A�o��lymorphi���c�pro���ject��9ion�an��alys�.e�r�for�Hask��9ell,�capa�b��le�of�d�؇e-����Hs�t���ect��9in��g���h�e�Nad�s��tr�'xi���ctn�e�A�s�Ns,�an�d�t��Th�e�	�refore�suit�a�b��le�for�sup�p�A�ort�in��g�all�kno�wn����Hs�s��tr�'xi���ctn��9e�A�s�Ns-rela���t���e�d���transform��a�t��9ions.�Dev�elo�pm�en���t�culmin��a���t���e�A�d�in�a�su�cce�A�s�Ns-����Hs�ful�P�tr�'xial�ins��t��9alla���t�ion�P�in�v��9e�	�r�s� �ion�0.19�of�t��Th��9e�Glasgo�w�Hask�ell�Compile�	�r,����Hs�an��9d���t��Th�e�sys��t���em�h�as�b� �een�us�.e�A�d�t��o�an��alys�e�a�ran��ge�of�Hask��9ell�programs,����Hs�includin��g�Tan�e�Narlie�	�r�v��9e�r��s� �ion�of�it��fs�.elf,�13000�lin��9e�A�s�lon��g.��"�Ѝ�,�(��N�cmbx12�1�
�In��ftro�`d��u�ct�ion��x��,�K�`y

cmr10�Th���e�#�pas�t�d��Tecad�e�#�h�as�s�1�een�a�dram�Îa��t�i���c�impro�v�em�en���t�in�t��Uh�e�p�#�e�
�rform�Îance�of�lazy����,fu��rnct���ion�Îal���lan�guage�Gs,�not���a�b��ly�Hask�ell,�as�imp��lem�en���t��ror�s�h�a�v�e�d��Tev�elo�p�#�e�Gd�w�ays�t��ro����,m�Îap���su���c�h�lan��rguage�Gs�ecien���t��Uly�on�t��ro�s�t�o�Gc���k�arc�hit��Uect�ure�Gs.�Nev�e�
�rt��Uh�ele�Gs�qs,�t��Uh�ey�s�t�ill����,ru��rn���an�ord��Te�
�r�of�m�Îagnit���ud�e�slo���w�e�
�r���t��Uh�an�t��Uh�e�Gir�imp�#�e�
�ra��t�iv�e�cou��rn���t��Ue�
�rpart��s,�an�d,�w�or�s�1�e,����,it��Qlo�Goks�lik���e�t��Uh�e�p�#�e�
�rform�Îance�impro�v�em�en���t��s�are�t�ailin��rg�o.�F��*�urt��Uh�e�
�r�incre�qas�1�e�Gs�in����,p�#�e�
�rform�Îance�V�d��Tep�en���d�on�n�din��rg�w�ays�t��ro�rep��lace�co�p�yin��rg�b�y�up�Gd��ra��t��Ue-in-p��lace,�an�d����,lazy���ev��q�alua��t���ion�b�y�s�tr�*�i���ct�ev��q�alua��t�ion,�wh�en�p�Go�qs�s�#�ib��le.���A���cr�*�it�i���cal�elem�en���t�in�t��Uhi�#�s�i�s����,t��Uh���e�UUs�1�em�Îan���t�i���c�an�Îalys�1�e�Gs�whi�c���h�di�#�s��Tco�v�e�
�r�wh�en�su�c�h�transform�Îa��t�ions�are�v��q�alid.����;Su���cce�Gs�qsful�PNus�1�e�of�s�tr�*�i���ctn�e�Gs�qs�an�d�sh�ar�*�in��rg�an�Îalys�1�e�Gs�in�compile�
�r�s�d��Tem�an���ds�care-����,ful��cons�#�id��Te�
�ra��t���ion�of�t��Uh�e�en��rgin�ee�
�r�*�in�g��cons�train���t��s�imp�Go�qs�1�e�d��b�y�s�1�epara��t��Ue�compila�t���ion,����,an���d�V�b�y�t��Uh�e�limit��Ue�Gd�compu��rt�in�g�V�re�Gsource�s�a���v��q�aila�b��le.�Sect�ion�2�of�t��Uhi�#�s�pap�e�
�r�exam-����,in���e�Gs�Y�su�c�h�cons�train���t��s�in�d��Tet�ail,�as�a�w�ay�of�gen�e�
�ra��t�in��rg�us�1�eful�m�etr�*�i���cs�wit��Uh�whi�c���h����,t��ro��as�qs�1�e�Gs�s�p�Go�s�s�#�ibilit���ie�s��in�t��Uh���e�d��Te�s�#�ign�space.�Bas�1�e�d�on�t��Uhi�#�s,�w���e�ou��rt�lin���e�in�Sec-����,t���ion�3�H�t��Uh�e�d��Te�Gs�#�ign�of�a�p�o��lymorphi���c,�bac���kw�ards�s�tr�*�i���ctn�e�Gs�qs�an�Îalys�1�e�
�r�for�Hask�ell.����,Th���e���an�Îalys�1�e�
�r�w�as�ins�t�alle�Gd�in�Glasgo�w�Hask�ell�0.19,�an�d�sh�Îo�ws�an�u��rnprece�Gd��Ten-����,t��Ue�Gd��1pr�*�i���ce-p�#�e�
�rform�Îance�ra��t���io.�Sect�ion�4�pre�Gs�1�en���t��s�t��Uh�e�re�Gsul��rt��s�of�t��Uhi�#�s�exp�e�
�r�*�im���en���t�an�d����,conclud��Te�Gs.�R�Al��rt��Uh�Îough�our�pr�*�im�ary�conce�
�r�#�n�i�s�s�tr�*�i���ctn���e�Gs�qs�an�Îalys�i�s�of�Hask���ell,�t��Uh�e�Gs�1�e����,id��Te�qas�H=h���a�v�e�wid��Te�
�r�ap�p��li���ca�bilit�y�t��ro�all�a�b�qs�tract-in���t��Ue�
�rpret�a��t�ion�bas�1�e�Gd�an�Îalys�e�Gs�for�����*�g�\����3��2�\����ܚ��R�fu��rnct���ion�Îal��olan�guage�Gs,�an���d�sh�Îould�in���t��Ue�
�re�s�t�t��Uh�Îo�qs�1�e�conce�
�r�#�n���e�d�b���y�t��Uh�e�s�1�eemin��rgly�large����Rgap�UUb�#�et���w�een�t��Uh�e�t��Uh�eory�an�d�pract�i���ce�of�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion.��w���aRe�qal,�)�usa���b��le�an�Îalys�1�e�Gs�die�
�r�f�*�rom�prot��rot�yp�#�e�imp��lem�en���t�a��t�ions�in�s�1�ev�e�
�ral�w�ays.����RTh���e�N/an�Îalys�#�i�s�h���as�t��ro�ru�n�in�re�qason�Îa���b��le�t�im�e�an�d�m�emory��*�,�ev�en�wh�en�pre�Gs�1�en���t��Ue�d�wit��Uh����Ru��rnre�qason�Îa���b��le�2oinpu�t��s;�it�sh�Îould�\t"�pro���p�#�e�
�rly�in���t�o�t��Uh���e�exi�#�s�t�in��rg�compile�
�r�f�*�ram�e-����Rw���or��k,�x�vi�#�s-a-vi�s�s�1�epara��t��Ue�compila�t���ion,�an�d�it�sh�Îould�do�a�go�Go�d�job�for�imp�ort���an���t����Rlan��rguage�p-fe�qa��t���ure�Gs,�part�i���cularly�su��rm-of-pro�Gd�u�ct��s�t�yp�#�e�Gs,�p�o��lymorphi�#�sm�an���d�high�e�
�r-����Rord��Te�
�r�E�fu��rnct���ions.�W��*�e�sh�Îort��Uly�examin�e�t��Uh�e�cons�1�equence�Gs�of�t��Uh�e�Gs�1�e�cons�train���t��s�in�som�e����Rd��Tet���ail.����aTh���e�e�m�Îain�fo�Gcus�of�t��Uhi�#�s�pap�e�
�r�i�s�on�global�d��Te�Gs�ign�trad��Teos.�Bas�1�e�Gd�on�t��Uh���a��t����Rdi�#�s��Tcus�qs�ion,�g�w���e�ou��rt��Ulin�e�a�part�i���cularly�eect�iv�e�p�Go��lymorphi���c�pro��8ject�ion�an�Îalys�1�e�
�r����Rfor���Hask���ell,�an�d�sh�Îo�w�som�e�re�Gsul��rt��s�f�*�rom�it.�Th�e�an�Îalys�1�e�
�r's�d��Te�Gs�#�ign�d�et���ails�are����Rb�Got��Uh���in���t��Ue�
�re�s�t���in��rg�an�d�v�o��lu��rminous,�bu�t�not�ap���pro�pr�*�ia��t��Ue�h�e�
�re,�so�refe�rence�Gs�t��ro�more����Rt��Uh�Îorough�A
tre�qa��t���m�en���t��s�are�giv�en�t��Uhrough�Îou��rt�{�t�h���e�r�s�t�p�Gort�of�call�i�#�s�proba���b��ly�t��Uh�e����Ra���u��rt��Uh�Îor's�UUPhD�t�h���e�Gs�#�i�s�[�Sew94��8�].�� U鍑R�Arc��9hit��"ect�ural��>Ov�e�Drview�-ȲThi�#�s�9�pap�e�
�r�divid��Te�Gs�s�1�em�Îan���t���i���c�an�alys�#�i�s�sys�t��Uems�in���t��ro����Rt���w�o�H�concept�ual�part��s:�an�a�b�qs�tract�in���t��Ue�
�rpret�e�r,�H�whi���c���h�gen�e�
�ra��t��Ue�Gs�recur�s�#�iv�e�equa��t�ions����Ro���v�e�
�r�`�som�e�dom�Îains,�an�d�a�xp�Goin���t��Ue�
�r,�whi���c�h�remo�v�e�Gs�recur�s�#�ion�f�*�rom�t��Uh�e�equa��t�ions,����Rt��Uh���e�
�re��Tb�y��5m�Îakin��rg�t�h���em�us�1�eful�t��ro�compile�
�r�s.�As�usual,�w�e�require�t��Uh�e�dom�Îains�t��ro�b�#�e����Rof�6nit��Ue�h���e�Gigh�t�6t��ro�guaran���t�ee�t�e�
�rmin�Îa��t���ion�of�xp�Goin���t�in��rg,�an�d�furt��Uh�e�
�r�re�Gs�tr�*�i���ct�t��Uh�em����Rt��ro�UUb�#�e�di�s�tr�*�ibu��rt���iv�e�UUla��t���t�i���ce�Gs�t��ro�m�Îak�e�xp�Goin���t�in��rg�e�qas�#�ie�
�r.����aSev���e�
�ral��$die�ren���t�s��Tc���h�em�e�Gs�for�xp�oin���t���in��rg�h�a�v�e�b�#�een�pro�p�Go�qs�1�e�d.�Th���e�F��*�ron���t�ie�
�r�s����Ralgor�*�it��Uhm�b'clev���e�
�rly�exp��loit��s�monot��roni���cit�y�t��ro�build�syn���t�act�i���cally�u��rnique�repre�Gs�1�en���t�a-����Rt���ions,��t��Uh�us�tr�*�iviali�#�s�in��rg�t��Uh���e�d��Tet��Uect�ion�of�xp�Goin���t��s.�In�tro�Gd���u�ce�d��b�y�Clac�k�an�d�P�eyt��ron����RJon���e�Gs�[�PC87�� ],���t��Uh�e�algor�*�it��Uhm�h�as�b�#�een�m��Uu�c�h�t�u��rn�e�Gd�o�v�e�
�r�t��Uh�e�y�e�qar�s�[�Mar92��Z,��Hu��rn91��o],����Ran���d��sup�p�Gort��s�high�e�
�r�ord��Te�r�xp�Goin���t���in��rg.�A��s�1�econ�d�lin�e�of�enquiry�i�#�s�t��Uh�a��t�of�lazy����Rxp�Goin���t���in��rg,�6�wh�e�
�re�t��Uh�e�xp�Goin���t�i�#�s�only�compu��rt��Ue�d�wh���e�
�re�n�ee�Gd��Te�d,�on�d��Tem�Îan���d.�Th�e����Rpreci�#�s�1�e��1or�*�igins�of�lazy�xp�Goin���t���in��rg�are�d��Te�ba��t�a�b��le,��1bu��rt�t�w�o�e�qarly�pre�Gs�1�en���t�a��t�ions����Rare���d���ue�t��ro�t��Uh�e�Cousot��s�[�CC78��q�]�an�d�t��ro�Jon�e�Gs�an�d�Mycroft�[�JM86��N=].�Ext��Uens�#�ions����Rt��ro��high���e�
�r-ord��Te�r�xp�Goin���t���in��rg�are�sh�Îo�wn�b�y�F��*�e�
�rguson�an�d�Hugh�e�Gs�[�FH93��!],�an�d�b�y����RRo�qs�1�en���d��ra�hl�[�Ro�s93��j�].�ΆTh���e�w�or��k�of�Hankin�an�d�Le�M���Get�ay�e�
�r�on�\lazy�t�yp�#�e�Gs"�[�HM94����]����Ri�#�s�UUalso�rela��t��Ue�Gd.����aIn�8�t��Uhi�#�s�pap�e�
�r�w���e�t�ak�e�a�t��Uhird�ap�proac�h:�compu��rt�a��t�ion�of�comp��let��Ue�xp�Goin���t��s����Rb���y�4�us�#�in��rg�a�t��Ue�
�rm�rewr�*�it�e�sys�t�em�t��ro�transform�s�1�em�Îan���t���i���cally�equiv��q�alen�t�t��Ue�
�rms�t��ro����Rsyn���t���act�i���cally�8|id��Ten�t�i���cal�8|norm�Îal�forms.�Cons�1�el�d��Te�Gs��Tcr�*�ib�#�e�s�8|a�s�imp��le�rewr�*�it��Ue�
�r�for�t���w�o-����Rp�Goin���t��ula��t���t���i���ce�s�us�1�e�d�in�Y��*�ale�Hask���ell�[�Con91���!],�an�d�t��Uh�e�t��Uec�hnique�w�as�ext��Uen�d��Te�Gd�t��ro����Rot��Uh���e�
�r���la��t���t�i���ce�Gs�in�[�Sew94��8�],�Sect�ion�5.�Rewr�*�it��Ue-bas�1�e�Gd�xp�oin���t��Ue�
�r�s�cannot,�in�gen���e�ral,����Rso��lv���e�UUhigh�e�
�r-ord��Te�r�equa��t���ions,�bu��rt,�as�w�e�sh�all�s�1�ee,�t��Uhi�#�s�m�Îay�not�m�a��t���t��Ue�
�r�m��Uu���c�h.����aNo�Gc���k�e�
�r�[�No�c93��8�]�Ѷsh�Îo�ws�a�w�or��kin��rg�an�Îalys�1�e�
�r,�bas�e�Gd�on�\a���b�qs�tract�re�d���u�ct�ion",����Rwh���e�
�re��8t��Ue�rm-rewr�*�it�in��rg��8i�#�s�us�1�e�Gd�t�o�execu�t��Ue�t��Uh���e�program�us�#�in�g�som���e�a�b�qs�tract�s�1�e-����Rm�Îan���t���i���cs.�dBy�compar�*�i�#�son,�our�t��Ue�
�rm-rewr�it���in��rg�i�#�s�us�1�e�Gd�t�o�d��Tet��Uect�xp�Goin���t��s,�an���d����Rt��Uh���e�
�re�-vi�#�s�a�cle�qar�di�s�t���inct�ion�-vb�et�w�een�-vt��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion�an�d�xp�Goin���t�in��rg����Ract���ivit�ie�Gs.����aTh���e��preci�#�s�1�e�n�Îa��t�ure�of�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions�i�#�s�d��Tet��Ue�
�rmin�e�Gd,�n�Îa��t�urally��*�,�b�y�����:�g�\����3��2�\����ܚ��,�t��Uh���e���transform�Îa��t�ion�t��ro�b�#�e�sup�p�Gort��Ue�d.�On���e�part�i���cularly�imp�Gort�an���t�c�h�aract��Ue�
�r�*�i�#�sa-����,t���ion�Z�i�#�s�t��Uh�e�la��t���t�i���ce�Gs�t��ro�whi�c���h�die�
�ren���t�t�yp�#�e�Gs�are�m�Îap�p�#�e�Gd.�In�t��Uh�e�s�#�imp��le�Gs�t�cas�1�e,����,all�R�non-fu��rnct���ion�Îal�t�yp�#�e�Gs�could�b�e�m�Îap���p�e�Gd�t��ro�a�t���w�o-p�oin���t�R�la��t���t�i���ce,�wit��Uh�t�h���e�p�Goin���t��s����,repre�Gs�1�en���t���in��rg�Rpno�d��Tem�Îan�d�an�d�w�e�qak�h�e�qad�norm�Îal�form�(WHNF)�Rod��Tem�an���d�re�Gsp�#�ect-����,iv���ely���in�s�tr�*�i���ctn�e�Gs�qs�an�Îalys�#�i�s.���F��*�or�a�s�#�imp��le�sh�ar�*�in��rg�an�Îalys�#�i�s,���w�e�migh�t�us�1�e�a�3-����,p�Goin���t�!�c���h�ain,�d��Tenot�in��rg�no�refe�
�rence�Gs,�exact��Uly�on�e�refe�
�rence,�an�d�t�w�o�or�more����,refe�
�rence�Gs.���Simp��le�a���b�qs�tract�ions���lik�e�t��Uh�e�Gs�1�e�are�rou��rt�in�ely�us�1�e�Gd�in�exi�#�s�t�in��rg�Hask�ell����,compile�
�r�s�[�Con91���!,����PJ93����].���Th���e�s�#�imp��li���cit�y�of�t��Uh�e�a�b�qs�tract�ions�m�Îak�e�Gs�t��Uh�e�Gs�1�e�an�Îalys�e�Gs����,c���h�e�qap�UUan�d�relia�b��le,�so�w�e�sh�all�not�cons�#�id��Te�
�r�t��Uh�em�furt��Uh�e�
�r.��+���;A���more���p�Go���w�e�
�rful�an�Îalys�#�i�s�migh���t�a��t���t��Uempt�t��ro�giv�e�d��Tet�aile�Gd�inform�Îa��t�ion�a�b�Gou��rt����,fu��rnct���ions��?d��Te�qalin�g�wit��Uh�s�tru���ct�ure�Gd�t�yp�#�e�Gs�su�c�h�as�li�#�s�t��s,�tree�Gs,�or�wh�a��t��Uev�e�
�r�program-����,m���e�
�r�s�7^care�t��ro�d��Ten�e.�La��t���t�i���ce�Gs�a�b�qs�tract�in��rg�su�c�h�t�yp�#�e�Gs�gro�w�in�accord��rance�wit��Uh�t�h���e����,comp��lexit���y�apof�t��Uh�Îo�qs�1�e�t�yp�#�e�Gs,�so�t��Uh�e�
�re�i�#�s�no�arbitrary�cu��rt�o�app�Goin���t�b�ey���on�d�apwhi���c�h����,all�LDd��Tet���ails�are�ignore�Gd.�In�ot��Uh�e�
�r�w�ords,�t��Uh�e�
�re�i�#�s�a�p�Go�qs�s�ibilit���y�LDof�s�1�ee�Gin��rg�arbitrar�*�ily����,f�#�ar���\ins�id��Te"�d��ra��t���a�s�tru�ct�ure�Gs.�Th�e�do�wns�#�id��Te�i�s�t��Uh���a��t�t�h���e�Gs�1�e�la��t���t�i���ce�Gs�can�an�d�do�get����,v���e�
�ry�&�large,�so�t��Uh�e�an�Îalys�#�i�s�&�b�ecom�e�Gs�&�exp�ens�iv�e.�&�In�t��Uhi�#�s�s�1�ens�e,�&�s�em�Îan���t�i���c�&�an�alys�#�i�s�i�s����,a��Qpart���i���cularly�in���tract�a�b��le�prob�lem,�b�#�eca���us�1�e�t��Uh���e�la��t�t���i���ce�s�#�ize�Gs�an�d�t��Uh�us��Qamou��rn���t�of����,eort�*Krequire�Gd�can�gro���w�exp�on���en���t�ially�*Kwit��Uh�comp��lexit���y�of�t�yp�#�e�Gs.�F��*�or�examp��le,�if����,an�&�it��Uem�of�t���yp�#�e��(Int,�?�Int,�Int)�&��i�s�mo�Gd��Telle�d�&�b���y�a�9�p�Goin���t�la��t���t�i���ce,�(2��W�
!",�

cmsy10���2����2)����O!�cmsy7�?����,����,addin��rg�B�jus�t�on���e�more��Int��t�o�t��Uh���e�t�up��le�eect�iv�ely�dou��Ub��le�Gs�t�h���e�la��t���t�i���ce�s�#�ize,�giv-����,in��rg�[f(2�畸��2����2����2)����?����.�Th���e�co�qs�t��s�of�high�e�
�r�ord��Te�r�s�1�em�Îan���t���i���c�an�alys�1�e�Gs�are�almo�qs�t����,legen���d��rary��*�,�wkbu�t�ev���en�r�s�t�ord��Te�
�r�an�Îalys�1�e�Gs�can�b�#�ecom���e�exce�s�qs�#�iv���ely�exp�ens�iv���e.�Get-����,t���in��rg��re�qason�Îa�b��le�p�#�e�
�rform�Îance�som�et�im�e�Gs�require�s�\w���or��k�limit�in��rg"�{�t��Uhro�win��rg�aw�ay����,d��Tet���ail�UUwhi���c�h�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion�w�ould�ot��Uh�e�
�rwi�#�s�1�e�pi���c�k�up.��!@���,�2�
�Cons�	�train��ft���s��on�via��b�ٙle�d��fe�`s�0igns���W��,�2.1��Separa��ft��"e��TCompila�t��9ion���W��,�Cur�*�iously���enough,�s�1�epara��t��Ue�compila�t���ion�i�#�s�t��Uh�e�bigge�Gs�t�s�#�in��rgle�source�of�d��Te�s�#�ign����,cons�train���t��s.�O�A�O�con���v�enien�t�O�w�ay�t��ro�view�a�m��Uul�t���i-mo�Gd�ule�program�i�#�s�as�a�direct��Ue�Gd,����,ro�Got��Ue�d,���p�o�qs�s�#�ib��ly�cycli���c�graph,�wit��Uh�arcs�re
ect���in��rg�imp�Gort�d��Tep�en���d�encie�Gs,���t��Uh�e��Main����,�mo�Gd���ule�G�a��t�t��Uh�e�\t��ro�p",�an�d�t��Uh�e�Hask�ell��Prelude��a��t�t��Uh�e�b�Got���t��rom����^��ٓ�Rcmr7�1���|s�.�Compila��t�ion�of�a����,mo�Gd���ule��.�M���ca���us�1�e�s�t��Uh���e�compile�
�r�t��ro�re�qad�t�h���e�source�t��Uext�of��M���an�d�in���t��Ue�
�rf�#�ace�le�Gs�of����,mo�Gd���ule�s���imm�e�dia��t��Uely���b�#�elo�w��M�,�an�d�emit�co�Gd��Te�an�d�in���t��Ue�
�rf�#�ace�le�Gs�for��M�.�In�t��Ue�
�rf�#�ace����,le�Gs��are�us�1�e�d�b���y�t��Uh�e�compile�
�r�t��ro�comm��Uu�ni���ca��t��Ue�re�Gsul�t��s�of�s�1�em�Îan���t���i���c�an�alys�1�e�Gs�acro�qs�s����,mo�Gd���ule��b�ou��rn�d�ar�*�ie�Gs.��In�t��Uh�e�a�b�qs�1�ence�of�inform�Îa��t�ion�a�b�Gou��rt�imp�ort��Ue�d�en���t���it�ie�s,��t��Uh�e�
�re����,i�#�s���alw���ays�a�safe�as�qsu��rmpt�ion�whi���c�h�can�b�#�e�m�Îad��Te.�Thi�s�f�*�ram���ew�or��k���imp�Go�qs�1�e�s�s�1�ev���e�
�ral����,limit���a��t�ions:���������2@�{����=�Th���e�tin���t��Ue�
�rf�#�ace�le�Gs�ough�t�t��ro�b�#�e�limit��Ue�Gd�t�o�a�re�qason�Îa���b��le�s�#�ize,�ot��Uh�e�
�rwi�#�s�1�e�t��Uh�e����=compile�
�r�\fm�Îay�sp�#�en���d�a�lot�of�t�im�e�re�qadin��rg�t��Uh�em.�F��*�or�examp��le,�Glasgo�w�Hask�ell����=0.19's��/�Prelude��in���t��Ue�
�rf�#�ace�i�s�a���b�Gou��rt�100k�lon�g,�an���d�re�qadin�g�it�s�#�ignican���t��Uly�slo���ws����=compile�
�r�UUs�t���art�up�for�sm�Îall�mo�Gd�ule�s.��,�	ىff8�ϟ
L͍�����-=�)�Aa�cmr6�1���	?��It�Ti� �s�con��9v�enien���t�Tt��o�as�Nsu�m��9e�all�mo�A�d�ule�s�Timp�ort�t��Th��9e��1ߤN		cmtt9�Prelude�.�����*^�g�\����3��2�\����ܚ�����X@�{����c�Inform�Îa��t���ion���only�
o�ws�up�w�ards,�t��ro�w�ards��Main�.�F��*�or�que�Gs�t�ions�of�t��Uh�e�form����c\h�Îo���w�Q6i�#�s�en���t�it�y�X�P�goin��rg�t�o�b�#�e�us�1�e�Gd?",�w���e�also�n�ee�Gd�inform�Îa��t�ion�
o�ws�do�wn�w�ard����cf�*�rom�UU�Main�.�������X@�{����c�T��*�o���compile�a�mo�Gd���ule��M�,�it�sh�Îould�suce�t��ro�re�qad�t��Uh�e�in���t��Ue�
�rf�#�ace�Gs�for�mo�d���ule�s����cimm���e�Gdia��t��Uely���b�#�elo�w��M�.�W��*�e�ce�
�rt�ainly�w�an���t�t��ro�a�v�oid�re�qadin��rg�all�t��Uh�e�in���t��Ue�
�rf�#�ace�Gs����cin���t��Uh���e�do�wn�w�ard�clo�qsure�of��M�:�for��Main�,�t��Uh�a��t�could�m�e�qan�re�adin��rg�t��Uh���e�en���t�ire����cs�1�et�UUof�in���t��Ue�
�rf�#�ace�Gs.������R�Mu��t��9ually���recur�-s�(�iv�e�mo�Q�d�ule�s�<;�Exi�#�s�t���in��rg�D�imp��lem�en���t�a��t�ions�d��Te�qal�wit��Uh�m�u��rt���ually����Rrecur�s�#�iv���e�c�mo�Gd�ule�s�c�in�t���w�o�c�w�ays.�On�e�i�#�s�t��ro�compile�all�mo�Gd�ule�s�c�in�a�group�t��ro-����Rget��Uh���e�
�r,��a�cle�qan�so��lu��rt�ion,�as�wit��Uh�Y��*�ale�Hask�ell's�\compila��t�ion�u��rnit��s".�Th�e�ot��Uh�e�
�r����Ri�#�s��pt��ro�compile�e�qac���h�mo�Gd�ule�in�t��Uh�e�group�s�1�epara��t��Uely��*�,�u��rn���t�il�in���t��Ue�
�rf�#�ace�le�Gs�s�t�a�bili�#�s�1�e,����Rd��Tenot���in��rg��La�xe�Gd�p�oin���t.�Thi�#�s�m���e�qans�t��Uh�a��t�a�t�le�qas�t�on���e�mo�Gd�ule�will�h�a�v�e�t��ro�b�#�e����Rcompile�Gd�?Nwit��Uh�ze�
�ro�s�1�em�Îan���t���i���c�kno�wle�Gdge�of�t��Uh�e�ot��Uh�e�
�r�s,�wit��Uh�t�h���e�compile�
�r�m�Îak-����Rin��rg��{w���or�s�t-cas�1�e�as�qsu��rmpt���ions.�Th�e�up�qsh�Îot�of�t��Uhi�#�s�i�s�t��Uh���a��t,�for�s�1�em�Îan���t�i���c�an�Îalys�1�e�Gs����Rin���v�o��lvin��rg�UUxp�Goin���t�in�g,�UUt��Uh�e�xp�Goin���t��s�b�#�e�in��rg�compu�t��Ue�Gd�m�Îay�b�#�e�su��Ub�o���pt�im�Îal.����R�2.2��Comp��Jlet��"e��Tor�minim��}al�fu��nct��9ion�graphs?������R�Fixp�Goin���t���in��rg�1]b�y�minim�Îal�fu��rnct�ion�graphs����^��2���	�в(MF�Gs)�builds�t��Uh�e�minim�Îal�s�1�et�of����Rargu��rm���en���t-re�Gsul�t�֌pair�s��
�b>

cmmi10�G��n�ee�Gd��Te�d�֌t��ro�ev��q�alua��t��Ue�t��Uh�e�xp�Goin���t�a��t�a�sp�#�ecic�argu��rm�en���t����R�x����t}\�cmti7�init��
��.�c/Th���e�init�ial�graph�i�#�s��f�(�x����init��
��;����>�)�g����^��3���|s�.�A�t�e�qac�h�it��Ue�
�ra��t�ion,�re�Gsul��rt��s�for�all�argu�m���en���t��s����Rin��4t��Uh���e�curren���t�graph��G����	0e�rcmmi7�n��	��are�re-ev��q�alua��t��Ue�Gd,�givin��rg��G����n�+1�����.�Wh�en�an�ap�p��li���ca��t�ion�of����Ra��Afu��rnct���ion�t�o�som���e�argu�m���en���t��x��i�#�s�encou�n���t��Ue�
�re�Gd,�t��Uh���e�exi�#�s�t�in��rg�graph��G����n��j��i�#�s�s�1�e�qarc�h�e�Gd����Rfor�s�a�corre�Gsp�on���din��rg�s�re�sul�t.�s�If�t��Uh���a��t��x��i�#�s�not�pre�Gs�1�en���t,�t�h���e�re�Gsul��rt�i�#�s�t�ak�en�as��>��an�d����Rt��Uh���e��9pair�(�x;����>�)�i�#�s�ins�1�e�
�rt��Ue�Gd�in���t��ro��G����n�+1�����.�Th�e�pro�Gce�s�qs��9rep�#�e�a��t��s�u��rn���t���il��G��s�t�a�bili�#�s�1�e�Gs,����Rwh���e�
�reup�Gon�UU�G�(�x����init��
��)�d��Teliv�e�
�r�s�t��Uh�e�require�Gd�v��q�alue.�As�an�examp��le,�cons�#�id��Te�
�r:��+D����繍����#x��':

cmti10�f������Ѳ::�����R�[�2�����_���?�������2?���
�ظ!���2�����_���?�������2?���
���]���Y�������#x�f��x�����Ѳ=��������R����u

cmex10�8��	���R�<�����R�:������d�������?����7�s�if��B�?�x���=��?�����������lift��ز(�lift��(�0�))���ȸu�㈲(��lift�����(�?�)�8�t��(�f�ڧ�?�))����7�s�if��B�?�x���=���lift���ò(�?�)������ظ�x�㈸u��(��lift�����(�?�)�8�t��(�f�ڧx�))����7�s�otherwise������������R�Giv���en���x����init���v�=��%_�lift��
�(�?�),�w�e�h�a�v�e��G����0���Ҳ=�%_�f�(��lift�����(�?�)�;����>�)�g�.�Ev��q�alua��t�in��rg�(�f��8��lift��.��(�?�))�giv�e�Gs����Rre�Gsul��rt�����lift��ز(�lift��(�0�))��4�dan���d���a�n�ew�pair�(�?�;����>�),�so��G����1��C��=���f�(�?�;��>�)�;��(��lift�����(�?�)�;��lift��ز(�lift��(�0�)))�g�.����RIt��Ue�
�ra��t���in��rg�4�again�giv�e�Gs��G����2��
b��=��K�f�(�?�;����?�)�;��(��lift�����(�?�)�;��lift��ز(�lift��(�0�)))�g�4ܲan�d��G����3��
b��=��K�G����2��|s�,�so����R�G�(�x����init��
��)��=���lift���ò(��lift�����(0)).����aIn�Dt��Uhi�#�s�examp��le,�t�h���e�require�Gd�answ�e�
�r�w�as�obt�ain�e�Gd�b�y�ev��q�alua��t�in��rg��f�W��a��t�t�w�o����Rou��rt��of�it��s�four�argu�m���en���t�p�Goin�t��s.�Wh���en�t��Uh�e�argu��rm�en���t�la��t���t�i���ce�Gs�con���t�ain�t��Uh�Îousan�ds����Rof�]�p�Goin���t��s,�t��Uh���e�h�Îo�p�#�e�i�s�t��Uh���a��t�only�a�t�in�y�minor�*�it�y�of�argu��rm�en���t-re�Gsul�t�]�pair�s�n�ee�Gd�t��ro����Rb�#�e�UUcompu��rt��Ue�Gd.����aMF���Gs�h>ac�hiev�e�\lazy"�xp�Goin���t�in��rg�b�#�eca���us�1�e�t��Uh�ey�m�Îak�e�exp��li���cit�t��Uh�e�d��Tep�#�en�d�ence����Rb�#�et���w�een�?inpu��rt�an���d�ou�t�ʪpu�t�p�Goin���t��s.�Not���i���ce�h�Îo�w�t��Uh�e�algor�*�it��Uhm�i�#�s�limit��Ue�Gd�t��ro�r�s�t��R����ff8�ϟ
L͍�����-=�2���	?��A�Tfu��nct��9ion's�graph�i� �s�no�more�t��Th�an�a�co��llect�ion�of�argu��m�en���t-re�A�sul�t�Tpair��s�for�it.��������-=�3���	?��,����		cmsy9�>�T�if�m��axim�al�Txp�A�oin���t��fs�are�sough��9t,��?��for�minim��al�xp�oin���t��fs.�����@��g�\����3��2�\����ܚ��,�ord��Te�
�r��6fu��rnct���ions:�high�e�
�r�ord��Te�r�xp�Goin���t���in��rg�w�ould�require�compar�*�in��rg�comp��let��Ue�fu�nc-����,t���ion���repre�Gs�1�en���t�a��t�ions,�whi���c�h�i�#�s�preci�s�1�ely�wh���a��t�lazy�xp�Goin���t�in��rg�i�#�s�d��Te�Gs�ign���e�d���t��ro�a���v�oid.����,Nev���e�
�rt��Uh�ele�Gs�qs,���b�y�ext��Uen�din��rg�t��Uh�e�not�ion�of�d��Tep�#�en�d�ency���b�#�et�w�een�inpu��rt��s�an�d�ou��rt�ʪpu�t��s,����,F��*�e�
�rguson�	an���d�Hugh�e�Gs�[�FH93��!]�h�a�v�e�su�cce�Gs�qsfully�gen�e�
�rali�#�s�1�e�Gd�MF�Gs�t��ro�w�or��k�in�t��Uh�e����,high���e�
�r�T�ord��Te�r�cas�1�e,�callin��rg�t��Uh���em�concret��Ue�d�a��t���a�s�tru�ct�ure�Gs�(CDSs),�an�d�Ro�qs�1�en�d��ra�hl����,rep�Gort��s�UUs�#�imilar�re�sul��rt��s�[�Ro�qs93��j�].����;F��*�u��rnct���ion�Îal�6t�yp�#�e�Gs�a�b�qs�tract�t��ro�dom�Îains�wit��Uh�so�m�an���y�p�Goin���t��s�t��Uh�a��t�lazy�xp�Goin���t-����,in��rg�p�can�m�Îak���e�an�enormous�die�
�rence�for�high�e�
�r�ord��Te�r�an�Îalys�#�i�s.�p�F��*�e�rguson�an���d����,Hugh���e�Gs�UUgiv�e�gure�Gs�for�t��Uh�e�f�#�amous��foldr�-�concat��examp��le:������;���foldr�?�::�(a�->�b�->�b)�->�b�->�[a]�->�b�����;��foldr�?�f�a�[]�=�a����;��foldr�?�f�a�(x:xs)�=�f�x�(foldr�f�a�xs)�����;��concat�?�::�[[a]]�->�[a]����;��concat�?�=�foldr�(++)�[]����,�wh���e�
�re��P�(++)��i�#�s�t��Uh�e�Hask�ell�li�#�s�t-ap�p�en�d��Po�p�e�
�ra��t��ror.��PUs�in�g��Pa�BHA-s�t���yle�forw�ard�a�b-����,s�tract���in���t��Ue�
�rpret���a��t�ion�[�BHA85�� []�require�Gs�buildin��rg�an�ins�t�ance�of��foldr��in�t��Uh�e�do-����,m�Îain�=�[�4�J��!��4��!��4�]��!��4��!��6��!��4�.�Thi�#�s�giv���e�Gs�an�argu��rm�en���t�la��t���t�i���ce�of�almo�qs�t����,600,000��1p�Goin���t��s.�Compu��rt���a��t�ion��1of�t��Uh���e�en�t���ire�fu��rnct�ion�graph�t�ak�e�Gs�on�t��Uh�e�ord��Te�
�r����,of��Gan�h�Îour�us�#�in��rg�t��Uh���e�f�*�ron���t�ie�
�r�s�algor�*�it��Uhm�[�FH93��!],�wh�e�
�re�qas�wit��Uh�CDSs�compu��rt�in�g����,jus�t��#t��Uh�Îo�qs�1�e�part��s�n���ee�Gd��Te�d��#t��ro�d�et��Ue�
�rmin���e�t��Uh�e�en���t�ire�xp�Goin���t�of��concat��t�ak�e�Gs�t�w�o�or����,t��Uhree��	s�1�econ���ds�u��rn�d��Te�
�r�s�#�imilar�circu��rms�t�ance�Gs.�F��*�or�more�comp��lex�fu��rnct�ion�space�Gs�t��Uh�e����,die�
�rence�UUi�#�s�ev���en�gre�qa��t��Ue�r.����;Giv���en�"su�c�h�an�o�v�e�
�rwh�elmin��rg�p�#�e�
�rform�Îance�adv��q�an���t�age,�it�i�#�s�t��Uempt�in��rg�t�o�for-����,get��en���t���irely�a�b�Gou��rt�an�y�ot��Uh�e�
�r�xp�Goin���t�in��rg�s��Tc�h�em�e.�Y��*�et�in���t��Uegra��t�ion�of�CDS�qbas�1�e�Gd����,xp�Goin���t���in��rg�.+pro�v�e�s�.+trou��Ub��le�som�e�.+wh�en�view�e�Gd�f�*�rom�a�wid��Te�
�r�f�ram���ew�or��k.�Th�e�
�re�are����,t���w�o���as-y�et�u��rnre�Gso��lv�e�d���i�#�s�qsue�s.�Fir�s�t��Uly��*�,���as�di�#�s��Tcus�qs�1�e�d�b�#�elo���w,�w�e�h�a�v�e�a�d��Teep�d�e�Gs�#�ire����,t��ro��Qa���v�oid�monomorphi���c�an�Îalys�1�e�Gs�of�an�y�kin�d.�CDSs�as�pre�Gs�1�en���t��Ue�d�so�f�#�ar�are�purely����,monomorphi���c.�;�Beca���us�1�e�of�t��Uh���e�n�ee�Gd�t��ro�clo�qs�1�ely�exp�o�qs�1�e�d��Tep�#�en���d�encie�s�;�b�#�et���w�een�su��Ub-����,part��s���of�t��Uh���e�inpu��rt�an�d�su��Ub-part��s�of�t�h���e�ou��rt�ʪpu�t,���it�i�#�s�not�cle�qar�h�Îo�w�t��Uh�ey�m�Îay�b�#�e����,us�1�e�Gd��,in�a�p�o��lymorphi���c�w���ay��*�.�F�or�r�s�t-ord��Te�
�r��,MF���G-s�t�yle��,xp�Goin���t�in��rg,�p�Go��lymorph-����,i�#�sm�Q�i�s�not�a�prob��lem:�K���u��Ubiak�[�KHL91���"]�h�as�imp��lem�en���t��Ue�Gd�a�p�o��lymorphi���c�pro��8ject���ion����,an�Îalys�1�e�
�r�UUwit��Uh�MF���G�xp�Goin���t�in��rg�in�t��Uh�e�Glasgo�w�Hask�ell�compile�
�r.����;A���more���imm���e�Gdia��t��Ue�prob��lem�wit��Uh�lazy�xp�oin���t���in��rg�i�#�s�h�Îo�w�t��ro�d��Te�qal�wit��Uh�mo�Gd�ule�s.����,A�dScrud��Te�dWs��Tc���h�em�e�i�#�s�t��ro�exp�Gort�wh�a��t��Uev�e�
�r�part��s�of�t��Uh�e�a�b�qs�tract�fu��rnct�ion�graph�h�a�v�e����,b�#�een�{Saggrega��t��Ue�Gd�whils�t�compilin��rg�t��Uh���e�d��Tenin�g�mo�Gd���ule.�If,�compilin�g�som���e�ot��Uh�e�
�r����,mo�Gd���ule,���t��Uh�e�compile�
�r�n�ee�Gds�t��ro�kno�w�t��Uh�e�xp�Goin���t�a��t�som�e�p�Goin���t�for�whi���c�h�no����,inform�Îa��t���ion��i�#�s�a�v��q�aila�b��le,�it�i�#�s�som�et�im�e�Gs�p�o�qs�s�#�ib��le��t��ro�m�Îak���e�a�safe�e�s�t���im�Îa��t��Ue�us�#�in��rg����,monot��roni���cit���y�UUan�d�t��Uh�e�inform�Îa��t�ion�whi���c�h��is��a�v��q�aila�b��le.����;F��*�or��!examp��le,�h���a�vin��rg��!exp�Gort��Ue�d��G��j�=��f�(�x����1��|s�;���f���x����1���)�;��(�x����2���;�f���x����2���)�g��!�w���e�m�Îay�wi�#�sh�t��ro����,kno���w��`(�f��x����3��|s�)�in�t��Uh�e�cas�1�e�wh�e�
�re��x����3��	]�v��}�x����1��	Ӳan�d��x����3��	]�v��}�x����2��|s�.�Since��f���i�#�s�monot��roni���c����,it�GGfo��llo���ws�t��Uh�a��t��f�m�x����3���Ƹv�ZS�f�x����1��ú�an�d�GG�f�x����3���Ƹv�ZS�f�x����2��|s�,�an���d�so��f�x����3���Ƹv�ZS�(�f�x����1��V��u��+�f�x����2��|s�).����,Pro���vid��Te�Gd�/�w�e�are�w�or��kin��rg�in�a�f�*�ram�ew�or��k�wh�e�
�re�o�v�e�
�re�Gs�t�im�Îa��t�ion�i�#�s�safe,�t��Uhi�s�giv���e�Gs����,an�UUap���pro�xim�Îa��t��Ue�v��q�alue�for��f�ڧx����3��|s�.�����V�g�\����3��2�\����ܚ��a�Cle�qarly��*�,���t��Uh���e�bigge�
�r�t�h���e�exp�Gort��Ue�d����G�,�t�h���e�b�#�et���t��Ue�
�r�t�h���e�e�Gs�t�im�Îa��t��Ue�s���t��Uh�a��t�can�b�#�e�m�Îad��Te����Rf�*�rom��Tit.�Bu��rt�t��Uh���e�wh�Îo��le�purp�Go�qs�1�e�of�MF�Gs�i�#�s�t��ro�k�eep��G��as�sm�Îall�as�p�Go�qs�s�#�ib��le,����Rcon���t���ainin��rg��p�#�e�
�rh�ap�qs�a�h�an�dful�of�p�Goin���t��s�ou��rt�of�t��Uh�Îousan�ds�of�can�did��ra��t��Ue�Gs.�Thi�#�s����Rmilit���a��t��Ue�Gs�3Oagains�t�m�Îakin��rg�go�o�d�ap���pro�xim�Îa��t�ions.�3OW��*�or�s�1�e,�not�all�t��Uh���e�p�oin���t��s�in��G����R�m�Îay��b�#�e�us�1�e�Gd�in�m�akin��rg�t��Uh���e�ap�pro�xim�Îa��t�ion:�in�t��Uh�e�examp��le�a�b�Go�v�e,�w�e�are�limit��Ue�Gd����Rt��ro�UUus�#�in�g�p�Goin���t��s��f�(�y�[�;���f�ڧy��)���2��G��0�j��x����3��C��v���y�[ٸg�.����aA�>�s�1�econ���d,�?!equally�u��rn�e�Gdifyin�g�?!so��lu�t�ion�?!i�#�s�t��ro�exp�Gort�not�only��G�,�bu�t�t��Uh���e�re-����Rcur�s�#�iv���e��Gdom�Îain�equa��t�ion�f�*�rom�wh�ence�it�cam�e�{�or�ev�en�t��Uh�e�source�t��Uext�whi���c�h����Rb�#�ega��t�dt��Uh���e�equa�t���ion.�Th�en,�wh�en��G��cannot�answ�e�
�r�a�que�ry��*�,�it�i�#�s�ext��Uen���d��Te�Gd,�in�t��Uh�e����Rm�Îann���e�
�r�:�d��Te�Gs��Tcr�*�ib�#�e�d�a���b�o�v�e,�:�as�require�Gd.�If�t��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions�get�large,����Rd���u��rmpin�g��/t��Uh�em�in���t��ro�in�t��Ue�
�rf�#�ace�le�Gs�m�Îay�not�b�e�pract���i���cal.�Thi�s�s��Tc���h�em�e��/also�h���as�a����Rmore��xsu��Ubt�le�w���e�qakn�e�Gs�s.��xA��hcru�cial�ins�#�igh�t�i�#�s�t��Uh�a��t�n�din��rg�t��Uh�e�xp�Goin���t�of�a�dom�Îain����Requa��t���ion���m�Îak�e�Gs�it�s�t�an�d�on�it��s�o�wn:�it�no�lon��rge�
�r�refe�rence�Gs�an���y�ot��Uh�e�
�r�equa��t�ion.����RCons�#�id��Te�
�r�͗t��Uh���e�fo��llo�win��rg�t��Uhree�mo�Gd�ule�s�͗d��Tenin��rg�recur�s�#�iv�e�fu��rnct�ions��f�,��g��an�d��h��wit��Uh����Rcorre�Gsp�on���din��rg�UUequa��t�ions��f#�,��g#��an�d��h#�:���m��a���module�?�F(f)�where�{�D?�f�=�...�f�...�$��}����a��module�?�G(g)�where�{�import�F;���g�=�...�g�...�f�...�}����a��module�?�H(h)�where�{�import�G;���h�=�...�h�...�g�...�}����R�Du��rmpin�g�UUt��Uh���e�u��rnso��lv�e�Gd�dom�Îain�equa��t�ions�in���t��ro�in�t��Ue�
�rf�#�ace�(�.hi�)�le�Gs�giv���e�s:����a���F.hi:���f#�?�=�...�f#�...����a��G.hi:���g#�?�=�...�g#�...�f#�...����a��H.hi:���h#�?�=�...�h#�...�g#�...����R�Wh���en��mo�Gd�ule��H��i�#�s�compile�Gd�it�m�Îay�b�e�n���ece�Gs�qsary�t��ro�ext��Uen�d�t��Uh�e�fu��rnct�ion�graph����Rfor�N��g#�.�Th���e�trou��Ub��le�i�#�s�t�hi�#�s�m���e�qans�re�adin��rg�in���t��Ue�
�rf�#�ace��F.hi��ev���en�t��Uh�Îough�t�h���e�t��Uext�of����Rmo�Gd���ule����H��Ӳdo�#�e�s�not�direct��Uly�refe�
�r�t��ro��F�:�in�gen���e�ral,�it�migh���t�b�#�e�n�ece�Gs�qsary�t��ro�re�ad�all����Rin���t��Ue�
�rf�#�ace�Gs�؍in�t��Uh���e�do�wn�w�ard�clo�qsure�of��H�.�An�y�s��Tc�h�em�e�whi���c�h�exp�Gort��s�in���t��ro�in�t��Ue�
�rf�#�ace����Rle�Gs�՜refe�
�rence�s�t��ro�fu�nct���ions�in�ot��Uh�e�
�r�mo�Gd�ule�s�՜sue�
�r�s�t��Uh���e�sam�e�prob��lem.�M��re�
�rely����Rinlinin��rg�?]refe�
�rence�Gs�t�o�ot��Uh���e�
�r�equa��t�ions�do�#�e�Gs�not�h�elp,�as�t��Uhi�#�s�m�Îak�e�Gs�t��Uh�e�in���t��Ue�
�rf�#�ace�Gs����Rcon���t���ain�UUev�e�
�ryt��Uhin��rg�b�#�elo�w�t��Uh�em�in�t��Uh�e�hie�
�rarc�h�y��*�,�an�d�h�ence�v�e�
�ry�large:����a���F.hi:���f#�?�=�...�f#�...�����a��G.hi:���g#�?�=�letrec�f#�=�...�f#�...�/?�in�...�g#�...�f#�...�����a��H.hi:���h#�?�=�letrec�f#�=�...�f#�...�/?�in�������letrec�?�g#�=�...�g#�...�f#�...�
�in�...�g#�...�h#�...����R�Beca���us�1�e���of�t��Uh���e�Gs�e�dicul��rt���ie�Gs,�lazy�xp�oin���t���in��rg�do�#�e�s�not�s�1�eem�t��ro�t�w���ell�in�an����Ren���vironm�en���t�UUwh�e�
�re�s�1�epara��t��Ue�compila�t���ion�i�#�s�t��Uh�e�norm.���m��R�2.3��P��9o��Jlymorphi��c��Tor�Monomorphi�c?����R�P���aram�etr�*�i���c�~Vp�Go��lymorphi�#�sm�i�s�an�imp�Gort���an���t�elem�en���t�of�t��Uh�e�t�yp�#�e�sys�t��Uems�of�mo�Gd��Te�
�r�n����Rfu��rnct���ion�Îal�UUlan�guage�Gs.�Giv���en�a�param�etr�*�i���cally�p�Go��lymorphi�c�fu��rnct���ion,�w�e�could:�����kJ�g�\����3��2�\����ܚ�����2@�{����=�Re�Gdo���t��Uh���e�an�Îalys�#�i�s���for�e�qac�h�die�
�ren���t�ins�t�an���t�ia��t�ion�of�t��Uh�e�fu��rnct�ion.�Thi�#�s�i�s����=equiv��q�alen���t�ߗt��ro�expan���din�g�ou�t�t��Uh���e�program�in���t�o�a�co��llect���ion�of�monomorphi���c����=ins�t���ance�Gs�UUb�#�efore�an�Îalys�i�s.���ٍ����2@�{����=�An�Îalys�1�e�&�t��Uh���e�fu��rnct�ion�once,�an�d�us�1�e�p�Go��lymorphi���c�in�v��q�ar�*�iance�re�Gsul��rt��s�t�o�d��Te�qal����=wit��Uh�UUdie�
�ren���t�ly�ins�t���an���t�ia��t��Ue�Gd�us�1�e�s�la��t��Ue�
�r�on.��Q���,An���oft-quot��Ue�Gd�di�#�sadv��q�an���t���age�of�t��Uh�e�form�e�
�r�ap�proac�h�i�#�s�t��Uh�a��t�p�Go��lymorphi���c�fu��rnct�ions����,m�Îay��Db�#�e�an�alys�1�e�Gd�m�an���y�t�im�e�Gs,�whi���c�h�i�#�s�w�as�t��Ueful.�In�t��Uh�e�w�or�s�t��Dcas�1�e,�t��Uh�e�n��Uu��rm��|qb�#�e�
�r�of����,ins�t���ance�Gs���can�b�#�e�exp�on���en���t�ial���in�t��Uh���e�len��rgt�h�of�t�h���e�program.�Nev�e�
�rt��Uh�ele�Gs�qs,�su�c�h�b�#�e-����,h���a�viour�tfdo�#�e�Gs�not�ap���p�e�qar�t��ro�o�Gccur.�M�e�qasurem���en���t��s�b�y�Mar��k�Jon�e�Gs�of�s�#�ix�su��Ub�qs�t�an���t�ial����,programs�6{in�t��Uh���e��nofib��suit��Ue�[�P�ar92��q�]�sugge�Gs�t�a�t�w�ofo��ld�incre�qas�1�e�in�t��Uh�e�n��Uu��rm��|qb�#�e�
�r�of����,bin���din��rg��group�qs�[�Jon93����].�F��*�urt��Uh�e�
�r,�only�s�#�imp��le�li�s�t-h���an�dlin��rg��fu�nct���ions�lik�e��map��an�d����,�foldr�S��h���a�v�e�a�large�n��Uu��rm��|qb�#�e�
�r�of�ins�t�ance�Gs,�an�d�su�c�h�fu��rnct�ions�are�oft��Uen�inlin�e�Gd�b�y����,o���pt�imi�#�s�in��rg���compile�
�r�s�an���yw�ay��*�.���So�monomorphi���c�an�Îalys�#�i�s���m�ay�not�act���ually�in�v�o��lv�e����,m��Uu���c�h�%d�up��li���ca��t�ion�of�w�or��k.�Ob�qs�1�e�
�rv�e�also�t��Uh�a��t�s�#�ince�t��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions�of����,t���yp�#�e�Gs���oft��Uen�m�Îap�qs�m�an���y�t�yp�#�e�Gs�t��ro�t��Uh�e�sam�e�la��t���t�i���ce,�monomorphi�#�sa��t�ion�on�t��Uh�e�bas�#�i�s����,of�UUla��t���t���i���ce�Gs�ca�us�1�e�Gs�ev���en�le�s�qs�expans�#�ion.����;More�qs�1�e�
�r�*�ious�i�#�s,�once�again,�t��Uh���e�in���t��Ue�ract���ion�of�monomorphi�#�sa��t�ion�wit��Uh�mo�Gd-����,ule�Gs.�^RF��*�or�a�mo�d���ule��M�^O�exp�ort���in��rg�a�p�o��lymorphi���c�fu��rnct���ion��f�,�w�e�can�e�Git��Uh�e�
�r�an�Îalys�1�e����,�f��ɲa��t�all�t��Uh���e�ins�t�ance�Gs�it�will�get�us�1�e�d�a��t,�or�w���e�can�w�ait�u��rn���t�il�all�mo�Gd�ule�s���a�b�o�v�e����M����,�are���compile�Gd�an���d�re�qan�Îalys�1�e��f��on�an�as-n�ee�Gd��Te�d���bas�#�i�s.�Bot��Uh�s��Tc���h�em�e�Gs�are�u��rn�Îa��t���tract-����,iv���e,���t��Uh�e�r�s�t�b�#�eca���us�1�e�it�require�Gs�a�do���wn�w�ard�(�Main��t��ro��Prelude�)�pas�qs�t��Uhrough�t�h���e����,mo�Gd���ule��ggraph�t��ro�e�s�t���a�b��li�#�sh��gins�t�an���t�ia��t�ions,��gt��Uh�e�s�1�econ�d�b�#�eca���us�1�e�of�t��Uh�e�n�ee�Gd�t��ro�carry����,arou��rn���d�UU�f�'s�source�t��Uext�wh�en�compilin��rg�mo�Gd�ule�s�UUa�b�o�v�e�UU�M�.����;P���o��lymorphi���c�\�an�Îalys�#�i�s�circu��rm���v�en���t��s�b�Got��Uh�prob��lems�b�#�eca���us�1�e�a�s�in��rgle�an�Îalys�i�s����,s�1�e�
�rv���e�Gs��[all�que�r�*�ie�Gs,�ev���en�t��Uh�Îo�qs�1�e�f�rom�die�
�ren���t�mo�Gd���ule�s.��[W��*�or��k�b�y�Baraki,�Hugh�e�Gs����,an���d�mLa���u��rnc�h�bury�[�Bar93��,��HL92b��!�X]�(t��ro�m�en���t�ion�bu��rt�a�few)�h�as�e�Gs�t�a�b��li�#�sh�e�d�mt��Uec�h-����,nique�Gs�0#for�b�ot��Uh�forw���ard�an�d�bac�kw�ard�p�Go��lymorphi���c�s�tr�*�i�ctn���e�Gs�qs�an�Îalys�1�e�s.�Bac���k-����,w���ard��%an�Îalys�1�e�Gs�len�d�t��Uh�ems�1�elv�e�Gs�part�i���cularly�w�ell�t��ro�su�c�h�an�ap�proac�h:�Sect�ion�5����,of�[�Sew94��8�]��d��Te�Gs��Tcr�*�ib�#�e�s�su���c�h�an�an�Îalys�#�i�s�in�cons�id��Te�
�ra���b��le�d�et���ail.�Baraki's�w�or��k�in�di���c-����,a��t��Ue�Gs���h�Îo���w�som�e�forw�ard�an�Îalys�1�e�Gs�m�ay�b�#�e�m�ad��Te�p�Go��lymorphi���c:�[�Sew94��8�],�Sect���ion�3����,d��Te�Gs��Tcr�*�ib�#�e�s�UUan�imp��lem���en���t�a��t�ion.����;F��*�or��dr�s�t�ord��Te�
�r�fu��rnct���ions,�p�Go��lymorphi���c�t��Uec�hnique�Gs�giv�e�t��Uh�e�sam�e�re�Gsul��rt��s�as����,monomorphi���c�82an�Îalys�#�i�s:�t��Uh���ey�are�exact.�Bu��rt�in�t�h���e�high�e�
�r�ord��Te�r�cas�1�e,�accuracy����,m�Îay���b�#�e�lo�qs�t.�F��*�or�bac���kw�ard���an�alys�1�e�Gs,�whi���c���h�are�inh�e�
�ren���t��Uly�r�s�t-ord��Te�r,���t��Uhi�#�s�m�Îay����,b�#�e��accept���a�b��le.�F��*�or�ot��Uh�e�
�r�an�Îalys�1�e�Gs,�t��Uh�e�m�Îagnit�ud��Te�of�t��Uhi�#�s�prob��lem�h�as�y�et�t��ro�b�#�e����,quan���t���ie�Gd.��!�<��,�2.4��High��9e�Dr��Tor�r�-s�t��Tord���e�r?���<��,�High���e�
�r��ord��Te�r�xp�Goin���t���in��rg�i�#�s�dicul�t�b�#�eca���us�1�e�t��Uh���e�la��t�t���i���ce�s�#�ize�Gs�for�fu��rnct�ion�space�Gs����,gro���w�8�so�rapidly��*�.�F�or�examp��le,�in�s�tr�*�i���ctn���e�Gs�qs�an�Îalys�#�i�s,�8�an�it��Uem�of�t�yp�#�e��[Int]�?�->�[Int]����,�migh���t���a�b�qs�tract�t��ro�dom�Îain�[�4�\�!��4�],�whi���c���h�h�as�35�p�Goin���t��s.�Addin��rg�a�s�1�econ�d�para-����,m���et��Ue�
�r�o�of�t��Uh�e�sam�e�t�yp�#�e�giv�e�Gs�dom�Îain�[�4���!��4��!��4�],�o�wit��Uh�24,696�p�oin���t��s,�an�incre�qas�1�e����,of���o���v�e�
�r�700�t�im�e�Gs.�Th�e�n��Uu��rm��|qb�#�e�
�r�of�p�Goin���t��s�in�[�4�v��!��4��!��4��!��4�]�i�#�s�ce�
�rt���ainly�v�e�
�ry�����|	�g�\����3��2�\����ܚ��R�large.��oMan���y�fu��rnct�ion�Îal�param�et��Ue�
�r�s�h�a�v�e�t�yp�#�e�Gs�more�comp��li���ca��t��Ue�d�t��Uh���an�t�hi�#�s,�an���d����Rcalcula��t���in��rg�UUcomp��let��Ue�xp�Goin���t��s�in�t��Uh�e�Gir�pre�s�1�ence�i�#�s�impract���i���cal.����aFixp�Goin���t���in��rg���b�y�t��Ue�
�rm�rewr�*�it�in��rg�som�et�im�e�Gs�f�#�ails�in�t��Uh�e�pre�Gs�1�ence�of�fu��rnct�ion�Îal����Rparam���et��Ue�
�r�s.�� In�t��Uh�e�gen�e�
�ral�cas�1�e,�high�e�
�r�ord��Te�r�equa��t���ions�cannot�b�#�e�so��lv�e�Gd,�b�#�eca���us�1�e����Rt��Uh���e�Gir��xp�oin���t��s�d��Tep�#�en���d�on�t��Uh�e�xp�Goin���t��s�of�t��Uh�e�fu��rnct�ion�Îal�param�et��Ue�
�r�s.�Th�e�usual����Rm���et��Uh�Îo�Gd�՛of�rewr�*�it�in��rg�adjacen���t�ap�pro�xim�Îa��t�ions�t��ro�norm�Îal�form�f�#�ails�t�o�d��Tet��Uect�an����Ro���v�e�
�rall�`xp�Goin���t�b�#�eca���us�1�e�su��Ub�qs�equen���t�ap���pro�xim�Îa��t�ions�`con�t�ain�`som�e�t��Ue�
�rm�in�v�o��lvin��rg����Ra�t�fu��rnct���ion�Îal�param�et��Ue�
�r�ap�p��lie�Gd�more�an�d�more�t�im�e�Gs.�Thi�#�s�o�ccur�s,�for�examp��le,����Rin�UUxp�Goin���t���in��rg�forw�ards�a�b�qs�tract�ions�of��foldr�:��Hٍ�a���foldr#(n)���=�?�\f�a�xs�->�...�f�(f���...�(f�E)�...�)�...�����a��foldr#(n+1)�?�=�\f�a�xs�->�...�f�(f�(f�...�(f�E)�...�)�)�...����R�wh���e�
�re��E��i�#�s�som�e�arbitrary�t��Ue�
�rm,�an�d��foldr#(n)��an�d��foldr#(n+1)��d��Tenot��Ue�t�w�o����Radjacen���t�1�ap���pro�xim�Îa��t�ions�t��ro�t��Uh�e�xp�Goin���t.�He�
�re,��f��i�#�s�a�fu��rnct�ion�Îal�param�et��Ue�
�r�b�#�e�Gin��rg����Rwrap���p�#�e�Gd���more�an�d�more�t�im�e�Gs�arou��rn�d��E�,�t��Uh�e�
�re��Tb�y�m�Îakin��rg�syn���t�act�i���c�d��Tet��Uect�ion�of����Ra���xp�Goin���t�imp�o�qs�s�#�ib��le.���Of�cour�s�1�e,�if�t��Uh���e�t��Ue�
�rm�rewr�*�it�e�
�r�i�#�s�extrem���ely�clev�e�
�r�it�can����Rd��Tet��Uect��#t��Uh���a��t,�for�som�e�suit�a�b��ly�large��n�,���f���� ��\p�n���b�=��M��x�����f��R��,�so�it�can�rep�lace���f��3�(��x������f��ڲ)�b���y�����R�x���`>1�f��h��an���d�-�t��Uh�e�
�re��Tb�y�gen�e�
�ra��t��Ue�norm�Îal�forms�whi���c�h�d��Tep�#�en�d�exp��li���cit��Uly�on��f�'s�xp�Goin���t.����RTh���e��prequire�Gd�pa��t���t��Ue�
�r�#�n�m�Îa�t���c�hin��rg��pi�#�s�tr�*�i���c���ky�{�not�so�s�imp��le�for�dou��Ub�ly�recur�s�#�iv���e����Rt��Ue�
�rms��_{�an���d�w�e�n�ee�Gd�t��ro�d��Tecid�e��_on�a�suit�a�b��le��n�.�Th�e�v��q�alue�of��n��d��Tep�#�en�ds�on�t��Uh�e����Rfu��rnct���ion�ܭspace�in�que�Gs�t�ion�{�cle�qarly��*�,�w�e�n�ee�Gd�a�qui���c�k�algor�*�it��Uhm�for�givin��rg�a����Rgo�Go�d���o���v�e�
�re�Gs�t�im�Îa��t��Ue�of�t��Uh�e�fu��rnct�ion�space's�h�e�Gigh�t.�Nielson�an�d�Nielson�lo�Gok�e�d���a��t����Rt��Uhi�#�s���prob��lem�[�NN92��],�bu��rt�t�h���e�Gir�w�or��k�can�giv�e�exce�Gs�qs�#�iv�ely�large�e�Gs�t�im�Îa��t��Ue�s���an�d�i�#�s����Rof��[limit��Ue�Gd�ap���p��li���ca�bilit�y��*�.��[A��>more�fu��rn���d�am�en���t�al��[prob��lem�i�#�s�p�Go�lymorphi�#�sm:�in�t��Uh���a��t����Rcas�1�e,�㾵n��v��q�ar�*�ie�Gs�wit��Uh�t�h���e�ins�t�an���t�ia��t�ion,�so�t��Uh�e�not�ion�of�compu��rt�in�g��a�s�#�in��rgle�v��q�alue����Rfor�UUit�i�#�s�nons�1�ens�e.����aNev���e�
�rt��Uh�ele�Gs�qs,��for�high���e�r�ord��Te�r�equa��t���ions�whi���c�h�do�not�d��Tep�#�en�d�on�t��Uh�e�xp�Goin���t��s����Rof��1t��Uh���e�Gir�fu��rnct�ion�Îal�param�et��Ue�
�r�s,�t�e�
�rm�bas�1�e�Gd�xp�oin���t���in��rg�w�or��ks�w�ell�an�d�can�b�#�e����Rt��Uh�Îousan���ds���of�t�im�e�Gs�c�h�e�qap�#�e�
�r�t��Uh�an�us�#�in��rg�f�*�ron���t�ie�
�r�s.�Su�c�h�equa��t�ions�can�b�#�e�gen�e�
�ra��t��Ue�Gd,����Rfor�՞examp��le,�f�*�rom�t��Uh���e�forw�ards�a�b�qs�tract�ions�of��map��an�d��filter��([�Sew94��8�],�Sect�ion����R4.3.5).��Hٍ�R�In���d���efence�of�r�-s�t���ord�e�Dr�an��}alys�(�i�s��Thi�#�s�%�pap�e�
�r�argue�Gs�agains�t�high���e�r�ord��Te�r����Ran�Îalys�1�e�Gs.�^�Wh���en�mo�d���ule�s�are�also�t���ak�en�^�in���t��ro�accou�n���t,�t��Uh���e�n�u��rm��|qb�#�e�
�r�of�d��Te�Gs�ign�con-����Rs�train���t��s��b�#�ecom���e�Gs�in�t��ro��le�
�ra���b�le.��Can�su�c�h�a�s�t��Uep�b�#�e�jus�t���ie�Gd?�W��*�ell,�t�ak�en�in�a�wid��Te�
�r����Rcon���t��Uext,�9:m�Îayb�#�e.�High���e�
�r�ord��Te�r�fu��rnct���ions�d��Tefe�qa��t�adv��q�ance�Gd�co�d��Te�gen���e�
�ra��t�ion�9:t��Uec�h-����Rnique�Gs,�Z�lik���e�ar�*�it�y�c�h�ec�k�a�v�oid��rance,�u�n��|qb�Go���xin�g�an���d�argu�m���en���t��s�in�regi�#�s�t��Ue�
�r�s,�Z�s�ince����Rt��Uh���ey���repre�Gs�1�en���t�calls�t��ro�comp��let��Uely�u�nkno���wn�fu�nct���ions.�A��q�ugus�t��s�qson�[�A�ug93���]���sug-����Rge�Gs�t��s�>�t��Uh���a��t�callin��rg�a�kno�wn�fu��rnct�ion�co�qs�t��s�h�alf�as�m��Uu�c�h�as�callin��rg�an�u�nkno���wn����Ron���e.����aTh���e��(Hask�ell)�compile�
�r�comm��Uu��rnit�y�go�t��ro�cons�#�id��Te�
�ra�b��le�trou��Ub�le�t��ro�get�r�*�id�of����Rcalls�UUt��ro�high���e�
�r�ord��Te�r�fu��rnct���ions.�F��*�or�examp��le:�������X@�{����c�Simp��le��non-recur�s�#�iv���e�com��|qbin�Îa��t��ror�s�lik���e��(.)��an�d��thenS��Ѳare�inlin�e�Gd�(in�Glasgo�w����cHask���ell).�����	���g�\����3��2�\����ܚ�����2@�{����=�Prelud��Te�uDfu��rnct���ions�whi���c�h�pas�qs�fu��rnct�ion�Îal�param�et��Ue�
�r�s�alon��rg�u�nc���h�an�ge�Gd,�uDlik�e����=�map�UU�an���d��foldr�,�are�u��rnfo��ld��Te�Gd�t�o�form�sp�#�eciali�s�1�e�Gd�UUv���e�
�r�s�ions�(in�Y��*�ale�Hask���ell).��
E�����2@�{����=�Ov���e�
�rload��Te�Gd��efu��rnct�ions�are�sp�#�eciali�s�1�e�Gd�a��t�t��Uh���e�ir�us�1�e�ins�t���ance�s,�a��t�le�qas�t�wit��Uhin����=s�#�in��rgle���mo�Gd���ule�s�(Glasgo���w�an�d�Ch�alm�e�
�r�s).�Thi�#�s�a�v�oids�a�gre�qa��t�d��Te�al�of�t��Uh���e����=high���e�
�r�uGord��Te�r�m�Îac���hin�e�
�ry�whi���c�h�i�#�s�oft��Uen�as�qso�Gcia��t�e�d�uGwit��Uh�imp��lem���en���t�a��t�ions�uGof����=o���v�e�
�rloadin��rg.��ύ�,Nelan�[�Nel91����]���d��Te�Gs��Tcr�*�ib�#�e�s�a��t�som���e�len��rgt��Uh�t��Uec�hnique�Gs�for�wh�a��t�h�e�t��Ue�
�rm�e�Gd��rstic-����,ation�:��lt��Uh���e�a���u��rt�om�Îa��t�i���c��lremo�v��q�al�of�high�e�
�r�ord��Te�r�fu��rnct���ions.�Al�t��Uh�Îough�con���v�e�
�r�s�#�ion��lof����,high���e�
�r-ord��Te�r�iprograms�t��ro�r�s�t-ord�e�
�r�ii�#�s,�in�gen���e�ral,�imp�Go�qs�s�#�ib��le,�iprogramm���e�r�s,�b���y����,an���d�83large,�us�1�e�high�e�
�r-ord��Te�r�#�n�e�Gs�qs�83in�ce�
�rt�ain�idiom�Îa��t�i���c�w�ays�whi���c�h��ar��}'e��am�en�Îa�b��le�t��ro����,r�s�t���ica��t�ion��Dus�#�in��rg�Nelan's�m�Îac���hin�e�
�ry��*�.��DThi�s�m�Îac���hin�e�
�ry��*�,��Dcom��|qbin�e�Gd�wit��Uh�aggre�s�qs�#�iv���e����,inlinin��rg,���can�b�#�e�rem�Îar��k���a���b��ly�eect�iv�e.�Ev�en�wit��Uh�Îou��rt�us�#�in�g�r�s�t���ica��t�ion,���m��Uu�c�h�of����,t��Uh���e�UUo�pt�imi�#�s�1�e�Gd�co�d��Te�d�e�qal��rt�wit��Uh�ins�#�id�e�Glasgo���w�Hask�ell�i�#�s�purely�r�s�t�ord��Te�
�r.����;F��*�rom��Aa�s�tr�*�i���ctn���e�Gs�qs�an�Îalys�#�i�s��Ap�oin���t�of�view,�r�s�t��Aord��Te�
�r�an�Îalys�#�i�s��Ah���as�t�w�o�m�Îa��8jor����,adv��q�an���t���age�Gs:�������2@�{����=�Fixp�Goin���t���in��rg���i�#�s�e�qas�ie�
�r.�Th���e�f�*�ron���t�ie�
�r�s�algor�*�it��Uhm�ru��rns�re�qason�Îa�b��ly�qui���c�kly�for����=r�s�t��Rord��Te�
�r�examp��le�Gs�([�Sew94��8�],�Sect���ion�3),�an�d�t��Ue�
�rm�rewr�*�it�e�bas�1�e�Gd�xp�oin���t���in��rg����=i�#�s���guaran���t��Uee�Gd�t��ro�w���or��k.�Compu�t���in�g�comp��let��Ue�fu�nct���ion�graphs�do�#�e�Gs�not�lo�ok����=quit��Ue��so�bad�in�t��Uh���e�r�s�t��ord��Te�
�r�cas�1�e,�an�d�doin��rg�so�m�Îak�e�Gs�mo�d���ule�s�e�qas�#�ie�
�r�t��ro����=d��Te�qal�UUwit��Uh.�������2@�{����=�P���o��lymorphi���c�6�gen�e�
�rali�#�sa��t�ion�giv�e�Gs�exact�re�sul��rt��s.�Monomorphi���c�an�Îalys�#�i�s�an���d����=it��s�UUa��t���t��Uen���d��ran���t�mo�Gd�ule-rela��t��Ue�d�UUprob��lems�can�b�#�e�a�v�oid��Te�Gd�en���t�irely��*�.��%����,�3�
�Th��e��De�fr�9�iv�e�`d�De�s�0ign��$Y��,�3.1��Ov��9e�Drview��$Y��,�Cons�#�id��Te�
�r�*�in��rg���t��Uh���e�d�e�Gs�#�ign�cons�train���t��s,�it�lo�oks�lik���e�a�r�s�t-ord��Te�
�r,���p�o��lymorphi���c�an�Îa-����,lys�#�i�s��compu��rt���in�g�comp��let��Ue�xe�Gd�p�oin���t��s�migh���t�form�a�p��la���us�#�ib�le�bas�#�i�s�for�a�w���or��kin��rg����,sys�t��Uem,��kso�t��Uhi�#�s�i�s�wh���a��t�h�as�b�#�een�cons�tru�ct��Ue�Gd.�A��q�b�qs�tract�in���t�e�
�rpret���a��t�ion��kpro�Gd�u�ce�s����,t��Ue�
�rms���in�wh���a��t�can�b�#�e�cons�id��Te�
�re�Gd�t��ro�b�e�an�a���b�qs�tract�lam��|qb�Gd��ra-calculus,�an�d�xp�Goin���t-����,in��rg��Hi�#�s�don���e�wit��Uh�a�t��Ue�
�rm-rewr�*�it�e��Hsys�t�em�whi���c���h�transforms�s�1�em�Îan���t�i���cally�equiv��q�alen���t����,t��Ue�
�rms�UUt��ro�syn���t���act�i���cally�UUid��Ten�t�i���cal�UUnorm�Îal�forms.����;Th���e�X�an�Îalys�1�e�
�r�forms�part�of�t��Uh�e�Glasgo�w�Hask�ell�compile�
�r,�an�d�o�p�#�e�
�ra��t��Ue�Gs�on�a����,d��Te�Gsugare�d���Hask���ell�form�lo�Go�qs�1�ely�refe�
�rre�d�t��ro�as�Core.�Core�allo���ws�lam��|qb�d��ra�t��Ue�
�rms,����,ap���p��li���ca��t�ions,��alit��Ue�
�rals,�lo�Gcal�bin���din��rgs,�on�e-lev�el�pa��t���t��Ue�
�r�#�n�m�Îa�t���c�hin��rg��a(�case�s)�an���d�con-����,s�tru���ct��ror���ap�p��li���ca��t�ions.�T�yp�#�e�inform�Îa��t�ion�sup�p��lie�Gd�b�y�previous�compile�
�r�ph�as�1�e�Gs����,m���e�qans�ft��Uh�e�t�yp�#�e�(an�d�h�ence�t��Uh�e�a�b�qs�tract�dom�Îain)�as�so�Gcia��t��Ue�d�wit��Uh�ev���e�
�ry�su�b�#�ex-����,pre�Gs�qs�#�ion�(\i�s�kno���wn.�Th�e�Core�tree�i�#�s�annot�a��t��Ue�Gd�wit��Uh�t�h���e�s�tr�*�i���ctn�e�Gs�qs�inform�Îa��t�ion����,compu��rt��Ue�Gd,��^m�Îakin�g�it�a���v��q�aila�b��le�t��ro�su��Ub�qs�1�equen���t�transform�Îa��t�ion�pas�qs�1�e�Gs,�an�d�t��ro�t��Uh�e����,in���t��Ue�
�rf�#�ace-pr�*�in�t���in��rg�bm�Îac�hin�e�ry��*�,�bso�ot��Uh���e�r�mo�Gd���ule�s�bcan�kno�w�a�b�Gou��rt�t��Uh�e�s�tr�*�i���ctn�e�Gs�qs�of����,fu��rnct���ions�UUin�t��Uhi�#�s�on�e.�����
�b�g�\����3��2�\����ܚ��R�3.2��Th��9e��Ta�b� �s�-tract�in��t��"e�Drpret�a��ft�ion������R�A��q�b�qs�tract��)in���t��Ue�
�rpret���a��t�ions�for�s�tr�*�i���ctn�e�Gs�qs�an�Îalys�#�i�s�h���a�v�e�hi�#�s�t��ror�*�i���cally�b�een�ca��t��Uegor-����Ri�#�s�1�e�Gd�Bas�forw���ard�or�bac�kw�ard�[�Hug90��>],�al��rt��Uh�Îough�t�h���e�ap�p�#�e�qarance�of�rela��t�ion�Îal�an�a-����Rlys�1�e�Gs���i�#�s�no���w�b��lurr�*�in��rg�t��Uh�a��t�di�#�s�t�inct�ion.�Bac�kw�ard�an�Îalys�1�e�Gs�gen�e�
�ra��t��Ue�inform�Îa�t���ion����Ra���b�Gou��rt���fu�nct�ion���argu�m�en���t��s���giv�en�kno�wle�Gdge�of�som�e�pro�p�#�e�
�rt�y�of�t��Uh�e�ap�p��li���ca��t�ion����Ras�ޛa�wh�Îo��le.�F��*�or�examp�le,�bac���kw�ard�ޛs�tr�*�i���ctn�e�Gs�qs�an�Îalys�#�i�s�of�an��n�-argu��rm���en���t�fu�nct���ion����Rpro�Gd���u�ce�s�H3�n��m�Îap�qs,�on���e�for�e�ac���h�argu��rm�en���t,�m�Îap�pin��rg�d��Tem�Îan�d�on�an�ap�p��li���ca��t�ion�t��ro����Rd��Tem�Îan���d��on�e�qac�h�argu��rm�en���t.�As�t��Uhi�#�s�imp��lie�Gs,�t�h���e�fu��rn�d�am�en���t�al��a�b�qs�tract�en���t�it�ie�Gs�are����Rp�Goin���t��s��in�la��t���t���i���ce�s,�wh���e�
�re�die�ren���t�p�Goin�t��s�d��Tenot��Ue�die�
�ren�t�d��Tem�Îan���ds�or�\n�ee�Gd��Te�d-����Rn���e�Gs�qs"���for�som�e�d��ra��t�a�s�tru�ct�ure.�It�i�#�s�usual�t��ro�(a��t�le�qas�t�p�Got��Uen���t�ially)�allo�w�e�qac�h����Rdie�
�ren���t�*�concret��Ue�t���yp�#�e�t��ro�h�a�v�e�it��s�o�wn�la��t���t�i���ce�of�a�b�qs�tract�d��Tem�Îan�ds,�in�ord��Te�
�r�t��Uh�a��t����Rw���e�UUcan�do�d��Tet�aile�Gd�an�Îalys�1�e�s�wit��Uh�d��ra��t���a�s�tru�ct�ure�Gs.��PW��aAl��rt��Uh�Îough���t�h���e�r�s�t�s�tr�*�i���ctn���e�Gs�qs�an�Îalys�1�e�s�w���e�
�re�of�t��Uh�e�forw�ards�t�yp�#�e,�la��t��Ue�
�r�d��Te-����Rv���elo�pm�en���t�{Tsugge�Gs�t��Ue�d�bac���kw�ards�an�Îalys�#�i�s�migh���t�b�e�qui���c���k�e�
�r�an�d�giv�e�a�s�#�imp��le�
�r����Rtre�qa��t���m�en���t�$7of�p�Go��lymorphi�#�sm,�an���d�pract�i���cal�w�or��k�s�1�eems�t��ro�b�#�e�qar�t��Uhi�s�ou��rt�([�Sew94��8�],����RSect���ion���5).�Th�e�few�pap�#�e�
�r�s�sh�Îo�win��rg�h�Îo�w�s�tr�*�i���ctn�e�Gs�qs�inform�Îa��t�ion�can�b�#�e�us�1�e�Gd�t��ro����Rgen���e�
�ra��t��Ue�c&b�#�et���t�e�r�c&co�Gd��Te�[�PJ93����,��Hal93���G]�all�e�it��Uh���e�
�r�sugge�s�t�or�imp��ly�t��Uh���a��t�bac�kw�ards����Rinform�Îa��t���ion�F.i�#�s�wh�a��t�i�#�s�act�ually�us�1�eful.�T��*�ak�en�t��roget��Uh�e�
�r,�t��Uh�e�cas�1�e�for�buildin��rg�a����Rbac���kw�ards�UUa�b�qs�tract�in���t��Ue�
�rpret�a��t�ion�s�1�eems�o�v�e�
�rwh�elmin��rg.����aSpace��blimit���a��t�ions�preclud��Te�m��Uu�c�h�di�#�s��Tcus�qs�ion�of�t��Uh���e�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion.����RSuce���it�t��ro�say�t��Uh���a��t�it�i�#�s�f�airly�con���v�en���t�ion�Îal:���t��Uh�e�o�v�e�
�rall�s�tru�ct�ure�i�#�s�s�imilar�t��ro����Rt��Uh���a��t��pre�Gs�1�en���t��Ue�d�b���y�John�Hugh�e�Gs�in�[�Hug90��>],�al��rt��Uh�Îough�t�h���e�m�ec�h�ani�#�sm�for�d��Te�qalin��rg����Rwit��Uh���d��ra��t���a�s�tru�ct�ure�Gs,�cons�tru�ct��ror�s���an�d�cas�1�e�t��Ue�
�rms�i�#�s�die�ren���t.�As�wit��Uh�an���y�purely����Rbac���kw�ard��
an�Îalys�#�i�s,�high���e�
�r-ord��Te�r�an�Îalys�#�i�s�i�s�imp�Go�qs�s�#�ib��le,�so�w���e�n�Îaiv�ely�as�qsu��rm�e�t��Uh�a��t����Rall�UUu��rnkno���wn�fu�nct���ions�do�not�d��Tem�Îan�d�t��Uh�e�Gir�argu��rm�en���t��s�a��t�all.����aMan���y��pbac�kw�ard�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions�go�t��ro�a�gre�qa��t�d��Te�al�of�trou��Ub��le�t��ro�mo�Gd��Tel����Rd��ra��t���a���s�tru�ct�ure�Gs�w�ell,�t��Uh�e�
�re��Tb�y�in�d�u�cin��rg�cons�#�id��Te�
�ra�b��le�comp�li���ca��t���ion�in�t��Uh�e�m�Îac�hin�e�
�ry����Rwhi���c���h��d��Te�qals�wit��Uh�d��ra��t�a�s�tru�ct�ure�Gs�{�cons�tru�ct��ror�fu�nct���ions�an�d��case�s.�F��*�ort�u��rn�Îa��t��Uely�,����Rt��Uh���e�Ypre�Gs�1�en���t�a��t�ion�can�b�#�e�s�imp��lie�Gd�b���y�t��Uh�e�ob�qs�1�e�
�rv��q�a��t�ion�t��Uh�a��t,�pro�vid��Te�Gd�t��Uh�e�a�b�qs�trac-����Rt���ion��nof��case�s�an�d�cons�tru�ct��ror�fu�nct���ions�ob�#�eys�ce�
�rt�ain�cons�train���t��s,�it�do�#�e�Gsn't�m�Îa��t-����Rt��Ue�
�r��<a��t�all�wh���a�t�t��Uh���ey�are.�So�t�h���e�bac�kw�ards�a�b�qs�tract�ion�can�b�#�e�sp�ecie�Gd�wit��Uh�Îou��rt����Rsayin��rg�iDan���yt��Uhin�g�m��Uu���c�h�a�b�Gou��rt�d�a��t���a�s�tru�ct�ure�Gs.�Su��Ub�qs�1�equen���t�param�et��Ue�
�r�*�i�#�sa��t�ions�of����Rit�?�pro�Gd���u�ce�comp��let��Ue,�w�or��k���a�b��le�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions,�an�d�die�
�ren���t�param�et-����Re�
�r�*�i�#�sa��t���ions��7can�pro�Gd�u�ce�in���t��Ue�
�rpret�a��t�ions�givin��rg�v�e�
�ry�die�ren���t�lev���els�of�d��Tet�ail�for����Rd��ra��t���a���s�tru�ct�ure�Gs.�Thi�#�s�mo�d���ular�ap�proac�h�an�d�som�e�param�et��Ue�
�r�*�i�#�sa��t�ions�of�it�are����Rd��Tev���elo�p�#�e�Gd�UUin�[�Sew94��8�],�Sect���ion�5;�w�e�ou��rt��Ulin�e�on�e�su�c�h�param�et��Ue�
�r�*�i�#�sa��t�ion�sh�Îort��Uly��*�.����aAn��'imp�Gort���an���t�fe�qa��t�ure�of�t��Uh�e�a�b�qs�tract�ion�i�#�s�t��Uh�a��t�suit�a�b��le�param�et��Ue�
�r�*�i�#�sa��t�ions����Rpro�Gd���u�ce��p�o��lymorphi���cally�in���v��q�ar�*�ian���t�in�t��Ue�
�rpret���a��t�ions.��P�o��lymorphi���c�in�v��q�ar�*�iance�f�#�acil-����Rit���a��t��Ue�Gs���s�1�epara�t�e���compila�t���ion,�as�di�#�s��Tcus�qs�1�e�Gd�in�Sect�ion�2.3,�an�d�it�also�m�e�qans�t��Uh�e�s�#�ize����Rof���t��Ue�
�rms�gen���e�ra��t��Ue�Gd�b���y�(h�ence,�t��Uh�e�co�qs�t�of��)�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion�i�#�s�not�rela��t��Ue�Gd����Rt��ro��6t��Uh���e�ins�t�an���t�ia��t�ion.�Thi�#�s�i�s�in�m�Îar��k���e�Gd�con���tras�t�t��ro,�for�examp��le,�W��*�adle�
�r's�or�*�igin�al����Rnon-
a��t��*in���t��Ue�
�rpret���a�t�ion�[�W��*�ad87��],��*in�whi���c�h�a�b�qs�tract�ion�of��case��expre�Gs�qs�#�ions�could����Rgen���e�
�ra��t��Ue��kt�e�rms��kwh�Îo�qs�1�e�s�#�ize�Gs�gro���w�exp�on���en���t�ially��kwit��Uh�t�h���e�s�#�ize�of�t�h���e�ins�t�an���t�ia��t�in��rg����Rt���yp�#�e�Gs.����aBac���kw�ards�{s�tr�*�i���ctn�e�Gs�qs�an�Îalys�1�e�s�w���or��k,�in�a�s�1�ens�e,�b���y�d��Tet��Uect�in��rg�f�*�ree�v��q�ar�ia���b��le�Gs�in��������g�\����3��2�\����ܚ��,�expre�Gs�qs�#�ions.���Beca���us�1�e�mo�s�t�v��q�ar�*�ia���b��le�Gs�do�not�ap�p�#�e�qar�f�*�ree�in�mo�s�t�expre�Gs�s�#�ions,�a����,n�Îaiv���e���an�alys�#�i�s�will�t��Uen���d�t��ro�gen�e�
�ra��t��Ue�m�Îan�y�h��Uuge�t��Ue�
�rms�whi���c�h�tr�*�ivially�re�Gd�u�ce�t��ro����,�?�,�h�t��Uh���e�p�Goin���t�d��Tenot�in��rg�ze�
�ro�d��Tem�Îan�d.�St�ill,�gen�e�
�ra��t�in��rg�t��Uh�e�Gs�1�e�t��Uhin��rgs,�t�h���en�re�Gd�u�cin��rg����,t��Uh���em,��t�ak�e�Gs�eort,�an�d�it�pro�v�e�Gs�v��q�alua�b��le�t��ro�p�lan���t�ce�
�rt���ain�k�ey�rewr�*�it��Ue�rule�Gs�ins�#�id��Te����,t��Uh���e�a�a�b�qs�tract�in���t��Ue�
�rpret�e�r�a�it��s�1�elf�t��ro�s�#�id��Te�Gs�t��Uep�t��Uh���e�pro�ce�s�qs�{�a�tr�*�ivial�mo�dica��t���ion�t��ro�t��Uh�e����,co�Gd��Te.��Incorp�ora��t���in��rg�four�of�t��Uh�e�mo�qs�t�p�Go�pular�s�#�imp��le�rewr�*�it��Ue�rule�Gs�dram�Îa��t�i���cally����,cu��rt��s��t��Uh���e�s�#�ize�of�gen�e�
�ra��t��Ue�Gd�t�e�
�rms�an���d�so�expan�ds�t��Uh�e�ran��rge�of�source�fu�nct���ions�for����,whi���c���h�UUa�b�qs�tract�in���t��Ue�
�rpret�a��t�ion�can�b�#�e�don�e�in�re�qason�Îa�b��le�t�im�e.��p��,�Th��9e��WHe� �ad-Str�1i��ct�P�aram�et��"e�Dr�1i�(�sa��ft�ion�L۲Our�nimp��lem���en���t�a��t�ion�us�1�e�Gs�a�p�o���w�e�
�rful����,param���et��Ue�
�r�*�i�#�sa��t�ion��d��Te�Gs�ign�e�Gd��t��ro�giv���e�d��Tet�aile�Gd�re�sul��rt��s�for�t��Uh���e�v��q�as�t�m�Îa��8jor�*�it�y�of�d��ra��t�a����,d��Teclara��t���ions���a�Hask�ell�programm�e�
�r�could�re�qason�Îa�b��ly�us�1�e.�Thi�#�s�i�s�in�con���tras�t����,t��ro���t��Uh���e�oft��Uen-limit�e�Gd���ran�ge�of�t���yp�#�e�Gs�whi���c�h�ot��Uh�e�
�r�imp��lem�en���t�a��t�ions�can�d��Te�qal�wit��Uh,����,som���et�im�e�Gs�D�jus�t�li�#�s�t��s�[�HH91��],�som���et�im�e�Gs�D�a�fulle�
�r�ran��rge�of�d�a��t���a�d��Teclara�t���ions�wh�e�
�re����,cons�tru���ct��ror���argu�m�en���t��s���m�Îay�b�#�e�on�e�of�t��Uh�e�t�yp�#�e�v��q�ar�*�ia�b��le�Gs,�or�a�recur�s�#�iv�e�call�t��ro�t��Uh�e����,t���yp�#�e,�\	bu��rt�not��Uhin�g�els�1�e�([�Sew91��8�],�Sect���ion�6).�Th�e�param�et��Ue�
�r�*�i�#�sa��t�ion�i�#�s�d��Te�Gs�ign���e�d�\	t��ro����,d��Tet��Uect��.h���e�qad�s�tr�*�i���ctn�e�Gs�qs.�W��*�e�w�an���t��Ue�Gd�t��ro�mo�v�e�aw�ay�f�*�rom�t��Uh�e�prot��rot�yp�#�e�s�t�age�an�d����,cre�qa��t��Ue���an�an�Îalys�#�i�s���whi���c���h�(1)�giv�e�Gs�us�1�eful�inform�Îa��t�ion�for,�eect�iv�ely��*�,�an�y�(non-����,fu��rnct���ion�Îally-t�yp�#�e�Gd)�{�co�d��Te�f�*�ragm���en���t,�an�d�(2)�gen�e�
�ra��t��Ue�Gs�inform�Îa�t���ion�t��ro�sup�p�Gort�all����,kno���wn�[s�tr�*�i���ctn�e�Gs�qs-rela��t��Ue�d�transform�Îa��t���ions�{�h�ence�t��Uh�e�n�ee�Gd�for�h�e�qad-s�tr�*�i���ctn�e�Gs�s.����,Th���e�Ure�Gsul��rt�i�#�s�t��Uh�a��t�t��Uh�e�param�et��Ue�
�r�*�i�#�sa��t�ion�i�#�s�ra��t��Uh�e�
�r�comp��li���ca��t��Ue�Gd,�so�w�e�will�try�an�d����,con���v�ey�UUt��Uh�e�e�Gs�qs�1�en���t�ial�id��Te�qas�wit��Uh�an�examp��le.��j��;Th���e�e�param�et��Ue�
�r�*�i�#�sa��t�ion�d��Te�
�r�*�iv�e�Gs�f�*�rom�Bur�#�n's�id��Te�qa�of�ev��q�alua��t�ion�transform�e�
�r�s.����,[�Sew91��8�]�Ipgen���e�
�rali�#�s�1�e�Gd�t��Uhi�s�t��ro�w���or��k�for�a�wid��Te�
�r�ran�ge�of�d�a��t���a�t�yp�#�e�Gs,�an�d�[�Sew94��8�]����,furt��Uh���e�
�r��ext��Uen�d��Te�Gd�it�t��ro�d�et��Uect�h���e�qad-s�tr�*�i���ctn�e�Gs�s.��Let�us�cons�#�id��Te�
�r�li�s�t��s.�Li�s�t��s�a���b�qs�tract����,t��ro���t��Uhree�co��llect���ions�of�p�Goin���t��s:�b�ot���t��rom�(�B�),�d��Tenot���in�g�no�ev��q�alua��t���ion,�t��Uh�e�s�1�et��W[a]�,����,d��Tenot���in��rg��7ev��q�alua��t�ion�t��ro�w�e�qak�h�e�qad�norm�Îal�form,�an�d�t��Uh�en,�if�a�cons�cell�i�#�s�pro-����,d���u�ce�Gd,��|ev��q�alua��t�ion�of�t��Uh�e�r�s�t�elem���en���t�wit��Uh��a�,�an�d�t��Uh�e�s�1�et��S[a][b]�,�d��Tenot�in��rg����,ev��q�alua��t���ion�4�of�t��Uh�e�comp��let��Ue�s�tru�ct�ure�of�t��Uh�e�li�#�s�t,�ev��q�alua��t�ion�of�t��Uh�e�r�s�t�4�elem�en���t����,wit��Uh��a��an���d�all�t�h���e�re�Gs�t�wit�h��b�.�If�w���e�mo�Gd��Tel�in���t��Uege�
�r�s�wit�h�t�h���e�t�w�o�ev��q�alua��t��ror�s��0����,�(no-ev��q�al)�UUan���d��1��(ev�al),�t��Uh���e�la��t���t�i���ce�for��[Int]��b�#�ecom�e�Gs:��Y����?��S[1][1]�������/�$��\�������S[1][0]�?�S[0][1]�������/���\��/�������W[1]�?�S[0][0]�������\���/�����?�W[0]����ο�|����ο�B��C?��;�F��*�or��examp��le,��W[1]��i�#�s�a�h���e�qad-s�tr�*�i���ct�ev��q�alua��t��ror,�ev�alua��t���in��rg�t�o�w���e�qak�h�e�qad�norm�Îal����,form,�
]an���d�t��Uh�e�h�e�qad��Int��t��ro�Go,�if�p�o�qs�s�#�ib��le.�
]�S[0][1]��m���e�qan�ev��q�alua��t��Ue�t��Uh�e�en���t�ire�li�#�s�t����,s�tru���ct�ure,�u�an�d�all��Int�s�except�t��Uh�e�r�s�t.��S�uY�(Stru���ct�ure)�ev��q�alua��t��ror�s�m�Îain���t�ain�t��Uh�e����,h���e�qad/non-h�e�ad�/�elem�en���t�di�#�s�t�inct�ion�so�t��Uh�a��t,�for�examp��le,�wh�en�a�li�#�s�t�i�s�kno���wn�t��ro��������g�\����3��2�\����ܚ��R�b�#�e�*cd��Tem�Îan���d�e�Gd�b�ot��Uh�t��ro��W[1]��an���d��S[0][1]�,�w�e�kno�w�w�e�can�d��Tem�Îan�d�t��Uh�e�li�#�s�t�t��ro����R�S[1][1]��Dz(whi���c���h�i�#�s���W[1]����t��3��S[0][1]��%�).�In�ot��Uh�e�
�r�w�ords,�t��Uhi�#�s�m�e�qans�t��Uh�e�h�e�qad-elem�en���t����Rinform�Îa��t���ion�.{on�a��W�.q�(WHNF)�ev��q�alua�t��ror�.{i�#�s�not�(n���ece�Gs�qsar�*�ily)�ob��lit��Ue�
�ra�t�e�Gd�.{wh���en�it�i�#�s����Rcom��|qbin���e�Gd�UUwit��Uh�an��S��ev��q�alua��t��ror.��$��aTh���e��s��Tc�h�em�e�gen�e�
�rali�#�s�1�e�Gs�in�s�ev���e�
�ral�direct�ions.�Recur�s�#�iv�e�t�yp�#�e�Gs�wit��Uh�more�t�h���an����Ron���e�.�t�yp�#�e�v��q�ar�*�ia�b��le�are�mo�Gd��Telle�d�wit��Uh�t�h���e�sam�e��B�/�W�/�S�.��co��llect�ion�of�p�Goin���t��s,�wit��Uh����Rt��Uh���e�(��W�(��an�d��S�(��p�Goin���t��s�con�t���ainin��rg�m��Uul�t���ip��le�param�et��Ue�
�r�*�i�#�s�in��rg�p�Goin���t��s,�ra��t��Uh���e�
�r�t�h���an�jus�t����Ron���e�s8an�d�t�w�o�re�Gsp�#�ect�iv�ely�as�wit��Uh�li�#�s�t��s.�La��t���t�i���ce�Gs�for�non-recur�s�#�iv�e�t�yp�#�e�Gs�omit�t��Uh�e����R�S��u�p�Goin���t��s,���bu��rt�are�ot��Uh���e�
�rwi�#�s�1�e�id��Ten�t���i���cal.�Cons�tru�ct��ror�s���oft��Uen�h�a�v�e�\cons�t�an���t"�t�yp�#�e�Gs����R{��$t��Uh�Îo�qs�1�e�not�m���en���t�ionin��rg��$t�yp�#�e�v��q�ar�*�ia�b��le�Gs�{�for�argu��rm�en���t��s,�or�h�a�v�e�argu��rm�en���t��s�in����Rwhi���c���h��t��Uh�e�t�yp�#�e�v��q�ar�*�ia�b��le�Gs�an�d�recur�s�#�iv�e�ins�t�ance�Gs�of�t��Uh�e�t�yp�#�e�ap�p�#�e�qar�bur�*�ie�Gd�ins�id��Te����Rarbitrary���lev���els�of�\in���t��Ue�
�rv�enin��rg"�t�yp�#�e�Gs.�Man�y�programs�also�emp��lo�y�m��Uu��rt�ually����Rrecur�s�#�iv���e�s�t�yp�e�Gs.�s�All�t��Uh���e�s�1�e�cas�e�Gs�can�b�#�e�h���an�dle�d,�s�al��rt��Uh�Îough�t�h���ey�m�Îak�e�t��Uh�e�preci�#�s�1�e����Rd��Tet���ails�<�of�t��Uh�e�param�et��Ue�
�r�*�i�#�sa��t�ion�ra��t��Uh�e�
�r�comp��li���ca��t��Ue�Gd.�Thi�#�s�param�et��Ue�
�r�*�i�#�sa��t�ion,�an�d����Rt��Uh�us�UUt�h���e�d��Te�
�r�*�iv�e�Gd�in���t��Ue�
�rpret�a��t�ion,�i�#�s�p�Go��lymorphi���cally�in�v��q�ar�*�ian���t.��U���R�3.3��Fixp�Q�oin��t��9in��g��U���R�Once��Tw���e�regard�t��Uh�e�ou��rt�ʪpu�t��Tof�t��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�e�r��Tas�a�t��Ue�rm�in�som���e�\a�b�qs�tract����Rlam��|qb�Gd��ra�Y$calculus",�an���d�w�e�kno�w�w�e�w�an���t�t��ro�compare�su�c�h�t��Ue�
�rms�for�s�1�em�Îan���t�i���c����Requalit���y��*�,�Ƕit�s�1�eems�n�Îa��t�ural�t��ro�in�v�e�Gs�t�iga��t��Ue�t��Uh�e�p�Go�qs�s�#�ibilit�y�Ƕof�buildin��rg�a�s�1�em�Îan���t�i���cs-����Rpre�Gs�1�e�
�rvin��rg���transform�Îa��t���ion�en�gin���e.�W��*�e�giv�e�only�t��Uh�e�bare�Gs�t�su��rmm�Îary�h�e�
�re�{�for����Rd��Tet���ails,�UUs�1�ee�[�Sew94��8�],�Sect�ion�4.�Som�e�imp�Gort�an���t�p�Goin�t��s�are:��D������X@�{����c�T��*�e�
�rms��+are�buil��rt�f�*�rom�a�sm�Îall�s�1�elect���ion�of�cons�tru�ct�ions.�Lam��|qb�Gd��ras,�v��q�ar�*�ia�b��le�Gs����can���d�Bap�p��li���ca��t�ions�in���tro�Gd�u�ce�an�d�refe�
�r�t��ro�v��q�ar�*�ia�b��le�Gs,�an�d�ap�p��ly�a�b�qs�tract�fu��rnct�ions����ct��Uh�us�I�form���e�Gd.�\Cons�tru�ct�ion�Îal"�t��Ue�
�rms�d��Tenot�in��rg��?�,�t��Uh�e�lift�in��rg�of�som�e�ot��Uh�e�
�r����ct��Ue�
�rm�M�an���d�t�up��lin��rg�are�us�1�e�Gd�t�o�build�v��q�alue�Gs�in�lift��Ue�d�an���d�pro�d���u�ct�M�la��t���t�i���ce�s,�M�an�d����ct��Uh���e�
�re�=are�a�corre�Gsp�on�din��rg�=s�1�et�of�\d��Te�Gs�tru�ct�ion�Îal"�t��Ue�
�rms�whi���c�h�t��Ue�Gs�t�lift�e�Gd-la��t���t���i���ce����cp�Goin���t��s��for��?�,�u��rn���do�lift�in��rgs,�an�d�s�1�elect�comp�Gon�en���t��s�f�*�rom�t�up��le�Gs.�Fin�Îally��*�,�joins����can���d�UUm�eet��s�of�t��Ue�
�rms�are�allo�w�e�Gd.�������X@�{����c�Th���e�Ldt��Ue�
�rms�are�s�tron��rgly-t�yp�#�e�Gd,�us�in��rg�wh���a��t�amou�n���t��s�t�o�an�a���b�qs�tract�v�e�
�r�s�#�ion����cof���t��Uh���e�Miln�e�
�r-Hin�dley�t�yp�#�e�sys�t��Uem.�W��*�ell-form�e�Gd�t��Ue�
�rms�m��Uus�t�b�#�e�w�ell-t�yp�#�e�Gd,����can���d�Am��Uus�t�also�b�#�e�monot��roni���c�wit�h�re�Gsp�#�ect�t��ro�t�h���e�Gir�f�*�ree�v��q�ar�ia���b��le�Gs.�Th�e�t�yp�#�e����csys�t��Uem�[3incorp�Gora��t�e�s�[3a�not���ion�of�param�etr�*�i���c�p�Go��lymorphi�#�sm.�Th�e�a�b�qs�tract�in-����ct��Ue�
�rpret�e�r���exp��loit��s�t��Uhi�#�s�b���y�m�Îap�pin��rg�p�Go��lymorphi�#�sm�in�t��Uh�e�source�program�on���t��ro����cp�Go��lymorphi�#�sm��in�t��Uh���e�a�b�qs�tract�t��Ue�
�rms,�whi���c�h�giv�e�Gs�p�o��lymorphi���c�an�Îalys�#�i�s��e�s-����cs�1�en���t���ially�UUfor�f�*�ree.�������X@�{����c�Th���e�Y3rewr�*�it��Ue�
�r�pro�p�#�e�
�r�cons�i�s�t��s�of�a�s��Tc���h�e�Gd�ulin��rg�Y3m�ec�h�ani�sm,�Y3whi���c�h�s�1�elect��s�re-����cd��Texe�Gs�6�an���d�ap�p��lie�Gs�rewr�*�it��Ue�rule�s�t��ro�t��Uh���em,�an�d�t��Uh�e�rewr�*�it��Ue�rule�Gs�t��Uh�ems�1�elv�e�Gs.����cTh���e�as��Tc�h�e�Gd�ule�
�r�d��Tet��Ue�rmin���e�Gs�t��Uh�e�re�Gd�u�ct�ion�ord��Te�
�r,�whi���c�h�h�as�a�m�Îa��8jor�b�#�e�qar�*�in��rg�on����cp�#�e�
�rform�Îance.��Th���e�re�are�a���b�Gou��rt�ft�y�rule�Gs,�m�Îan�y�wit��Uh�comp��lex�s�#�id��Te�con�dit�ions.����cSince���t��Uh���e�rule�Gs�are�co�d��Te�d�in�Hask���ell,�t��Uh�ey�can�us�1�e�t��Uh�e�full�p�Go�w�e�
�r�of�Hask�ell����cpa��t���t��Ue�
�r�#�n-m�Îa�t���c�hin��rg.��Th�e�rewr�*�it��Ue�
�r�i�#�s�comp��li���ca��t�e�Gd�som���ewh�a��t�b�y�t��Uh�e�n�ee�Gd�t��ro�pro-����cp�Goga��t��Ue�aTan���d�us�1�e�part�ial�kno�wle�Gdge�(ie,�i�#�s/i�s�aTnot��?�)�of�t��Uh�e�v��q�alue�Gs�of�su��Ubt��Ue�
�rms����cin�UUord��Te�
�r�t��ro�re�qac���h�norm�Îal�form.�����
��g�\����3��2�\����ܚ��,�Makin��g��t��Th��9e�rewr�1it��"e�Dr�w�or��2k�w�ell�fʲOnce��a�norm�Îal�form�h���as�b�#�een�d��Tecid�e�Gd��on�an�d����,suit���a�b��le�.�rewr�*�it��Ue�rule�Gs�gen���e�
�ra��t�e�Gd,�t��Uh���e�
�re�i�#�s�s�t�ill�t��Uh�e�i�#�s�qsue�of�h�Îo�w�t��Uh�e�rule�Gs�are�t��ro�b�#�e����,ap���p��lie�Gd.���Thi�#�s�b�oils�do���wn�t��ro�a�proba�b��ly-irreconcila�b�le���con
i���ct�b�#�et�w�een�inn�e�
�rmo�qs�t-����,r�s�t��can���d�ou��rt��Ue�
�rmo�qs�t-r�s�t��crewr�*�it�in��rg.�Bot��Uh�s�tra��t��Uegie�Gs�w�or��k�w�ell�m��Uu�c�h�of�t��Uh�e�t�im�e,����,bu��rt���b�Got��Uh�also�sue�
�r�f�*�rom�pa��t�h�Îo��logi���cal�in���t��Ue�
�ract���ions�b�#�et�w�een�t��Ue�
�rms�emit���t�e�Gd�b���y����,t��Uh���e���a�b�qs�tract�in���t��Ue�
�rpret�e�r���an���d�som�e�of�t��Uh�e�rewr�*�it��Ue�rule�Gs.�In�t��Uh�e�Gs�1�e�cas�e�Gs,�rewr�*�it���in��rg����,can�p�t���ak�e�a�sm�Îall�t��Ue�
�rm�an�d�expan�d�it�exp�Gon�en���t�ially�t��ro�a�gigan���t�i���c�in���t��Ue�
�rm�e�Gdia��t�e����,t��Ue�
�rm��nb�#�efore�emp��lo���yin��rg�som�e�ot��Uh�e�
�r�rule�t��ro�shr�*�ink�it�t�o�anot��Uh���e�
�r�sm�Îall�t��Ue�rm.�Th���e����,eect���on�p�#�e�
�rform�Îance�i�s�di�sas�trous.�Get���t���in��rg�rou�n���d�t��Uhi�#�s�prob��lem�require�Gs�a�h�ybr�*�id����,re�Gd���u�ct�ion�Y�s�tra��t��Uegy�whi���c���h�tr�*�ie�s�t��ro�a���v�oid�Y�kno�wn�pa��t��Uh�Îo��logi���cal�cas�1�e�Gs.�Thi�#�s�w�or��ks�w�ell,����,al��rt��Uh�Îough�'�d��Tecidin�g�on�t��Uh���e�sp��lit�require�Gs�a�gre�qa��t�d��Te�al�of�d��Tet���aile�Gd�in�v�e�Gs�t�iga��t�ion�in���t��ro����,t��Uh���e�UUpreci�#�s�1�e�dyn�Îami���cs�of�t�h���e�re�Gd�u�ct�ion�sys�t��Uem�as�ap�p��lie�Gd�t��ro�re�qali�#�s�t�i���c�w�or��kloads.����;W��*�a��t���c�hin��rg�w�t��Uh�e�rewr�*�it��Ue�
�r�a��t�w�or��k�rev�e�qale�Gd�anot��Uh�e�
�r�in���t��Ue�re�Gs�t���in��rg,�bu�t,�in�retro�qsp�#�ect,����,u��rnsurpr�*�i�#�s�in�g�Ƈf�act:�t��Uh���e�a�b�qs�tract�in���t��Ue�
�rpret�e�r's�Ƈ\v���o�Gca�bulary"�of�t��Ue�
�rm-com��|qbin�Îa��t�ions����,emit���t��Ue�Gd���i�#�s�part���i���cularly�limit�e�Gd.�Th���e�sam�e�sm�Îall�co��llect�ion�of�idioms�o�Gccur�s�o�v�e�
�r����,an���d���o�v�e�
�r�again.�Som�e�of�t��Uh�e�Gs�1�e�idioms�are�extrem�ely�common,�bu��rt�t��Uh�ey�are�also����,quit��Ue��big.�Big�t�e�
�rms�are�a�p�#�e�rform�Îance�lia���bilit�y;��cons�#�i�s�t��Uen���t��Uly�sm�Îall�t�e�
�rms�t�en���d�t��ro����,giv���e���m��Uu�c�h�b�#�et���t��Ue�
�r�p�e�
�rform�Îance.�Th���a��t�m�ak���e�Gs�it�a��t���tract�iv�e�t��ro�capt�ure�su�c�h�idioms����,in���sp�#�ecial,�n���ew�t��Ue�
�rms,�an�d�adjus�t�t��Uh�e�rewr�*�it��Ue�rule�Gs�accordin��rgly��*�.�Thi�#�s�sh�Îould�b�e����,don���e���spar�*�in��rgly��*�,�s�#�ince�t��Uh�e�t��Ue�
�rm�rewr�*�it�e�
�r�b�#�ecom���e�Gs�comp��li���ca��t�e�Gd�b���y�h�a�vin��rg�t�o�d��Te�qal����,wit��Uh��m�ul��rt���ip��le�repre�Gs�1�en���t�a��t�ions�of�t��Uh�e�sam�e�t��Ue�
�rm.�St�ill,�capt�ur�*�in��rg�jus�t�t�w�o�common����,idioms���lik���e�t��Uhi�#�s�h�as�giv�en�p�#�e�
�rform�Îance�gains�v�e�
�ry�roughly�on�t��Uh�e�ord��Te�
�r�of�25����,t���im�e�Gs�UUfor�som���e�inpu��rt��s.����;Ev���en�?wit��Uh�t�hi�#�s�tr�*�i���c���k�e�
�ry��*�,�?t�h�e�?a�b�qs�tract�in���t��Ue�
�rpret�e�r�?can�som���et�im�e�Gs�?emit�t��Ue�rms�so����,large���t��Uh���ey�sw�amp�t��Uh�e�rewr�*�it��Ue�
�r.�In�t��Uhi�#�s�s�it���ua��t�ion���it�i�s�h���elpful�t��ro�d��Tevi�s�1�e�a�w���ay�t��ro����,pru��rn���e���t��Ue�
�rms�so�t��Uh�e�mo�qs�t�imp�Gort�an���t�inform�Îa��t�ion�i�#�s�ret�ain�e�Gd,�whils�t�dram�Îa��t�i���cally����,shr�*�inkin��rg���t��Uh���e�t��Ue�
�rm.�Of�cour�s�1�e,�d��Tenin�g�wh���a��t�inform�Îa�t���ion�i�#�s�imp�Gort�an���t�an�d�h�Îo�w����,safet���y�.�i�#�s�pre�Gs�1�e�
�rv�e�d�.�d��Tep�#�en�ds�en���t�irely�on�t��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ion.�F��*�or�t��Uhi�#�s�kin�d����,of�K�s�tr�*�i���ctn���e�Gs�qs�an�Îalys�#�i�s,�K�it�i�#�s�safe�t��ro�rep��lace�an�y�t��Ue�
�rm�b�y��?�,�s�#�ince��?��c�h�aract��Ue�
�r�*�i�#�s�1�e�Gs�\no����,d��Tem�Îan���d".���Th�e�s��Tc�h�em�e�emp��lo�y�e�Gd�pru��rn�e�Gs�t��Ue�
�rms�aft�e�
�r�a�sp�#�ecie�Gd�d��Tept��Uh�of�n���e�s�t��Ue�d����,�W��8�or��[�S��cons�tru���ct�ions�h�as�b�#�een�s�1�een.�Thi�s�d��Tept��Uh-bas�1�e�Gd�pru��rnin�g,�whils�t�crud��Te,�i�#�s����,f�*�requen���t��Uly��eect���iv�e,�bu��rt�do�#�e�Gs�not�w�or��k�w�ell�for�v�e�
�ry�wid��Te,�sh�allo�w�t��Ue�
�rms.�F��*�urt��Uh�e�
�r����,in���v�e�Gs�t�iga��t�ion��in���t��ro�clev���e�
�re�r��pru�nin�g�s�tra��t��Uegie�Gs,�an���d�t��Uh�e�Gir�rela��t�ionship�t��ro�wid��Tenin�g,����,could�UUb�#�e�w���ort��Uh�while.��!����,�3.4��In��t��"e�Drf�(�acin��g��Tt��Th��9e�a�b� �s�-tract�in��t��"e�Drpret�e�r��Tan��9d�xp�Q�oin��t��"e�r������,�All��<imp��lem���en���t�a��t�ion�w�as�don�e�in�t��Uh�e�lazy�fu��rnct�ion�Îal�lan��rguage�Hask�ell.�P�e�
�rform-����,ance�5Kprolin��rg�rev���e�qale�Gd�an�imp�ort���an���t�f�#�act:�h�Îo�w�w�ell�t��Uh�e�sys�t��Uem�as�a�wh�Îo��le�w�or��ks����,d��Tep�#�en���ds�m�h�e�qa�vily�on�h�Îo�w�m��Uu�c�h�of�t��Uh�e�a�b�qs�tract�in���t��Ue�
�rpret�e�r's�m�ou��rt�ʪpu�t�t��Uh���e�xp�Goin���t��Ue�
�r����,(h���ence,��mt��Uh�e�rewr�*�it��Ue�
�r)�n�ee�Gds�t��ro�s�1�ee.�If�t��Uh�e�xp�Goin���t��Ue�
�r�i�#�s�v�e�
�ry�clev�e�
�r�it�m�Îay�ignore����,mo�qs�t�ɦof�t��Uh���e�in���t��Ue�
�rpret�e�r's�ɦou��rt�ʪpu�t.�Bu�t�s�#�ince�wr�*�it���in�g�t��Uh���e�in���t��Ue�
�rpret�e�r�ɦin�Hask���ell����,m�Îak���e�Gs�"�it�d��Tem�an���d-dr�*�iv�en,�"�clev�e�
�r�#�n�e�Gs�qs�on�t��Uh�e�xp�Goin���t��Ue�
�r's�part�sa�v�e�Gs�a�gre�qa��t�d��Te�al����,of�e(exp�#�ens�1�e�in�t��Uh���e�in���t��Ue�
�rpret�a��t�ion�it��s�1�elf.�It�s�eems�safe�t��ro�say�t��Uh���a��t�t�h���e�p�#�e�
�rform�Îance����,re�Gsul��rt��s�uHrep�ort��Ue�d�b�#�elo���w�could�n�ev�e�
�r�h�a�v�e�b�#�een�ac�hiev�e�Gd,�nor�ev�en�ap�proac�h�e�Gd,��������g�\����3��2�\����ܚ��R�h���ad�k7t��Uh�e�in���t��Ue�
�rpret�e�r�k7b�#�een�wr�*�it���t��Uen�in�a�s�tr�i���ct�lan��rguage,�SML,�for�examp��le.�F��*�u�t��Uh���e�
�r����Rd��Tet���ails�UUare�a�v��q�aila�b��le�in�[�Sew94��8�],�Sect�ion�4.�����aTh���e�� comm�en���t��s�t��Uhree�paragraphs�bac�k�regardin��rg�idioms�an�d�t��Uh�e�t��Ue�
�rm�rewr�*�it�e�
�r����Rb�#�elie���a�more�fu��rn���d�am�en���t�al���d��Te�Gs�#�ign�
aw�whi���c�h�limit��s�p�#�e�
�rform�Îance:�s�1�e�r�*�ious�an���d����Rext��Uens�#�iv���e�Q�sh�ar�*�in��rg�lo�qs�s�1�e�Gs.�Th���e�idiom-sp�ot���t���in��rg�tr�*�i���c�k�giv�e�Gs�big�p�#�e�
�rform�Îance�sp�ee�Gd���up�qs����Rpr�*�im�Îar�ily���b�#�eca���us�1�e�it�a���v�oids���d�up��li���ca��t�ion�of�arbitrar�*�ily�large�su��Ubt��Ue�
�rms.�Man�y�of�t��Uh�e����Rcas�1�e�Gs�=�of�t��Uh���e�a�b�qs�tract�in���t��Ue�
�rpret�e�r�=�d���up��li���ca��t�e�t�e�
�rms�in���di�#�s��Tcr�*�imin�Îa��t�ely��*�.�All�t��Uhi�#�s�p�Goin���t��s����Rt��ro���a�n���ee�Gd�for�exp��li���cit�sh�ar�*�in��rg�in�t��Ue�
�rms:�non-recur�s�#�iv�e�a�b�qs�tract��let�s.�Mo�Gdifyin��rg����Rt��Uh���e���t��Ue�
�rm�rewr�*�it�e�
�r�t��ro�w���or��k�wit��Uh��let�s�sou�n���ds�le�Gs�qs�t��Uh�an�s�traigh�tforw�ard,�so�it�migh�t����Rb�#�e�zuh���elpful�t��ro�b�Gorro�w�k�ey�id��Te�qas�f�*�rom�t��Uh�e�call-b�y-n�ee�Gd�lam��|qb�d��ra�calculus�d��Te�s��Tcr�*�ib�#�e�d����Rin�[�AFM���^��+�����95��'�]].����aGo�Go�d�>+p�#�e�
�rform�Îance�hin��rge�Gs�on�gen���e�ra��t�in��rg�>+sm�Îall�t��Ue�rms�an���d�k�eepin��rg�t��Uh�em�sm�Îall����Rt��Uhrough�Îou��rt�/<t�h���e�Gir�v��q�ar�*�ious�m�Îan��rglin�gs.�Id��Te�qally��*�,�t��Uh���e�s�#�ize�of�t�h���e�a�b�qs�tract�in���t��Ue�
�rpret�e�r's����Rou��rt�ʪpu�t�F�sh�Îould�b�#�e�pro���p�Gort�ion�al�F�only�t��ro�t��Uh���e�s�#�ize�of�t�h���e�source�program.�Thi�#�s�i�s����Rproba���b��ly���u��rnre�qali�#�s�t�i���c.�Nev�e�
�rt��Uh�ele�Gs�qs,�d��Te�s�#�ign���e�
�r�s�of�a�b�qs�tract�in���t��Ue�
�rpret�a��t�ions�w�ould����Rb�#�e�>w���ell�advi�s�1�e�Gd�t��ro�s�tr�*�iv���e�t�o���w�ards�>t��Uhi�#�s�goal.�As�an�examp��le,�Phil�W��*�adle�
�r's�or�*�i-����Rgin�Îal�a"non-
a��t�s�tr�*�i���ctn���e�Gs�qs�an�alys�#�i�s�a"s��Tc���h�em�e�[�W��*�ad87��]�ga�v�e�an�in���t��Ue�
�rpret�a��t�ion�of��case����R�expre�Gs�qs�#�ions�eHwhi���c���h�expan�ds�exp�Gon�en���t�ially�wit��Uh�t�h���e�s�#�ize�of�ins�t�an���t�ia��t�in��rg�t�yp�#�e�Gs.�Thi�s����Rren���d��Te�
�r�s�ݕit�impract�i���cal�for�all�bu��rt�t��Uh�e�t�inie�Gs�t�programs�([�Sew94��8�],�Sect�ion�5.8).�Our����Rbac���kw�ards��f�*�ram�ew�or��k�i�#�s�p�Go��lymorphi���cally�in�v��q�ar�*�ian���t,�so�it�a�v�oids�t��Uh�a��t�part�i���cular����Rh�Îorror,���bu��rt�it�s�t���ill�h�as�p��len���t�y�of�p�Got��Uen���t�ial�for�o�pt�imi�#�sa��t�ion�us�#�in��rg�a�b�qs�tract��let�s.����RTh���e�v�p�Goin���t�of�t��Uhi�#�s�examp��le�i�s�t��Uh���a��t,�wit�h�a�lit���t�le�care,�m�u���c�h�v�of�t�h���e�\exp�Gon�en���t�ialn�e�s�qs"����Rcan�UUb�#�e�en��rgin���ee�
�re�Gd�aw�ay��*�,�givin��rg�su��Ub�qs�t�an���t�ial�p�#�e�
�rform�Îance�b�en���et��s.�� �7��R�4�
�Re�`sul��t���s���э�R�4.1��In��Tt��Th��9e�sm��}all���э�R�Th���e�6wt��Uec�hno��logy�d��Te�Gs��Tcr�*�ib�#�e�d�a���b�o�v�e�6ww�as�cons�tru�ct��Ue�Gd�ins�#�id��Te�a�purp�o�qs�1�e-buil��rt�d��Tev���el-����Ro���pm�en���t�-`f�*�ram�ew�or��k.�Th�e�f�*�ram�ew�or��k�i�#�s�a�qui���c�k-an�d-dirt�y�imp��lem�en���t�a��t�ion�of�t��Uh�e����Rf�*�ron���t�&�part�of�a�compile�
�r�for�an�o���v�e�rloadin��rg-f�*�ree�&�su��Ub�qs�1�et�of�Hask���ell,�d��Te�Gs�#�ign�e�d�&�t��ro����Rf�#�acilit���a��t��Ue���exp�e�
�r�*�im�en���t�a��t�ion.���A���high�e�r-ord��Te�r���remo�v��q�al�transform�Îa��t�ion�in�t��Uh�e�s�t�yle����Rof��LNelan�[�Nel91����]�allo���ws�r�s�t-ord��Te�
�r��Lan�Îalys�1�e�Gs�of�programs�m�akin��rg�su��Ub�qs�t���an���t�ial��Lus�1�e����Rof��high���e�
�r-ord��Te�r�fu��rnct���ions.�All�an�Îalys�1�e�Gs�w�e�
�re�don�e�monomorphi���cally��*�,�t��ro�m�Îak�e����Rcompar�*�i�#�son���wit��Uh�a�forw���ard�in���t��Ue�
�rpret�a��t�ion�f�#�aire�
�r.�F��*�or�t��Uh�e�bac�kw�ards�an�Îalys�1�e�Gs,����Rof�L�cour�s�1�e,�t��Uh���e�
�re�i�#�s�no�in���tr�*�ins�i���c�re�qason�t��ro�us�1�e�monomorphi�c�an�Îalys�#�i�s.�L�F��*�our�inpu��rt��s����Rw���e�
�re�UUus�1�e�Gd:��gۍ����X@�{����c�avlTree�:�UUins�1�e�
�rt���ion�of�it��Uems�in���t��ro�an�A���VL�tree�(44�lin�e�Gs).�������X@�{����c�life�:�X�La���u��rnc���h�bury's�imp��lem�en���t�a��t�ion�of�Con�w�ay's�\life"�s�#�im��Uula��t�ion�(311�lin�e�Gs).�������X@�{����c�fft�:��F��*�as�t�four�*�ie�
�r�transform,�f�rom�Hart��Uel's�b�#�enc���hm�Îar��k�suit�e�[�HL92a���]�(421����clin���e�Gs).�������X@�{����c�ida�:�UUSo��lv���e�Gs�t��Uh�e�15-puzzle,�also�f�*�rom�Hart��Uel's�suit�e�(728�lin���e�Gs).��M䍑a�life�,�M��fft��an���d��ida��are�su��Ub�qs�t�an���t�ial�inpu��rt��s.�Quot��Ue�Gd�s�#�ize�s�are�aft��Ue�
�r�ins�1�e�rt���ion�of����Rsuit���a�b��le�i�prelud��Te�fu��rnct���ions.�Th�ey�m�Îak�e�su��Ub�qs�t�an���t�ial�us�1�e�of�high�e�
�r-ord��Te�r�i�fu��rnct�ions,�������g�\����3��2�\���j�����͍����?���������F���orw��Cards������Ev��h�alT���rans����� �wHe�KadStr�-qi���ct�������Z˶�Program�H��Lτff����ff����\�Tim��9e�H��Lτff����g�Re�A�s� �id�H��Lτff����ff���ܤ�Tim��9e�H��Lτff�����Re�A�s� �id�H��Lτff����ff���!E�Tim��9e�H��Lτff���A��Re�A�s� �id���YeP��5�ffU��1����ke�avlTree��(��Lτff����ff���;V`�9.58�H��Lτff���c,�1514�H��Lτff����ff������0.23�H��Lτff����"��3�j��		cmti9�197�H��Lτff����ff����?��0.27�H��Lτff�������200�������	���life��(��Lτff����ff���2d�359.20�H��Lτff���^��11203�H��Lτff����ff������2.01�H��Lτff����m�628�H��Lτff����ff����?�2.97�H��Lτff�������615�������ޑ�fft��(��Lτff����ff���6�b�28.76�H��Lτff���b�!�1473�H��Lτff����ff�������6.38�H��Lτff����j�1473�H��Lτff����ff����?��8.38�H��Lτff����
��1524�������ޑ�ida��(��Lτff����ff���6�b�920+�H��Lτff���W[54000+�H��Lτff����ff������9.32�H��Lτff����j�1725�H��Lτff����ff����?��7.70�H��Lτff����
��1734������:�3��,�T���a��Cb��le��1.����P��9e�	�rform��ance�of�a�b�Ns��tract�in���t���e�	�rpret�e�r��s���(t��9im�e�in�s�.econ�ds,�re�A�s� �id�؇encie�s�in�Kb��9yt���e�s).����,It��9ali���ci� �s�.e�A�d��2gure�s�in��9di���ca���t���e�p� �e�Nak�re�s� �id�؇encie�s�d�؇en��9e�d�b��9y�prepro�ce�s�Ns� �in��g�ph��9as�.e�s,�ra���t��Th��9e�	�r�t�h��9an����,a��9b�Ns��tract��>in���t���e�	�rpret�a���t�ion�or�xp�A�oin���t�in��g.�Th�e��F���orw��Cards��an��alys� �i�s�of��ida��did�not�comp��let���e����,ev��9en�Tin�54�m�ega�b�yt���e�A�s�of�h�e�Nap.���"�,�whi���c���h�;vt��Uh�e�r�s�t���ie�
�r�h�as�t��ro�w�or��k�quit��Ue�h�ard�t��ro�remo�v�e,�an�d�whi���c�h�ca���us�1�e�Gs�t��Uh�e�inpu��rt�t�o����,t��Uh���e��7a�b�qs�tract�in���t��Ue�
�rpret�e�r��7pro���p�#�e�r�t��ro�b�#�e�cons�id��Te�
�ra���b��ly�bigge�r�t��Uh���an�t�h���e�u��rn���transform�e�Gd����,source�Gs.���ꍑ;Th���e�pNan�Îalys�1�e�
�r�w�as�wr�*�it���t��Uen�in�s�t�an�d��rard�Hask�ell�1.2,�compile�Gd�wit��Uh�Glasgo�w����,Hask���ell�bS0.19�\�-O�",�an�d�ru��rn�on�a�quiet�64-m�ega�b�yt��Ue�Su��rn�Sparc�10/31�ru�nnin�g����,Su��rnOS�v4.1.3.�vOA�gen���e�
�ra��t�ion�Îal�garbage�co��llect��ror�w�as�us�1�e�Gd,�an�d�h�e�qap�s�#�ize�Gs�w�e�
�re����,s�1�et�yet��ro�try�an���d�k�eep�garbage�co��llect�ion�co�qs�t��s�b�#�elo�w�10%,�al��rt��Uh�Îough�for�large�
�r�re�Gs-����,id��Tencie�Gs��.t��Uhi�#�s�i�s�dicul��rt.�Tim���e�Gs�u�n���d��Te�
�r�s�#�ixt�y�s�1�econ�ds�are�a�v�e�
�rage�Gd�o�v�e�
�r�s�#�ix�ru��rns.����,Th���ey�Kfinclud��Te�t��Uh�e�prepro�Gce�s�qs�#�in��rg�Kft�im�e�s�Kfof�par�s�#�in��rg,�d��Te�Gsugar�*�in�g,�t���yp�#�ec�h�ec�kin�g,�Kfmono-����,morphi�#�sa��t���ion�g�an�d�r�s�t���ica��t�ion,�bu��rt�in�no�cas�1�e�do�t��Uh�e�Gs�1�e�excee�d�20%�of�t��Uh���e�t��rot�al.����,T��*�a���b��le�1�UUsh�Îo�ws�t��Uh�e�re�Gsul��rt��s,�us�#�in�g�t��Uhree�die�
�ren���t�a���b�qs�tract�in�t��Ue�
�rpret���a��t�ions:���������2@�{����=He� �adStr�1i��ct�:��a�h���e�qad�s�tr�*�i���ct,�bac�kw�ards�in���t��Ue�
�rpret�a��t�ion�preci�#�s�1�ely�as�d��Te�Gs��Tcr�*�ib�e�d����=in�UUt��Uhi�#�s�pap�e�
�r.�������2@�{����=Ev��\ralT��
�rans�:���anot��Uh���e�
�r�bac�kw�ards�in���t��Ue�
�rpret�a��t�ion,�form�e�Gd,�as�wit��Uh�He�qadStr�*�i���ct,����=us�#�in��rg�'kt��Uh���e�gen�e�
�r�*�i���c�f�ram���ew�or��k�'kd��Te�Gs��Tcr�ib�#�e�d�'ka���b�o�v�e,�'kbu��rt�us�#�in�g�a�s�#�imp��le�
�r�c���h�aract��Ue�r-����=i�#�sa��t���ion�Sof�d��ra�t���a�s�tru�ct�ure�Gs,�e�s�qs�1�en���t���ially�a�gen�e�
�rali�#�sa��t�ion�of�Geo�Bur�#�n's�Ev��q�alu-����=a��t���ion�UUT��*�ransform�e�
�r�s.�������2@�{����=F��
�orw��9ards�:��a�forw���ards�BHA-s�t�yle�in���t��Ue�
�rpret�e�r,��wit��Uh�h���an�dlin��rg��of�d�a��t���a�s�tru�c-����=t���ure�Gs��tas�d��Te�s��Tcr�*�ib�#�e�d�in�[�Sew91��8�].�Th���e�d��ra��t�a-s�tru�ct�ure�h�an�dlin��rg�can�b�#�e�cons�id��Te�
�re�Gd����=in�UUa�s�1�ens�e�UUof�\equiv��q�alen���t"�d��Tet���ail�t��ro�t��Uh�a��t�of�Ev��q�alT��*�rans.������,Eac���h��in���t��Ue�
�rpret�e�r��w���as�m�e�qasure�Gd�wit��Uh�a�rewr�*�it��Ue-bas�1�e�d�xp�oin���t��Ue�
�r�d��Te�s�#�ign���e�d�sp�#�ecially����,for���it.�Th���e�rewr�*�it��Ue�
�r�s�are�v�e�
�ry�s�#�imilar,�an�d�b�y�us�#�in��rg�t��Uh�e�sam�e�kin�d�of�o�pt�imi�#�sa��t�ions����,in�UUe�qac���h�w�e�h�Îo�p�#�e�t��ro�m�Îak�e�t��Uh�e�compar�*�i�#�son�re�qason�Îa�b��ly�f�#�air.����;Th���e�Gs�1�e��1m�e�qasurem�en���t��s�m�Îak�e�cle�qar�jus�t�wh�a��t�an�adv��q�an���t�age�t��Uh�e�bac�kw�ards�in���t��Ue�
�r-����,pret���a��t�ions�/h�a�v�e�{�t��Uh�e�Ev��q�alT��*�rans�an�Îalys�#�i�s�of��life��ru��rns�almo�qs�t�t���w�o�h��Uu��rn�dre�Gd�t�im�e�Gs����,f�#�as�t��Ue�
�r�6�t��Uh���an�t�h���e�forw�ards�an�Îalys�#�i�s,�6�an�d�in�a�f�*�ract�ion�of�t��Uh�e�space.�Th�e�He�qadStr�*�i���ct����,in���t��Ue�
�rpret���a��t�ion�-i�#�s�not�s�ignican���t��Uly�slo���w�e�
�r�-t�h�an�-t�h�e�-Ev��q�alT��*�rans�v���e�
�r�s�#�ion.�Thi�s�com���e�Gs����,as�'a�bit�of�a�surpr�*�i�#�s�1�e,�s�ince�on���e�migh�t�exp�#�ect�it�t��ro�pro�Gd�u�ce�m��Uu�c�h�more�d��Tet�ail,����,an���d�l�t�ak�e�corre�Gsp�on���din��rgly�lon�ge�
�r.�Insp�#�ect���ion�of�ou�t�ʪpu�t��s�rev���e�qals�t��Uh�a��t�it�do�#�e�Gsn't����,alw���ays�apn�d�a�gre�qa��t�d��Te�al�more�s�tr�*�i���ctn���e�Gs�s�t��Uh���an�t�h���e�Ev��q�alT��*�rans�an�Îalys�#�i�s.�An���d�quit��Ue�����*.�g�\����3��2�\����ܚ��R�wh���y���t��Uh�e�He�qadStr�*�i���ct�an�Îalys�#�i�s�sh�Îould�som���et�im�e�Gs�b�#�e�qui���c�k�e�
�r�(for��ida�)�i�#�s�m�ys�t��Ue�
�r�*�ious,����Rp�Go�qs�s�#�ib��ly�UUd���ue�t��ro�t��Uh�e�preci�#�s�1�e�d��Tet�ails�of�re�Gd�u�ct�ion�pa��t��Uhs�in�t�h���e�t��Ue�
�rm�rewr�*�it�e�
�r�s.��qm��R�4.2��In��Tt��Th��9e�large��qm��R�Aft��Ue�
�r���ext�ens�#�iv���e�t�u��rnin�g�in�t��Uh���e�d��Tev�elo�pm�en���t�f�*�ram�ew�or��k,�t��Uh�e�(p�Go��lymorphi���c)�He�qad-����RStr�*�i���ct�y}in���t��Ue�
�rpret�e�r�y}an���d�it��s�xp�Goin���t��Ue�r�w���e�re�ins�t���alle�Gd�in�Glasgo�w�Hask�ell�0.19�t��ro����Ras�qs�1�e�Gs�s��+t��Uh���e�via�bilit�y�of�su�c�h�s�tr�*�i���ctn�e�Gs�qs�an�Îalys�#�i�s��+\in�t��Uh�e�large".�In���t��Uegra��t�ion�add��Te�Gd����Ra���b�Gou��rt���5700�non-b��lank,�non-comm�en���t�lin�e�Gs�of�co�d��Te�t��ro�an�exi�#�s�t���in�g�t�ot���al�of�a�b�Gou��rt����R50000.�]Beca���us�1�e�t��Uh���e�compile�
�r�i�#�s�w�ell�d��Te�Gs�#�ign�e�d,�]in���t��Uegra��t�ion�w�as�rem�Îar��k���a�b��ly�cle�qan,����Rwit��Uh��t�h���e�sm�Îalle�Gs�t�of�mo�dica��t���ions�t��ro�exi�#�s�t�in��rg�co�Gd��Te.�Th�e�exi�#�s�t�in��rg�f�*�ram�ew�or��k�for����Rtransmit���t���in��rg�=-pragm�Îa��t�i���c�inform�Îa��t�ion�b�#�et�w�een�mo�Gd�ule�s�=-w�as�ext��Uen�d��Te�Gd�t��ro�allo�w�full����Rin���t��Ue�
�rmo�Gd���ule��\an�Îalys�#�i�s;�giv���en�t��Uh�e�argu��rm�en���t��s�pre�Gs�1�en�t��Ue�d��\in�Sect���ion�2,�t��Uh�e�exp�#�e�
�r�*�im�en���t����Rw���ould�UUh�a�v�e�b�#�een�largely�w�ort��Uhle�Gs�qs�h�ad�t��Uhi�#�s�b�een�omit���t��Ue�Gd.����aCompilin��rg���Glasgo���w's�imp��lem�en���t�a��t�ion�of�t��Uh�e�Hask�ell��Prelude�,�p��lus�som�e�ot��Uh�e�
�r����Rgen���e�
�ral-purp�Go�qs�1�e�I�librar�*�ie�s,�t��rot���allin�g�a���b�Gou�t�4000�lin���e�Gs,�t�ak�e�Gs�som�e�four�h�Îour�s�on�a����RSu��rn���SparcSt���a��t�ion�IPX,�roughly�a�dou��Ub��lin��rg�of�t�h���e�no-an�Îalys�#�i�s�t���im�e.�A���h�e�qap�s�#�ize����Rof�bT24�m���ega�b�yt��Ue�Gs�bTpro�v�e�d�bTmore�t��Uh���an�ad��Tequa��t��Ue,�an�d,�p��le�qas�#�in��rgly��*�,�t��Uh�e�
�re�w�as�no�n�ee�Gd����Rt��ro�ijre�Gsort�t�o�t��Uh���e�tree-pru�nin�g�d��Te�Gs��Tcr�*�ib�#�e�d�ijin�Sect���ion�3.3.�An�e�qarlie�
�r�v�e�
�r�s�#�ion�of�t��Uh�e����Ran�Îalys�1�e�
�r,�s�in�it��s�d��Tev���elo�pm�en���t�s�f�*�ram�ew�or�k,�s�cons�t�it�u��rt�in�g�s�13000�lin���e�Gs�in�28�mo�d���ule�s,����Rw���as���su��Ub�qs�1�equen���t�ly�compile�Gd.�25�mo�d���ule�s�w���en���t�t��Uhrough�wit�h�no�prob��lems,�whils�t����Rt��Uhree�UUrequire�Gd�pru��rnin�g.����aBy�t7an���y�s�t�an�d��rards,�su�c�h�exp�#�e�
�r�*�im�en���t�a��t�ion�wit��Uh�re�qal�compile�
�r�s�an�d�re�qal�pro-����Rgrams�glen���ds�m�Îa��8jor�cre�Gdibilit�y�t��ro�t��Uh�e�en��rgin�ee�
�r�*�in�g�gd��Te�Gs��Tcr�ib�#�e�d�gin�t��Uhi�s�pap�e�
�r.�Ob-����Rs�1�e�
�rv��q�a��t���ion�\of�t��Uh�e�in���t��Ue�
�rpret�e�r�\an���d�xp�Goin���t��Ue�r�grap���p��lin��rg�wit��Uh�non-t�o���y�inpu�t��s�le�qad�t�o����Rm�Îan���y�5Hren�em�en���t��s,�an�d�t��ro�t��Uh�e�sugge�Gs�t�ions�for�furt��Uh�e�
�r�d��Tev�elo�pm�en���t�t��ro�w�ards�t��Uh�e����Ren���d�UUof�Sect�ion�3.4.����R�4.3��Conclus�(�ions��qm��R�Th���e�`�a�b�qs�tract�in���t��Ue�
�rpret�e�r�`�an���d�xp�Goin���t�in��rg�m�ec�h�ani�#�sm�ou��rt��Ulin�e�Gd�a�b�Go�v�e�h�a�v�e�b�#�een����Rd��Tev���elo�p�#�e�Gd�Xan�d�t�u��rn�e�Gd�b�y�ru��rnnin�g�t��Uh���em�o�v�e�
�r�ap�pro�xim�Îa��t��Uely�t�w�en���t�y�t��Uh�Îousan�d�lin�e�Gs����Rof�Q�Hask���ell�source�co�Gd��Te.�As�qs�1�e�s�s�#�in��rg�Q�t��Uh���e�via�bilit�y�of�n�ew�s��Tc�h�em�e�Gs�only�on�sm�Îall�ex-����Ramp��le�Gs���or�us�#�in��rg�pap�e�
�r�an�Îalys�1�e�Gs�can�b�e�mi�sle�qadin��rg.�Go�Go�d���en�gin���ee�
�r�*�in�g�require�Gs�not����Ronly�F�sup���p�Gort�in��rg�t��Uh�eory�{�of�whi���c�h�t��Uh�e�eld�sh�Îo�ws�no�sh�Îort�age�{�bu��rt�also�ext��Uens-����Riv���e�8quan���t�it�a��t�iv�e�an�Îalys�#�i�s�on�re�qali�s�t���i���c-s�ize�Gd�inpu��rt��s.�Th���e�rela��t�iv�e�lac�k�of�eect�iv�e����Rimp��lem���en���t�a��t�ions�Iof�s�tr�*�i���ctn���e�Gs�qs�an�d�ot��Uh�e�
�r�s�1�em�Îan���t�i���c�an�Îalys�1�e�Gs�for�Hask�ell�highligh�t��s����Rt��Uh���e�UUn�ee�Gd�for�furt��Uh�e�
�r�a��t���t��Uen���t�ion�t��ro�en�gin���ee�
�r�*�in�g�i�#�s�qsue�Gs�in�a���b�s�tract�in���t��Ue�
�rpret���a��t�ion.����aUs�#�in��rg�Y�t��Uh���e�Gs�1�e�pr�*�incip��le�s,�a�p�o��lymorphi���c�pro��8ject���ion�an�Îalys�1�e�
�r�for�Hask�ell�h�as�b�#�een����Rcre�qa��t��Ue�Gd.��Th���e�an�Îalys�1�e�
�r�i�#�s�eect�iv�e,�robus�t,�relia�b��le,�t�ur�#�ns�in�go�Go�d��p�e�
�rform�Îance�s,����Ran���d���h�as�b�#�een�us�1�e�Gd�t��ro�sup�p�Gort�re�s�1�e�qarc���h�in�a���u��rt�om�Îa��t���i���c�s�tr�*�i�ct���ica��t�ion�of�Hask�ell����Rprograms����^��4���|s�.��QIt�also�lays�ou��rt�a�d��Te�Gs�#�ign�wit��Uh�cons�id��Te�
�ra���b��le�p�Got��Uen���t�ial�for�ren�em�en���t,����Rpart���i���cularly���wit��Uh�re�Gsp�#�ect�t��ro�buildin�g�more�economi���cal�a���b�qs�tract�in���t��Ue�
�rpret�a��t�ions,����Ran���d�G�t��ro�xin�g�sh���ar�*�in�g�prob��lems�in�t��Uh���e�xp�Goin���t�in��rg�m�ec�h�ani�#�sm.�F��*�urt��Uh�e�
�r�d��Tev�elo�pm�en���t����Rm�Îay�UUyield�impre�Gs�qs�#�iv���e�s�tr�*�i���ctn�e�Gs�qs�an�d�sh�ar�*�in��rg�an�Îalys�1�e�Gs�for�Hask�ell.��R��ff8�ϟ
L͍�����-=�4���	?��Deni� �s�THo��9w�e,�Depart�m�en���t�of�Compu��t�in�g,�TImp� �e�	�r�'xial�Co��llege,�Lon��9don.�����A	�g�\����3��2�\����ܚ��,�Refe�frence�`s��#f����,�[AFM���-=�+��n�95]���Z�xZen��a��'Ar�'xio��la,�Ma���t��3t��Thias�F��:�elle�A�i� �s�.en,�John�Marai�s��t,�Mart��9in�Od�؇e�	�r�sky��:�,�an��9d�Philip����Xa�W��:�adle�	�r.�MA��ocall-b��9y-n�ee�A�d��lam��Pb�d��a�calculus.�MIn��22nd�USymp��osium�on�Principles����Xa�of�6�Pr��o�gr�amming�L�anguages�,���San�F��:�ranci� �s��!co,�Califor�nia,�Jan��Tuary�1995.�A��9CM����Xa�Pre�A�s�Ns.������,[A��|rug93]���Xa�Lenn��art��LA��|rugus��t��fs�Nson.��Imp��lem��9en���t�in��g�h�ask�ell�o�v�e�	�rloadin��g.��In��Pr��o�c�e�e�dings�۹of����Xa�the���F��J�unctional�Pr��o�gr�amming���L�anguages�and�Computer�A�Îr�chite�ctur�e�Confer-����Xa�enc��e,�N<Cop�enhagen,�Denmark�,�TJu��n��9e�1993.������,[Bar93]���Xa�Ge�؇bre�A�s�.elas�Ns� �ie���Baraki.��g�A�Îbstr��act�1Interpr�etation�of�Polymorphic�Higher-Or�der����Xa�F��J�unctions�.���PhD���t��Th��9e�A�s� �i�s,��Depart�m�en���t�of�Compu��t���e�	�r�Science,�Univ�e�	�r��s� �it�y�of����Xa�Glasgo��9w,�M�Lilybank�Gard�؇ens,�Glasgo�w�G12�8QQ,�UK,�F��:�e�؇bruary�1993.��fAlso����Xa�a��9v��|raila�b��le�Tas�a�Glasgo��9w�T��:�ec�h�Rep�A�ort�FP-93-07.������,[BHA85]���Xa�G.L.�n�Bur� �n,�C.L.�Hankin,�an��9d�S.�A��|rbramsky��:�.��+Th�e�t��Th�eory�of�s��tr�'xi���ctn�e�A�s�Ns�an��alys� �i�s����Xa�for�}high��9e�	�r-ord�؇e�r�fu��nct��9ions.�&4In��Pr��o�c�e�e�dings�Rof�the�Workshop�on�Pr��o�gr�ams�Ras����Xa�Data���Obje��cts�,��Upage�A�s�42{62,�DIKU,�Co��9p� �enh�agen,��UDenm��ar��fk,�17{19�Oct��ob�e�	�r����Xa�1985.�TSpr�'xin��ge�	�r-V��:�e�rlag�LNCS�217.������,[CC78]���Xa�Cousot��an��9d�Cousot.��CSt�a���t�i���c�d�؇et���e�	�rmin��a���t�ion�of�dyn��ami���c�pro�p� �e�	�rt�ie�A�s�of�recur��s� �iv�e����Xa�pro�A�ce�d��9ure�s.�(vIn��E.J.�Neuh��o��ld,�e�A�dit��or,��F��J�ormal��Description�of�Pr��o�gr�amming����Xa�Conc��epts�.�TNort��Th-Ho��llan��9d,�1978.������,[Con91]���Xa�Ch��9arle�A�s���Cons�.el.��F��:�as��t�s�tr�'xi���ctn��9e�A�s�Ns�an��alys� �i�s���via�sym��Pb�o��li���c�xp�oin���t�it���e�	�ra���t��9ion.��Un-����Xa�pu��Tb��li� �sh��9e�A�d.�}Y��:�ale�Univ�e�	�r��s� �it�y��:�,�Depart�m�en���t�of�Compu��t���e�	�r�Science,�Sept�em��Pb� �e�	�r����Xa�1991.������,[FH93]���Xa�Alex��QF��:�e�	�rguson�an��9d�John�Hugh�e�A�s.���F��:�as��t�a�b�Ns��tract�in���t���e�	�rpret�a���t�ion�us� �in��g�s�.equen-����Xa�t��9ial�\�algor�'xit��Thms.���In��Pr��o�c�e�e�dings���of�the�Chalmers�Pr��o�gr�amming���Metho�dolo�gy����Xa�Gr��oup���Winter�Me�eting�,�jJan��Tuary�1993.�U�Depart��9m�en���t�jof�Compu��t���e�	�r�Science�A�s,����Xa�Ch��9alm�e�	�r��s�TUniv�e�r��s� �it�y�Tof�T��:�ec��9hno��logy�.������,[Hal93]���Xa�Cord�؇elia�V.��ZHall.��KUs� �in��g�s��tr�'xi���ctn��9e�A�s�Ns�an��alys�i�s�in�pract��9i���ce�for�d��a���t�a�s��tru�ct�ure�A�s.����Xa�In�{John�T.�O'Donn��9ell�an�d�K�evin�Hammon�d,�e�A�dit��or��s,��Glasgow���Workshop����Xa�on��F��J�unctional�Pr��o�gr�amming�,��wW��:�or��fksh��o��9p�Ns�in�Compu��t�in�g,��wAyr,�Scot��Tlan�d,�July����Xa�1993.�TSpr�'xin��ge�	�r-V��:�e�rlag.������,[HH91]���Xa�Se�؇bas��t��9ian���Hu��n���t�an�d�Chr�'xi� �s�Hankin.���Fixe�A�d�p�oin���t��fs�an��9d�f�'xron�t��9ie�	�r��s:�a�n�ew�p� �e�	�r-����Xa�sp� �ect��9iv�e.�
��Journal�0Sof�F��J�unctional�Pr��o�gr�amming�,���1(1):91�{�120,�Jan��Tuary�1991.������,[HL92a]���Xa�Piet���e�	�r�H.���Hart�el�an��9d�Ko� �en�G.�Lan��gen�do� �en.�	Benc�hm��ar��fkin�g���imp��lem�en���t�a���t�ions����Xa�of�(flazy�fu��nct��9ion��al�lan�guage�A�s.�M�T��:�ec��9hni���cal�rep�ort,�Depart��9m�en���t�(fof�Compu��t���e�	�r����Xa�Sys��t���ems,��F��:�acul��t��9y�of�Ma���t��Th�em��a�t�i���cs��an�d�Compu��t���e�	�r�Science,�Univ�e�	�r��s� �it�y�of�Am-����Xa�s��t���e�	�rd��am,�TDecem��Pb� �e�r�1992.������,[HL92b]���Xa�John�� Hugh��9e�A�s�an�d�John�La��3u��nc�h�bury��:�.�	��Pro���ject�ions�for�p�A�o��lymorphi���c�r��s�t-����Xa�ord�؇e�	�r���s��tr�'xi���ctn��9e�A�s�Ns�an��alys� �i�s.��In����Mathematic��al�9�Structur�es�in�Computer�Scienc�e�,����Xa�v��9o��lu��m�e�2,�Tpage�A�s�301{326,�1992.������,[HM94]���Xa�C.�L.�B9Hankin�an��9d�D.�Le�M������Xet��9ay�e�	�r.���De�r�'xivin��g�B9algor�it��Thms�f�rom�t��9yp� �e�infe�	�rence����Xa�sys��t���ems:��(A��|rp��9p��li���ca���t�ion�t��o�s��tr�'xi���ctn�e�A�s�Ns�an��alys� �i�s.���In��Pr��o�c�e�e�dings���of�POPL'94�,����Xa�1994.������,[Hug90]���Xa�John���Hugh��9e�A�s.��Compile-t�im�e�an��alys� �i�s�of�fu��nct��9ion��al�programs.��In�Da�vid�A.����Xa�T��:�ur� �n��9e�	�r,��
e�A�dit��or,��R��ese�ar�ch��xT��J�opics�in�F�unctional�Pr��o�gr�amming�.��
Addi� �son-����Xa�W��:�e�A�sley��DPu��Tb��li� �shin��g�Compan��9y�,�1990.�ϮF�rom�t��Th��9e�1987�Y�e�Nar�of�Programmin��g,����Xa�Univ��9e�	�r��s� �it�y�Tof�T��:�exas,�A��|rus�t��9in,�T��:�exas.������,[Hu��n91]���Xa�Se�؇bas��t��9ian��Hu��n���t.��2�A�Îbstr��act��Interpr�etation�of�F��J�unctional�L�anguages:�F��J�r�om����Xa�The��ory�?fto�Pr�actic�e�.�'�PhD��t��Th��9e�A�s� �i�s,��Imp�e�	�r�'xial�Co��llege,�Univ��9e�r��s� �it�y��of�Lon�don,����Xa�1991.�����W+�g�\����3��2�\����ܚ����R�[JM86]���~a�Ne�A�il�D.��Jon��9e�s�an��9d�Alan�Mycroft.��pDa���t�a�
o�w�an��alys� �i�s�of�ap��9p��li���ca���t�iv�e�programs����~a�us� �in��g���minim��al�fu�nct��9ion�graphs:�A��|rbr�'xidge�A�d�v�e�	�r��s� �ion.��In��Thirte��enth��A�ÎCM��Sym-����~a�p��osium��/on�Principles�of�Pr�o�gr�amming�L�anguages,�St.�Petersbur�g,�Florida�,����~a�page�A�s�T296{306,�1986.������R[Jon93]���~a�Mar��fk�P��:�.��LJon��9e�A�s.��P�art�ial�ev��|ralua���t�ion�for�di���ct�ion��ary-f�'xree�o�v�e�	�rloadin��g.��T��:�ec�hni���cal����~a�Rep�A�ort��RR-959,�Depart��9m�en���t��of�Compu��t���e�	�r�Science,�Y��:�ale�Univ��9e�r��s� �it�y��:�,��A��|rpr�'xil����~a�1993.������R[KHL91]���~a�R.�K��9u��Tbiak,���J.�Hugh�e�A�s,���an�d�J.�La��3u��nc�h�bury��:�.�n�A���prot�ot�yp� �e���imp��lem�en���t�a���t�ion�of����~a�pro���ject��9ion-bas�.e�A�d���r��s�t-ord�؇e�	�r�p�A�o��lymorphi���c�s�tr�'xi���ctn��9e�A�s�Ns�an��alys� �i�s.��RIn�R.�Held��al,����~a�e�A�dit��or,�R��Dr��aft�rPr�o�c�e�e�dings�of�F��J�ourth�A�Înnual�Glasgow�Workshop�on�F�unc-����~a�tional�N<Pr��o�gr�amming�,�Tpage�A�s�322{343,�Sky��9e,�A��|rugus��t�13{15�1991.������R[Mar92]���~a�Chr�'xi� �s��t��o��9ph�e�	�r�Ch�arle�A�s�t6Mart�in.�4��A�Îlgorithms��mfor�Finding�Fixp��oints�in�A�bstr��act����~a�Interpr��etation�.��PhD��t��Th��9e�A�s� �i�s,���Imp�e�	�r�'xial�Co��llege,�Univ��9e�r��s� �it�y���of�Lon�don,�Ju��n�e����~a�1992.������R[Nel91]���~a�George�C.�T�Nelan.���Firstic��ation�.�PhD�Tat��Th��9e�A�s� �i�s,�Ar�'xizon��a�St��9a���t���e�Univ�e�	�r��s� �it�y��:�,�1991.������R[NN92]���~a�F.�Nielson�Dan��9d�H.R.�Nielson.��Finit���en�e�A�s�Ns�con�dit�ions�for�xe�A�d�p�oin���t�it���e�	�ra-����~a�t��9ion.�|�T��:�ec�hni���cal��grep�A�ort,�Compu��t���e�	�r�Science�Depart��9m�en���t,��gAarh��Tus�Univ��9e�r��s� �it�y��:�,����~a�Denm��ar��fk,�TF��:�e�؇bruary�1992.������R[No�A�c93]���~a�Er�'xi���c�֓No�A�c��9k�e�	�r.��Str�i���ctn�e�A�s�Ns�֓an��alys� �i�s�us�in��g�a��9b�Ns��tract�re�A�d�u�ct�ion.��In��Pr��o�c�e�e�dings��of����~a�FPCA93,�N<Cop��enhagen,�Denmark�,�TJu��n��9e�1993.������R[P��9ar92]���~a�Will�/�P��9art�ain.�cTh�e��nofib��b� �enc�hm��ar��fk�suit���e�of�h�ask�ell�programs.�cIn��Fifth����~a�A�Înnual�N<Glasgow�Workshop�on�F��J�unctional�Pr��o�gr�amming,�N<Ayr�,�T1992.������R[PC87]���~a�Simon���P��9eyt��on�Jon�e�A�s�an�d�Chr�'xi� �s�Clac�k.���Fin�din��g�xp�A�oin���t��fs�in�a�b�Ns��tract�in���t���e�	�r-����~a�pret��9a���t�ion.��.In�VkS.�A��|rbramsky�an��9d�C.L.�Hankin,�e�A�dit��or��s,��A�Îbstr��act���Interpr�etation����~a�of�R`De��clar�ative�L�anguages�,�0kCompu��t���e�	�r��s�an��9d�Th�e�A�ir�A��|rp�p��li���ca���t�ions,�c�h�apt���e�	�r�11,����~a�page�A�s�T246{265.�Elli� �s�Horw��9o�o�d,�1987.������R[PJ93]���~a�Will�nP��9art�ain�an�d�Simon�L.�P�eyt��on�Jon�e�A�s.�"EM��e�Nasur�'xin�g�t��Th��9e�eect�iv�en�e�A�s�Ns�of�a����~a�s� �imp��le��as��tr�'xi���ctn��9e�A�s�Ns�an��alys�.e�	�r.��In�John�T.�O'Donn�ell�an�d�K�evin�Hammon�d,�e�A�d-����~a�it��or��s,�@&�Glasgow�u�Workshop�on�F��J�unctional�Pr��o�gr�amming�,�W��:�or��fksh��o��9p�Ns�in�Com-����~a�pu��t��9in�g,�TAyr,�Scot��Tlan�d,�July�1993.�Spr�'xin��ge�	�r-V��:�e�rlag.������R[Ro�Ns93]���~a�Mads���Ro�Ns�.en��9d��a�hl.�+2High�e�	�r-ord�؇e�r���c�h�aot�i���c�it���e�	�ra���t�ion�s�.equence�A�s.�+2In��PLILP'93�,����~a�page�A�s�T332{345,�T��:�allinn,�Es��t��onia,�1993.�Spr�'xin�ge�	�r-V��:�e�rlag�TLNCS714.������R[Sew91]���~a�Julian�+�Sew��9ard.�W�T��:�o�w�ards�a�s��tr�'xi���ctn�e�A�s�Ns�an��alys�.e�	�r�for�h�ask�ell:�Pu��t��3t�in�g�+�t��Th�eory����~a�in���t��o���pract��9i���ce.���Mas��t���e�	�r's�t��Th�e�A�s� �i�s,���Univ�e�	�r��s�it�y���of�Manc�h�e�A�s��t���e�	�r,�Depart�m�en���t�of����~a�Compu��t���e�	�r���Science,�1991.���Av��|raila��9b��le�as�Univ�e�	�r��s� �it�y�of�Manc�h�e�A�s��t���e�	�r�T��:�ec�hni���cal����~a�Rep�A�ort�TUMCS-92-2-2.������R[Sew94]���~a�Julian��)Sew��9ard.����A�Îbstr��act��LInterpr�etation:�A��-Quantitative�Assessment�.���PhD����~a�t��Th��9e�A�s� �i�s,��Depart�m�en���t�of�Compu��t���e�	�r�Science,�Univ�e�	�r��s� �it�y�of�Manc�h�e�A�s��t���e�	�r,�Oxford����~a�Road,�TManc��9h�e�A�s��t���e�	�r�M13�9PL,�UK,�Oct��ob� �e�r�1994.������R[W��:�ad87]���~a�P��:�.L.���W�adle�	�r.��eStr�'xi���ctn��9e�A�s�Ns�an��alys� �i�s�on�non-
a���t�dom��ains�(b��9y�a�b�Ns��tract�in���t���e�	�rpret-����~a�a���t��9ion��o�v�e�	�r�nit���e�dom��ains).���In�S.�A��|rbramsky�an�d�C.L.�Hankin,�e�A�dit��or��s,��A�Îb-����~a�str��act��+Interpr�etation�of�De�clar�ative�L�anguages�,���c��9h�apt���e�	�r�12,�page�A�s�266{275.����~a�Elli� �s�THorw��9o�A�o�d�Ltd.,�Chi���c��9h�e�A�s��t���e�	�r,�W��:�e�s��t�Sus�Ns�.ex,�En��glan��9d,�1987.��K3g��RThi� �s�Tart��9i���cle�w�as�pro�A�ce�s�Ns�.e�d�Tus� �in��g�t��Th�e�L����5������A�����T���uA���E����X�m��acro�pac�k���age�wit��Th�LLNCS�s��t�yle�����k����;�g�\���3�j��		cmti9�1ߤN		cmtt9�,����		cmsy9�)�Aa�cmr6�(��N�cmbx12�&t�:		cmbx9�%o���		cmr9�t}\�cmti7��':

cmti10���<x

cmtt10��"V

cmbx10���Kffffcmbx14�
!",�

cmsy10�O!�cmsy7�
�b>

cmmi10�	0e�rcmmi7�K�`y

cmr10�ٓ�Rcmr7���u

cmex10���������