<    April 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 25 26 27 28 29  
30
00:02 <monochrom> Is S->(A,S) very abstract to you?
00:06 vaibhavsagar joined
00:11 <Squarism> no
00:12 eacameron joined
00:13 <Squarism> trying to follow bind in https://gist.github.com/sdiehl/8d991a718f7a9c80f54b
00:13 godfrey joined
00:13 <Squarism> its far from intuitive to me. Maybe its just alien
00:14 <Squarism> I found what i need though Cont monad
00:15 <monochrom> State is just one type alias and two newtype wrappers away from S->(A,S).
00:15 <monochrom> You cannot have one of them abstract and the other not.
00:15 <monochrom> Either you declare both abstract or both concrete.
00:20 newhoggy joined
00:22 <mniip> base: primitive haskell types are concrete
00:22 <mniip> by induction, everything is concrete
00:26 Rodya_ joined
00:28 <benzrf> Squarism: a value of type 'State s a' is a stateful computation resulting in an 'a'
00:31 <Squarism> benzrf, i guess im just having trouble see the point of it.
00:31 louispan joined
00:32 <Squarism> ...and i do understand thats my wrong
00:33 <benzrf> Squarism: the point of it is that it turns out that the monad interface is useful for manipulating this kind of thing
00:33 <benzrf> Squarism: think about it like this - it's pretty straightforward to implement something that would be stateful in an imperative language by writing a function of "S -> (A, S)", right?
00:34 conal joined
00:35 <benzrf> the problem is that in imperative languages, you can easily compose stateful computations by doing something like this:
00:35 <Squarism> if the function had a local variable that keept its value between invokations you mean?
00:35 <benzrf> yeah
00:35 <monochrom> No.
00:35 <benzrf> in an imperative language i can say something like this: some_func(stateful_a(), stateful_b())
00:36 <benzrf> however, if i model stateful_a and stateful_b as "S -> (A, S)", i can't compose things like this - i have to manually handle threading the S around
00:36 <benzrf> like
00:36 <benzrf> foo s = some_func s''
00:36 <benzrf> er, wait
00:37 <benzrf> foo s = (some_func a b, s'') where (a, s') = stateful_a s; (b, s'') = stateful_b s'
00:37 <benzrf> not very nice!
00:38 <benzrf> so the concept is that - as it turns out - Monad is a very useful interface for intuitively taking such computations and combining them in a way almost as nice as in an imperative language
00:40 <Squarism> i read something about that chaining part
00:40 ali_bush joined
00:40 ali_bush joined
00:41 harfangk joined
00:42 <Squarism> i guess ill just need to read up on it. Finding non academic examples etc
00:42 <monochrom> http://www.engr.mun.ca/~theo/Misc/haskell_and_monads.htm explains State.
00:42 dni- joined
00:43 <monochrom> (It promises to be a monad tutorial, but it has too much State in mind. Still, great for the State story if that's what you need.)
00:43 <monochrom> which is basically elaborating benzrf's story.
00:44 Rodya_ joined
00:46 <Squarism> benzrf, monochrom : thanks - ill dwelve into that article
00:46 <benzrf> good luck!
00:46 <Squarism> thanks
00:47 <monochrom> But it has non-standard naming. Its "State" is your s or my S. Its "StateTrans" is our State.
00:47 <monochrom> It was written long before mtl
00:57 louispan joined
00:59 vaibhavsagar joined
00:59 crave_ joined
01:06 emmanuel_erc joined
01:20 newhoggy joined
01:29 takle joined
01:31 louispan joined
01:43 cschneid_ joined
01:44 geekosaur joined
01:46 ploop joined
01:50 Youmu joined
01:57 nicknovi1 joined
01:58 eacameron joined
01:59 newhoggy joined
02:04 louispan joined
02:04 takle joined
02:14 mengu_ joined
02:20 takle joined
02:31 dni- joined
02:35 exferenceBot joined
02:36 blissdev joined
02:36 takle joined
02:37 NeverDie_ joined
02:43 Rodya_ joined
02:47 exferenceBot joined
02:48 chlong joined
02:51 hexagoxel joined
02:51 louispan joined
03:00 geekosaur joined
03:11 takle joined
03:14 louispan joined
03:19 taksuyu joined
03:25 hazyPurple joined
03:31 systemfault joined
03:36 baweaver joined
03:42 hazyPurple joined
03:47 __red__ joined
03:47 <__red__> Wow, more people than I expected - cool...
03:53 howdoi joined
04:02 takle joined
04:07 malaclyps joined
04:12 pixelfog_ joined
04:18 takle joined
04:20 dni- joined
04:27 louispan joined
04:33 takle joined
04:34 aarvar joined
04:49 vaibhavsagar joined
04:51 takle joined
05:05 takle joined
05:10 pungi-man joined
05:20 louispan joined
05:22 yellowj joined
05:24 ridho joined
05:35 mstruebing joined
05:47 kaorti joined
05:54 ThomasLocke joined
05:54 ThomasLocke joined
06:03 cschneid_ joined
06:09 dni- joined
06:11 Gurkenglas joined
06:19 exferenceBot joined
06:23 eacameron joined
06:52 exferenceBot joined
06:56 takle joined
07:04 hphuoc25 joined
07:09 GreySunshine joined
07:12 louispan joined
07:12 hphuoc25 joined
07:15 ThomasLocke joined
07:26 bvad joined
07:27 hazyPurple joined
07:27 mattyw joined
07:28 dni- joined
07:32 GreySunshine joined
07:32 mengu joined
07:35 hphuoc25 joined
07:44 newhoggy_ joined
07:46 grayjoc joined
07:50 thc202 joined
07:54 hanna_ joined
07:56 takle joined
07:57 hanna_ left
08:00 Gloomy joined
08:01 toppler joined
08:02 hazyPurple joined
08:07 hphuoc25 joined
08:12 Gloomy joined
08:13 Gloomy joined
08:14 Gloomy joined
08:15 Gloomy joined
08:17 Gloomy joined
08:18 Gloomy joined
08:19 Gloomy joined
08:20 Gloomy joined
08:20 Gloomy joined
08:21 Gloomy joined
08:27 Gloomy joined
08:28 Durz0 joined
08:28 grdryn joined
08:33 mengu joined
08:36 mstruebing joined
08:36 j4ke joined
08:38 meandi joined
08:40 <lpaste> nn pasted “caesar” at http://lpaste.net/354986
08:41 <j4ke> o/ all, how could you do this --^ in a more "haskell way" ?
08:42 alem0lars joined
08:42 <Akii> looks pretty haskellish to me
08:43 <j4ke> Akii: Nice, I have heard about https://wiki.haskell.org/Tying_the_Knot ... is it possible tying the knot here?
08:43 <alem0lars> j4ke: it looks pretty haskellish to me :)
08:45 EricPoe joined
08:50 takle joined
08:51 nacon joined
08:54 newhoggy joined
08:56 <jle`> j4ke: i'd use guards instead of bool
08:56 <lpaste> jle` annotated “caesar” with “caesar (annotation)” at http://lpaste.net/354986#a354987
09:00 binaryplease joined
09:00 takle joined
09:02 <j4ke> jle`: thanks, I have also thought about it. Finally I have choosen `bool` function only because I have learned it in the ninth chapter of "haskell programming" book exercises :)
09:02 <jle`> no problem! it's not particularly bad, it's just that i feel like the version with the guards is much more readable immediately
09:03 <jle`> the main advantage of bool is being able to pass it partially-applied to higher-order functions
09:03 <jle`> but if you're going to fully apply it anyway, might as well use guards or if/then/else
09:04 <jle`> > map (bool "is odd" "is even" . even) [1..5]
09:04 <lambdabot> ["is odd","is even","is odd","is even","is odd"]
09:05 <j4ke> jle`: Uh Cool! Thanks for the explanation! About guards, You are totally right it is more readable :)
09:09 crave joined
09:09 mengu joined
09:11 geekosaur joined
09:12 qu1j0t3 joined
09:27 Levex joined
09:28 yellowj joined
09:29 ralu joined
09:31 madjestic joined
09:34 kritzcreek joined
09:35 qu1j0t3 joined
09:40 noumenon joined
09:40 ephemeral joined
09:48 qu1j0t3 joined
09:55 eatman joined
09:56 <eatman> Hi!
09:59 <Iceland_jack> Hey eatman!
10:01 zero_byte joined
10:05 newhoggy joined
10:06 govg joined
10:08 takle_ joined
10:09 takle joined
10:13 nobodyzxc joined
10:19 hphuoc25 joined
10:22 newhoggy joined
10:31 newhoggy joined
10:31 vaibhavsagar joined
10:38 newhoggy joined
10:46 newhoggy joined
10:51 binaryplease1 joined
10:53 m` joined
10:57 nhtyjbgf joined
11:01 cschneid_ joined
11:01 <eatman> Hi all. I try to implement a HashLife algorithm (http://www.drdobbs.com/jvm/an-algorithm-for-compressing-space-and-t/184406478?pgno=1) and here is my code so far : http://ix.io/rXm/hs
11:01 newhoggy joined
11:02 <eatman> At the moment, the code is the HashLife algo without any optimisatoin.
11:02 <eatman> I saw I found https://hackage.haskell.org/package/hashable-1.2.6.0/docs/Data-Hashable.html in order to hash my board.
11:03 <eatman> And I plan to change my QuadTree to
11:03 Gloomy joined
11:03 <eatman> QuadTree a = Hash | Leaf a a a a | Branch (QuadTree a) (QuadTree a) (QuadTree a) (QuadTree a)
11:04 <eatman> By doing so I "only" have to carry a map Hash -> QuadTree in order to spare the duplicates trees associated memory loss.
11:05 <eatman> But, How am I supposed to carry this Map for one computation to the next?
11:07 hphuoc25 joined
11:11 mengu joined
11:15 Pupnik joined
11:15 nil_ joined
11:23 dni- joined
11:25 bvad joined
11:39 hphuoc25 joined
11:49 m` joined
11:50 plakband joined
12:00 zachary12 joined
12:01 mengu joined
12:02 jathan joined
12:05 alqatari joined
12:08 pbrant joined
12:09 mattyw joined
12:14 Iceland_jack joined
12:19 netheranthem joined
12:22 <eatman> Hey again.
12:22 <eatman> So, I'm stiil looking into my GameOfLife code.
12:23 <eatman> I guess I need a correct use of the State monad to "remember" the previoulsy done computations.
12:24 <eatman> But, I don't quite understand how I am supposed to give the previously computed things without loosing my board in the mean time.
12:25 <eatman> A step of the game can be seen as : step :: Board -> (HashMap, Board)
12:26 <eatman> [...] AFK...
12:36 binaryplease1 joined
12:41 <eatman> Back.
12:42 Levex joined
12:43 carlomagno joined
12:44 <tuturto> eatman: I haven't looked at the code, but why step needs to be Board -> (HashMap, Board)? wouldn't Board -> Board be enough?
12:45 <tuturto> (looking at the code, but will take a while to understand what I'm looking at)
12:50 carlomagno1 joined
12:51 texasmynsted joined
12:52 pungi-man joined
12:53 nil_ joined
12:59 <tuturto> aah, now I follow
13:00 <tuturto> clever
13:02 cschneid_ joined
13:02 asante joined
13:09 ridho joined
13:11 binaryplease joined
13:12 dni- joined
13:14 carlomagno joined
13:18 texasmynsted joined
13:18 zero_byte joined
13:19 madjestic joined
13:19 iAmerikan joined
13:24 <eatman> tuturto: Back again.
13:24 <eatman> If you follow this link http://www.drdobbs.com/jvm/an-algorithm-for-compressing-space-and-t/184406478?pgno=1 you'll have a better understanding (look at the page's bottom).
13:25 <eatman> In this algo, there are two maps.
13:25 xificurC joined
13:25 <eatman> One to avoid storing every similar nodes.
13:26 newhoggy joined
13:26 <eatman> And one to store the result of an already done step with a known input.
13:27 <eatman> But I struggle to understand how to e efficient doing so in Haskell.
13:27 <eatman> And the function signature is wrong actually.
13:28 <eatman> It's more like (Map, Map, Board) -> (Map, Map, Map) board.
13:28 <eatman> It's more like (Map, Map, Board) -> (Map, Map, Board).
13:29 <eatman> In fact, there will probably be a huge memory problem.
13:29 <eatman> I tried to use https://hackage.haskell.org/package/hashable-1.2.6.0/docs/Data-Hashable.html but the output of the hash function is an Int.
13:30 <eatman> So, even if i've no collision, I can only have 8*8 boards.
13:30 <eatman> Needless to say : this sucks.
13:32 <eatman> I was wrong with the Hash thing, it's a kind of pointer or (even better), const reference that I need.
13:34 <eatman> Do we have ocnst references in haskell?
13:35 m` joined
13:35 cschneid_ joined
13:35 jmiven joined
13:43 crave joined
13:47 newhoggy joined
13:47 Levex joined
13:49 <thang1> const references? wut
13:49 zero_byte joined
13:49 <thang1> eatman: Why don't you just try it out the naive way and see what the memory usage actually is? Haskell tends to be pretty smart about memory and you only really need to mess around with weird ways of doing things in special cases
13:50 <eatman> thang1: const reference or pointer to const objects, I don't mind.
13:50 <hexagoxel> in a pure, lazy language everything is a const reference, pretty much.
13:51 <eatman> Yeah, but I need a map from a key to this const reference.
13:51 <eatman> And that key needs to be unique.
13:51 <hexagoxel> unless you consider lower-level stuff like UNPACK or Ptr's.
13:51 <eatman> Yes, I got it, I was wrong about the memory usage.
13:52 <eatman> It's juste a problem of hash function.
13:52 <eatman> And I'm about to solve it.
13:54 <hexagoxel> if you mean "can i derive a hash from the location of the object in memory", then the answer is firstly that you don't even need that and secondly generally no, because gc (although there are stableptrs..).
13:55 Denthir joined
13:55 <eatman> That was not my question. I shouldn't have asked, it was really confused.
13:55 <hexagoxel> a hashmap can contain more pairs than the cardinality of the output of your hash function.
13:56 Big_G joined
13:56 <eatman> hexagoxel: the problem was about the unicity of my hash given the Data.Hashable module.
13:56 <eatman> But I'm ok now.
13:57 newhoggy joined
13:57 <hexagoxel> ah, good :) feel free to ask if you still have any open questions.
13:58 vicfred joined
14:04 mizu_no_oto_work joined
14:05 Durbley joined
14:09 Denthir_ joined
14:11 Denthir joined
14:11 newhoggy joined
14:18 ephemeral joined
14:21 newhoggy joined
14:33 <eatman> Well, I was wrong... again.
14:34 <eatman> I'll need to use the show function as my key...
14:34 <eatman> I mean, a stringyfied version of my trees...
14:35 blissdev joined
14:52 newhoggy joined
14:53 Levex joined
15:01 dni- joined
15:02 newhoggy joined
15:03 ysgard joined
15:06 mizu_no_oto_work joined
15:14 mengu joined
15:15 <Squarism> Sorry for crossposting - but i guess this is the right place. I have a function that now is : IO (SomeType, Writer x y) - i understand that can be written in done in a nicer way with some monad transformer right?
15:15 <Squarism> i mean i have a function with that result
15:16 newhoggy joined
15:17 cschneid_ joined
15:17 uglyfigurine joined
15:24 rembo10 joined
15:29 newhoggy joined
15:32 dni- joined
15:35 <toppler> Squarism: If you want your type to be a monad, then you probably want the transformer version of Writer, which is WriterT. So you would use it here as WriterT x IO. You also want to decide what type it is you are writing. Is it x, or is it (SomeType,x)? Maybe what you want is WriterT (SomeType,x) IO y.
15:36 nicknovi1 joined
15:44 Levex joined
15:44 <Squarism> toppler, ah okey
15:44 geekosaur joined
15:46 newhoggy joined
15:46 Durbley joined
15:47 myrkraverk joined
15:48 ephemeral joined
15:50 <tuturto> eatman: that looks interesting way of doing game of life
15:51 <tuturto> do let us know if you get it working
15:53 conal joined
15:53 ephemeral joined
15:55 newhoggy joined
15:56 ephemeral joined
15:57 baweaver left
16:00 ephemeral joined
16:03 ephemeral joined
16:06 ephemeral joined
16:07 govg joined
16:08 chlong_ joined
16:10 newhoggy joined
16:10 ephemeral joined
16:12 Gloomy joined
16:12 meandi_2 joined
16:12 pungi-man joined
16:14 carlomagno1 joined
16:21 newhoggy joined
16:23 carlomagno joined
16:35 zero_byte joined
16:35 newhoggy joined
16:38 Gurkenglas joined
16:42 vmeson joined
16:50 newhoggy joined
16:50 vmeson joined
16:56 conal joined
16:57 newhoggy joined
17:05 pilne joined
17:06 carlomagno joined
17:07 newhoggy joined
17:11 Denthir joined
17:20 newhoggy joined
17:26 sigmundv_ joined
17:31 newhoggy joined
17:31 pixelfog joined
17:32 Deide joined
17:33 uglyfigurine joined
17:34 mizu_no_oto_work joined
17:35 yellowj joined
17:39 newhoggy joined
17:43 malaclyps joined
17:47 newhoggy joined
17:53 jaykay123 joined
17:53 <jaykay123> hi, with regards to referential transparency
17:53 <jaykay123> why is it relevant to parallelism?
17:53 <jaykay123> I'm not sure I understand
17:55 iAmerikan joined
17:55 newhoggy joined
18:02 <geekosaur> because it ensures that only the values you explicitly expose can be viewed or modified by other threads?
18:03 <geekosaur> no, or at least fewer, thread interaction gotchas, *without* the need for locking/mutexes --- the safety is by design, not by locking
18:04 NSilv joined
18:06 newhoggy joined
18:13 <monochrom> For example, GHC's runtime does have some lock-like mechanism to reduce duplicate work --- when two threads both want to evaluate the same expression. But it is not a perfect lock, and it doesn't have to be, duplicate work is safe, just less efficient. And precisely because it is not a perfect lock, it is faster than perfect locks in practice.
18:13 <monochrom> Look for "white hole" for more details.
18:14 <Akii> what's the way-to-go to install Haskell on Windows? asking for a friend
18:14 <monochrom> Yes :)
18:14 <monochrom> More seriously, there are 3 ways to go.
18:15 <monochrom> 1. Install Haskell Platform for Windows instead. Despite all you can say against having more global libraries, you do not want to build the network package yourself on Windows.
18:16 <monochrom> 2. Install VirtualBox, install Linux inside, get GHC or Stack for Linux.
18:16 <monochrom> 3. Buy a Mac.
18:18 <Akii> wow
18:18 <Akii> I'm about to fmap a friend
18:18 <monochrom> Oh actually there is a 4th. Buy a Raspberry Pi. :)
18:18 <Akii> but that has to go smoothly
18:19 <Akii> basically all he needs is ghci at first
18:19 <Akii> looking up this haskell platform thingy :D
18:19 Gurkenglas joined
18:20 newhoggy joined
18:22 delexi joined
18:23 <monochrom> I guess it is OK to just get GHC alone for Windows first. If your friend needs the extra libraries from Haskell Platform later, can always uninstall GHC then install Haskell Platform.
18:24 <Akii> if Haskell Platform is easy to install np
18:24 <monochrom> At any rate both comes with Windows-style installers and uninstallers.
18:24 <Akii> I personally don't care and neither will he
18:24 <monochrom> Yeah they are equally easy.
18:24 <Akii> right now he's getting somewhat into C++
18:24 <Akii> gotta stop him before it's too late
18:24 <Akii> :D
18:24 <monochrom> Oh don't worry. I learned C++ before I learned Haskell. It's fine.
18:25 <monochrom> Hell, edwardk learned C++ before Haskell. Look where he's now! Your friend is on to greatness.
18:25 <Akii> ye but he has no CS education background whatsoever; I think he might have more fun with Haskell
18:25 <Akii> maybe
18:25 <Akii> at least I want to show it to him once
18:26 <monochrom> I think edwardk also picked up his CS backgraound later not earlier.
18:26 <Akii> definitely not gonna force it onto him
18:26 <monochrom> I think one's got to see C++ sooner or later for completeness.
18:26 <thang1> Just show him some magic with lazy evaluation and elegant/concise code :p
18:26 <monochrom> Just don't worship any language, then you're fine.
18:26 <Akii> I won't :D
18:27 <Akii> my goal is him having fun
18:27 <monochrom> I did my share of worshipping to be fair. I grew out of it later.
18:28 <monochrom> When I saw Pascal (that's after BASIC) I was like "this is the best thing since sliced bread!"
18:28 <monochrom> Then I saw C and I was like "this is the best thing since Pascal!" (On the slight pretext that I just need to type "{" for "begin")
18:29 newhoggy joined
18:29 <monochrom> Then I saw Lisp and I was like "this is the best thing since C!"
18:29 <monochrom> Then I saw Perl and I was like "this is the best thing since Lisp!"
18:29 <monochrom> Then I saw SML and I was like "this is the best thing since... Oh wait, I think I see a pattern there."
18:29 <Akii> xD
18:30 nicknovi1 joined
18:30 <Akii> then you extracted that pattern into a category and poof, here you are
18:30 <qu1j0t3> never. fall. in love. with a. language.
18:31 <monochrom> Anyway, the BASIC->Pascal gap was legitimately big. I already wished for parameter-passing for GOSUB before I saw Pascal, for example.
18:31 <qu1j0t3> monochrom: Yeah. I went BASIC -> BBC BASIC -> Pascal (then, inexplicably, to C)
18:32 <qu1j0t3> Pascal was clearly a much better language than BASIC even to my uneducated teenage brain.
18:32 <monochrom> Pascal->C was only because school required it.
18:33 <qu1j0t3> I should certainly have learned Lisp instead of C, at that time, but I didn't have any mentor who'd have pushed me to
18:35 <monochrom> I am not the "never use goto" kind. But BASIC's "no other choice than goto" is even worse.
18:35 <monochrom> And indentation! That fact that you can indent at your option is nice.
18:36 <qu1j0t3> BBC BASIC had a lot of good structured concepts. Procedures, and so on. But it's still no Pascal.
18:37 <qu1j0t3> REPEAT/UNTIL, etc
18:37 <monochrom> Yeah, QuickBASIC was OK too.
18:38 newhoggy joined
18:38 c0smo_ joined
18:38 ridho joined
18:42 irclogger_com joined
18:42 Topic for
18:44 ebw joined
18:46 <lpaste> ebw pasted “haskellbook ch 7” at http://lpaste.net/355004
18:47 <ebw> Hi, I am learning haskell from haskellbook.com . Whats wrong with my nested wheres in http://lpaste.net/355004
18:48 Levex joined
18:48 MotherFlojo joined
18:50 jmg8766 joined
18:50 newhoggy joined
18:50 <jmg8766> how can I filter a list of functions by the first parameter of the function? I'm getting an error "Illegal view pattern"
18:51 <nitrix> jmg8766: I'm not sure what you mean by filtering the first parameter.
18:52 <kadoban> You can't have a list of functions that take different types of first parameters, so I don't think the question itself makes sense.
18:52 <nitrix> jmg8766: filter ? [(+1), (*2)]
18:53 <nitrix> jmg8766: Even if they had all the same type, say `Num a => a -> a`, you can't do introspection on functions.
18:53 <nitrix> You probably mean something else entirely.
18:54 <jmg8766> gonna think about my question and then get back to you, thanks
18:54 <nitrix> jmg8766: Do you have a concrete example or problem you're faced with? We can find a better suited question and answer that one.
18:55 <ebw> ahh I forgot an =
18:56 <* geekosaur> guesses nitrix is actually on the right track for what was asked for, and indeed the answer is "you can't"
18:56 <geekosaur> it's compiled code at that point, not constructors
18:57 <geekosaur> your expected first parameter might even have been optimized into something else... or optimized away entirely
18:58 <nitrix> There's the small possibility that he wants to know what argument was partially applied, but I'm waiting on more explanations before I jump and suggest a different data type to represent the function.
18:59 <nitrix> And even that sounds like an XY problem :P
19:00 <nitrix> geekosaur: Nice to see you again !
19:00 <nitrix> I missed IRC; I had to migrate my bouncer to another server c:
19:00 <jmg8766> trying to represent an NFA, with a list of transition functions a start state and a list of final states, I was hoping to filter out transition functions that were epsilon transitions, but my data type is probably the problem here
19:00 newhoggy joined
19:03 <nitrix> I think with scanl you'll be able to apply a list of functions on a given initial state, and pass the new state to the next function, and utimately collect all the intermediate results.
19:05 <nitrix> But for the filtering you mentioned, you'd have to do this before hand. Often you end up using your own custom recursion scheme if for example the previous results determine what next functions are applied.
19:07 <nitrix> jmg8766: Are you sure it's wise to filter out epsilon transitions? Episilon transitions are still important as they affect the state, despite not consuming any arguments.
19:10 <jmg8766> I am writing a function that calculates the epsilonClosure of a set of states, so I meant filter out states that aren't epsilon closures
19:10 <jmg8766> as an intermediate step
19:15 newhoggy joined
19:28 newhoggy joined
19:28 <Squarism> looking here https://hackage.haskell.org/package/mtl-2.2.1/docs/Control-Monad-Writer-Lazy.html - i cannot find the implementation of : instance Monad (WriterT w m a) ... ? (No source link) - where should i look?
19:28 <Squarism> or better, how can i find where to look
19:32 hvr joined
19:32 hvr joined
19:33 <geekosaur> mtl is a layer on top of http://hackage.haskell.org/package/transformers
19:33 <geekosaur> so you will find many of the things mtl exports are reexports from that
19:33 iAmerikan joined
19:34 Levex joined
19:36 <geekosaur> in this case I think you have to just know the history of mtr, but in general if there's no source link then it's a reexport and you get to examine the list of dependencies. here that's simple as there's only two: base and transformers, and transformers sounds right anyway...
19:36 <geekosaur> *history of mtl
19:36 <nitrix> http://lpaste.net/6875226460223700992
19:36 <nitrix> Squarism: ^
19:38 <geekosaur> (brief summary of said history: mtl1 was a monolith. later on there was transformers and monads-fd/monads-td, which were experiments to see if functional dependencies or type families worked better for monad transformer implementations. the community decided to stay with fundeps, so mtl2 was more or less monads-fd with modules renamed for compatibility with mtl1)
19:38 <geekosaur> *monads-tf
19:38 <geekosaur> apparently I can't type today :/
19:40 newhoggy joined
19:42 ekinmur joined
19:44 nobodyzxc joined
19:46 Levex joined
19:53 <Squarism> nitrix, thanks
19:54 newhoggy joined
20:00 Gurkenglas joined
20:05 ycheng joined
20:06 newhoggy joined
20:09 <Squarism> Ok. Had this "problem" to add arbitrary "logging/probing" of a function (that does alot more than show in example). Now ive changed result from "IO x" to "WriterT Log IO x". I wonder - am i doing crazyness or is this sane haskell code? http://lpaste.net/355006
20:10 grayjoc joined
20:11 merijn joined
20:17 newhoggy joined
20:17 Denthir joined
20:18 meandi joined
20:22 ycheng joined
20:23 thallada joined
20:27 newhoggy joined
20:34 <nitrix> Squarism: Seems a little off.
20:34 <Squarism> nitrix, oh ok.
20:34 <nitrix> Squarism: I think you'd rather want `StateT MyState (WriterT Log IO) a`.
20:35 <nitrix> Squarism: Say, type Game a = StateT MyState (WriterT Log IO) a
20:35 <Squarism> why have 1 monad transformer when you can have 2! =D
20:35 <glguy> Squarism: WriterT is inappropriate for logging except in perhaps the smallest cases, generally not when combined with IO or Monad instances with strict>>= implementations
20:36 <Akii> I'd love to understand the problem with writer
20:36 <nitrix> If I recall, the problem glguy is rising is that you don't get all the logged data until the last IO has run.
20:38 <nitrix> It's probably a lot of unevaluated thunks you'll accumulate.
20:38 <Squarism> glguy, its actually quite small logs it will produce. Ill use it to probe game states i want to modify/delete because of changes ive done in game code - only for database migrations
20:39 <Squarism> nitrix, thanks for your pointer there. Ill try to understand what you mean by your proposed change
20:40 <Squarism> nitrix, you mean loadGame should return "StateT MyState (WriterT Log IO) a" right?
20:41 <nitrix> Squarism: loadGame is different; I almost believe that you loading the game should happen outside your Game computation, probably in IO, load the state of the game, then run your game with `runGame yourGame theState`, where `runGame` is using runStateT and runWriteT under the hood.
20:42 newhoggy joined
20:42 <Squarism> nitrix, it does. loadGame is only produce a state from list of messages
20:42 <Squarism> is only used to
20:42 <Squarism> even
20:43 takle joined
20:46 <nitrix> Squarism: http://lpaste.net/355009
20:46 <nitrix> Squarism: Very prototyped, but have a look and ask questions :P
20:49 <Squarism> nitrix, Nice - thanks alot. This question is more about adding a mechanism to loadGame so that i can probe / test each of the consecutive states it produces and then add them to the "Log". Like now ive found that i can skip/remove certain client-to-game-messages - but only for certain gamestates. This will make it possible to find these states (really the messages that produced them)
20:50 <nitrix> Squarism: I think loadGame should just load the state of the game.
20:50 <nitrix> Squarism: Something like gameLoop would be the one logging the state at each loop.
20:51 newhoggy joined
20:52 <Squarism> Its not about designing the game - it works. (Maybe could be done better). But now i wanna create a utility and load all of the stored games (just messages database entities) - and in the process give me a log of messages i can remove from the database
20:53 <Squarism> next version of the game wont be able to handle these messages because of a change in the code ill add
20:54 <nitrix> Then I'm a little lost, but I think if you were to use a monad transformer stack of StateT and WriterT, you'd probably have some eureka moment.
20:55 <nitrix> I'm sure you'll want to change a lot of the structure of the application after all. It'll make a lot more sense :P
20:56 <Squarism> nitrix, hehe. I guess. Transformers are the final frontier for me - and this is the first one ive used. So its some time until that Eureka moment. I do hope i reach it soon.
20:56 <nitrix> (Possibly even see the whole power of monads, as well as monad transformers if you do)
20:56 takle joined
20:57 <nitrix> But I still see what you're trying to do. Maybe I can clean up a little, let's see...
20:59 <nitrix> Squarism: loadGame is supposed to load the state of the game and might fail at multiple places during the process? So you want to log that?
21:02 <Squarism> nitrix, not really - id prefer to crash then. This is about searching gamelog for certain states. Like now i found that : in certain situations when a player cannot retreat - i dont need him to tell me that he'll stay and fight - its given. So ill remove all those messages - cause they will not work in next version of the game.
21:02 newhoggy joined
21:02 ali_bush joined
21:02 ali_bush joined
21:02 <Squarism> retreat from a battle that is
21:13 newhoggy joined
21:26 yellowj joined
21:30 newhoggy joined
21:33 newhoggy joined
21:36 newhoggy joined
21:37 MarcelineVQ joined
21:42 yellowj joined
21:43 NoCreativity joined
21:53 hiratara joined
21:53 GreySunshine joined
21:56 peterbec` joined
21:56 Gurkenglas joined
21:58 newhoggy joined
22:03 Denthir joined
22:03 peterbecich joined
22:04 binaryplease joined
22:08 takle joined
22:13 sbrg_ joined
22:13 mehs_ joined
22:14 govg joined
22:14 Quintasan_ joined
22:16 newhoggy joined
22:16 reptar_ joined
22:17 tolt joined
22:17 simony joined
22:17 simony joined
22:19 domenkozar joined
22:19 geekosaur joined
22:19 emily1 joined
22:21 mikedlr joined
22:21 teehemkay joined
22:26 etrepum joined
22:28 ocharles joined
22:31 hiratara joined
22:31 uglyfigurine joined
22:33 Denthir joined
22:35 xacktm joined
22:41 ridho joined
22:42 texasmynsted joined
22:43 uglyfigurine joined
22:47 peterbecich joined
22:51 newhoggy joined
22:54 peterbecich joined
23:18 newhoggy joined
23:30 cschneid_ joined
23:30 bananagram joined
23:36 benley joined
23:36 uglyfigurine joined
23:38 benley joined
23:44 zero_byte joined
23:49 scared joined