Sebastian Fischer wrote: >> With GADTs, the specific choice of constructor is what gives you the >> type matching functionality. > > My intention was to use a GADT as data family instance (hence, I > wrote it in GADT style and it was accepted as such). Can't GADTs be > used as data family instances?
I'm not aware of any restriction there, but that's not the issue here. You were trying to choose between different top-level types (which happen to be instances of the same family) by their constructors. GADTs allow you to choose between different constructors of the *same* top-level type. If DataFam Bool had multiple constructors, you could choose between them in fffuuuu. But fffuuuu would have to have type DataFam Bool -> Bool -> Int (as is necessary with your originally posted code). Ganesh =============================================================================== Please access the attached hyperlink for an important electronic communications disclaimer: http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html =============================================================================== _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users