<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:20 carlomagno joined
00:34 dni- joined
00:42 efm joined
00:54 aarvar joined
00:56 takle joined
01:00 NeverDie joined
01:04 takle joined
01:04 moei joined
01:16 ridho joined
01:18 takle joined
01:44 permegreen joined
01:44 takle joined
01:50 Pupnik joined
01:50 malaclyps joined
02:02 takle joined
02:07 NeverDie joined
02:15 ridho joined
02:15 exferenceBot joined
02:16 cschneid_ joined
02:16 cschneid_ joined
02:17 systemfault joined
02:20 takle joined
02:23 dni- joined
02:23 ridho joined
02:36 exferenceBot joined
02:36 systemfault joined
02:36 HEGX64 joined
02:40 takle joined
02:41 govg joined
02:41 hexagoxel joined
02:58 NeverDie joined
03:07 eacameron joined
03:08 Durbley joined
03:12 malaclyps joined
03:28 uglyfigurine joined
03:29 ridho joined
03:31 takle joined
03:47 takle joined
03:55 takle joined
04:12 dni- joined
04:13 takle joined
04:20 takle joined
04:28 zero_byte joined
04:36 <LiaoTao> Hello again! I'm playing with the State Monad now, but am having a bit of trouble
04:36 <LiaoTao> Is something like this possible? setElem :: Integral a => Int -> a -> State (M.IntMap a) ()
04:37 <LiaoTao> Or does State require a concrete type as argument?
04:41 takle joined
04:44 <srhb> LiaoTao: It's entirely possible, but I get the feeling you may think that this will allow you to make a heterogenous IntMap. It will not.
04:45 <LiaoTao> srhb: Uh, what does heterogeneous mean in this case?
04:45 <LiaoTao> Not up to spec on terminology here
04:45 <srhb> LiaoTao: That the values of the Map have different (Integral) types
04:46 <LiaoTao> Oh, no! I mean it will either be a map of Integrals or Ints
04:46 <LiaoTao> No mixing
04:46 <LiaoTao> Uh
04:46 <LiaoTao> Integers
04:47 <srhb> Well, as long as those are the two only Integral instances, sure, you're good :)
04:47 <LiaoTao> srhb: Thanks for the help
04:47 <LiaoTao> Now to figure out what I'm doing wrong to make the compiler cry
04:47 <srhb> What's it crying about?
04:48 <LiaoTao> Data constructor not in scope:
04:48 <LiaoTao> State :: (M.IntMap a -> ((), M.IntMap a)) -> State (M.IntMap a) ()
04:49 <LiaoTao> Probably my implementation of setElem not doing it correctl
04:49 <LiaoTao> y
04:49 haskelleksah joined
04:49 <glguy> Try lowercase state, not State
04:49 <srhb> State no longer exists.
04:49 <srhb> ^
04:49 <LiaoTao> Oh
04:49 <LiaoTao> That's an annoying gotcha
04:49 <glguy> Somewhen ago State s because a type synonym for StateT s Identtiy
04:49 <srhb> It's been years now, but a lot of materials have not been updated.
04:50 <glguy> Somewhen ago State s became a type synonym for StateT s Identity
04:53 Pupnik_ joined
04:55 <LiaoTao> http://lpaste.net/5197723465469132800
04:55 <LiaoTao> Yay it works
04:55 <LiaoTao> Thanks a lot!
04:59 takle joined
05:02 <srhb> LiaoTao: It would also clean up nicely if you use modify :)
05:02 <srhb> :t modify
05:02 <lambdabot> MonadState s m => (s -> s) -> m ()
05:08 <LiaoTao> srhb: That's really handy
05:12 nickolay joined
05:15 wei2912 joined
05:17 takle joined
05:30 eacameron joined
05:36 takle joined
05:40 haskelleksah joined
06:00 dni- joined
06:03 exferenceBot joined
06:16 takle joined
06:23 takle joined
06:26 jargmonk joined
06:32 Gloomy joined
06:37 takle joined
06:44 takle joined
06:55 takle joined
06:55 eacameron joined
06:56 cschneid_ joined
07:04 uglyfigurine joined
07:04 eacameron joined
07:22 takle joined
07:36 takle joined
07:49 dni- joined
07:54 takle joined
07:57 eacameron joined
07:57 geekosaur joined
08:01 Gloomy joined
08:02 takle joined
08:12 takle joined
08:22 Pupnik joined
08:25 takle joined
08:33 eacameron joined
08:33 takle joined
08:39 eacameron joined
08:40 takle joined
08:41 conal joined
08:52 conal joined
08:54 <nickolay> hi
08:55 <nickolay> in this code http://lpaste.net/355267 - is the "hopefullyLazyListOfChecks" indeed lazy?
08:55 <nickolay> my intent is to check that some predicate holds for every element, which, obviously, can fail early, w/o evaluation of whole list
08:56 <nickolay> but in the "checkAll" it is "returned" from the IO action, which makes me curios if it will be returned fully evaluated or not
08:59 <nickolay> below is the version I wrote initially, which is obviously lazy, but looks too verbose
09:02 eacameron joined
09:02 <srhb> nickolay: let foo = hopefullyLazyListOfChecks ++ [False, undefined]
09:02 <srhb> nickolay: Now return $ all id foo
09:05 <nickolay> srhb: but then it will always fail on the False element?
09:05 takle joined
09:05 <srhb> nickolay: You're not talking about the short-circuiting behaviour of all? What other laziness are you referring to?
09:06 <nickolay> srhb: yes, question is - will the "hopefullyLazeListOfChecks" be fully evaluated or only until the 1st False element
09:06 <srhb> nickolay: Yes, that's what I'm trying to demonstrate. If undefined is ever evaluated, your program will crash.
09:07 <srhb> > all id [True,False,undefined]
09:07 <lambdabot> False
09:07 <srhb> Or better yet
09:07 <srhb> > all id $ [True, False] ++ undefined
09:07 <lambdabot> False
09:07 <nickolay> srhb: ah, I see
09:07 <srhb> Whereas
09:08 <srhb> > all id $ [True, True] ++ undefined
09:08 <lambdabot> *Exception: Prelude.undefined
09:08 <srhb> So you can use this as a tool to explore evaluation.
09:08 <nickolay> srhb: ok, and what about the returning from the monad - that does not evaluate the full list?
09:08 <srhb> I don't know what "returning from the monad" means, but it's probably wrong.
09:09 <nickolay> srhb: I guess I can try as you suggested
09:09 <srhb> Yes, you should. :)
09:09 <nickolay> srhb: thanks for the help!
09:09 <srhb> Welcome :)
09:12 takle joined
09:14 conal joined
09:14 <nickolay> it is lazy it seems, cool :)
09:15 <srhb> Yep, it short circuits just fine, because all does. :)
09:16 <nickolay> right, I was confused by the monadic thing
09:16 <srhb> Yeah, I figured. But if you think of it, all reduces that list to just one Bool. If you were convinced that that part was short-circuiting correctly, there's no way you could somehow rebuild the original list from the reduced value. It's gone forever.
09:17 <srhb> So no matter what return does in IO or any other monad (which is not much, by the way) it couldn't possibly do what you were suspecting. :)
09:18 <nickolay> I see :)
09:21 <ski> and = all id
09:27 <nickolay> ski: oh, indeed, thanks
09:29 nobodyzxc joined
09:29 Levex joined
09:36 qu1j0t3 joined
09:38 dni- joined
09:44 takle joined
09:51 eacameron joined
10:00 qu1j0t3 joined
10:01 takle joined
10:02 takle joined
10:03 netheranthem joined
10:16 thc202 joined
10:22 Gurkenglas joined
10:23 mstruebing joined
10:26 wildlander joined
10:46 conal joined
10:47 madjestic joined
11:13 Pupnik_ joined
11:13 Big_G joined
11:23 Levex joined
11:25 permegreen joined
11:27 dni- joined
11:48 ralu joined
11:57 ebw joined
11:57 cschneid_ joined
11:59 qwertyasdfgh joined
12:03 user__ joined
12:07 zero_byte joined
12:07 mengu joined
12:08 govg joined
12:08 Gloomy joined
12:09 user__ joined
12:12 eacameron joined
12:14 Levex joined
12:19 Denthir joined
12:29 Gloomy joined
12:34 govg joined
12:36 wei2912 joined
12:45 mengu_ joined
12:52 teqwve joined
12:53 Levex joined
12:57 aarvar joined
13:16 dni- joined
13:20 dni- joined
13:33 levex_ joined
13:38 teqwve joined
13:46 Pupnik joined
13:49 nickolay joined
13:52 ebw joined
13:57 pilne joined
13:58 prophile joined
14:04 permagreen joined
14:16 hphuoc25 joined
14:26 NeverDie joined
14:35 eacameron joined
14:38 binaryplease joined
14:45 Deide joined
14:48 crave joined
14:58 Gurkenglas joined
15:29 bvad joined
15:31 kritzcreek joined
15:45 peterbecich joined
15:48 Tene joined
15:48 Tene joined
15:48 zero_byte joined
15:54 mojjo joined
15:56 NeverDie joined
15:58 cschneid_ joined
16:07 Mutter joined
16:13 meandi_2 joined
16:17 hphuoc25 joined
16:20 Hjulle joined
16:25 <crave> I was just wondering about this question - is there a way to dynamically load modules in haskell? Sort of like you can load shared libraries at runtime in C?
16:26 <crave> Oh a quick search solves my question - https://hackage.haskell.org/package/plugins-1.5.6.0/docs/System-Plugins-Load.html
16:33 nobodyzxc joined
16:35 teqwve joined
16:43 mizu_no_oto_work joined
16:46 <glguy> crave: The 'hint' package makes this easier
16:46 <glguy> ?hackage hint
16:46 <lambdabot> http://hackage.haskell.org/package/hint
16:48 <glguy> crave: For example here's a use of hint to load a module at runtime to provide bot logic for a game https://github.com/glguy/Ninjas/blob/master/src/Bot.hs#L253-L266
16:50 <crave> glguy, I suspect it's slower since it's interpreted?
16:53 <glguy> I don't know if you can get hint to compile and then run the object code or not
16:58 cschneid_ joined
17:08 pixelfog_ joined
17:11 systemfault joined
17:12 teqwve joined
17:17 NeverDie joined
17:24 takle joined
17:32 contiver joined
17:39 eacameron joined
18:02 ebw joined
18:10 Gloomy joined
18:14 bungoman joined
18:18 hphuoc25 joined
18:19 Uniaika joined
18:20 ExpHP joined
18:21 fotonzade joined
18:23 eacameron joined
18:27 takle joined
18:27 eacamero_ joined
18:31 mstruebing joined
18:31 eacameron joined
18:39 eacameron joined
19:01 yellowj joined
19:02 peterbecich joined
19:04 peterbecich joined
19:04 oscarftoro joined
19:17 takle joined
19:21 bvad joined
19:25 malaclyps joined
19:29 taksuyu joined
19:29 haskelleksah joined
19:43 Gloomy joined
19:45 takle joined
19:47 govg joined
19:48 donny joined
19:49 donny left
19:50 donnydxyz joined
19:52 donnydxyz left
19:58 geekosaur joined
20:03 madjestic joined
20:04 takle joined
20:13 MotherFlojo joined
20:18 kritzcreek joined
20:19 delexi joined
20:19 hphuoc25 joined
20:20 acarrico joined
20:24 takle joined
20:55 takle joined
21:06 NeverDie joined
21:12 takle joined
21:42 m0d joined
21:46 modlin joined
21:48 conal joined
21:50 Gloomy joined
21:52 hiratara joined
22:05 haskelleksah joined
22:14 cschneid_ joined
22:20 hphuoc25 joined
22:30 Durbley joined
22:31 hiratara joined
22:34 brennie joined
22:36 crave_ joined
22:39 aarvar joined
22:40 brennie joined
22:52 brennie joined
22:59 fotonzade joined
23:21 shayan_ joined
23:28 Prutheus joined
23:50 prophile joined
23:51 louispan joined