<  February 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 _2_4 25  
26 27 28
00:04 malaclyps joined
00:05 takle joined
00:07 NoCreativity joined
00:08 NoCreativity joined
00:09 harfangk joined
00:20 cschneid_ joined
00:20 ederign joined
00:27 <qmm> tips on how to get this to work? drop 2 $ getDirectoryContents "/tmp"
00:27 <qmm> > :t drop
00:27 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
00:27 <qmm> :t drop
00:27 <lambdabot> Int -> [a] -> [a]
00:27 <qmm> :t getDirectoryContents
00:27 <lambdabot> error:
00:27 <lambdabot> Variable not in scope: getDirectoryContents
00:27 <qmm> getDirectoryContents :: FilePath -> IO [FilePath]
00:27 <qmm> a -> m a
00:28 <qmm> they are both that, right?
00:28 <geekosaur> but different m-s
00:29 <geekosaur> however, you can do it, and quite easily
00:29 <geekosaur> :t fmap
00:29 <lambdabot> Functor f => (a -> b) -> f a -> f b
00:29 <qmm> geekosaur: figured it out :)
00:29 ederign joined
00:30 <qmm> i did it on my own, but i'm glad you answered anyway
00:30 <* qmm> is a big boy
00:30 <qmm> big boys don't ask simple questions like this, probably
00:31 <geekosaur> they do when they need to. there is also such a thing as rubber duck debugging :)
00:31 <* geekosaur> would note that an under-recognized notion of "big" is "big enough to admit when they need a little help"
00:31 <qmm> i need the rubber duck to respond to me
00:33 <qmm> maybe there's a rubber duck arduino projet which makes a duck nod and say things like "maybe", "what does the source code tell us?", etc.
00:33 takle joined
00:34 <benzrf> hehehehe
00:36 Rizy joined
00:44 cschneid_ joined
00:47 sigmundv_ joined
00:49 jamie_ joined
00:49 justinfokes joined
00:51 eacameron joined
00:54 takle joined
00:55 <geekosaur> arduliza
00:55 faberbrain joined
00:55 <monochrom> ?
00:55 ederign joined
00:56 <geekosaur> just being a smartaleck :) arduino eliza
00:57 eacameron joined
01:10 vicfred joined
01:11 nacon joined
01:11 nacon joined
01:12 takle joined
01:17 unpack joined
01:18 Foras joined
01:18 eacameron joined
01:22 Foras joined
01:30 takle joined
01:35 Jannoo joined
01:35 <Jannoo> good evening folks
01:37 temp joined
01:40 conal joined
01:42 jmg8766 joined
01:42 <qu1j0t3> Jannoo: o/
01:45 Youmu joined
01:58 Rizy joined
02:00 myk267 joined
02:04 takle joined
02:08 nacon joined
02:21 jmg8766 joined
02:27 nacon joined
02:30 takle joined
02:32 Jannoo joined
02:32 nacon joined
02:32 nacon joined
02:36 systemfault joined
02:42 nacon joined
02:45 jamie_ joined
02:51 takle joined
02:55 Big_G joined
02:57 takle joined
03:05 staffehn joined
03:09 Rodya_ joined
03:18 Rodya_ joined
03:19 hphuoc25 joined
03:20 exferenceBot joined
03:21 hexagoxel joined
03:21 takle joined
03:24 lspitzner joined
03:30 deepbook5broo joined
03:30 deepbook5broo left
03:33 Rizy joined
03:36 AndiK joined
03:48 polsab joined
03:51 vicfred joined
03:53 surtn joined
03:54 vicfred joined
04:00 vicfred joined
04:04 vicfred joined
04:05 takle joined
04:13 takle joined
04:13 Rizy joined
04:14 cschneid_ joined
04:19 Rodya_ joined
04:21 takle joined
04:22 patbecich joined
04:23 earldouglas joined
04:24 vicfred joined
04:26 howdoi joined
04:32 nomotif joined
04:42 systemfault joined
04:46 hexagoxel joined
04:53 i-amd3 joined
04:54 takle joined
04:55 faberbrain joined
04:55 hphuoc25_ joined
04:56 lubricy_ joined
04:57 jamie_ joined
04:59 jamie___ joined
05:00 hphuoc25 joined
05:01 hphuoc25 joined
05:01 jamie____ joined
05:04 jamie_ joined
05:05 Squarism joined
05:06 jamie___ joined
05:09 joshuagross joined
05:09 eacameron joined
05:11 Deide joined
05:24 Errdonald joined
05:34 takle joined
05:35 justicefries joined
05:36 <zipper> Did anyone else have a problem understanding what the execise section of Reader expected in the haskell book?
05:36 <zipper> Like what does it want zipped? I don't really get the question, gonna skip that for now.
05:36 <zipper> From around page 890
05:37 <zipper> bitemyapp: ^ ?
05:58 <MarcelineVQ> that question is a little vague since there's multiple different exercises there if you mean the end of chapter 22. was there something specific you needed clarification about?
05:59 <MarcelineVQ> lemme have a look, I see you mentioned zipping
05:59 Rizy joined
06:02 hphuoc25 joined
06:03 <MarcelineVQ> have a look at zs for an example of what they mean for xz = undefined and ys = undefined it may seem to odd write those but you use them right after
06:04 <MarcelineVQ> *mean for xs
06:04 <MarcelineVQ> assuming we have similar book versions anyway :>
06:06 malaclyps joined
06:07 faberbrain joined
06:07 kritzcreek joined
06:07 AndiK joined
06:21 Rodya_ joined
06:32 malaclyps joined
06:34 cschneid_ joined
06:35 justicefries joined
06:42 abhiroop joined
06:45 mengu joined
06:54 Pupnik joined
07:00 louispan joined
07:02 pbrant joined
07:10 jamie_ joined
07:10 nomotif joined
07:11 takle joined
07:17 unlaudable joined
07:23 Rodya_ joined
07:29 takle joined
07:30 joshuagross joined
07:39 hphuoc25 joined
07:41 hphuoc25_ joined
07:42 justicefries joined
07:50 takle joined
08:11 takle joined
08:12 mattyw joined
08:16 thc202 joined
08:18 <ubsan> how do I create variables inside ghci
08:18 <ubsan> specifically, how do I define a function?
08:20 <ubsan> hmm
08:20 <ubsan> okay, so I've figured that out
08:21 <ubsan> how do I give a variable a type?
08:21 <ubsan> specifically a function
08:23 <ubsan> okay, so I've just used a file
08:23 <ubsan> what's up with both >>= and >> existing?
08:24 <ubsan> you can trivially implement each in terms of the other
08:27 louispan joined
08:29 <PiDelport> ubsan: I don't think you can define >>= in terms of >>
08:30 <PiDelport> They're there because they do different things.
08:30 <ubsan> PiDelport: wee
08:30 <ubsan> *well
08:30 <ubsan> you can at least trivially implement >> in terms of >>=
08:30 <PiDelport> ubsan: But yeah, in ghci, it's like working in a do block.
08:30 <PiDelport> You can say let x = ... ; x :: SomeType
08:31 <ubsan> (>>) m1 m2 = m1 >>= (\_ -> m2)
08:31 <PiDelport> Right.
08:31 <ubsan> PiDelport: ah, okay
08:31 <ubsan> so why does >> exist, I guess is my question
08:31 <ubsan> or
08:31 <ubsan> why isn't it a free function taking a Monad m
08:31 <PiDelport> But they're different in strength; for >>, you actually don't need Monad at all; you just need Applicative, which calls the same operation *>
08:31 <PiDelport> >>= introduces the need for join, and requires Monad.
08:31 <ubsan> I guess
08:31 <ubsan> but it's on monad :P
08:32 <PiDelport> Yeah, but that's for historical reasons.
08:32 <PiDelport> Same as why both pure and return exist.
08:32 Miroboru joined
08:32 <ubsan> okay
08:32 <PiDelport> Nowadays, you can ignore return and >> and just use pure and *> instead. :)
08:32 <ubsan> thanks :)
08:32 <ubsan> cool
08:32 <ubsan> will do
08:32 <ubsan> well
08:32 <ubsan> I'll at least use pure
08:32 <ubsan> it looks more like idris :3
08:33 <PiDelport> Oh, by the way, the reason >> is part of the Monad class is just so some instances can provide more efficient implementations than the default.
08:33 <PiDelport> (But in theory the adoption of Applicative should eventually make that need go away.
08:33 <PiDelport> )
08:34 <ubsan> PiDelport: oh, interesting
08:35 Durz0 joined
08:37 AndreasK joined
08:58 fbergmann joined
08:59 justicefries joined
09:09 gregman_ joined
09:12 ali_bush joined
09:12 ali_bush joined
09:15 lithie joined
09:20 grdryn joined
09:22 takle joined
09:24 t0by joined
09:27 jamie_ joined
09:28 moei joined
09:28 bruschkov joined
09:29 jamie___ joined
09:30 bruschkov joined
09:31 geekosaur joined
09:36 merijn joined
09:38 nacon joined
09:38 nacon joined
09:42 Miroboru joined
09:44 Gloomy joined
09:49 netheranthem joined
09:53 slomo joined
09:53 slomo joined
09:56 slomo joined
09:56 slomo joined
10:06 gmg85 joined
10:13 mengu joined
10:13 jmg8766 joined
10:16 Rizy joined
10:17 patbecich joined
10:22 Atrumx joined
10:25 Rodya_ joined
10:26 justicefries joined
10:35 geekosaur joined
10:36 skapazzo joined
10:37 faberbrain joined
10:44 ederign joined
10:44 Rizy joined
10:44 mattyw joined
10:46 galderz joined
10:49 hphuoc25 joined
11:00 gmg85 joined
11:01 Gurkenglas joined
11:02 galderz joined
11:07 mengu joined
11:13 geekosaur joined
11:18 patbecich joined
11:19 cur8or joined
11:26 Rodya_ joined
11:34 mattyw joined
11:35 mounty joined
11:42 madjestic joined
11:43 jamie_ joined
11:54 stianhj joined
12:04 vaibhavsagar joined
12:06 geekosaur joined
12:12 TCZ joined
12:16 dni- joined
12:16 eacameron joined
12:21 cschneid_ joined
12:27 Rodya_ joined
12:28 Zialus joined
12:37 eacameron joined
12:39 faberbrain joined
12:51 jomg joined
12:53 hphuoc25 joined
12:54 Sose joined
12:58 aphorisme joined
13:11 netheranthem joined
13:15 viscera joined
13:16 <viscera> So when one verbally says "it's an integer" and it isn't clear from the context whether it's Int or Integer... is there spoken idiom to distinguish?
13:17 <viscera> i.e. an Int is still an "integer" mathematically speaking
13:17 <viscera> This may be a dumb question
13:19 patbecich joined
13:19 <PiDelport> viscera: Probably depends on context how much the distinction matters or not?
13:21 <viscera> PiDelport: this isn't related to a real-world problem
13:21 <viscera> just a thought
13:22 gmg85 joined
13:22 <viscera> working through CIS194
13:22 <viscera> the other question: why does / only work for Double?
13:22 <viscera> seems inconsistent
13:23 <PiDelport> viscera: Well, it works for any Fractional instance.
13:23 <PiDelport> So that's Float, Double, and Rational, in the standard library.
13:23 <PiDelport> And a bunch more user types.
13:23 <viscera> okay but why wouldn't the language designers support integer with it
13:23 <viscera> also support*
13:23 <PiDelport> You can't do fractional division with integers.
13:24 <viscera> but you can do regular division...
13:24 <PiDelport> You can do integral / rounding division with integers, though; that's what `div` is for.
13:24 <viscera> hmm
13:24 <PiDelport> That works for any Integral type.
13:24 <viscera> i get it... i just don't get why the operator isn't overloaded
13:24 <PiDelport> It is overloaded, but Haskell makes a distinction between the two kinds of division.
13:24 <PiDelport> They're mathematically distinct in meaning.
13:25 <viscera> i see
13:25 <viscera> fair enough
13:25 <PiDelport> Not all languages make that distinction, but e.g. Python is another one that does.
13:25 <viscera> hmm, i didn't realise thta
13:25 <viscera> that*
13:25 <viscera> thank you
13:25 <PiDelport> (In Python, / is fractional division and // is integral or floor division.)
13:27 mjs2600 joined
13:28 Rodya_ joined
13:28 <viscera> oh, it was in the next paragraph...
13:28 <viscera> oops :)
13:32 deank joined
13:37 eacameron joined
13:53 jamie_ joined
14:01 Gloomy joined
14:08 ski joined
14:09 myk267 joined
14:10 galderz joined
14:11 hphuoc25 joined
14:15 chlong joined
14:20 Rodya_ joined
14:21 mjs2600 joined
14:22 mizu_no_oto_work joined
14:26 contiver joined
14:28 AndreasK joined
14:35 bruschkov joined
14:36 bruschkov joined
14:37 bruschkov joined
14:37 lspitzner joined
14:38 pie___ joined
14:38 eacameron joined
14:39 bruschkov joined
14:41 faberbrain joined
14:41 bruschkov joined
14:46 mthek joined
14:46 <mthek> Could somebody help me understand if in the AST Parser of Haskell (http://hackage.haskell.org/package/haskell-src-exts-1.19.1/docs/Language-Haskell-Exts-Parser.html#t:ParseResult) there is a format to output the AST as an actual Tree type. I can't seem to get it working.
14:47 eacameron joined
14:52 <zipper> MarcelineVQ: Hey, how long will you be online?
14:52 <zipper> I want to ask you about the execise at the end of the Reader Monad when I get home
14:52 <zipper> In like 1 hour idk
14:53 bruschkov joined
14:58 bruschkov joined
14:59 galderz joined
14:59 kadoban joined
15:05 merijn joined
15:06 Apocalisp joined
15:07 bruschkov joined
15:10 bruschkov joined
15:10 carlomagno joined
15:13 asundark joined
15:17 bruschkov joined
15:18 <nitrix> mthek: The same module offers pretty printing: http://hackage.haskell.org/package/haskell-src-exts-1.19.1/docs/Language-Haskell-Exts-Pretty.html
15:19 <nitrix> mthek: If you're using parseModule for example, you'll end up with something of type: ParseResult (Module SrcSpanInfo)
15:19 <nitrix> mthek: `Module a` actually has an instance of `Pretty`.
15:20 <mthek> nitrix: I am trying to make it as lossless as possible and to be able to continue parsing skipping over errors (I will store the error messages somewhere else)
15:21 patbecich joined
15:21 myrkraverk_ joined
15:21 <nitrix> mthek: So you can just pattern match on the ParseResult being successful and pretty print whatever you get. Unfortunately, I do not think you'll get a tree structure.
15:21 <mthek> nitrix: Goal: output an AST for a Haskell file in message pack format, with as little possible information lost
15:21 <mthek> nitrix: so I have to manually parse it into a Tree type?
15:22 <nitrix> It think it pretty prints as an Haskell source file, there's a few couple different modes and stuff
15:23 <nitrix> PPInLine, PPSemiColon, PPNoLayout... PageMode, ZigZagMode, LeftMode, ... ehm...
15:25 <mthek> nitrix: okay, I'll play with it a bit, it's a tough first project in Haskell compared to other languages
15:25 <nitrix> mthek: People have done similar work: https://github.com/Pnom/haskell-ast-pretty
15:27 <mthek> nitrix: wow, that's extensive. I feel like I am missing something though, just wanting to output a simple json, it should be easy in a language such as Haskell
15:27 <nitrix> Even that one isn't really a tree it seems.
15:28 <nitrix> I don't know x]
15:30 hphuoc25 joined
15:36 aphorisme joined
15:38 Apocalisp joined
15:39 bitemyapp joined
15:41 mjs2600 joined
15:41 bruschkov joined
15:42 shayan_ joined
15:44 bruschkov joined
15:44 bruschkov joined
15:45 bruschkov joined
15:50 bruschkov joined
15:51 bruschkov joined
15:52 bruschkov joined
15:57 Apocalisp joined
15:58 chrissl joined
15:59 Rodya_ joined
16:02 eacameron joined
16:07 abhiroop joined
16:07 mjs2600 joined
16:10 cschneid_ joined
16:20 lithie joined
16:27 eacameron joined
16:31 sigmundv_ joined
16:32 sigmundv_ joined
16:38 jathan joined
16:42 faberbrain joined
17:03 Rodya_ joined
17:06 mattyw joined
17:07 mengu joined
17:22 patbecich joined
17:23 delexi joined
17:29 jamie_ joined
17:29 contiver joined
17:43 peterbecich joined
17:44 faberbrain joined
17:46 mizu_no_oto_work joined
17:46 mjs2600 joined
17:46 peterbecich joined
17:47 flojo joined
17:48 Gurkenglas joined
17:53 wildlander joined
17:54 wildlander joined
17:57 louispan joined
17:58 wildlander joined
18:00 wildlander joined
18:00 madjestic joined
18:03 pilne joined
18:06 faberbrain joined
18:06 patbecich joined
18:16 Rodya_ joined
18:17 mjs2600 joined
18:28 conal joined
18:31 joshuagross joined
18:31 hphuoc25 joined
18:35 takle joined
18:49 takle joined
18:58 grayjoc joined
18:59 mattyw joined
19:01 nacon joined
19:01 nacon joined
19:03 mojjo joined
19:05 takle joined
19:05 sandonfuge joined
19:09 mizu_no_oto_work joined
19:15 grayjoc joined
19:23 jamie_ joined
19:24 albertus1 joined
19:30 malaclyps joined
19:31 unlaudable joined
19:33 takle joined
19:36 nomotif joined
19:37 justicefries joined
19:38 takle joined
19:38 ederign joined
19:38 conal joined
19:39 Apocalisp joined
19:47 peterbecich joined
19:55 takle joined
20:08 ubsan joined
20:08 mengu joined
20:14 takle joined
20:18 <AlainODea> mthek: aeson's ToJson instances are very nice. https://github.com/AlainODea-haskell/tenable-securitycenter/blob/master/src/Network/Tenable/SecurityCenter/Token.hs#L44-L47
20:18 mheinzel joined
20:19 <AlainODea> You can create a value if the data type with a ToJSON instance and use encodeJson on it
20:21 takle joined
20:23 aarvar joined
20:23 grayjoc joined
20:34 mthek joined
20:39 <MarcelineVQ> zipper: You can leave me messages here if you like when I'm not around, the channel is slow enough for that, the side-benefit of that is that if someone else knows an answer they'll tell you :>
20:39 <zipper> MarcelineVQ: Hello
20:41 <MarcelineVQ> hey :>
20:44 <zipper> So we say "-- zip x and y using 3 as the lookup key " So we want xs to return a tuple of type (Int, [Int])?
20:45 <MarcelineVQ> no the type is given above it
20:47 <MarcelineVQ> that may be worded confusingly, I​ mean the type is provided: -- zip x and y using 3 as the lookup key xs :: Maybe Integer xs = undefined
20:50 <zipper> hmmm I see the words I just don't get it lol I feel dumb rn. Can you zip with a lookup key?
20:51 <zipper> You zip with a function
20:51 <zipper> Say x and y are two lists
20:51 <zipper> You zip them with +
20:51 <zipper> or anything else but if it's a lookup they need a unique key
20:51 <monochrom> Actually what is "zip with a lookup key"?
20:52 <zipper> monochrom: Yeah what is that?
20:52 <monochrom> You may need to show 10 examples.
20:52 <MarcelineVQ> it's pretty oddly worded, plainly it wants you to zip x and y because lookup takes a zipped list
20:52 <monochrom> OK that's entirely different. zip, then lookup?
20:53 <MarcelineVQ> Yep
20:53 <contiver> is there some way to promote a package candidate?
20:53 <monochrom> lookup 5 (zip [3,1,4,5] ['a', 'b', 'c', 'd'])?
20:53 <zipper> Ok so xs is (== 3) ?
20:53 <monochrom> who is xs?
20:53 <zipper> Oh that's what they mean
20:54 <zipper> xs is (zip [3,1,4,5] ['a', 'b', 'c', 'd'])
20:54 peterbecich joined
20:54 <zipper> but I don't see that giving us Maybe Int s
20:54 <monochrom> That's because I deliberately chose Char.
20:54 <zipper> :t zip
20:54 <lambdabot> [a] -> [b] -> [(a, b)]
20:54 <monochrom> No reason why the world is only numbers.
20:55 <zipper> > zip [1 2 3] [4 5 6]
20:55 <lambdabot> error:
20:55 <lambdabot> • Could not deduce (Num t0)
20:55 <lambdabot> from the context: (Num (t5 -> t6 -> b),
20:55 <monochrom> you need commas
20:55 <zipper> Oh lol too much clojure
20:55 <zipper> > zip [1, 2, 3] [4, 5, 6]
20:55 <MarcelineVQ> zipper: "The next thing we want to do is write some functions that zip those lists together and uses lookup to find the value associated with a specified key in our zipped lists."
20:55 <lambdabot> [(1,4),(2,5),(3,6)]
20:56 <monochrom> That sentence is perfectly clear. Who butchered it to "zip with lookup keys"?!
20:56 <MarcelineVQ> the helpful comments above the individual defintions unfortunately :>
20:56 <zipper> MarcelineVQ: `zipWith (\x -> if x == 3 then Just x else Nothing) x y` ?
20:57 <contiver> :t zipWith
20:57 <lambdabot> (a -> b -> c) -> [a] -> [b] -> [c]
20:57 <zipper> My lambda was bad but you get the logic, no?
20:58 <zipper> > zipWith (\x y -> if x == 3 then Just x else Nothing) [1,2,3] [4,5,6]
20:58 <lambdabot> [Nothing,Nothing,Just 3]
20:59 <zipper> naaah nvm me
20:59 <zipper> I'm totally not following the type sig
20:59 <MarcelineVQ> haha well you've got the right inclination but it's trying to get you to compose existing functions to do that, specifically zip and lookup which it names
20:59 takle joined
20:59 <MarcelineVQ> > lookup 2 [(1,'a'),(2,'b'),(3,'c')] -- this is the job of lookup, find a value from a key in a list of tuples
20:59 <lambdabot> Just 'b'
21:00 <zipper> MarcelineVQ: So the xs is the lamdba, right?
21:00 <zipper> In this case
21:00 <monochrom> zipWith leads you to an XY problem.
21:01 <MarcelineVQ> it's a value that has the type of xs :: Maybe Integer
21:01 <zipper> Ok xs =(\x y -> if x == 3 then Just x else Nothing) and ys = (\x y -> if x == 6 then Just x else Nothing)
21:01 <zipper> Oh
21:01 <zipper> Just 3
21:02 <MarcelineVQ> Just 3 in this case yes
21:04 <MarcelineVQ> though just so we're clear, the answer isn't to write xs = Just 3 it wants you to use zip and lookup, which are two seperate specific functions, in your answer.
21:06 <contiver> I came in the middle of the conversation, but the idea is writing a function to zip two lists, and do a lookup, am I right?
21:06 <monochrom> Yes.
21:06 <zipper> it wants me to zip the two lists ok and then lookup 3
21:06 <zipper> Oh I get it
21:06 <MarcelineVQ> zipper: you got it
21:06 <zipper> So what monochrom wrote
21:07 <zipper> lookup 3 $ zip x y
21:07 <zipper> Just 6
21:07 <MarcelineVQ> yes, and the paragraph above the problems :>
21:07 albertus11 joined
21:08 <MarcelineVQ> that's correct, Just 6, I was wrong to say the result was Just 3
21:08 <zipper> It's cool
21:08 <zipper> I feel like I should sleep rn but right after this exercise
21:10 Apocalisp joined
21:11 <zipper> I'm so sleep :(
21:11 <zipper> I am literally sleep
21:12 <MarcelineVQ> I recall these exercises feeling a little rushed when I did them so I'm not surprised the wording is throwing you off in some parts, the instruction paragraphs are pretty clear though so be sure to re-read intructions to problems first when you're stuck instead of staring right at the problem
21:13 <MarcelineVQ> idk if you got stuck starting at the problem but I​ tend to so I'm mentioning it :>
21:13 <zipper> MarcelineVQ: LOL I have that problem
21:13 <zipper> Because I used to write haskell a while ago and haven't in a while
21:13 <zipper> I feel the need to skim through the topic and jump to the exercises
21:13 <zipper> but good to know
21:13 <zipper> I will def do that
21:14 <zipper> Thanks MarcelineVQ
21:14 <MarcelineVQ> np, what's really going to bug you is that these list things are just data for some examples that show up a little later
21:21 <nitrix> evolution :: Population -> IO Population
21:21 <nitrix> evolution pop = fitness pop >>= aging >>= reproduction
21:21 <nitrix> Whoops, sorry.
21:24 <nitrix> Well, now that it's posted here; hey, my first use case of >=> kleisli composition!
21:34 nil_ joined
21:34 <nil_> Why is (, "YogiBear") not a valid section again?
21:35 <zipper> nil_: Section?
21:35 <nitrix> nil_: You want want {-# LANGUAGE TupleSections #-}
21:35 <nitrix> *might
21:36 <nil_> That sounds good, I'll take a look.
21:37 jamie_ joined
21:37 <nitrix> nil_: The reason being that (,) and [] are infix operators that needs additional help from the language for being able to "wrap around" stuff.
21:37 <nitrix> nil_: e.g. being able to write `[a]` intead of `[] a`.
21:38 kadoban joined
21:38 <nitrix> nil_: The Haskell Report was very generous for lists but unfortunately not as much for tuples.
21:38 <nil_> nitrix: right, I realized about '[a]'.
21:38 <MarcelineVQ> zipper: an section is notation for partially applying an operator, for example ("wee"++)
21:38 <MarcelineVQ> or something like (1+) which you've likely seen before
21:40 Apocalisp joined
21:40 <zipper> MarcelineVQ: Oh
21:40 <nitrix> nil_: If it makes you more comfortable, Haskell Prime (fancy name to describe the next version of Haskell) has a ticket to consider adding GHC's TupleSections extension to the language specification.
21:41 <nitrix> nil_: https://prime.haskell.org/ticket/69
21:41 <zipper> I didn't know that MarcelineVQ :)
21:41 <nil_> nitrix: could be a worthwhile addition if most users support it. I'm fine using the "LANGUAGE" pragma too, though.
21:42 <nitrix> nil_: To be honest, nowadays's Haskell is pretty much GHC's Haskell.
21:43 <nil_> nitrix: I realize.
21:44 <zipper> nitrix: hmmmm interesting
21:44 pie___ joined
21:45 takle joined
21:47 <MarcelineVQ> > (1, ,'c',) "b" 'd' -- tuple sections are pretty neat in that you can fill in any slot you like. tuple sections are kind of annoying in that you can fill in any slot you like, can be easy to miss seeing spots :>
21:47 <lambdabot> (1,"b",'c','d')
21:48 patbecich left
21:49 <jle`> i think there's a whitespace convention that you should leave no space between the commas surrounding 'mising' spots
21:50 <jle`> i'm still waiting for list sections
21:51 <nitrix> jle`: (5:3:) :: [Int] -> [Int] ?
21:51 <jle`> nitrix: [4,3,,5] 6 => [4,3,6,5]
21:52 <nitrix> Oh, gotcha.
21:52 <jle`> or [,,] 1 2 => [1,2]
21:53 <jle`> oop
21:53 hiratara joined
21:53 <jle`> [,,] 1 2 3 => [1,2,3]
21:53 <nitrix> [(,),] :: (a -> b -> (a, b)) -> [(a -> b) -> (a, b)]
21:53 <nitrix> Fancy type.
21:53 <jle`> think of all the fun
21:54 <nitrix> http://www.kappit.com/img/uploads/20150125_093410_.jpg
21:57 malaclyps joined
22:00 Bane^ joined
22:01 ubsan joined
22:17 Bane^ joined
22:19 NoCreativity joined
22:26 jamie_ joined
22:28 <threestrikes_> I was working with a stack build using gtk. It's supposed to use a file called simple.ui. I have the simple.ui file in the same folder as Main.hs. Whenever I build the stack package I have to be in the app directory to get it to work. How would I get stack to recognize where the simple.ui file is?
22:29 <threestrikes_> I tried adding it to the stack.yaml under packages but it won't accept the .ui extension.
22:30 <geekosaur> generally this is multiple steps: (1) add to data-files stanza in cabal file (2) use getDataFileName to access file (https://www.haskell.org/cabal/users-guide/developing-packages.html#accessing-data-files-from-package-code) (3) cabal/stack will try to arrange for this to work both in-place and installed, but this sometimes can fail requiring you to install the package
22:31 hiratara joined
22:31 <geekosaur> you will probably have to dig through gtk docs to figure out how to make it load a ui file from a specific place
22:32 <threestrikes_> ok, if I edit the cabal file with the stanza. Will stack pick it up or do I need to do something similar with it as well.
22:32 jamie_ joined
22:33 <threestrikes_> thanks gee, I'll play around with it.
22:38 <geekosaur> sorry, have many pots on the fire >.> you will need to do a build and may need to explicitly configure first
22:38 <geekosaur> or do a clean
22:39 <geekosaur> I am less familiar with stack, but have heard ti does not always handle in-place data-files correctly (mostly because it's Hard, and doing in-place it all is something of an ugly hack to begin with)
22:40 <geekosaur> *at all
22:51 <threestrikes_> I was trying to keep the .ui extensions separate. I could write it into the original module but didn't think that was the best option.
23:01 justicefries joined
23:02 pietilson joined
23:07 texasmynsted joined
23:17 shayan_ joined
23:31 Pupnik joined
23:51 ali_bush joined
23:51 ali_bush joined
23:53 systemfault joined