[Haskell-ELTE] GADT-s kérdés

Dévai Gergely deva at inf.elte.hu
2010. Május. 6., Cs, 16:23:34 CEST


Sziasztok!

A múltkori GADT-s kérdésemet feltettem a svéd kollégáknak is. Emil 
Axelsson (Chalmers University) megoldotta kérdést dinamikus típusok 
segítségével. Csatolom a probléma precíz megfogalmazását és Emil megoldását.

Üdv,
Gergő

-------- Original Message --------
Subject: Re: GADT question
Date: Thu, 6 May 2010 15:59:31 +0200
From: Emil Axelsson

I'm pretty sure that's not possible as it stands (without using dynamic
types).

I attach a version that uses dynamic types to achieve what you want. See
example e3. Note that if the types of the symbols "a" and "x" are
different, you get a runtime error.

/ Emil

--------- következő rész ---------
A non-text attachment was scrubbed...
Name: problem.hs
Type: text/x-haskell
Size: 898 bytes
Desc: problem.hs
URL: <https://plc.inf.elte.hu/pipermail/haskell/attachments/20100506/356de00a/attachment.hs>
--------- következő rész ---------
A non-text attachment was scrubbed...
Name: solution.hs
Type: text/x-haskell
Size: 1039 bytes
Desc: solution.hs
URL: <https://plc.inf.elte.hu/pipermail/haskell/attachments/20100506/356de00a/attachment-0001.hs>


More information about the Haskell mailing list