[Haskell-cafe] Enforcing data structures invariant in the type system
frank at fstaals.net
Mon Mar 30 18:28:39 UTC 2015
Nicola Gigante <nicola.gigante at gmail.com> writes:
>> Il giorno 30/mar/2015, alle ore 19:17, Oliver Charles <ollie at ocharles.org.uk> ha scritto:
>> You're in the right ballpark that's for sure - and your experience with
>> hard-to-decode error messages is not a new one either! Haskell is somewhat
>> "experiemental" in this domain, as its only now starting to learn the
>> features necessary to do what you want to do.
> Having some compilers background I understand very well the difficulties in making sensible error messages,
> especially when dealing with such advanced features. The point was more that I don’t know the basics on
> how those features work (and what is involved in the job of the type checker) so I can’t even parse what
> GHC try to tell me (skolem what?).
>> I think some of the best work to learn the latest techniques is described
>> here: https://github.com/jstolarek/dep-typed-wbl-heaps-hs
> Thank you that looks very useful!
>> -- ocharles
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
Stephanie Stephanie Weirich gave an invited talk about maintaining color
and height invariants for Red-Black trees at ICFP this year . Connor
McBride had a talk and paper about also maintinging order invariants
. You might want to have a look at them.
As for getting used to the error messages. I think the only way to learn
is to get your hands dirty yourself. I can highly reccommend also just
doing the red-black trees yourself. Getting insertions to work is not
too difficult. Deletions are a bit harder. I also did so some time ago
 (before seeing the ICFP talk even; I found it very cool that I had
pretty much the same solution :)).
More information about the Haskell-Cafe