Two minutes ago, Anthony Cowley wrote: > On Fri, Aug 5, 2011 at 12:08 AM, Eli Barzilay <[email protected]> wrote: > > 6 minutes ago, Asumu Takikawa wrote: > >> A few of us in the lab today were discussing how the Haskell > >> community has this nice tool called Hoogle > >> (http://www.haskell.org/hoogle) that lets you search Haskell docs by > >> type. > > > > Are there any *practical* uses for that thing? > > Hoogle is very popular among the Haskell community, and regularly > used by experienced programmers and as a resource neophytes are > pointed to.
That's not surprising -- the question is how much the search-by-type feature is used vs the plain by-name searches. > > (Not a flame, I tried it a few times, and it looked like i might > > be useful in a language where you use point-free style to compose > > functions -- so you might know the type that you need `(a -> b -> > > c) -> (b -> c -> a)' but not the `flip' name. But such serches > > don't see, to work. So from this shallow scan, it looks like one > > of these things that sound cool on paper, but are useless in > > practice.) > > The correct type for flip would have yielded more useful results: > <http://www.haskell.org/hoogle/?hoogle=%28a+-%3E+b+-%3E+c%29+-%3E+%28b+-%3E+a+-%3E+c%29> (Doh...) > On the teaching side, how much use students get out of hoogle varies > a lot. Some students struggle to get to the point where they can > adequately formulate the types they want, leaving hoogle a rather > pointless exercise somewhat akin to the frustration of a child using > a dictionary to look up how to spell a word (e.g. how can I find it > if I can't spell it?). Other students who embrace the > specification-side of programming seem to use it in an exploratory > manner as much as a name lookup service (e.g. this type seems > interesting, I wonder if it's a thing...). We already have that kind of exploratory searching, since "types" in the contract system are real functions. I guess that this is another way to make the point: in Haskell and other statically typed languages types are second-class, but in Racket they're first class so looking for a type name will get you information because it's also a binding. (And the same goes for TR, only those are not runtime values.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev

