▁a . ▁These ▁restrictions ▁rule ▁out ▁higher - kind ed ▁dat at ypes ▁as ▁well ▁as ▁nested ▁dat at ypes , ▁where ▁the ▁recursive ▁calls ▁are ▁of ▁a ▁different ▁form . ▁The ▁fl atten ▁function ▁in ▁Poly P ▁is ▁here ▁provided ▁as ▁an ▁example : ▁▁▁▁ ▁fl atten ▁:: ▁Reg ular ▁d ▁=> ▁d ▁a ▁-> ▁[ a ] ▁▁▁ ▁fl atten ▁= ▁c ata ▁fl ▁▁▁▁ ▁poly ty pic ▁fl ▁:: ▁f ▁a ▁[ a ] ▁-> ▁[ a ] ▁▁▁▁▁ ▁case ▁f ▁of ▁▁▁▁▁▁▁ ▁g + h ▁-> ▁either ▁fl ▁fl ▁▁▁▁▁▁▁ ▁g * h ▁-> ▁\( x , y ) ▁-> ▁fl ▁x ▁++ ▁fl ▁y ▁▁▁▁▁▁▁ ▁() ▁-> ▁\ x ▁-> ▁[] ▁▁▁▁▁▁▁ ▁Par ▁-> ▁\ x ▁-> ▁[ x ] ▁▁▁▁▁▁▁ ▁Rec ▁-> ▁\ x ▁-> ▁x ▁▁▁▁▁▁▁ ▁d @ g ▁-> ▁conc at ▁. ▁fl atten ▁. ▁p map ▁fl ▁▁▁▁▁▁▁ ▁Con ▁t ▁-> ▁\ x ▁-> ▁[] ▁▁▁▁ ▁c ata ▁:: ▁Reg ular ▁d ▁=> ▁( Fun ctor Of ▁d ▁a ▁b ▁-> ▁b ) ▁-> ▁d ▁a ▁-> ▁b ▁ ▁Gener ic ▁H askell ▁Gener ic ▁H askell ▁is ▁another ▁extension ▁to ▁H askell , ▁developed ▁at ▁U tre cht ▁University ▁in ▁the ▁Netherlands . ▁The ▁extensions ▁it ▁provides ▁are : ▁Type - index ed ▁values ▁are ▁defined ▁as ▁a ▁value ▁indexed ▁over ▁the ▁various ▁H askell ▁type ▁construct ors ▁( unit , ▁primitive ▁types , ▁sums , ▁products , ▁and ▁user - defined ▁type ▁construct ors ). ▁In ▁addition , ▁we ▁can ▁also ▁specify