3 ms·
>The biggest real problem I’ve found with large “where” clauses is that they tend to have a lot of implicit dependencies on variables from the enclosing scope.
by clusmore 10y ago
>The biggest real problem I’ve found with large “where” clauses is that they tend to have a lot of implicit dependencies on variables from the enclosing scope.
For me it's always a toss up. I like to make things local where possible to give some indication that the definitions need not be looked over with a fine-toothed comb -- they aren't used extensively. On the other hand, it does often lead to implicit dependencies. It would be nice to have scope highlighting - color every identifier based on the distance from the scope it's defined in. This idea shamelessly stolen from Doug Crockford in https://www.youtube.com/watch?v=b0EF0VTs9Dc https://www.youtube.com/watch?v=b0EF0VTs9Dc
- chriswarbo 10y agoDr Racket has a nice feature where it draws arrows between a variable and its binding site, and between a binding and its use sites; it would be nice to use a similar thing in Haskell. https://docs.racket-lang.org/drracket/buttons.html#%28idx._%28gentag._9._%28lib._scribblings%2Fdrracket%2Fdrracket..scrbl%29%29%29 https://docs.racket-lang.org/drracket/buttons.html#%28idx._%...
- andromeduck 10y agoI think something like eclipse's definition window would do a better job.