[Haskell-beginners] How to avoid repeating a type restriction from a data constructor
Daniel Fischer
daniel.is.fischer at googlemail.com
Wed Apr 24 14:00:07 CEST 2013
On Wednesday 24 April 2013, 10:35:34, gs wrote:
> Daniel Fischer <daniel.is.fischer <at> googlemail.com> writes:
> > Use a GADT,
> >
> > {-# LANGUAGE GADTs #-}
> >
> > data Source x y where
> >
> > Source :: Variable v => { bindings :: v [Binding a], var :: v a }
> >
> > -> Source v a
>
> I tried this, but every place that I remove the restriction Variable v =>
> from something using Source, I get an error No instance for (Variable v) ...
Sounds like you're not pattern-matching on the `Source` constructor.
Can you post some example code?
More information about the Beginners
mailing list