<     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:00 bydo joined
00:24 systemfault joined
00:35 m1dnight_ joined
00:37 vaibhavsagar joined
00:52 takle joined
00:54 spion joined
00:58 <__red__> So this haskell book makes a wierd claim - that main is not a function
00:58 <geekosaur> functions take parameters
00:58 <__red__> it has a type signature, I call it like a function
00:58 <geekosaur> main is a CAF
00:58 <__red__> CAF?
00:58 <geekosaur> "constant applicative form"
00:58 <geekosaur> and yes, it's an ugly term but there isn't really a better one
00:58 <__red__> Okay, file that under "learn about that later"
00:59 skeet70 joined
00:59 <__red__> So, no such thing as a zero arity function in haskell then
01:00 <__red__> hmm, now that I think about it a zero arity function would simply be a value if we assume no side-effects
01:00 <geekosaur> not really. if it has no parameyers, it's a constant of some kind
01:00 <geekosaur> but some "constants" represent actions of some variety, thus constant applicative form
01:07 takle joined
01:13 Cale joined
01:19 louispan joined
01:22 takle joined
01:25 takle_ joined
01:26 systemfault joined
01:43 takle joined
01:54 <Squarism> im want to create a "null" log here. Any idea for a emty log type? Some meaningless Monoid i guess?
01:54 aarvar joined
01:57 <geekosaur> > () <> ()
01:57 <lambdabot> ()
01:58 <Squarism> thanks
01:59 louispan joined
02:02 takle joined
02:04 vaibhavsagar joined
02:13 takle joined
02:19 takle joined
02:35 takle joined
02:42 exferenceBot joined
02:43 takle joined
02:46 hexagoxel joined
02:50 howdoi joined
02:51 takle joined
02:58 takle joined
03:06 <saylu> Hey guys! In Cassava, is there a way to parse a named record that _might_ be there? For example, lookup the column "Name", and if it doesn't exist, then keep parsing the spreadsheet but simply return Nothing for that field.
03:16 takle joined
03:20 binaryplease joined
03:32 takle joined
03:32 louispan joined
03:39 takle joined
03:49 takle joined
04:08 takle joined
04:12 moei joined
04:17 takle joined
04:18 <Axman6> saylu: Parser has an Alternative isntance so you can use (m .: "Name" <|> pure Nothing)
04:19 <glguy> :t optional
04:19 <lambdabot> Alternative f => f a -> f (Maybe a)
04:19 <Axman6> possibly needs ((Just <$> m .: "Name") <|> pure Nothing)
04:19 <Axman6> which is probably what optional does (which I never remember)
04:19 hphuoc25 joined
04:19 <geppettodivacin> I didn't realize that optional was such a general combinator. That's neat.
04:19 TerNit joined
04:20 <Axman6> __red__: remember: _all_ functions take one argument. if it takes no argument, it's not a function
04:21 <Axman6> @src optional
04:21 <lambdabot> optional v = Just <$> v <|> pure Nothing
04:21 <TerNit> Hello! Can you help me solve the difficult problem? https://paste.pound-python.org/show/FFf0aAlhCrq5fxi6WINC/
04:22 takle joined
04:29 wei2912 joined
04:34 louispan joined
04:36 takle joined
04:48 takle joined
05:09 takle joined
05:23 takle joined
05:24 keutoi joined
05:29 eminhi joined
05:31 takle joined
05:46 eminhi joined
05:47 <TerNit> How to write callCFC? https://paste.pound-python.org/show/pkGO3N8vQM9cPZjs3UWk/
05:48 <TerNit> update https://paste.pound-python.org/show/TU3ZGjxoRuiGh2CB6Apb/
05:51 takle joined
06:00 haskelleksah joined
06:01 <ski> TerNit : follow the types
06:02 louispan joined
06:03 <TerNit> ski: Thank you! I'll do it now.
06:04 <ski> start by asking yourself what's the type of `undefined' there is
06:04 <ski> and then how you could construct a value of that type
06:05 <ski> there's basically only one way you can implement `callCFC'
06:06 takle joined
06:11 Durz0 joined
06:12 takle joined
06:21 hphuoc25 joined
06:21 <saylu> Axman6: Ah! Of course! Thanks
06:31 bvad joined
06:33 eminhi joined
06:34 louispan joined
06:36 chobytes joined
06:46 takle joined
06:56 takle joined
07:07 TerNit left
07:09 m3tti joined
07:10 takle joined
07:19 seanparsons joined
07:22 hphuoc25 joined
07:27 Pupnik joined
07:27 takle joined
07:31 newhoggy_ joined
07:33 takle joined
07:38 ebw joined
07:39 thc202 joined
07:54 takle joined
08:04 Denthir joined
08:06 seanparsons joined
08:07 bkboggy joined
08:10 <LiaoTao> Wow, flip (:) is really useful!
08:10 <LiaoTao> Haskell is amazing
08:18 <reptar_> it sure is
08:18 takle joined
08:24 takle joined
08:25 takle joined
08:43 <ski> LiaoTao : useful for what, pray tell ?
08:49 <LiaoTao> ski: Concatenating efficiently in the other direction!
08:49 <LiaoTao> Of course
08:49 <LiaoTao> :3
08:50 <LiaoTao> Infinite lists and foldr and stuff
08:50 <LiaoTao> Uh
08:50 <LiaoTao> Anyway!
08:51 <LiaoTao> (I realized it's actually foldl that is used with flip)
08:57 <reptar_> omg, didn't think of that
09:09 <ski> LiaoTao : with a potential `reverse' at the end, itym
09:21 noumenon joined
09:22 grayjoc joined
09:23 hphuoc25 joined
09:25 <LiaoTao> ski: Probably!
09:30 newhoggy joined
09:31 hphuoc25 joined
09:36 newhoggy joined
09:40 Pupnik_ joined
09:42 newhoggy joined
09:48 newhoggy joined
09:50 Denthir joined
10:11 qu1j0t3 joined
10:23 seanparsons joined
10:28 newhoggy joined
10:34 Gurkenglas joined
10:39 netheranthem joined
10:40 newhoggy joined
10:46 mengu joined
10:54 yellowj joined
10:55 seanpars1 joined
10:56 permagreen joined
10:59 m3tti joined
11:07 chlong joined
11:13 crave joined
11:15 romank joined
11:16 romank joined
11:19 romank joined
11:34 newhoggy joined
11:39 binaryplease joined
11:40 newhoggy joined
11:45 newhoggy joined
11:46 romank joined
11:47 kritzcreek joined
11:51 acarrico joined
11:53 newhoggy joined
11:59 romank joined
12:08 pungi-man joined
12:14 romank joined
12:19 nadirs joined
12:25 eacameron joined
12:25 zero_byte joined
12:33 newhoggy joined
12:40 pbrant joined
12:41 binaryplease1 joined
12:41 newhoggy joined
12:51 mekeor joined
12:53 <mekeor> i want to use xmonad and develop in haskell on debian (testing). should i install ghc, haskell-platform or haskell-stack? should i install it with apt or by downloading an installer from the website?
12:53 takle joined
12:56 <nitrix> I'd recommend stack.
12:56 <nitrix> And then let stack manage your versions of GHC for you on a per-project basis.
12:57 <mekeor> nitrix: sounds good. how would i install xmonad then? using stack?
12:58 <mekeor> also, should i install stack using apt or by using stack's installer-script?... i guess, that doesn't matter much
12:59 <mekeor> (because i could just run `stack upgrade` as described at https://docs.haskellstack.org/en/stable/install_and_upgrade/#debian )
13:00 newhoggy joined
13:00 colt44 joined
13:06 takle joined
13:06 iAmerikan joined
13:10 <nitrix> Try `stack install xmonad`, it should put the binary in ~/.local/bin or something. If that's in your path, you'll be able to run xmonad just as good from there.
13:11 takle joined
13:14 jedb joined
13:14 <nitrix> I think most people would just install xmonad using their package manager though.
13:20 <srhb> I doubt that. You still need to be able to build your xmonad.hs. Or does the packaged versions also deal with ghc etc?
13:22 <nitrix> https://github.com/commercialhaskell/stack/issues/710#issuecomment-289150630
13:23 <srhb> afaik the simplest way once you have a ghc build chain is simply cabal install xmonad
13:23 <srhb> That should be all that's required.
13:23 <srhb> Haskell build chain, not ghc. :-)
13:24 Glooomy joined
13:24 <nitrix> Then anything that breaks in the haskell ecosystem breaks your window manager.
13:25 <srhb> That's... Hyperbole.
13:25 <srhb> But sure, sandboxing is nice, if you want to take the effort.
13:25 <srhb> I use Nix for my Xmonad myself. :)
13:25 takle joined
13:33 newhoggy joined
13:33 mizu_no_oto_work joined
13:37 yellowj joined
13:43 newhoggy joined
13:45 romank joined
13:50 Pupnik joined
13:51 thallada joined
13:52 yellowj joined
13:55 newhoggy joined
14:05 newhoggy joined
14:14 newhoggy joined
14:23 newhoggy joined
14:30 iAmerikan joined
14:34 newhoggy joined
14:37 romank joined
14:37 yellowj joined
14:42 michbad joined
14:43 newhoggy joined
14:44 nobodyzxc joined
14:51 asdfjkljkl joined
14:55 newhoggy joined
14:59 Lokathor joined
15:02 pixelfog_ joined
15:02 uglyfigurine joined
15:03 Denthir joined
15:04 newhoggy joined
15:13 newhoggy joined
15:16 mounty joined
15:21 newhoggy joined
15:21 eacameron joined
15:27 prophile joined
15:28 <alem0lars> how do I convert Int to GHC Word32 ?
15:30 <geekosaur> notice that both are instances of Integral, and that there exists
15:30 seanpars1 joined
15:30 <geekosaur> :t fromIntegral
15:30 <lambdabot> (Num b, Integral a) => a -> b
15:31 <geekosaur> or, note that both are instances of Enum and use toEnum and fromEnum
15:32 <alem0lars> geekosaur: thanks!
15:37 newhoggy joined
15:37 freechips joined
15:45 newhoggy joined
15:46 wildlander joined
15:49 bvad joined
15:53 newhoggy joined
16:01 newhoggy joined
16:06 argent0 joined
16:07 eacameron joined
16:08 newhoggy joined
16:10 bvad joined
16:13 meandi_2 joined
16:13 Gloomy joined
16:16 newhoggy joined
16:24 newhoggy joined
16:32 trolling joined
16:35 hrnz joined
16:36 hrnz joined
16:36 tmciver_ joined
16:37 pilne joined
16:37 vito_swiss joined
16:39 _cyril__ joined
16:39 aminb_ joined
16:40 newhoggy joined
16:40 eacameron joined
16:41 hrnz joined
16:42 mimi_vx joined
16:43 nicknovi1 joined
16:43 qu1j0t3 joined
16:43 Nycatelos joined
16:43 Denthir joined
16:43 mbrcknl joined
16:43 lambdabot joined
16:43 nullcone joined
16:45 blissdev joined
16:47 Purlox joined
16:49 chlong joined
16:51 mthek joined
16:51 spicydonuts joined
16:51 runeks joined
16:52 bytesighs joined
16:52 reptar_ joined
16:58 newhoggy joined
16:59 zero_byte joined
17:11 mstruebing joined
17:13 newhoggy joined
17:14 MotherFlojo joined
17:16 skeet70 joined
17:19 newhoggy joined
17:19 NeverDie joined
17:20 zero_byte joined
17:25 newhoggy joined
17:26 pungi-man joined
17:31 newhoggy joined
17:33 eacameron joined
17:33 shayan_ joined
17:40 malaclyps joined
17:41 <reptar_> why does this happen? http://lpaste.net/6923005067993808896
17:42 <Gurkenglas> reptar_, looks right to me. What did you want to happen?
17:43 <reptar_> i wanted the first to return "2 4 7 5 "
17:44 <reptar_> and i don't understand why it doesn't
17:45 systemfault joined
17:45 <glguy> reptar_: Probably because you used traverseTree when defining traverseTree'
17:46 <glguy> that you didn't include that definition in the paste suggests that you didn't think it was relevant?
17:47 <reptar_> yeah...
17:47 newhoggy joined
17:47 <reptar_> that's it :) *facepalm*
17:48 <reptar_> glguy: thank you!
17:48 <Gurkenglas> Whoops, that shouldn't have looked right to me.
17:49 carlomagno joined
17:50 acarrico joined
17:52 ebw joined
17:58 newhoggy joined
17:58 bvad joined
18:05 newhoggy joined
18:09 Big_G joined
18:09 c0dehero joined
18:17 iskander joined
18:18 iskander left
18:18 newhoggy joined
18:19 mac10688 joined
18:21 argent0 joined
18:23 jship joined
18:27 newhoggy joined
18:29 muumuu joined
18:31 Glooomy joined
18:34 zaphyr joined
18:34 conal joined
18:38 newhoggy joined
18:39 nomotif joined
18:44 newhoggy joined
18:47 texasmynsted joined
18:47 romank joined
18:47 iAmerikan joined
18:50 newhoggy joined
18:56 newhoggy joined
18:57 ebw joined
18:59 iAmerikan joined
19:00 malaclyps joined
19:04 conal joined
19:04 newhoggy joined
19:09 mengu joined
19:09 newhoggy joined
19:12 romank joined
19:13 binaryplease joined
19:17 newhoggy joined
19:18 iAmerikan joined
19:23 carlomagno joined
19:23 newhoggy joined
19:28 acarrico joined
19:29 newhoggy joined
19:31 sigmundv_ joined
19:38 newhoggy joined
19:44 newhoggy joined
19:48 <lpaste> ebw pasted “Significant difference?” at http://lpaste.net/355114
19:49 iAmerikan joined
19:49 <ebw> Is there any reason to recommend myAny or myAny2 over the other? (Ignoring any from the standard library)
19:50 newhoggy joined
19:51 <nitrix> ebw: That's a curious function. I think I'd write it myAny3 = foldr (||) False . map
19:53 <MarcelineVQ> nitrix: you may mean myAny3 = (foldr (||) False .) . map which is possibly arcane
19:53 <nitrix> That is, you're mapping a transformation (Functor) before folding with `foldr (||) False` (Foldable) which as you've found out, is called `any` in base.
19:53 <nitrix> Mhhh...
19:53 <nitrix> foldr (||) False .: map
19:54 <nitrix> @let (.:) = (.) . (.)
19:54 <lambdabot> Defined.
19:54 <nitrix> :t foldr (||) False .: map
19:54 <lambdabot> (a -> Bool) -> [a] -> Bool
19:54 <nitrix> Wooo!
19:54 <nitrix> MarcelineVQ: You're right x]
19:54 <MarcelineVQ> ebw: I'd prefer myAny2 because it's all in one nicely readable place
19:55 <nitrix> I agree on myAny2; no extra function that does juggling. We're fairly able to read foldr with simple sections like these.
19:55 <ski> @type (`foldr` False) . ((||) .)
19:55 <lambdabot> Foldable t => (a -> Bool) -> t a -> Bool
19:55 <MarcelineVQ> alternatively and . map f
19:55 <ski> itym s/and/or/
19:56 <MarcelineVQ> or any as you've mentioned
19:56 <MarcelineVQ> ah yeah or :>
19:56 newhoggy joined
19:57 <nitrix> @src any
19:57 <lambdabot> any p = or . map p
19:57 <nitrix> @src or
19:57 <lambdabot> or = foldr (||) False
19:58 <ski> @type [\c n f -> foldr c n . map f,\c n f -> foldr (c . f) n]
19:58 <lambdabot> [(a1 -> b -> b) -> b -> (a -> a1) -> [a] -> b]
19:58 <nitrix> ebw: You're as close as it gets :P
19:58 <* ski> thinks it probably follows from parametricity
20:00 <ski> yes, it does :)
20:00 <ski> @free foldr :: (a -> b -> b) -> b -> [a] -> b
20:00 <lambdabot> (forall x. g . h x = k (f x) . g) => g . foldr h y = foldr k (g y) . $map f
20:01 <ski> pick `g' as `id'. this then simplifies to
20:01 <* nitrix> bangs his palms in rapid successions euphorically.
20:01 <ski> (forall x. h x = k (f x)) => foldr h y = foldr k y . $map f
20:01 <ski> iow
20:02 <ski> h = k . f => foldr h y = foldr k y . $map f
20:02 <ski> which is the same as
20:02 <ski> foldr (k . f) y = foldr k y . $map f
20:02 <nitrix> Nice proof c:
20:02 <ski> just rename `k' to `c', and `y' to `n', adjusting `$map' to `map', and you get
20:03 carlomagno joined
20:03 <ski> foldr (c . f) n = foldr c n . map f
20:03 <ebw> I am lost. Lol. I think I will spend the next two hours trying to understand (foldr (||) False . ) . map
20:04 <nitrix> ebw: It's probably best to not eta-reduce it further. I liked it more with the parameter myAny2 had.
20:04 <ski> ebw : well .. it might help to understand that `\x -> f . g x' is equal to `(f .) . g'
20:05 newhoggy joined
20:05 <ebw> ski : Thanks for the pointer.
20:05 <ski> `f . g x' is `(f .) (g x)' is `((f .) . g) x' (composition of `(f .)' and `g', applied to `x')
20:05 <ebw> nitrix : Whit is eta-reduce?
20:05 Tomatosoup- joined
20:05 <nitrix> ebw: myAny2 f = foldr (||) False (map f) -- reads nicely to me
20:05 <ski> so `\x -> f . g x' is `\x -> ((f .) . g) x', which my eta is `(f .) . g'
20:05 <nitrix> Type error my bad
20:06 <nitrix> myAny2 f = foldr (||) False . map f
20:06 <ski> ebw : anyway, `myAny2' is more readibly intelligible than `myAny3' above
20:06 <nitrix> ebw: eta-reduction here would be eliminating `f` from both sides of the equation.
20:07 <ski> ebw : still, i think it may help to realize that `composeLeft = (.)' .. so that `myAny f = foldr ((||) . f) False', which i also find reasonably readable
20:07 <nitrix> ^ this
20:07 <ski> @type \f -> foldr (||) False . map f
20:07 <lambdabot> (a -> Bool) -> [a] -> Bool
20:07 <nitrix> I think he discovered this on his own; just named it composeLeft instead of (.) :P
20:08 <ski> maybe, maybe not. it's not clear, looking at the type signature of it
20:20 malaclyps joined
20:20 dni- joined
20:26 <Tomatosoup-> hi
20:29 crave joined
20:29 iAmerikan joined
20:32 ebw joined
20:33 MotherFlojo joined
20:35 iAmerikan joined
20:36 geekosaur joined
20:42 carlomagno joined
20:43 shayan_ joined
21:07 patbecich joined
21:07 <ebw> That is absolutely mind blowing ...
21:08 <ebw> It is a function as value thing I didn't thought about. So type variable a can of course be a function type ...
21:15 geekosaur joined
21:16 romank joined
21:17 seanparsons joined
21:19 newhoggy joined
21:19 m0d joined
21:29 newhoggy joined
21:35 Uniaika joined
21:36 Heasummn joined
21:37 ysgard joined
21:42 seagreen joined
21:44 gihoveg joined
21:51 iAmerikan joined
21:52 gihoveg left
21:53 hiratara joined
21:54 exferenceBot joined
21:55 carlomagno joined
21:56 malaclyps joined
21:59 Bare joined
22:03 ysgard_ joined
22:04 seanparsons joined
22:04 seanparsons joined
22:15 begriffs joined
22:22 LiaoTao_ joined
22:28 ysgard joined
22:30 madjestic joined
22:30 m0d joined
22:31 hiratara joined
22:36 conal joined
22:38 aarvar joined
22:53 zero_byte joined
22:54 jmiven joined
22:58 ysgard_ joined
23:00 newhoggy joined
23:15 newhoggy joined
23:17 takle joined
23:47 Big_G joined
23:53 takle joined