Search Haskell Channel Logs

Sunday, January 29, 2017

#haskell channel featuring dfeuer, dibblego, ertes, lambdabot, orzo, Koterpillar,

dfeuer 2017-01-29 16:11:15
ertes: me must to going home now. Got meeting in morning. lambdabot knows where to find me.
orzo 2017-01-29 16:15:01
there should be a prelude name for (return ())
orzo 2017-01-29 16:17:50
since (return ()) is a common do-nothing default, it feels wrong to have all the awkward parenthesis
dibblego 2017-01-29 16:18:05
void
orzo 2017-01-29 16:18:40
void is the wrong type
dibblego 2017-01-29 16:19:04
I have never written return () in 12 years of writing production haskell
dibblego 2017-01-29 16:19:30
because void exists, and even then, that's rare
dfeuer 2017-01-29 16:19:38
<$
ertes 2017-01-29 16:19:45
dfeuer: just as i finished a working implementation =P
dfeuer 2017-01-29 16:19:50
ertes: oh, really?
dfeuer 2017-01-29 16:19:51
OK.
dfeuer 2017-01-29 16:19:55
Well, I got glued to my chair.
Koterpillar 2017-01-29 16:19:56
orzo: use void and remove the last line (which would be "return ()")
dfeuer 2017-01-29 16:19:59
So ... show me?
orzo 2017-01-29 16:20:03
i frequently use it for exception handlers or fail cases for things like 'maybe', 'either', and 'bool'
dibblego 2017-01-29 16:20:16
use void instead
Koterpillar 2017-01-29 16:20:41
unless it's the only thing that you have
Koterpillar 2017-01-29 16:20:49
> void undefined
lambdabot 2017-01-29 16:20:51
error:
lambdabot 2017-01-29 16:20:51
• Ambiguous type variable 'f0' arising from a use of 'show_M682050353230...
lambdabot 2017-01-29 16:20:51
prevents the constraint '(Show (f0 ()))' from being solved.
dfeuer 2017-01-29 16:20:57
ertes: link?
dfeuer 2017-01-29 16:21:11
void undefined? That's totally different.
Koterpillar 2017-01-29 16:21:25
void $ return undefined
orzo 2017-01-29 16:21:33
void undefined isn't going to save me much parens
Koterpillar 2017-01-29 16:21:39
parens, yes
Koterpillar 2017-01-29 16:21:41
typing, no
dibblego 2017-01-29 16:21:44
orzo: show the code, let's fix it
ertes 2017-01-29 16:21:52
dfeuer: here is the FRP implementation: https://gist.github.com/esoeylemez/02bd5e00fcccdbf284ba632eff4efe2a
dfeuer 2017-01-29 16:22:05
ertes: I'll have a look tomorrow. Thanks again!
ertes 2017-01-29 16:22:06
it's a bit messy, but it works (the cache stuff is commented out, because it's buggy)
orzo 2017-01-29 16:22:12
well, here's an awkward line of code: flip (withAsync g) (return ()) $ atomically $ do
dfeuer 2017-01-29 16:22:21
Oh boy. Long.
ertes 2017-01-29 16:22:54
dfeuer: yes… there is a lot of stuff i ended up not using
ertes 2017-01-29 16:23:05
dfeuer: i'll make a minimal version
dfeuer 2017-01-29 16:23:24
ertes: so the unsafe stuff seems to actually not be used?
ertes 2017-01-29 16:23:43
dfeuer: yeah… right now everything is safe, but it's just a minor bug that needs to be fixed
ertes 2017-01-29 16:23:59
dfeuer: here is a test case: app ev = do rec bx1 <- scan 1 (fmap (+) (tag (const <$> bx1) ev)); pure (tag (const <$> bx1) ev)
ertes 2017-01-29 16:24:04
that one can be used with 'react'
ertes 2017-01-29 16:24:25
this works: main = print . take 10 . react app $ [1..]
dfeuer 2017-01-29 16:25:04
ertes: gotta runnnnnnnn. I don't know what that means. Can't read it now.
dfeuer 2017-01-29 16:25:09
Gotta run for reals!
dfeuer 2017-01-29 16:25:11
BYE
ertes 2017-01-29 16:25:15
dfeuer: bye =)
orzo 2017-01-29 16:25:28
hm, i guess for this code i need (const $ return ())
orzo 2017-01-29 16:32:16
instead of (const $ return()) I can use (void . return)
orzo 2017-01-29 16:32:57
i do like the latter better