01:55:52 <donri> stepcut: happstack-dot-com wants to connect synthea, how can i launch only web app?
09:00:34 <lapinferoce> Hello i m a newbe in haskell world ...
09:01:30 <lapinferoce> and i have a trouble with happstack-lite fileupload
09:02:37 <lapinferoce> how can i move my file before it is removed from /tmp
09:14:22 <lapinferoce> please help
14:52:35 <donri> http://rlv.zcache.de/css_ist_fantastisch_tasse-p168716435071981928enwnp_400.jpg
15:12:31 <stepcut> donri: i think there is a config option in the bot state that says whether to connect or not?
15:12:56 <stepcut> also, that image is a riot and very sad
15:13:56 <donri> "riot"?
15:16:21 <dsfox> riot == very funny
15:16:50 <donri> ah :)
17:56:02 <donri> discovery of the day: monad comprehensions are nice for acid-state queries
17:57:54 <donri> particularly for dealing with the maybe's from ixset and Map lookups
17:58:17 <stepkut> nice
17:58:26 <stepkut> hpaste?
17:59:12 <hpaste> donri pasted “monad comprehensions” at http://hpaste.org/72086
17:59:49 <donri> also featured: lens-families
18:00:01 <stepkut> crazy
18:00:51 <donri> could use a monad comprehension for the Query itself as well but not as pretty when nested like that
18:01:51 <donri> and yes i'm relying on "fail" here ;)
18:04:42 <donri> could be fun to explore ways to get rid of do-notation in happstack 8, like, can applicative style be useful for writing handlers? and of course monad comps / arrow procs
18:05:17 <donri> (just for fun. "do" is fine.)
18:33:55 <stepkut> ACTION should try to get ops here 'just in case'
18:35:01 <mightybyte> I tried ages ago for #snapframework, but haven't heard back
18:35:35 <stepkut> well, this channel is registered, I think Lemmih or someone can do it
18:36:59 <stepkut> hmm, Founder    : freenode-staff
18:37:03 <stepkut> not sure what implications that ha
18:37:04 <stepkut> has
18:40:45 <stepkut> looks like vegai and freenode-staff are the only people with +f
18:40:54 <stepkut>  +f - Enables modification of channel access lists.
18:41:00 <stepkut> @seen vegai
18:41:00 <lambdabot> Unknown command, try @list
18:41:39 <stepkut> :-/
19:20:56 <donri> @xseen vegai
19:20:56 <lambdabot> Unknown command, try @list
19:21:01 <donri> needs moar preflex
19:21:36 <donri> stepkut: just ask a freenode staff :)
20:12:19 <chrisdone> stepcut: bump
20:18:38 <donri> ohai kiris
20:19:24 <chrisdone> y halo thar
20:19:33 <chrisdone> ^_^
20:46:31 <donri> chrisdone: so, what's up with the name and how do you pronounce it
20:46:45 <donri> is it "fi" or "fey"
20:47:47 <chrisdone> fey. it's a name, but it's also has a nice derivation
20:47:49 <chrisdone> @wn fay
20:47:49 <lambdabot> *** "fay" wn "WordNet (r) 3.0 (2006)"
20:47:49 <lambdabot> fay
20:47:50 <lambdabot>     n 1: a small being, human in form, playful and having magical
20:47:50 <lambdabot>          powers [syn: {fairy}, {faery}, {faerie}, {fay}, {sprite}]
20:48:04 <chrisdone> :)
20:48:22 <donri> ah!
20:48:29 <donri> i thought it might be fairy related
20:48:47 <chrisdone> hehe
20:48:49 <donri> they even used that word in true blood latest ep
20:49:00 <donri> and it's basically what we say in swedish
20:49:44 <chrisdone> ahh
20:50:09 <chrisdone> ACTION . o O ( wish italians could make shows like true blood… )
20:50:38 <donri> ACTION . o O ( can't unthink: italians making a show like true blood )
20:54:11 <donri> the fay site is beautiful btw, we should get you to do happstack.com *soliciting*
20:54:41 <donri> vafanculo!
20:54:43 <chrisdone> haha, thanks. as always my "design" is really "lack of design"
20:54:49 <donri> well, i like simple ;)
20:54:59 <chrisdone> :)
21:20:56 <stepcut> chrisdone: what's up?
21:21:44 <chrisdone> oh you're here :)
21:22:11 <chrisdone> i was wondering if you wanted to share some ideas on integrating fay with happstack as we started discussing on reddit
21:22:25 <stepcut> definitely!
21:22:32 <stepcut> i hate javascript with a passion
21:22:42 <chrisdone> haha, then you're my kinda guy
21:23:06 <stepcut> I've also tried HJScript (in earnest) and determined that an EDSL is definitely not the solution
21:23:33 <chrisdone> i agree. also tried it, it's still just javascript in a pretty dress
21:23:43 <stepcut> my primary concern with Fay is how hard/easy it is to integrate with OO client-side 'libraries' like jQuery, the normal DOM stuff, etc
21:23:55 <stepcut> it's more like javascript in an ugly dress
21:25:01 <chrisdone> well regarding jquery and dom stuff i've already done some work similar to that. you bind foreign functions and methods, and create pseudo nullary data types and classes for them. that seems quite ok for me
21:25:42 <chrisdone> here's an example i did at work, it's a wrapper over jquery (called ji, but not that haskell project ji, i just re-used the name): http://hpaste.org/71486
21:26:03 <chrisdone> does that look agreeable or horrible to you?
21:27:55 <donri> i'm pondering if ffi bindings could be generated automatically for yui, it has javadoc-like comments including type information
21:28:08 <donri> if it works, not sure if the result would be horrible or not though :)
21:28:51 <stepcut> i think even more than the OO-ness of javascript is the dynamic typing.. functions taking variable numbers of arguments and allowing different types for the same argument
21:29:51 <stepcut> but, on the other hand, I don't tend to use many javascript libraries.. so it is not an ongoing battle
21:30:12 <stepcut> in theory, we provide a good binding to the basic javascript stuff, and then everything is wonderful fay code
21:30:29 <donri> is that really that common though, the example on the jmacro wiki page for jquery is wrong i think. it always returns a "jQuery object"
21:30:38 <donri> it's just that that object is a "god object" :P
21:32:42 <stepcut> anyway, the only way to find out for real is to do it
21:32:53 <chrisdone> yeah, for the dynamic args and many-use functions like $ i actually just bind it a few different ways with different types
21:32:54 <stepcut> and see what happens. I am convinced the idea has enough merit to try that
21:33:16 <stepcut> what would be needed for Happstack integration?
21:33:26 <chrisdone> for example, i don't know, createElem = $ :: String -> Element, but also query = $ :: String -> Fay [Element]
21:35:11 <chrisdone> erm, i don't know. the key elements are:
21:36:19 <donri> i'd like a quasi quoter like jmacro, but duno if that'd work well for fay which may need to know about foreign functions
21:37:55 <donri> we could have something that serves .fay files as .js, but then we don't really get build-time type checking...
21:38:03 <donri> so it seems to me fay integration boils down to build-system integration?
21:38:44 <chrisdone> ok so you should definitely be importing your fay modules into your server project
21:39:12 <chrisdone> so when you rebuild the server, it will also compile the client. just for the type-checking and consistency checks
21:40:11 <chrisdone> the actual codegen you can run whenever. when you regenerate your sass code or whatnot?
21:40:51 <chrisdone> maybe i should make an example project with happstack
21:40:55 <stepcut> is there a QQ for Fay?
21:40:56 <donri> yea, i tend to avoid things that require special build steps or third-party non-haskell deps though (save for maybe C libs)
21:41:10 <donri> might be worth it for fay though ;)
21:41:37 <chrisdone> stepcut: there isn't. maybe there could be with the ghc api?
21:42:12 <chrisdone> donri: yeah. i guess in the Setup.hs there could be a custom step that also generates the js
21:42:20 <donri> actually since fay is written in haskell itself i think it's fine because you can cabal install it / depend on it
21:42:30 <chrisdone> (as one approach. personally i have an emacs shortcut that does it)
21:42:31 <donri> what i don't like is "to run my haskell app, first set up rubygems to install sass"
21:42:56 <chrisdone> eh, well, that's big projects for ya
21:43:27 <donri> "then proceed to configure an sql server with this 5k lines config file" ;)
21:43:32 <donri> yea, sure
21:43:51 <stepcut> chrisdone: do you envision serving the compiled fay code from static files on the disk? Or linking them right into the server? (or both?) the latter seems nice because then you don't have to find extra files on the disk, and you know that client/server code are the versions that where compiled together
21:43:52 <chrisdone> sounds like when i built the scrive codebase
21:43:56 <donri> heh
21:45:54 <chrisdone> stepcut: i consider that beyond fay's concern. personally, i'm easy. by linking them into the server do you mean using some TH to store them in a big string variable somewhere?
21:46:25 <stepcut> yeah.. or using file-embed maybe
21:46:27 <chrisdone> actually this is entirely up to you and the kind of stuff where your opinion is what counts
21:46:29 <donri> how about instead of a QQ we have, $(embedFay "dir"), compiles all sources in "dir" and embeds a bytestring in the executable
21:46:50 <stepcut> donri: could even pre-gzip it
21:46:55 <donri> + that
21:46:57 <chrisdone> right, file-embed
21:47:02 <stepcut> (file-embed uses TH, of course)
21:47:39 <chrisdone> hmm. but that would be OK because it wouldn't run in Fay, it'd run in the Haskell
21:47:44 <chrisdone> nice
21:48:06 <stepcut>  supporting both options is probably best.. since during development you probably want to be able to quickly hack on Fay changes with out having to rebuild the whole happstack app everytime
21:48:08 <chrisdone> i like that idea. so the client+server are not only compiled together but linked together
21:48:39 <chrisdone> yeah, i do that. i hit F6 to regenerate the fay when i'm quickly iterating in emacs<->the browser
21:50:57 <donri> i suppose one issue is do you serve one big JS file or do we keep the "source files are modules" thing plus perhaps a server-side combo handler?
21:51:54 <donri> because with the latter i don't imagine you can do pre-gzipping
21:52:31 <donri> that is, with a combo handler
21:52:57 <donri> although you could do cached gzipping :)
21:53:48 <stepcut> what does fay generate ?
21:54:42 <chrisdone> fay currently generates one big module
21:54:56 <donri> aha
21:55:03 <donri> chrisdone: btw does import work in fay?
21:55:09 <stepcut> so, pre-gzipping should work for now anyway
21:55:50 <donri> true, "let's not get a head of ourselves" :)
21:55:55 <donri> ahead?
21:55:55 <stepcut> if we get this working now I can talk about it at CUFP :)
21:56:11 <chrisdone> donri: it just brings the whole file in. there is some discussion about how to do modules: https://github.com/chrisdone/fay/issues/8 i plan to make some easy API so that people can implement their own ways of module generation. i prefer the one-big-file, others want the async import() stuff
21:56:33 <chrisdone> stepcut: hehe :)
21:56:37 <donri> yea both approaches have pros and cons
21:57:25 <stepcut> chrisdone: any ideas on how to integrate fay with 'onclick' handlers? One option, of course, is to put no javascript in the html, and just use getElementById to assign the handlers..
21:58:53 <chrisdone> that's the usual way, sure $('#the-id').click(function(){ … }); some would say the ideal way
21:58:55 <donri> you're not "supposed" to use onclick, but it's so seductively cute with hsx+jmacro
21:59:01 <chrisdone> stepcut: do you have something more composable in mind?
21:59:33 <chrisdone> ACTION . o O ( is there some onclick meaning in happstack i'm not aware of?)
21:59:40 <donri> no, it's the normal thing
22:00:10 <stepcut> chrisdone: no I just mean <button onclick="alert('you clicked me.');">click me</button>
22:00:15 <chrisdone> ahh
22:00:23 <chrisdone> if you want to do that, you can write
22:00:54 <chrisdone> onclick="fay.force(fay.my_function)" where my_function :: Fay ()
22:01:12 <donri> <p onclick=[jmacro| alert "ohai"; |]>clicky</p>  --< what we have now with hsx+jmacro
22:01:21 <chrisdone> i do this already at work as fay has to sit inside an existing big JS codebase
22:01:28 <donri> i suppose that's one place where a fay QQ could be nice
22:02:17 <chrisdone> right. something to ponder. if the ghc api allows an “input TH'd haskell → receive normal haskell” then maybe it can be done
22:02:18 <stepcut> chrisdone: can you pass in args?
22:02:50 <chrisdone> stepcut: sure: here's a real example from work: client.force(client.submissionDetails(draft.sid)(container));
22:02:53 <donri> <p onclick=[fay| foreignFay "window.alert" "" "ohai" |]/>
22:02:55 <donri> somesuch
22:03:10 <stepcut> donri: do we even need QQ? perhaps a plain old function is enough ?
22:03:24 <chrisdone> stepcut: (where submissionDetails :: Double -> Container -> Fay ())
22:03:56 <stepcut> anyway, we can work out those details later
22:04:05 <donri> stepcut: i suppose we could have a concrete implementation of the Fay monad and support that in hsx
22:04:10 <stepcut> something is definitely possible, which is all I wanted to know
22:04:18 <chrisdone> indeed
22:04:24 <chrisdone> lots of potential!
22:05:02 <donri> chrisdone: do you think that's possible? having the Fay monad actually generate JS on the server? without parsing
22:05:08 <donri> seems doable?
22:05:38 <chrisdone> if that was possible we'd have a js monad by now i guess
22:05:48 <donri> i guess
22:06:20 <donri> how does the Fay monad work in fay though, like, does forM_ generate a for loop?
22:06:26 <stepcut> heh.. we need a DSL for expressing Haskell in Haskell ;)
22:06:38 <stepcut> which is sort of what template haskell is.. and it huuuurts
22:06:43 <donri> [| ohai TH reporting in |]
22:06:56 <chrisdone> forM_ is defined normally: https://github.com/chrisdone/fay/blob/master/src/Language/Fay/Stdlib.hs#L154
22:07:14 <stepcut> ok, so what is the first action item?
22:07:19 <chrisdone> it won't stackoverflow due to delicious laziness
22:07:23 <chrisdone> erm
22:07:34 <donri> ah yea
22:07:34 <stepcut> create a little demo app using off-the-shelf happstack + fay and figure out where the friction is ?
22:07:37 <chrisdone> first, perhaps i make an example project?
22:07:39 <chrisdone> right
22:07:45 <stepcut> great!
22:07:57 <chrisdone> ok, i'll make a ticket for myself
22:08:15 <donri> \o/
22:08:30 <stepcut> :)
22:09:21 <donri> at which point do we get server-side-controlled client-side FRP with transparent use of the same data structures we put in acid-state?
22:10:20 <chrisdone> first we get server-client transparent use of the same data structure
22:10:23 <donri> or i guess client-controlled server-side FRP
22:10:33 <chrisdone> then one of you clever chaps who understands FRP makes an FRP library in fay
22:10:34 <chrisdone> :p
22:11:49 <donri> "meteor.hs"
22:11:54 <chrisdone> pretty much
22:12:03 <chrisdone> even code can be shared, provided it's pure
22:12:53 <donri> foreignPure? :p
22:14:55 <chrisdone> not that one :p
22:15:18 <stepkut> once we get this working, then we need to come up with some simple game ideas that can be implemented using happstack+fay+acid-state in < 2 hours
22:15:42 <donri> i guess in server-side foreignPure would have to be a runtime error?
22:16:10 <donri> stepkut: and then implement it in 20 hours because we're on new territory? :)
22:16:30 <stepkut> :)
22:16:49 <stepkut> well I'll write a guide so that other people can implement it in < 2
22:18:14 <donri> have some new game theory math: http://s3.boskent.com/prisoners-dilemma/fixed.html
22:18:29 <donri> -- http://bosker.wordpress.com/2012/07/23/the-prisoners-dilemma/
22:20:09 <stepkut> i wonder how easy/hard it would be to integrate web-routes into Fay
22:20:24 <stepkut> that would be quite useful
22:21:31 <chrisdone> indeed. i should be able to write: query (SomeRoute abc 12) $ \MyResponse lala bbb -> …
22:21:43 <donri> ah yea that'd be nice
22:22:11 <stepkut> calling acid-state from Fay would be interesting as well
22:22:36 <chrisdone> how would that be like?
22:23:04 <donri> means we need a security layer (the very problem meteor didn't solve)
22:23:16 <stepkut> results <- query (SomeMethod arg1 arg2) ?
22:23:59 <donri> it might be easier to solve for acid-state because we have a fixed, known set of transactions
22:24:05 <stepkut> right
22:24:21 <stepkut> we are not allowing arbitrary SQL or anything
22:24:24 <donri> whereas meteor just is "run this js on the db"
22:24:29 <donri> kinda.
22:24:58 <stepkut> some much fun stuff to try
22:25:07 <chrisdone> :)
22:25:13 <chrisdone> that would indeed be nice
22:27:13 <chrisdone> ok, i'm off to bed. ciao, guys!
22:27:27 <donri> something i've been wanting for a while is to be able to unit test js without a browser
22:27:29 <donri> aww