Search Haskell Channel Logs

Thursday, February 2, 2017

#haskell channel featuring opqdonut, tdammers, lambdabot, merijn, tsahyt, Sindriava, and 5 others.

demoninajar 2017-02-02 00:45:12
not sure if this is off-topic but any ideas on writing a composition operator such that that f <$$> g1 <$$> g2 <$$> .. <$$> gn = \x1 x2 .. xn -> f (g1 x1) (g2 x2) .. (gn xn) ?
maffh 2017-02-02 00:48:44
Hello, I am trying to install wxhaskell on Windows 10 using this wiki https://wiki.haskell.org/WxHaskell/Windows. Unfortunately, I don't think I can use the easy way installation. So I tried installing wxWidget using the section "1.2 Installing the hard way". This seemed like it worked because I did not receive any errors. However, when I tried running this command: "cabal install wx" this resulted in the following error:"This version of wxc requi
maffh 2017-02-02 00:48:44
res one of the following wxWidgets versions to be available: ["3.0","2.9"]". I am not sure what I did wrong. Does somebody maybe have some tips on how to possibly solve it?
tdammers 2017-02-02 00:52:16
jophish: I think that should be perfectly possible
opqdonut 2017-02-02 00:53:25
demoninajar: That's "f <$> g1 <*> g2 <*> g3" in the (e->) applicative
Sindriava 2017-02-02 00:54:08
Could someone help me install Hakyll?
opqdonut 2017-02-02 00:54:16
> let f x y z = x+y+z in f <$> succ <*> pred <*> (*2) $ 2 -- demoninajar
lambdabot 2017-02-02 00:54:19
8
Sindriava 2017-02-02 00:54:30
`stack install hakyll` fails on "Error: While constructing the build plan"
Sindriava 2017-02-02 00:59:19
I guess I need to change the resolver somehow, to allow me to install hakyll? Gotta say, stack doesn't do a very good job of explaining what I should be doing :/
tabaqui1 2017-02-02 01:01:18
If I have "recursiveIO = forever $ some_action >> recursiveIO" will I get memory leaks?
ski 2017-02-02 01:01:42
opqdonut : no it's not
tabaqui1 2017-02-02 01:02:04
I've already asked about some recursive IO, but it's still somewhat wild for me
tabaqui1 2017-02-02 01:02:25
*recursiveIO :: IO ()
tdammers 2017-02-02 01:02:45
tabaqui1: there won't be memory leaks, the `forever` is just redundant
demoninajar 2017-02-02 01:03:07
@opqdonut that turns f to a function taking a single argument
lambdabot 2017-02-02 01:03:07
Unknown command, try @list
tdammers 2017-02-02 01:03:08
unless some_action itself is leaky, of course
tabaqui1 2017-02-02 01:03:41
tdammers: not in my case, there is if/then/else inside
opqdonut 2017-02-02 01:03:42
ski: demoninajar: oh right
tdammers 2017-02-02 01:04:13
tabaqui1: then no problem
merijn 2017-02-02 01:04:36
I think not, but you can always benchmark :)
merijn 2017-02-02 01:04:45
If you do it's not that hard to fix
tabaqui1 2017-02-02 01:05:05
tdammers: ok, thanks
tdammers 2017-02-02 01:05:12
tabaqui1: mentally stepping through the evaluation/execution helps a ton
merijn 2017-02-02 01:05:13
'fix $ \loop -> myAction >> loop' <- fixed
tabaqui1 2017-02-02 01:05:27
merijn: I'm not sure about ghc optimizations
tdammers 2017-02-02 01:05:30
tabaqui1: as long as you remember that evaluation is non-strict
demoninajar 2017-02-02 01:05:40
I /think/ this should require quite a few language extensions and some typeclass abuse but hopefully I am wrong
tabaqui1 2017-02-02 01:05:42
it's pretty hard for me to catch leaks in lazy runtime
tdammers 2017-02-02 01:06:07
someAction >> recursiveIO -- when the runtime sees this, it figures out that in order to run it, it needs to evaluate someAction, so it does that
tdammers 2017-02-02 01:06:32
but it doesn't fully evaluate the >> expression yet, just the first operand
tdammers 2017-02-02 01:06:39
that's enough to start running it
merijn 2017-02-02 01:06:40
tdammers: Depending on your monad instance and inlining, the >>= might end up allocating repeatedly
merijn 2017-02-02 01:07:09
tabaqui1: But eh, isn't the forever redundant in that example?
tabaqui1 2017-02-02 01:07:36
merijn: I have something like
tabaqui1 2017-02-02 01:08:08
forever $ action >>= (\err -> when err then recursiveIO)
tabaqui1 2017-02-02 01:08:18
so I need forever here
tabaqui1 2017-02-02 01:08:26
*when err recursiveIO
tdammers 2017-02-02 01:09:21
@src forever
lambdabot 2017-02-02 01:09:21
forever a = let a' = a >> a' in a'
tdammers 2017-02-02 01:09:26
tabaqui1: ^
tdammers 2017-02-02 01:10:13
it's going to recurse either way, either through forever, or explicitly
tabaqui1 2017-02-02 01:10:17
tdammers: yeah, right
merijn 2017-02-02 01:10:29
tdammers: Forever is more efficient, though
merijn 2017-02-02 01:10:34
That's why it's defined like that
tabaqui1 2017-02-02 01:10:35
but where will go memory allocated for err, for example?
merijn 2017-02-02 01:10:44
tabaqui1: GC
tdammers 2017-02-02 01:11:02
merijn: true, although I believe the gain is tiny when it comes to IO
tabaqui1 2017-02-02 01:11:18
gc, gc
tdammers 2017-02-02 01:11:24
garbage collection
tabaqui1 2017-02-02 01:11:26
everybody tells gc
tabaqui1 2017-02-02 01:11:31
it's so easy in C)
tabaqui1 2017-02-02 01:12:13
maybe I should trust another developers
tabaqui1 2017-02-02 01:13:42
hackage has broken link to "data IO" source
merijn 2017-02-02 01:14:03
tabaqui1: link?
tsahyt 2017-02-02 01:14:06
nice
tsahyt 2017-02-02 01:14:11
oh, wrong buffer, sorry
tabaqui1 2017-02-02 01:14:28
https://hackage.haskell.org/packages/archive/%01/%02/doc/html/src/GHC-Types.html#IO
tabaqui1 2017-02-02 01:14:45
%01, %02 in url?
merijn 2017-02-02 01:16:12
It doesn't have a source link (as it should), but Haddock is rendering it wrong
merijn 2017-02-02 01:16:18
Notice the absence of "source"
merijn 2017-02-02 01:16:32
Where'd you get that links from?
ph88 2017-02-02 01:16:38
hi guys, i made this code that works with GHC.Generics and it works. Could anyone have a look at my code and see if there are some things left that still can be improved? https://paste.fedoraproject.org/542869/37744148/
tabaqui1 2017-02-02 01:16:42
https://hackage.haskell.org/package/base-4.6.0.0/docs/System-IO.html
tabaqui1 2017-02-02 01:16:50
reference to "data IO a"
merijn 2017-02-02 01:17:31
tabaqui1: Note that has no "source", unlike all the others
merijn 2017-02-02 01:17:51
oh, that one does
merijn 2017-02-02 01:18:01
tabaqui1: That's a way old version, though
merijn 2017-02-02 01:18:19
tabaqui1: https://hackage.haskell.org/package/base-4.9.1.0/docs/System-IO.html
tabaqui1 2017-02-02 01:19:09
ok, thx
merijn 2017-02-02 01:20:14
tabaqui1: Are you using Chrome?
tabaqui1 2017-02-02 01:21:04
nope, firefox
tabaqui1 2017-02-02 01:21:07
why?
merijn 2017-02-02 01:21:14
Ah, not sure if it exists for Firefox
merijn 2017-02-02 01:21:30
tabaqui1: There's a Hackage-Fu extension for Chrome that adds a warning if your browsing old docs + link to latest
merijn 2017-02-02 01:21:33
https://chrome.google.com/webstore/detail/hackage-fu/dnpldbohleinhdgfnhlkofpgkdcfcfmf
merijn 2017-02-02 01:22:31
There seems to be a basic firefox port, but it probably needs work
merijn 2017-02-02 01:22:35
https://github.com/statusfailed/hackage-fu
tabaqui1 2017-02-02 01:25:29
there is plugin with which it can use google extensions if FF
tabaqui1 2017-02-02 01:25:51
dunno, I don't have problems with docs usually
tdammers 2017-02-02 01:35:39
jophish: http://hackage.haskell.org/package/casing-0.1.1.0/docs/Text-Casing.html#toWords