[Haskell-beginners] How to avoid repeating a type restriction from a data constructor

gs voldermort at hotmail.com
Wed Apr 24 14:27:23 CEST 2013


Daniel Fischer <daniel.is.fischer <at> googlemail.com> writes:

> > > 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?

http://code.accursoft.com/binding/src/c13ccbbec0ba8e326369ff2252863f20a891ef76/binding-core/src/Data/Binding/Simple.hs

http://code.accursoft.com/binding/src/c13ccbbec0ba8e326369ff2252863f20a891ef76/binding-core/src/Data/Binding/List.hs




More information about the Beginners mailing list