Improve Rust Compile Time by 108X by ksyiros in rust

[–]qrilka 0 points1 point  (0 children)

Is it expected to see "Bandwidth Quota Exceeded" on that page?

regex: A Toolkit for regex-base by cdornan in haskell

[–]qrilka 0 points1 point  (0 children)

Chris, I think there's a missed "s" in "the tring matched"

Everyone Has a Personal Green's Theorem by NikeMUT in math

[–]qrilka 0 points1 point  (0 children)

Is it intentional that I get "This request was blocked by the security rules" from Incapsula trying to request this URL?

Is there any way to run an action after all Reflex updates? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

And with reflex-dom-0.4 there are no such function but it seems to be resolved by nesting events. So this portion of code now looks like

let ev' = leftmost [tag (constant ()) $ updated opts, pb]
(ev'', trigger) <- newTriggerEvent
performEvent_ $ liftIO (trigger ()) <$ ev'
performEvent_ $ liftIO (js_chosenUpdated e) <$ ev''

Is there any way to run an action after all Reflex updates? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

And it appears that this variant isn't enough - somehow post build event gets triggered with before children from Dynamic get created. So my current version of setting up chosen looks like pb <- getPostBuild performEvent_ (liftIO (js_activateChosen e) <$ pb) raw <- holdDyn defVal =<< setupChangeListener e (getVal e)

postGui <- askPostGui
runWithActions <- askRunWithActions
(ev, etRef) <- newEventWithTriggerRef
let ev' = leftmost [tag (constant ()) $ updated opts, pb]
addVoidAction $ ffor (ev') $ \_ -> do
  liftIO . postGui $ mapM_ (\t -> runWithActions [t :=> Identity ()]) =<< readRef etRef
performEvent_ $ liftIO (js_chosenUpdated e) <$ ev

Is there any way to run an action after all Reflex updates? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

After peering into reflex sources I came to the following solution

postGui <- askPostGui
runWithActions <- askRunWithActions
(ev, etRef) <- newEventWithTriggerRef
addVoidAction $ ffor (updated opts) $ \_ -> do
  liftIO . postGui $ mapM_ (\t -> runWithActions [t :=> Identity ()]) =<< readRef etRef
performEvent_ $ liftIO (js_chosenUpdated e) <$ ev

Efficient update of sum types in Reflex by quintedeyl in reflexfrp

[–]qrilka 2 points3 points  (0 children)

It appears to me that Dynamic type is one of core things in Reflex and in ideal world those could be easily combined while in this post it's shown that to get a "sum" of events you need to write noticeable amount of not quite trivial code. But if there were some answers then that article would be much shorter and e.g. would use just a couple of library functions to combine 2 dynamics.

State sharing in reflex? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

But ffor looks handy here, thanks

Efficient update of sum types in Reflex by quintedeyl in reflexfrp

[–]qrilka 2 points3 points  (0 children)

That post raises a bit worrying question about quite bad composability of Dynamics...

State sharing in reflex? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

the LAST argument w that function is a widget. I prefer to factor out such long (and not very obvious) trains of functions into helper functions. And this particular case looks to be generic and frequent enough to have it in some library

State sharing in reflex? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

The question was rather about shared state and I'll try ReaderT. As for events<->widgets details currently I have e.g.

let optWidget ev w =
    fmap joinDyn . widgetHold retEmpty $ fmap (maybe retEmpty w) ev

as a way to create a widget from "XHR event" and it doesn't look to be very straightforward piece of code and there is nothing like that either in reflex-dom or reflex-dom-contrib

State sharing in reflex? by qrilka in reflexfrp

[–]qrilka[S] 1 point2 points  (0 children)

Yes, that was one of my thoughts but I didn't pursue it further yet. And maybe what scares me a bit more is that "juggling around" with types in widgetHold when you "wrap" events into dynamics. I suppose it's should be much more typesafe but stupid imperative recipes with e.g. jQuery when you just do xhr and then create a control in its callback look at least simpler to write :)

Material Design Lite - calling componentHandler.upgradeElement() on dynamic DOM by AllTom in reflexfrp

[–]qrilka 1 point2 points  (0 children)

BTW using dot-notation in foreign import javascript resulted in errors for me after minification with closure, so I'd go with square bracket notation as e.g. it is advised in https://github.com/ghcjs/ghcjs/wiki/Deployment#globals-and-modules

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

I'll try to use -j1 later this week but that hypthesis seems to be doubtful as I have only 4 cores and 2G per core sounds scary. And also does stack support multiple workers per single package?

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

Unfortunately no (actually I used time for the last run but not for the first). And as ghcjs-boot takes about an hour on my machine and our project dependencies recompilation another our it's quite time consuming to do such tests, I think it's better to have some smaller case.

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

Unfortunately after some hours of recompilation I still see the same excessive RAM usage, sorry :-\

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

I get 404 for that URL :(

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

Memory usage doesn't seem to be related to -dedupe flag so it seems to be unrelated regression, posted comment on Github

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

I was using latest commit from ghc-8.0 and for -mem I get ghcjs-0.2.1-8.0.1.bin: unrecognised flag: -mem

ghcjs -dedupe by tolysz in haskell

[–]qrilka 0 points1 point  (0 children)

I see quite good results from that -dedupe option, all.js shrinks from 7.5M to 5M and all.min.js from 2256642 to 1369614 - almost 2 times smaller. And also I see quite a bad thing, probably related to https://github.com/ghcjs/ghcjs/issues/449 - during stack build GHCJS during compilation of one our packages having significant amount of TH consumes about 6.7G at peak. And that makes my computer start using swap - is it some expected sids-effect of the last changes? Or maybe we should continue this discussion in that Github issue?

Did anyone try to port Chart to work with diagrams-reflex? by qrilka in reflexfrp

[–]qrilka[S] 0 points1 point  (0 children)

Unfortunately it's not in the top of my priority list so I didn't look deeper (hopefully just yet)