<    March 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 31
00:01 hiratara joined
00:02 louispan joined
00:11 mengu joined
00:17 Ayey_ joined
00:18 Levex joined
00:21 mengu joined
00:23 Levex joined
00:30 takle joined
00:44 jmg joined
00:46 takle joined
00:47 eacameron joined
00:49 EricPoe joined
00:53 louispan joined
01:09 Durbley joined
01:20 mengu joined
01:25 Xlaech joined
01:26 Levex joined
01:29 dni- joined
01:35 Youmu joined
01:37 mizu_no_oto_work joined
01:39 eacameron joined
01:40 Ayey_ joined
01:41 chindy joined
01:41 <parsnip> happy to say i'm peering at haskell again
01:42 levex_ joined
01:42 Rodya_ joined
01:42 <parsnip> i did `stack install cabal-install`, but if i try `cabal init`, cabal can't find a ghc on path. is there a canonical solution?
01:43 eacameron joined
01:44 <MarcelineVQ> if you installed ghc solely stack then you'd use stack, stack exec -- cabal init
01:45 cschneid_ joined
01:52 systemfault joined
01:53 <parsnip> http://sprunge.us/ViEE "cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with\n..."
01:55 <parsnip> or... XY problem, i'm really trying to circumvent the overkill stack templates by doing the lightweight `cabal init` then `stack init`, which was my fave last time i messed with haskell
01:56 <geekosaur> you probably don't want cabal installed solely for stack... (I'd expect running stack under another stack exec to have similar issues; they can't coexist)
01:58 <parsnip> okay, i'll just review making a custom .cabal
02:05 louispan joined
02:10 peterbecich joined
02:18 Rizy joined
02:23 sullyj3 joined
02:24 <lpaste_> sullyj3 pasted “nextMultiple” at http://lpaste.net/353620
02:25 <sullyj3> is there a nicer way of getting the 2 ints the user enters into the binding "multiple" and "n"?
02:25 <sullyj3> the let feels ugly to me
02:31 <geekosaur> (multiplier:n:_) <- map read . words <$> getLine :: IO [Int]
02:31 Ayey_ joined
02:33 <sullyj3> geekosaur: that's nice, thanks.
02:37 hphuoc25 joined
02:46 Rizy joined
03:02 gfixler joined
03:06 eacameron joined
03:08 Ayey_ joined
03:11 stvc1 joined
03:18 dni- joined
03:19 hphuoc25 joined
03:21 cschneid_ joined
03:22 hphuoc25 joined
03:24 louispan joined
03:28 aarvar joined
03:28 hexagoxel joined
03:38 hphuoc25 joined
03:38 ali_bush joined
03:42 eacameron joined
03:44 Rodya_ joined
03:46 exferenceBot joined
03:51 hexagoxel joined
03:53 louispan joined
04:02 shayan_ joined
04:03 Big_G joined
04:33 aarvar joined
04:45 Rodya_ joined
04:45 louispan joined
04:50 ali_bush joined
04:50 ali_bush joined
04:52 DataComputist joined
04:56 permagreen joined
05:06 hexagoxel joined
05:07 dni- joined
05:11 roboguy` joined
05:13 lithie joined
05:16 Apocalisp joined
05:27 roboguy` joined
05:30 hphuoc25 joined
05:31 takle joined
05:34 louispan joined
05:40 takle joined
05:43 systemfault joined
05:46 Rodya_ joined
05:50 cur8or joined
05:52 ali_bush joined
05:52 ali_bush joined
05:56 Gurkenglas joined
06:08 Rizy joined
06:08 Pupnik_ joined
06:10 harfangk joined
06:22 Pupnik joined
06:25 louispan joined
06:27 hphuoc25 joined
06:35 eacameron joined
06:36 hphuoc25 joined
06:36 hphuoc25 joined
06:39 Rizy joined
06:47 Rodya_ joined
06:51 Ayey_ joined
06:52 meandi_2 joined
06:53 ThomasLocke joined
06:53 ThomasLocke joined
06:56 dni- joined
06:56 t0by joined
07:02 kritzcreek_ joined
07:08 hexagoxel joined
07:08 hdeshev joined
07:09 Rizy joined
07:20 ali_bush joined
07:20 ali_bush joined
07:21 cschneid_ joined
07:24 Ayey_ joined
07:25 Ayey_ joined
07:32 ali_bush joined
07:32 ali_bush joined
07:32 dni- joined
07:33 emily1 joined
07:42 hexagoxel joined
07:44 Ayey_ joined
07:49 Sose joined
07:51 ali_bush joined
07:51 ali_bush joined
07:55 wei2912 joined
07:56 eacameron joined
07:56 takle joined
07:56 galderz joined
08:05 mattyw joined
08:06 hphuoc25 joined
08:16 takle joined
08:16 hphuoc25 joined
08:18 ali_bush joined
08:18 ali_bush joined
08:28 hexagoxel joined
08:33 Durz0 joined
08:37 curious_corn joined
08:41 merijn joined
08:43 thc202 joined
08:53 hphuoc25 joined
09:03 louispan joined
09:05 nacon joined
09:07 howdoi joined
09:10 takle joined
09:21 hphuoc25 joined
09:26 ederign joined
09:31 ali_bush joined
09:31 ali_bush joined
09:36 mengu joined
09:43 comerijn joined
09:50 hphuoc25 joined
09:59 zero_byte joined
09:59 infinite-Joy joined
10:00 infinite-Joy joined
10:08 ali_bush joined
10:08 ali_bush joined
10:09 gregman_ joined
10:22 eacameron joined
10:26 codenirvana joined
10:27 codenirvana left
10:29 ali_bush joined
10:29 ali_bush joined
10:36 infinite-Joy314 joined
10:38 galderz joined
10:39 louispan joined
10:44 Sose joined
10:45 yellowj joined
10:48 EO_ joined
10:49 Rodya_ joined
10:50 ali_bush joined
10:50 ali_bush joined
11:00 ali_bush joined
11:00 ali_bush joined
11:00 infinite-Joy314 joined
11:03 mattyw_ joined
11:09 Rizy joined
11:12 ali_bush joined
11:14 pie_ joined
11:16 Apocalis_ joined
11:29 louispan joined
11:38 Rizy joined
11:43 infinite-Joy314 joined
11:50 Rodya_ joined
11:56 dennisvennink joined
12:03 hexagoxel joined
12:03 Rizy joined
12:03 mengu joined
12:09 prophile joined
12:09 mattyw joined
12:19 cschneid_ joined
12:22 jmg joined
12:22 slomo joined
12:29 infinite-Joy314 joined
12:41 yellowj joined
12:47 snowcrshd joined
12:47 pie_ joined
12:51 Rodya_ joined
12:56 eacameron joined
13:02 netheranthem joined
13:14 earldouglas joined
13:16 Gurkenglas joined
13:21 sujeet joined
13:25 eacameron joined
13:27 Rodya_ joined
13:29 mizu_no_oto_work joined
13:33 chlong joined
13:39 pbrant joined
13:39 mizu_no_oto_work joined
13:55 Levex joined
14:00 Levex joined
14:00 harfangk joined
14:01 carlomagno joined
14:09 t0by joined
14:10 eacameron joined
14:42 Cthalupa joined
14:43 Rodya__ joined
14:49 cschneid_ joined
14:53 zero_byte joined
14:56 uglyfigurine joined
14:58 albertus1 joined
15:05 Cthalupa joined
15:17 guampa joined
15:22 Ayey_ joined
15:31 Levex joined
15:37 conal joined
15:41 thc202 joined
15:42 blissdev joined
15:45 machinedgod joined
15:59 Ayey_ joined
16:10 conal joined
16:11 Vzox01 joined
16:11 tolt joined
16:13 dennisvennink joined
16:20 jathan joined
16:32 NeverDie joined
16:53 NeverDie_ joined
16:53 Rodya_ joined
16:56 pie_ joined
17:08 nil_ joined
17:08 Ayey_ joined
17:16 AndreasK joined
17:17 aarvar joined
17:24 Rodya_ joined
17:30 malaclyps joined
17:35 ysgard joined
17:39 wildlander joined
17:39 expo873 joined
17:39 wildlander joined
17:46 kadoban joined
17:48 Vzox01 joined
17:49 <Vzox01> Am I correct in thinking of Semigroup as a Monoid that can never be empty or is there more to it than that?
17:50 <kadoban> A Semigroup is a Monoid without an "identity" element specified, yeah.
17:51 <geekosaur> a monoid is a semigroup with an identity element. for some monoids, or for some interpretations, "can be empty" is a reasonable interpretation
17:51 <geekosaur> (specifically, when "empty" means "is the identity element")
17:51 conal joined
17:54 <Vzox01> kadoban, geekosaur: Thanks! Is it a mistake to think of Monoid as "anything that can be concatenated"?
17:54 <geekosaur> for some definition of concatenation
17:54 <geekosaur> consider that addition is a monoid with identity 0
17:55 <Vzox01> geekosaur: Right, interesting.
17:55 nil_ joined
17:55 <geekosaur> (it's not in Haskell, but that's because numbers have *two* monoids but you can have only one typeclass instance for Monoid per type. since neither one can be called the main one, both are done with newtypes in Haskell)
17:55 <geekosaur> basically you're reaching for what a monoid is :)
17:56 <geekosaur> it's a generalization of the notion of accumulation. concatenation is one way to accumulate. addition is another
17:56 <monochrom> I would call it a mistake, but perhaps that's too harsh. It is evidently pretty limiting.
17:56 <nil_> In the phrase, "Monads are monoids in the category of endofunctors", is "monad" a hand-wavey informal rendering of Kleisli arrow?
17:57 freechips joined
17:57 <nil_> Or is it actually precise?
17:57 <kadoban> I think if your intuition can encompass the monoids ((++), []), ((+), 0), ((*), 1) you're doing pretty well. Whatever words you want to use might be a bit immaterial.
17:57 <geekosaur> it's precise, but only in the realm of category theory
17:57 <nil_> geekosaur: alright, thanks!
17:58 <geekosaur> er. s/generalization of/formalization of/ earlier. what's generalized is "concatenation" and "addition"
18:00 conal joined
18:13 conal joined
18:13 <Vzox01> geekosaur: Thanks, that was really helpful!
18:17 machinedgod joined
18:20 curious_corn joined
18:21 malaclyps joined
18:22 animated_ joined
18:23 mizu_no_oto_work joined
18:28 guampa joined
18:28 <nil_> Can someone help me with folding over some [Comparison]'s where Comparison a = (a -> a -> Ordering)? http://lpaste.net/353640
18:31 dni- joined
18:31 conal joined
18:34 <geekosaur> looks like a Monoid to me, except there's already a Monoid instance for Ordering that behaves differently (and, tbh, that makes me mistrust your description of Awesome's behavior a bit)
18:36 nacon joined
18:38 Levex joined
18:38 <MarcelineVQ> looks like same behavior, EQ just isn't mentioned by name
18:38 <nil_> That Monoid instance seems equivalent to mine.
18:39 cur8or joined
18:39 <Cale> Note that there is an instance (Monoid m) => Monoid (e -> m) which acts pointwise
18:39 <nil_> Do you think making Comparison an instance of Monoid would do the trick?
18:40 <Cale> So, a -> a -> Ordering is already an instance of Monoid
18:40 <nil_> Cale: oh, right!
18:40 <geekosaur> what Cale just said
18:40 <nil_> Wow, it all looks so simple now.
18:40 <geekosaur> was looking to point you at that but probably easier to just say it :)
18:40 <Cale> So you can just fold
18:40 <Cale> :t fold
18:40 <lambdabot> (Monoid m, Foldable t) => t m -> m
18:41 <nil_> So compareBy = fold ? Friggin' aweSum.
18:41 <geekosaur> and now you see why we put effort into things like Monoid
18:41 dennisvennink joined
18:42 <Cale> Yeah, apart from the fact that there's a newtype, so you'll want to use GeneralizedNewtypeDeriving, and add deriving (Monoid) to the newtype declaration.
18:42 <nil_> Right, thanks!
18:46 peterbecich joined
18:47 averagehat___ joined
18:47 levex_ joined
18:51 ali_bush joined
18:52 mattyw joined
18:53 pie_ joined
18:54 shayan_ joined
19:03 animated_ joined
19:04 Levex joined
19:05 pkoshy joined
19:05 conal joined
19:07 curious_corn joined
19:08 IRCFReAK joined
19:13 Levex joined
19:13 conal joined
19:16 conal joined
19:17 malaclyps joined
19:25 Levex joined
19:25 louispan joined
19:26 louispan joined
19:28 ysgard joined
19:35 albertus1 joined
19:37 peterbecich joined
19:41 peterbecich joined
19:43 peterbecich joined
19:45 danny_ joined
19:45 Levex joined
19:49 peterbecich joined
19:51 Rodya_ joined
19:52 peterbecich joined
19:55 Levex joined
20:00 curious_corn joined
20:02 conal joined
20:05 acarrico joined
20:12 NeverDie joined
20:13 NeverDie_ joined
20:14 thc202 joined
20:14 Prutheus joined
20:19 dni- joined
20:21 owiecc joined
20:22 conal joined
20:27 Levex joined
20:30 Levex joined
20:36 aarvar joined
20:39 curious_corn joined
20:45 IRCFReAK joined
20:45 IRCFReAK left
20:46 acarrico joined
20:48 djfo joined
20:50 IRCFReAK joined
20:52 takle joined
20:59 snowcrshd joined
21:00 Rodya_ joined
21:05 conal_ joined
21:16 jomg joined
21:16 uglyfigurine joined
21:19 texasmynsted joined
21:30 MotherFlojo joined
21:35 pie___ joined
21:49 curious_corn joined
21:52 hiratara joined
21:57 nyuszika7h joined
21:59 <owiecc> I have a recursive function http://lpaste.net/353655 and at high values of the first parameter it becomes naturally slow (e.g. gramPoly 26 20 1). How can I make faster?
22:00 <glguy> owiecc: since the values of m and i don't change and the values of k only decrease, you should try to compute each of the values only once
22:01 <glguy> You can do that with either an array indexed by the 'k' parameter, or with the MemoTrie package, or a list instead of an array, etc.
22:02 Rodya_ joined
22:08 dni- joined
22:09 <owiecc> the k parameter can be negative, isn't that an issue for an array?
22:10 <geekosaur> depends on how you define it. it is a problem for lists
22:11 <owiecc> I guess I can split the problem into [-1, 0] and the rest [1..]
22:12 <glguy> The array package's arrays support whatever index range you give them. MemoTrie doesn't care
22:12 <geekosaur> arrays can use specified ranges for indexes, and the index may be any type that has an Ix instance
22:17 <owiecc> so I can use the array similarly to the Fibonacci numbers array example from https://www.haskell.org/tutorial/arrays.html ?
22:18 <owiecc> Wouldn't it have the same performance problems as my current implementation?
22:18 <glguy> owiecc: Since you only ever look two elements back, you could just iteratively compute the k'th element
22:18 <monochrom> You should try.
22:19 <monochrom> "f (n-1) + f (n-2)" is very different from "let me just read off answers from the array"
22:20 <monochrom> Or more wordily, "let me recompute everything again" is very different from "let me just read the answer I stored last time I computed this".
22:21 <monochrom> Not to say that the latter is always better. There are times you're short on memory.
22:22 <owiecc> I agree this is a problem of computing the same things too many times
22:23 <owiecc> I can implement it in Matlab easily
22:23 <owiecc> in Haskell I have some doubts because of immutability
22:24 <monochrom> If you need to overwrite an array entry several times, yes that will be hard to translate to Haskell, and every translation has its issues.
22:25 <monochrom> But if it's really write-once-read-many, that's exactly the definition of lazy array.
22:25 <monochrom> lazy immutable array.
22:26 conal joined
22:27 <owiecc> OK, I will try to implement it in an array. Thanks for the tips!
22:28 <monochrom> The reason is obvious in retrospect. Don't be distracted by "immutable". Immutable or mutable, there is always "initialization". But "initialization" = "write once".
22:28 <monochrom> "Immutable" just means "can't write the 2nd time".
22:31 hiratara joined
22:32 curious_corn joined
22:42 djfo left
22:42 malaclyps joined
22:45 louispan joined
22:49 conal joined
22:50 <Lazersmoke> Note that immutability isn't as horribly slow as it sounds; It doesn't have to create an entirely fresh copy of a thing in memory if you make a new version of it.
22:50 srhb joined
22:51 vmeson joined
22:52 <Lazersmoke> For example, if you have a list like [1,2,3,6,1,8,43... ten thousand more elements ...] and you make a new list where only the first three numbers are different so it's like [0,0,0,6,1,8,43...], both lists will share everything from the 6 on in memory.
23:06 systemfault joined
23:12 Prutheus joined
23:13 takle joined
23:19 meandi joined
23:26 louispan joined
23:36 pilne joined
23:39 blissdev joined
23:44 malaclyps joined
23:44 Ayey_ joined
23:49 ysgard_ joined
23:55 Ayey_ joined
23:58 dni- joined
23:58 takle joined
23:59 takle joined