[Yhc] idea for ycr2js demo,
actually meant for an in-house project. is this realistic?
tphyahoo at gmail.com
Mon Nov 26 13:47:05 EST 2007
As I mentioned in a previous post, I've been spending quite some time
trying to get live with ycr2js because there's a project it would be
useful for for my day job, as well as making another nice demo to add
to the list.
Basically, I have some functionality that does client-side filtering
of large html tables. It's pretty smart -- it can filter on multiple
filter works by hiding rows that don't match the filter; it's built on
Unfortunately this is rather ugly from the user's perspective. You
have to type something like
into the search string or
(x > 5 && x < 7)
I would like for the user to be able to enter search criteria in a
more intuitive "google" style
=skittles or (=~"mr. goodbar" and =~"15 grams")
so you need a parser that takes the search criteria and converts it
into a function from (String -> Bool)
This parser is relatively easy to build in haskell; I built it. It's
So at any rate what I have is
-- parser from String -> (String -> Bool) (haskell)
multicolumn table with multiple filter expressions. There is a
function here that takes a string and returns a bool, but it's icky,
doesn't recognize quoted strings, doesn't recognize boolean and/or or
parentheses. I want to replace it with a function generated from
haskell that does all of these things.
What I need is to combine these two components.
I'll try and post some minimal source code for the parser and the
can become another example for ycr2js.
A possible reason why this wouldn't work is that when you're using the
ycr2js stuff, *everything* has to be generated; it doesn't play well
be surprised if that was the case, but since I haven't actually
successfully generated any code yet i guess anything possible. At any
rate, if this sort of thing could cause issues please someone in the
know give me fair warning.
More information about the Yhc