<    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 _2_4 25  
26 27 28 29 30 31
00:00 bydo joined
00:19 Durbley joined
00:38 janitor1 joined
00:49 peterbecich joined
00:52 peterbecich joined
00:55 peterbecich joined
00:56 peterbecich joined
00:57 bno1 joined
00:58 \Mike joined
01:07 peterbecich joined
01:08 meandi joined
01:09 takle joined
01:09 cschneid_ joined
01:12 janitor joined
01:14 janitor1 joined
01:29 skapazzo joined
01:40 MotherFlojo joined
01:44 Youmu joined
01:53 faberbrain joined
01:59 pilne joined
02:08 Rodya_ joined
02:30 systemfault joined
02:32 Pupnik_ joined
02:32 louispan joined
02:37 harfangk joined
02:52 hexagoxel joined
02:52 louispan joined
03:05 <tmciver> Hey folks. What's the recommended lib for dealing with timestamps in Haskell?
03:06 <tmciver> I've seen some complaints about the usability of Data.Time and I see Data.DateTime is supposed to provide functions for making it easier to deal with.
03:07 gfixler joined
03:07 <gfixler> Is PFPL generally well regarded by the Haskell crowd?
03:15 hexagoxel joined
03:20 MotherFlojo joined
03:23 kadoban joined
03:25 takle joined
03:32 peterbecich joined
03:37 hphuoc25 joined
03:38 hphuoc25 joined
03:38 peterbecich joined
03:39 aarvar joined
03:45 asivitz joined
03:51 exferenceBot joined
03:54 cschneid_ joined
03:55 faberbrain joined
03:56 hexagoxel joined
04:05 xmonader2 joined
04:06 louispan joined
04:22 Big_G joined
04:32 Decoy_ joined
04:37 louispan joined
04:39 hphuoc25 joined
04:45 mounty joined
04:47 louispan joined
05:02 louispan joined
05:09 louispan joined
05:20 louispan joined
05:23 <dmj`> tmciver: what complaints have you received about time
05:24 dni- joined
05:26 exferenceBot joined
05:28 <Cale> tmciver: I would generally use time
05:32 <Cale> If you need a bit more performance, then check out thyme, which is a rewrite of part of the time library to use Int64 instead of Integer in order to make things a bit faster.
05:32 <Cale> But otherwise, time is generally excellent.
05:34 janitor1 joined
05:37 louispan joined
05:37 MotherFlojo joined
05:44 joneshf-laptop joined
05:47 MotherFlojo joined
05:55 hphuoc25 joined
05:57 louispan joined
05:57 faberbrain joined
06:00 hexagoxel joined
06:04 hphuoc25 joined
06:09 hphuoc25 joined
06:14 louispan joined
06:17 ali_bush joined
06:17 ali_bush joined
06:25 djfo joined
06:26 hphuoc25 joined
06:33 Prutheus joined
06:48 hexagoxel joined
06:51 gmg85 joined
06:53 mcspud joined
06:54 ThomasLocke joined
06:56 meandi_2 joined
07:13 dni- joined
07:16 hphuoc25 joined
07:21 merijn joined
07:26 smwangi joined
07:26 takle joined
07:27 smwangi joined
07:34 ederign joined
07:37 Xlaech joined
07:44 mengu joined
07:50 thc202 joined
07:57 Durz0 joined
07:59 faberbrain joined
07:59 hexagoxel joined
08:00 djfo left
08:12 dni- joined
08:13 hphuoc25 joined
08:28 hdeshev joined
08:40 merijn joined
08:41 louispan joined
08:42 fbergmann joined
08:47 hphuoc25_ joined
08:56 nacon joined
08:56 nacon joined
08:58 louispan joined
08:58 albertus1 joined
09:00 cschneid_ joined
09:06 ederign joined
09:11 MotherFlojo joined
09:19 takle joined
09:20 ThomasLocke_ joined
09:22 kritzcreek_ joined
09:24 louispan joined
09:26 grdryn joined
09:28 qu1j0t3 joined
09:35 janitor1 joined
09:38 fbergmann joined
09:39 <Geekingfrog> What is the difference between a channel and a queue?
09:41 galderz joined
10:01 faberbrain joined
10:04 stef204 joined
10:06 Decoy__ joined
10:26 hphuoc25 joined
10:32 grdryn joined
10:38 Gurkenglas_ joined
10:42 Rodya_ joined
10:43 netheranthem joined
10:44 skapazzo joined
10:45 hexagoxel joined
10:52 louispan joined
10:58 Uniaika joined
11:02 faberbrain joined
11:03 ederign joined
11:11 MotherFlojo joined
11:12 Pupnik joined
11:26 flounders joined
11:29 hphuoc25 joined
11:30 ederign joined
11:35 janitor joined
11:37 mniip joined
11:39 fbergmann joined
11:43 janitor1 joined
11:45 Rodya_ joined
11:46 yellowj joined
12:02 slomo joined
12:02 slomo joined
12:08 <mounty> What's the best way of multiplying a Date.Time.Clock.NominalTimeDiff ? I.e., newDiff = timeDelta * num / den where num, den :: Int8 ?
12:14 <Akii> hm
12:15 <Akii> data Foo = Bar | Baz
12:15 <Akii> Bar is a value constructor, right?
12:16 <merijn> Akii: Right
12:16 <Akii> is there any way I can express that `data AnotherThing = A { bar :: Bar }` where Bar is a value constructor
12:17 <Akii> in the specific case I need to make sure a property is a JSON Object
12:17 <Akii> not just any Value
12:17 <Akii> (probably makes no sense to do that.. as I need to either make this a specific type or just perform a case analysis on every usage)
12:17 snowcrshd joined
12:21 louispan joined
12:24 <merijn> I don't usually do JSON, so I'm not sure what you mean :)
12:26 <mounty> Despite https://wiki.haskell.org/Rational , (num % den) results in: Variable not in scope: (%) :: Int8 -> Int8 -> Rational
12:30 hphuoc25 joined
12:36 lithie joined
12:46 Rodya_ joined
12:47 <Akii> mounty: might have to import the function first
12:48 <merijn> % is from Data.Ratio
12:51 <Akii> :( https://www.haskell.org/hoogle/?hoogle=Int8+-%3E+Int8+-%3E+Rational
12:52 <merijn> Akii: This works: https://www.haskell.org/hoogle/?hoogle=Int8+-%3E+Int8+-%3E+Ratio+Int8
13:03 faberbrain joined
13:13 MotherFlojo joined
13:30 ederign joined
13:31 hphuoc25 joined
13:46 Rodya_ joined
13:48 mizu_no_oto_work joined
13:48 kadoban joined
13:52 eacameron joined
13:59 hphuoc25 joined
14:01 e14 joined
14:01 pbrant joined
14:04 faberbrain joined
14:07 Decoy__ joined
14:07 <nitrix> Akii: `Bar` exists at the value level, with the type `Bar :: Foo` (it's a constant). I do not think it is possible to have your record specify a value as type
14:08 <nitrix> Unless you start looking into dependently typed stuff.
14:08 <Akii> nitrix: not yet ^^
14:08 <Akii> I can work around that, later
14:08 <nitrix> :)
14:10 <nitrix> {-# LANGUAGE DataKinds #-}
14:10 <nitrix> Now that'd also give you Foo as a kind, and Bar / Baz as types.
14:10 <Akii> yup
14:10 <Akii> played around with that recently; maybe my idea comes from that
14:10 <Akii> but not ready for that yet
14:10 <Akii> or rather, no time
14:11 <Akii> have to produce results - fast
14:11 chlong joined
14:11 <nitrix> It's a vicioous cycle. Then you have type families and so forth.
14:11 <Akii> yup :D
14:11 <Akii> which I also want to look into
14:14 <nitrix> Akii: They're grossly functions at the type-level.
14:15 <merijn> And then you realise all this stuff you spend months trying to figure out would be downright trivial in Idris/Agda :p
14:16 <nitrix> I'm like Akii there. I don't think I'm using dependent types enough to justify using Idris/Agda.
14:16 <nitrix> I mean, they're very intimidating languages (albeit not as much as Coq).
14:16 <merijn> I'm not recommending those as "regular languages"
14:17 <merijn> But if you wanna look into dependent types, then Idris will show you it's not so hard and it's just Haskell's flaws that make it such a pain
14:17 <nitrix> Gotcha.
14:17 <merijn> nitrix: What's so intimidating about them?
14:22 hphuoc25 joined
14:23 <nitrix> I haven't seen too much, but it seemed to revolve around proofs and I'm not particuliarly gifted with these things.
14:24 <merijn> nitrix: Before writing it off as too intimidating, have a look at this: https://www.youtube.com/watch?v=fVBck2Zngjo :)
14:24 <merijn> Akii: You too if your curious :)
14:24 <merijn> It's a video of implementing type-safe printf
14:24 <nitrix> Haskell typeclasses' laws, while not enforced, are kinda straight forward to verify without making the language / type system too crazy.
14:25 <* qu1j0t3> has seen a live talk demonstrating this example in Idris
14:25 <Akii> 13 mins is certainly doable :D
14:25 <Akii> I'll also have to read this idris book
14:25 <nitrix> But hey, I did want to write a dependently typed language just a month ago so there's surely a fine line there that would make me happy.
14:25 <Akii> apparently there is a standard book to read
14:25 <nitrix> merijn: Will do.
14:25 <qu1j0t3> I was pretty impressed with Idris Akii
14:25 <Akii> qu1j0t3: I went to a meedup where someone gave an introduction into Idris
14:25 <qu1j0t3> but i haven't studied it myself. impressed from the talk(s).
14:25 <Akii> very impressive indeed
14:25 <qu1j0t3> Akii: same. this was a meetup.
14:26 <nitrix> merijn: How would your order Agda / Idris / Coq if you had to give them an Ord instance :P ?
14:26 <Akii> Mike Sperber was the speaker
14:27 <merijn> nitrix: Coq is explicitly a proof-assistant (so computer aided proofs), Agda less so, but still heavily focussed on computer aided proofs
14:27 <merijn> Idris is explicitly meant to be a general purpose programming language like Haskell, but with dependent types
14:27 <nitrix> How about Idris? Still theorem proving or a better Haskell?
14:27 <nitrix> Oh sweet.
14:27 <merijn> nitrix: I wouldn't say it's a better Haskell. More that it's just different
14:28 <nitrix> What prevents it from gaining traction?
14:28 <merijn> But Haskellers are the explicit target audience for Idris, so all their material is written as "Haskell-to-Idris" guide, so it should be easy for most Haskell people to pick it up
14:28 <merijn> nitrix: Well, it's only a handful of years old
14:28 gregman_ joined
14:28 <nitrix> Looks like it's eager evaluation.
14:29 <nitrix> That's going to mess me up badly. I was just starting to get comfortable with all the Haskell gotchas :P
14:29 <merijn> nitrix: Coq is from 1989, Agda 2007
14:29 <merijn> Idris is something like 2014?
14:30 <nitrix> > "Dependent records with projection and update"
14:30 <nitrix> Lovely.
14:30 <lambdabot> mueval-core: Time limit exceeded
14:30 <nitrix> > "Totality checking"
14:30 <lambdabot> "Totality checking"
14:30 <nitrix> Mhh, yeah this requires some serious thougt.
14:30 <merijn> So the main thing stopping Idris from gaining traction is "not being anywhere close to done" :p
14:31 <nitrix> Any big names working on the compiler?
14:31 <nitrix> (Or semantic)
14:32 <merijn> Edwin Brady is fairly well-known, albeit mostly from being the guy doing Idris :p
14:32 <nitrix> Catch-22 :P
14:33 <nitrix> I'll check. I'll admit I'm curious. As great as my ivory tower is, I'm an elitist by nature :P
14:34 <nitrix> I need to find the next better thing to dismiss Haskell. you know.
14:34 <merijn> nitrix: The printf example I linked should be fairly trivial for even beginning Haskellers
14:34 <nitrix> I'll watch on lunch time (~2.5 hours from now)
14:35 mizu_no_oto_work joined
14:47 Rodya_ joined
14:58 hexagoxel joined
15:01 cschneid_ joined
15:06 faberbrain joined
15:07 <Vzox01> Guys, since you were discussing Agda earlier, I have a question. Is it possible to do logic programming in Agda, or equivalent of logic programming? The reason I ask is because that I've overheard on more that one occasion that when you're working with type systems in languages like Haskell or Idris you're doing a kind of logic programming, and since Agda seems to have the most powerful type system I was wondering whether it would be possible to
15:07 <Vzox01> combine almost Prolog like programming with functional programming in it.
15:08 flounders joined
15:11 <Cale> Vzox01: Well, the language doesn't directly support logic programming, but you might be able to rig up something close to it.
15:14 MotherFlojo joined
15:15 zero_byte joined
15:17 takle joined
15:18 <benzrf> Vzox01: wrong kind of "logic programming"
15:18 <hexagoxel> Vzox01: you are aware of the curry language? its type system is maybe the weakest of the mentioned languages, but it does exactly logic+functional.
15:18 <benzrf> Vzox01: when you work with the Idris type systems, you're not doing "logic programming", you're doing logic
15:19 <benzrf> Vzox01: basically, it turns out that if your type system is powerful enough, writing a term of type T corresponds structurally to writing a proof of some statement
15:22 <Vzox01> It's interesting, I have a program that I'm writing that essentially consists of number of records which encode properties of objects, and properties of these objects might change depending on whether the objects are together in a collection and changes what properties they have. Sorry if I'm not making sense. Currently I'm implementing it with a lot of ifs and checks with multiple nesting levels so I've been wondering about logical programming as
15:22 <Vzox01> well. But the real problem comes later, after it appears to work, when I'm not certain whether I've encoded checks and ifs that might result in infinite cycles or missed something, currently I'm trying to write complete code coverage, but I've been wondering about Agda while doing that.
15:24 <Geekingfrog> In the IO monad, to get the time taken for an action (IO a), do I need strictness anotation for both timestamp and the evaluation of the action?
15:25 hphuoc25 joined
15:28 <merijn> Geekingfrog: Depends on what you care about
15:28 <merijn> Geekingfrog: And how you're getting your timestamp, etc. etc.
15:30 uglyfigurine joined
15:32 Miroboru joined
15:33 <Geekingfrog> http://lpaste.net/353497 merijn what do you think about that ?
15:34 <Geekingfrog> Not quite sure what I'm doing with all these ! to be honest.
15:35 skeet70 joined
15:36 <merijn> Geekingfrog: Honestly, getCurrentTime will probably have too much overhead if you have a short action
15:36 <merijn> Geekingfrog: are you trying to just benchmark the action or also the time to fully evaluate it's results?
15:42 tsmish joined
15:42 teppic joined
15:48 Rodya_ joined
15:50 Rodya_ joined
15:52 teppic joined
15:52 flounders joined
15:53 <Geekingfrog> I need the time to fully evaluate the action. And it's something costly (network stuff), it usually takes a few minutes, so small overhead are not important.
15:55 <merijn> Geekingfrog: Anyway, have you looked at criterion?
15:56 <merijn> Geekingfrog: Because that comes with stuff to benchmark this kinda thing for you
15:56 <Geekingfrog> I'm not really interested in benchmark. I only want to know roughly how long a few actions take in my script.
15:58 <merijn> Geekingfrog: If you just care about the action the bang patterns all seem irrelevant
15:58 <merijn> Because that's already what happens
15:59 <Geekingfrog> what do you mean? Is it because it's implicitely sequenced by >>= ?
15:59 <merijn> Well, I would say explicitly
15:59 <merijn> Lemme reverse the question: Why do you think bang patterns are required?
16:09 <Geekingfrog> I thought doing getCurrentTime wouldn't actually run the action and defer it when it's needed, that is when computing the difference.
16:09 HaskellLord69 joined
16:10 <merijn> No
16:10 <merijn> Geekingfrog: Despite what many people seem to think there is almost no lazy IO in base
16:10 <merijn> There's like 4 or 5 lazy IO operations
16:11 <merijn> Regular IO is always strict
16:11 <Geekingfrog> Ok, good to know.
16:11 <Vzox01> merijn: is putStrLn strict?
16:11 <Geekingfrog> What are the common lazy IO operations so I know where to look ?
16:12 <merijn> Vzox01: Yes
16:12 <merijn> Geekingfrog: I dunno all of them of the top of my head (except getContents/hGetContents), but note that those mention it in the docs: https://hackage.haskell.org/package/base-
16:13 <Vzox01> merijn: thanks, I think I saw couple of times a program of mine not outputing something until later on during execution, but perhaps it was buffer related, not really sure *scratches head*
16:13 <Geekingfrog> Thanks
16:13 <MarcelineVQ> afaik unsafeInterleaveIO being invovled is your clue for lazy IO
16:14 <merijn> Vzox01: Yes, buffering is the usual issue
16:15 <merijn> Vzox01: Like normal on unix (python, C, etc. do the same thing) output to terminal is line-buffered (not flushed until a newline is printed)
16:15 <merijn> hSetBuffering lets you fix buffering issues
16:15 <Vzox01> merijn: that's useful to know
16:21 <nitrix> I was going to recommend the same thing as MarcelineVQ. The implementation is going to have unsafeInterleaveIO somewhere down the lines.
16:26 hphuoc25 joined
16:27 ego joined
16:29 carlomagno joined
16:29 contiver joined
16:34 snowcrshd joined
16:45 simendsjo joined
16:50 Baulter joined
16:53 contiver joined
16:56 Prutheus joined
17:00 earldouglas joined
17:05 jorris joined
17:07 Decoy__ joined
17:07 faberbrain joined
17:09 teppic joined
17:10 mcspud joined
17:15 MotherFlojo joined
17:17 conal joined
17:18 Uniaika joined
17:19 zaquest joined
17:26 hphuoc25 joined
17:42 <nitrix> merijn: I learned two things from the video you linked.
17:42 <nitrix> merijn: (1) I'm sure Haskell's Printf approach could be done much better.
17:43 <nitrix> merijn: (2) Dependent types are fascinating. He has functions at the value and type level (seemingly interchangeably), along this fancy Type type.
17:43 Rodya_ joined
17:43 <nitrix> This looks a lot like the most recent extensions of GHC; but built in in the language.
17:43 Miroboru joined
17:45 <nitrix> Does it means Idris's type system is turing complete?
17:47 <nitrix> merijn: (3) Lastly, it seems like the value (the format string) has to be known at compile-time for his implementation to work.
17:51 animated joined
17:52 expo873 joined
17:54 <geekosaur> haskell's printf started out as oleg demonstrating typeclass abuse :)
18:05 contiver joined
18:08 <Cale> https://hackage.haskell.org/package/category-printf -- printf from an alternate timeline ;)
18:08 faberbrain joined
18:10 pilne joined
18:12 MotherFlojo joined
18:14 jorris joined
18:15 Rodya_ joined
18:17 asante10111 joined
18:24 ederign joined
18:25 contiver joined
18:26 flounders joined
18:26 nadirs joined
18:35 nacon joined
18:35 nacon joined
18:38 mcspud joined
18:42 freechips joined
18:44 zero_byte joined
18:49 takle joined
18:54 Levex joined
18:56 Rodya_ joined
18:56 pie_ joined
19:00 contiver joined
19:05 Miroboru joined
19:05 t0by joined
19:05 Cale joined
19:06 takle joined
19:06 Rodya_ joined
19:07 merijn joined
19:08 <merijn> nitrix: Yes, with dependent types it's, in principle, possible (or even easy) to have a Turing complete type system
19:09 <merijn> nitrix: This is why so many dependent languages are total, because then you rule out Halting issues in your type system
19:09 <merijn> nitrix: Agda and Coq being total, and Idris having an optional totality checker
19:09 <merijn> Of course, in practice having a terminating type checker is only marginally relevant
19:10 <merijn> Because the fact that it terminates tells you nothing about how long it takes, nor does it guarantee terminating on this side of the heath death on the universe
19:10 <merijn> So saying "fuck it" and leaving your type system non-terminating is, practically speaking, not a big issue. Although it has implications for your logic if you use it as a proof system, I think
19:13 Rodya_ joined
19:24 <nitrix> I see.
19:29 hphuoc25 joined
19:30 mcspud joined
19:36 curious_corn joined
19:36 grayjoc joined
19:37 Decoy__ joined
19:38 Prutheus joined
19:42 Miroboru joined
19:51 MotherFlojo joined
19:52 Levex joined
20:02 dysoco joined
20:04 chlong joined
20:06 Cale joined
20:07 madjestic joined
20:10 faberbrain joined
20:15 freechips joined
20:19 contiver joined
20:20 curious_corn joined
20:21 louispan joined
20:23 nil_ joined
20:35 <nil_> Why does fp-course (ex NICTA) "introduce Haskell syntax" by defining the Identity monad, Maybe and Either?
20:36 <nil_> If it's supposed to help newcomers get comfortable with the syntax, it's a strange choice to put it mildly.
20:36 <qu1j0t3> well yes
20:37 Heasummn joined
20:37 <qu1j0t3> since the Thompson book goes 18 chapters without even mentioning a monad, iirc.
20:39 <nil_> It's sort of like saying, "you want to get started with Lisp? Here are some advanced macros to get the ball rolling!"
20:40 curious_corn joined
20:41 <qu1j0t3> "On Lisp", lol.
20:41 MotherFlojo joined
20:43 <zipper> Hey, umm I'm having trouble with pure for `newtype Compose f g a = Compose {getCompose :: f (g a)} deriving (Eq, Show)`
20:44 <zipper> I have something close to `pure a = Compose $ \_ -> (\_ -> id a)`
20:44 <zipper> and I see it's completely wrong but I'm out of ideas
20:44 <zipper> Well I can't see but the typechecker says it is
20:45 <zipper> hmm I thought `id` like id . id would work but no
20:45 Levex joined
20:46 zerokarmaleft joined
20:46 <Ferdirand> so, you are trying to write pure :: a -> Compose f g a
20:46 <zipper> Ferdirand: Yes
20:47 merijn joined
20:47 <kadoban> zipper: You should be using the fact that f and f are themselves Applicative
20:47 <kadoban> f and g*
20:47 <Ferdirand> which is pure = (Compose . _) where the hole has type (a -> f (g a))
20:48 <Ferdirand> as kadoban says, f and g are Applicative, so you are allowed to use (pure :: a -> g a) as well as (pure :: b -> f b) (renamed the type variable for clarity)
20:49 <Ferdirand> now all is left is to fit the pieces
20:54 MotherFlojo joined
20:56 contiver joined
20:57 curious_corn joined
20:58 NoCreativity joined
21:01 <tapirus> length.filter (\x -> 'A' == head x) $ chunksOf 3 "A01A02B01B02C01C02C03D01D02D03"
21:01 <nil_> tapirus: you need a '>' at the start of the line if you want lambdabot to evaluate it.
21:01 Gurkenglas joined
21:01 <tapirus> > length.filter (\x -> 'A' == head x) $ chunksOf 3 "A01A02B01B02C01C02C03D01D02D03"
21:02 <lambdabot> 2
21:02 <tapirus> having a bit of trouble with this...this returns 2,2,3,3 for 'A', 'B', 'C', 'D' respectively
21:02 malaclyps joined
21:02 <tapirus> trying to use applicative functors to try and get something that takes "ABCD" and returns [2,2,3,3] but I can't get it working (I can't even get it started)
21:03 Prutheus joined
21:04 louispan joined
21:05 <nil_> Do you always want to map 'A' to 2, 'B' to 2, 'C' to 3 and 'D' to 3?
21:05 <kadoban> I think for each element in "ABCD", they're counting how many of that character are in the string "A01A02B01B02C01C02C03D01D02D03" perhaps.
21:05 <kadoban> Or maybe the number after the last one? Not quite sure
21:06 <nil_> tapirus: can you be more specific about the problem you're trying to solve?
21:06 <tapirus> yeah, sorry :)
21:06 <tapirus> > chunksOf 3 "A01A02B01B02C01C02C03D01D02D03D65D34"
21:06 <lambdabot> ["A01","A02","B01","B02","C01","C02","C03","D01","D02","D03","D65","D34"]
21:07 <tapirus> they actually represent playing cards, and the prefixes represent the suits
21:07 <nil_> Ah, I see.
21:07 <tapirus> CHDS would be more appropriate than ABCD
21:07 <tapirus> but I basically want to count the number of cards in each suit present in the hand (the string given)
21:07 conal joined
21:08 <tapirus> it's from a silly programming challenge thing that I'm using to learn Haskell, so the syntax of the string given to me to represent the hand doesn't change
21:08 <nil_> So it's the first thing kadoban said, right?
21:09 <kadoban> > map (head &&& length) . group . sort . map head . chunksOf 3 $ "A01A02B01B02C01C02C03D01D02D03"
21:09 <lambdabot> [('A',2),('B',2),('C',3),('D',3)]
21:09 <kadoban> Something like that?
21:10 <tapirus> not quite, I was trying to solve a simpler problem first, which is just simply how many of each suit exist (which would be as kadoban stated), however I also need an array with an element for each card in the hand (since I'll need to check for duplicate cards to see if the hand is a valid one)
21:10 <nil_> kadoban: that's a nice solution, but why not let tapirus solve it on their own?
21:11 <tapirus> i.e. ultimately I'd like [["A01","A02"],["B01","B02"],["C01","C02","C03"],["D01","D02","DO3"]]
21:11 argent0 joined
21:11 <MarcelineVQ> nil_> It's sort of like saying, "you want to get started with Lisp? Here are some advanced macros to get the ball rolling!" idk about that analogy, those first sections are intended to be read not neccearily understood, List is where you start working on understanding. you could ask dibblego why it's set up that way I suspect it's because I think it's intended as a compliment to a live workshop
21:11 <kadoban> nil_: A good point
21:12 <nil_> tapirus: you want to _group_ elements together according to some rule, right? You might want to look up some library functions that do that!
21:12 <dibblego> nil_: it's done on person, using those as examples.
21:12 <nil_> tapirus: are you familiar with Hoogle?
21:12 curious_corn joined
21:12 <nil_> MarcelineVQ: fair enough.
21:13 <tapirus> nil_: yep :)
21:13 <nil_> tapirus: alright then, try and find you some functions that will do most of the work for you.
21:17 merijn joined
21:18 <tapirus> > groupBy (\x y -> (head x) == (head y)) $ chunksOf 3 $ "D02A01A02B01B02C01C02C03D01D02D03"
21:18 <lambdabot> [["D02"],["A01","A02"],["B01","B02"],["C01","C02","C03"],["D01","D02","D03"]]
21:18 <nil_> Excellent! :)
21:18 <tapirus> hah, almost, I need to sort them first (that D at the start), but 99% there :)
21:18 <nil_> Good job.
21:18 <tapirus> cheers for the hint :)
21:26 uglyfigurine joined
21:28 shayan_ joined
21:31 hphuoc25 joined
21:47 chlong joined
21:48 Prutheus joined
21:48 expo873 joined
21:52 hiratara joined
21:56 conal joined
22:05 greeny joined
22:08 louispan joined
22:11 pie_ joined
22:12 faberbrain joined
22:15 malaclyps joined
22:28 NoCreativity_ joined
22:31 hiratara joined
22:32 hphuoc25 joined
22:34 ederign joined
22:44 jorris joined
22:47 louispan joined
22:49 exferenceBot joined
22:53 louispan joined
22:55 louispan joined
22:56 uglyfigu_ joined
23:01 AndreasK joined
23:10 louispan joined
23:11 takle joined
23:12 uglyfigurine joined
23:13 faberbrain joined
23:20 guampa joined
23:20 louispan joined
23:22 conal joined
23:25 louispan joined
23:30 MotherFlojo joined
23:32 hphuoc25 joined
23:36 <metalbot> so i'm trying to follow the yesod quick-start instructions
23:36 <metalbot> but when i try to run "stack exec -- yesod devel"
23:36 <metalbot> it compiles, but then loops on an error that nix-shell is not found
23:36 <metalbot> is there actually a dependency on nix, or do i have something misconfigured?
23:38 zero_byte joined
23:38 amIaName joined
23:39 <amIaName> Hello, I am working through the cs194 course and I'm confused with a compilation error I'm receiving for exercise 2 in the second week
23:39 <amIaName> Let me attach a copy of my code with the compilation error
23:41 <amIaName> http://pastebin.com/Be1kADkF
23:44 <metalbot> the case statement doesn't quite make sense there
23:44 <metalbot> are you trying to use guards?
23:44 <amIaName> No
23:45 yellowj joined
23:46 <amIaName> Isn't 'case' the form a switch-case in haskell?
23:46 <metalbot> case is generally used for pattern matching
23:47 <metalbot> whereas the guard is more of a switch
23:47 <amIaName> okay
23:47 <metalbot> but i think there are problems in your arguments of insert
23:47 louispan joined
23:47 <Lazersmoke> case is pattern matching; for a "switch-case" use pattern guards: https://wiki.haskell.org/Pattern_guard
23:48 <amIaName> @metalbot where do you see potential problems?
23:48 <lambdabot> Unknown command, try @list
23:48 <metalbot> you are trying to use type constructors in the arguments
23:48 <amIaName> @Lazersmoke thank you for the reference
23:48 <lambdabot> Unknown command, try @list
23:48 <metalbot> but they aren't capitalized
23:49 <Lazersmoke> `(message _ timeStampMessage _)` <-- here, you probably meant to capitalize the `message`
23:50 <Lazersmoke> or actually you probably meant to use MessageTree instead of both message and tree on that line
23:50 <amIaName> I wanted to call the LogMessage 'message' so that I could reference it later on
23:50 <amIaName> is that not valid?
23:51 <Lazersmoke> you need to use an @-pattern
23:51 <amIaName> oh, right!
23:51 <Lazersmoke> message@(MessageTree _ timeStampMessage _)
23:52 <Lazersmoke> what is your data decl for MessageTree exactly? you seem to be using different numbers of arguments in different places. Is it `data MessageTree = MessageTree MessageTree LogMessage MessageTree | Leaf`?
23:53 <metalbot> i think it's "Node" rather than MessageTree in the data constructor
23:54 <metalbot> looking at the version that i did a while ago
23:56 <amIaName> Here: http://pastebin.com/WjS2MeuE
23:58 <Lazersmoke> OK
23:59 eacameron joined
23:59 <Lazersmoke> important to note: when you pattern match (in function parameters or in a case statement), you are always matching on *data constructors* (which are in your case Node and Leaf), not on type constructors (in your case, MessageTree)