
19 Feb
2016
19 Feb
'16
10:12 p.m.
On February 19, 2016 10:54:11 PM GMT+02:00, Francesco Ariis
hey Gesh,
you are right (not able to compile it atm too, but it looks correct and way elegant). Maybe post it in the Ml to help OP?
ciao ciao F
On Fri, Feb 19, 2016 at 04:59:56PM +0200, Gesh wrote:
I'm away from compiler at the moment, but... Shouldn't this work?
{-# LANGUAGE GADTs #-} data NodeS = HamsterS | PersonS data NodeP a where Hamster :: String -> NodeP HamsterS Person :: String -> NodeP PersonS data Node = forall a. NodeP a type Graph = Gr Node... hamsters :: NodeP PersonS -> ...
Basically the idea of that you reify the choice of constructor to the type level, permitting static restriction of the constructors used.
HTH, Gesh
Oops, meant to send to list.