<    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:00 cschneid_ joined
00:03 Levex joined
00:04 conal joined
00:08 mwilly joined
00:11 conal joined
00:14 louispan joined
00:16 fhoffmeyer joined
00:17 yellowj joined
00:20 Rizy joined
00:20 Rodya_ joined
00:21 MotherFlojo joined
00:22 liam_ joined
00:23 Ayey_ joined
00:23 takle joined
00:24 ali_bush_ joined
00:27 liam_ joined
00:30 Decoy__ joined
00:32 Decoy__ joined
00:33 \Mike joined
00:33 Levex joined
00:37 takle joined
00:40 louispan joined
00:40 systemfault joined
00:45 skapazzo joined
00:48 systemfault joined
00:51 aarvar joined
00:52 louispan_ joined
01:00 conal joined
01:04 Big_G joined
01:04 faberbrain joined
01:13 cschneid_ joined
01:14 Ayey_ joined
01:15 <tapirus> > let ordering = [1,2,3,4,0,5]
01:15 <lambdabot> <no location info>: error:
01:15 <lambdabot> not an expression: ‘let ordering = [1,2,3,4,0,5]’
01:15 <tapirus> > let ordering = [1,2,3,4,0,5] ; let table = [(1,'a'),(2,'b'),(3,'d'),(4,'c'),(0,'f'),(5,'e')] ; lookup <$> ordering <*> table
01:15 <lambdabot> <hint>:1:125: error:
01:15 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
01:16 <tapirus> ack
01:16 justicefries left
01:17 fhoffmeyer joined
01:18 <geekosaur> lambdabot is not ghci, it needs full expressions
01:18 <geekosaur> use let-in, not let "statements"
01:20 liam__ joined
01:22 <parsnip> > f 2 2 = 5
01:22 <lambdabot> <hint>:1:7: error:
01:22 <lambdabot> parse error on input ‘=’
01:22 <lambdabot> Perhaps you need a 'let' in a 'do' block?
01:22 <tapirus> > let ordering = [1,2,3,4,0,5] ; table = [(1,'a'),(2,'b'),(3,'d'),(4,'c'),(0,'f'),(5,'e')] in lookup <$> ordering <*> [table]
01:22 <lambdabot> [Just 'a',Just 'b',Just 'd',Just 'c',Just 'f',Just 'e']
01:22 <tapirus> :)
01:22 <MarcelineVQ> tapirus: to answer your earlier question, I'm not aware of a way to avoid the elongation of the prompt with :{ :} but there isn't a comprelling reason for it to do that in the first place so it's likely to me that it was just overlooked
01:23 <tapirus> can I infer from your question that there is a compelling reason I'm missing for it to expand the prompt in the first place, even if the user has already set the prompt to something terser?
01:24 <tapirus> infer from your response*
01:25 <MarcelineVQ> It's likely to me that respecting the already set prompt was just overlooked when the code for pretty-printing :{ :} was invented
01:30 liam_ joined
01:31 <MarcelineVQ> I'll have a look at it later, doesn't seem like a particularly difficult thing to change since there's only a few things responsible for displaying a prompt or a contintuation prompt, which is the thing you're having trouble with
01:34 eacameron joined
01:35 <MarcelineVQ> tapirus: mmm actually, good news, this is an option already. you can set your contintation prompt with :set prompt2 in the same way you've :set prompt
01:35 <MarcelineVQ> by default :set prompt only overrides one of them it seems
01:37 faberbrain joined
01:37 <MarcelineVQ> So much for my comments earlier, that'll teach me to open my gob before investigating :>
01:39 Youmu joined
01:39 <tapirus> hahaha
01:39 <tapirus> cool :)
01:40 <MarcelineVQ> Good question though, now I have an addition to make to my .ghci as well
01:56 louispan joined
01:56 takle joined
02:03 louispan joined
02:04 wei2912 joined
02:05 MotherFlojo joined
02:15 ali_bush joined
02:15 ali_bush joined
02:19 fhoffmeyer joined
02:19 faberbrain joined
02:19 damncabbage joined
02:23 nomotif joined
02:24 ali_bush joined
02:24 ali_bush joined
02:24 uglyfigurine joined
02:24 louispan joined
02:30 skeet70 joined
02:34 hexagoxel joined
02:40 louispan joined
02:51 takle joined
02:53 bitemyapp joined
02:53 qmm joined
02:53 louispan joined
03:00 faberbrain joined
03:04 takle joined
03:10 MotherFlojo joined
03:11 xDroid joined
03:14 hphuoc25 joined
03:20 fhoffmeyer joined
03:24 eacameron joined
03:26 liam_ joined
03:32 Kongaloosh joined
03:41 faberbrain joined
03:43 MotherFlojo joined
03:48 exferenceBot joined
03:53 hexagoxel joined
03:59 mac10688 joined
04:01 myrkraverk joined
04:03 takle joined
04:09 cschneid_ joined
04:21 fhoffmeyer joined
04:21 faberbrain joined
04:21 vaibhavsagar joined
04:31 louispan joined
04:33 rlpowell_ joined
04:33 hexagoxel joined
04:40 suls joined
04:47 howdoi joined
04:48 <howdoi> anyone interested in converting foldr (\x acc -> acc ++ map (x:) acc) [[]] to JS?
04:53 hexagoxel joined
04:54 <MarcelineVQ> does the order matter? that seems to be subsequences which probably has a JS equivalent
04:56 karce joined
05:03 faberbrain joined
05:08 <howdoi> MarcelineVQ: yes, trying to see, if it can get better than xs.reduceRight((k, x) => k.concat(k.map(l => [x].concat(l))), [[]]);
05:22 fhoffmeyer joined
05:23 Cale joined
05:31 nomotif joined
05:42 Rodya_ joined
05:45 kritzcreek_ joined
05:46 faberbrain joined
06:01 takle joined
06:02 moei joined
06:08 hexagoxel joined
06:09 aniketd joined
06:13 hphuoc25 joined
06:16 louispan joined
06:20 t0by joined
06:20 Prutheus joined
06:24 fhoffmeyer joined
06:26 faberbrain joined
06:29 takle joined
06:35 pdgwien joined
06:41 hexagoxel joined
06:45 pdgwien- joined
06:48 ThomasLocke joined
06:52 takle_ joined
07:00 hdeshev joined
07:01 louispan joined
07:02 obh15 joined
07:04 louispan joined
07:07 faberbrain joined
07:12 Ayey_ joined
07:14 mac10688 joined
07:18 louispan joined
07:23 eacameron joined
07:25 fhoffmeyer joined
07:29 Sose joined
07:30 eacameron joined
07:30 patbecich joined
07:32 hphuoc25 joined
07:40 patbecich joined
07:43 ljc joined
07:43 eacameron joined
07:44 slomo joined
07:48 faberbrain joined
07:48 xmonader joined
07:48 eacameron joined
07:56 jarshwa__ joined
07:56 hexagoxel joined
07:57 thc202 joined
08:01 merijn joined
08:02 eacameron joined
08:03 galderz joined
08:04 hphuoc25 joined
08:11 ljc joined
08:16 hphuoc25 joined
08:18 Durz0 joined
08:21 mattyw joined
08:26 takle joined
08:27 fhoffmeyer joined
08:27 hphuoc25 joined
08:29 Miroboru joined
08:30 faberbrain joined
08:30 louispan joined
08:32 hphuoc25 joined
08:32 zero_byte joined
08:41 cur8or joined
08:41 patbecich joined
08:44 yogsototh joined
08:54 ederign joined
08:55 nacon joined
08:56 mengu joined
09:06 MotherFlojo joined
09:10 eacameron joined
09:11 faberbrain joined
09:16 louispan joined
09:19 uglyfigurine joined
09:27 grdryn joined
09:28 fhoffmeyer joined
09:30 Levex joined
09:32 samiratwork[m] left
09:32 rodoa96[m] left
09:32 na9da[m] left
09:32 M-wamaral left
09:34 meandi joined
09:36 Rizy joined
09:41 Guest45614 joined
09:48 takle_ joined
09:51 merijn joined
09:51 gregman_ joined
09:53 faberbrain joined
10:07 louispan joined
10:09 hphuoc25 joined
10:17 mattyw joined
10:28 jarshwah_ joined
10:29 fhoffmeyer joined
10:32 hexagoxel joined
10:35 faberbrain joined
10:35 eacameron joined
10:45 <tapirus> > foldl1 (\x y -> if (Just True) == ((<=) <$> x <*> y) then y else Nothing) [Just 0,Just 2,Just 2,Just 4,Just 4,Just 8]
10:45 <lambdabot> Just 8
10:46 <tapirus> > foldl1 (\x y -> if (Just True) == ((<=) <$> x <*> y) then y else Nothing) [Just 0,Just 2,Just 2,Just 4,Nothing,Just 8]
10:46 <lambdabot> Nothing
10:46 <tapirus> > foldl1 (\x y -> if (Just True) == ((<=) <$> x <*> y) then y else Nothing) [Just 0,Just 2,Just 3,Just 4,Just 4,Just 8]
10:46 <lambdabot> Just 8
10:46 <tapirus> > foldl1 (\x y -> if (Just True) == ((<=) <$> x <*> y) then y else Nothing) [Just 0,Just 2,Just 5,Just 4,Just 4,Just 8]
10:46 <lambdabot> Nothing
10:47 <tapirus> So I have the code above (which I'm happy with), which returns a Just Int if the numbers are all there, and (monotonically) increasing
10:48 <tapirus> however my guy instinct is that the lambda supplied is a bit clunkier than needs be...is there a better way of writing that?
10:48 Axman6 joined
10:50 exferenceBot joined
10:51 macheath joined
10:52 geekosaur joined
10:54 fhoffmeyer joined
10:56 Gurkenglas joined
10:56 <tapirus> gut instinct* :p
11:08 yellowj joined
11:12 <Vzox01> Hello, everyone! Is there a list of basic Haskell terminology with examples? Something akin to a cheat sheet but for common things like "type constructor" looks like this and "bind" looks like that etc.
11:12 Levex joined
11:15 <Vzox01> never mind, found this: http://cheatsheet.codeslower.com/
11:16 faberbrain joined
11:17 tsmish joined
11:17 snowcrshd joined
11:25 guampa joined
11:29 <tapirus> nice find
11:31 <tapirus> I've never understood why it was so rare for technical documentation, be it man pages or programming language docs, to have a selection of simple clear and elucidative examples, they're easy to write (probably easier than a description) and they greatly aid in rapid comprehension
11:33 cur8or joined
11:42 jmg joined
11:44 <merijn> tapirus: I don't see a simpler way to do it, but it also seems a rather odd thing to write?
11:45 <merijn> I can think of lots of neat ways to write something similar, but not quite that
11:47 <merijn> > foldl1 (\x y -> y <$ ((<=) <$> x <*> y)) [Just 0,Just 2,Just 2,Just 4,Just 4,Just 8]
11:47 <lambdabot> error:
11:47 <lambdabot> • Occurs check: cannot construct the infinite type: a ~ Maybe a
11:47 <lambdabot> Expected type: Maybe a
11:47 <merijn> hmmm
11:47 Decoy__ joined
11:55 hdeshev joined
11:57 faberbrain joined
12:00 <tapirus> I've no particular attachment to using the fold, if there's a superior way of checking whether the list of maybes is monotonic increasing, I'd love to hear it
12:05 jorris joined
12:07 <merijn> tapirus: Well, there's foldMap and all sorts of nice monoids, but non quite mapping to what you want. So if this is a one-of issue, this is the best you can (well, maybe move the lambda into a let/where), if this is a reoccuring thing you could do something with a custom newtype/monoid
12:08 Rizy joined
12:13 netheranthem joined
12:19 Pupnik joined
12:23 mizu_no_oto_work joined
12:25 wei2912 joined
12:35 ali_bush joined
12:35 ali_bush joined
12:39 faberbrain joined
12:44 vaibhavsagar joined
12:48 Rizy joined
12:59 yellowj joined
13:10 Glooomy joined
13:14 blissdev joined
13:15 pbrant joined
13:15 wei2912 joined
13:18 geekosaur joined
13:20 jomg joined
13:20 faberbrain joined
13:42 jorris joined
13:42 mizu_no_oto_work joined
13:44 shayan_ joined
13:50 merijn joined
14:00 takle joined
14:00 eacameron joined
14:03 faberbrain joined
14:07 Rizy joined
14:12 cschneid_ joined
14:12 ederign joined
14:17 mizu_no_oto_work joined
14:20 Levex joined
14:39 vmeson joined
14:41 ajmccluskey joined
14:44 faberbrain joined
14:48 cschneid_ joined
14:53 snowcrshd joined
14:58 yellowj joined
14:59 codenirvana joined
15:08 liam__ joined
15:08 carlomagno joined
15:08 uglyfigurine joined
15:27 faberbrain joined
15:37 Levex joined
15:41 mengu joined
15:44 CuriousErnestBro joined
15:46 harfangk joined
15:49 Decoy__ joined
15:54 kori joined
15:55 yellowj joined
15:57 skeet70 joined
15:58 liam__ joined
16:02 seangrove joined
16:02 mengu joined
16:11 mattyw joined
16:15 chrissl joined
16:17 hphuoc25 joined
16:18 Levex joined
16:18 <nitrix> Vzox01: My recommendation is simply to ask them here, I'll be glad to answer and even provide examples.
16:18 <nitrix> Vzox01: The wiki does cover a handful of those though.
16:19 <nitrix> Vzox01: The terminology is also varying from one person to another, generally spread through the teaching material (book authors) and papers.
16:21 <nitrix> Vzox01: data Maybe a = Just a | Nothing -- We say `Maybe` is a type constructor, as it receives any type `a` as argument and results in a concrete type.
16:22 <nitrix> Vzox01: In fact I can demonstrate this. Haskell has multiple layer of abstractions. Just like values all have a type, types all have a kind.
16:22 <nitrix> :k Maybe
16:22 Glooomy joined
16:22 <lambdabot> * -> *
16:23 <nitrix> Vzox01: You can observe two things here. (1) It does looks like a function, that's where the constructor idea originates from (2) It takes any concrete type of kind `*` and results in a concrete type of kind `*`.
16:23 <nitrix> For example:
16:23 <glguy> Constructor isn't related to looking like a function or taking a parameter
16:23 <nitrix> Maybe :: * -> *
16:23 <nitrix> Maybe :: Int -> Maybe Int
16:24 <nitrix> glguy: I'm aware but we have to draw a line somewhere.
16:24 <nitrix> glguy: It's -beginners for a reason.
16:24 <glguy> I don't know what that means, but you're confusing people
16:24 <glguy> You should pick a different word to make up
16:25 <nitrix> bitemyapp.
16:25 <nitrix> glguy: To be clear, I'm aware that Int is a perfectly find type constructor, as well as `Either` is a type constructor and `Either e` isn't.
16:26 <nitrix> *fine
16:26 <nitrix> Keep being over zealous.
16:27 HaskellLord69 joined
16:28 ederign joined
16:28 <Vzox01> nitrix: Thanks! I'm reading on generic programming in Haskell and things tend to get confusing there, with the type system. I'm trying to write something like a automatic parser for a sum type, so that I can add constructors and automatically get parsers, I managed to do that for one argument (parameter?) Int constructors, but I want to make it more generic
16:28 aminb joined
16:28 aminb joined
16:29 <nitrix> Vzox01: glguy will take over from here :)
16:29 ab9rf joined
16:30 <Vzox01> So when I have something like Aaa = Bbb Int; Int is an argument, and Bbb is a function, right? Am reasoning about this correctly?
16:30 <Vzox01> A type of the argument I mean
16:31 <Vzox01> But are "argument" and "function" (in regards to Bbb) correct terms?
16:31 <glguy> If you're using Bbb as a value, suppose: Bbb 10, then 10 is an argument
16:32 <nitrix> @let data Aaa = Bbb Int
16:32 <lambdabot> Defined.
16:32 <nitrix> :t Bbb
16:32 <lambdabot> Int -> Aaa
16:33 <Vzox01> Right, but Aaa is just a type name then?
16:33 <glguy> Aaa is a type constructor
16:33 <glguy> Bbb is a value level constructor and can be used as a value or in a pattern
16:33 <glguy> So you could have: case something of Bbb myInt -> stuff
16:33 <Vzox01> glguy: but why is it a constructor if it's just a name? *scratches head* what could it construct in contrast to Bbb?
16:34 <glguy> constructor is just a kind of name
16:34 <glguy> There are constructors and variables
16:34 <glguy> Constructor , variable
16:34 <nitrix> Bbb 42 constructs a value of type Aaa. Aaa constructs a type of kind *, as far as I can distinguish.
16:35 <Vzox01> nitrix: Aha, and kind is a type of a type?
16:35 <glguy> Vzox01: Because you have declared 'data Aaa = Bbb Int', then the value Bbb has the type: Int -> Aaa
16:36 <galderz> hi all!
16:36 <glguy> and Bbb can be applied to an Int as a function
16:36 <galderz> trying to compile this code:
16:36 <galderz> https://gist.github.com/galderz/11a5609d8ccbd344a0e03db25ad77a06
16:36 <nitrix> Vzox01: You get the idea right, excepted that values have their own level, so do types, and so do kinds.
16:36 <galderz> but can't figure out why it won't compile
16:36 <galderz> any helpers?
16:36 <glguy> Vzox01: "function" is something that can be applied to something else
16:36 <nitrix> Vzox01: Values have types, types have kinds, kinds have sorts, and so on (although that changed quite a lot recently)
16:36 Levex joined
16:36 <galderz> it should print:
16:36 <galderz> Sum {getSum = 0}...
16:37 <glguy> galderz: Add a type signature so that it's clear which type your numbers have
16:37 <galderz> glguy: where exactly?
16:37 <galderz> glguy: I've tried adding: (0 :: Integer) but didn't work
16:37 <glguy> galderz: on f or g
16:38 <glguy> galderz: on f and g
16:38 <Vzox01> nitrix: dear god, this in confusing, I gotta learn to distinguish these levels
16:38 <nitrix> Vzox01: You could keep creating greather abstractions like this until you reach categories (at some point type theory intersect category theory).
16:38 <nitrix> Vzox01: Nah, it all comes in time :)
16:39 <galderz> glguy: hmmmm
16:39 <galderz> glguy: added "f :: Combine Integer (Sum Integer)" but it complains there's no instance for Semigroup Integer
16:39 <nitrix> Vzox01: Type polymorphism is enough for most people; only rarely do people venture into kind polymorphism.
16:39 <Cale> I... I don't think categories fit anywhere in the values -> types -> kinds -> ... progression
16:40 <glguy> galderz: Good, now that the ambiguity is resolved you have a new bug to fix :)
16:40 <Vzox01> nitrix: but Haskell has some specific implementation of approach to typing (not sure how to call it)?
16:40 <glguy> galderz: Int is in fact not an instance of Semigroup. You can change your instance as follows "instance Semigroup b => Semigroup (Combine a b) where"
16:40 <Cale> (Apart from the fact that you can make categories out of some of those things in various ways)
16:41 <glguy> galderz: Since you didn't actually need the 'a' type to be an instance of Semigroup given that definition
16:42 <galderz> glguy: oh ic
16:42 <galderz> glguy: good catch :), learning....
16:42 <glguy> galderz: The reason you needed f and g to have a type signature is due to the monomorphism restriction
16:42 <Vzox01> For example, I've heard that Agda has a type system that (as far as I can remember) was created by some Swedish folks, so does Haskell have a type system that also has a name or is it just Haskell's type system?
16:43 <nitrix> Vzox01: It's probably best to continue with your questions on Haskell's type system rather than venturing with endless abstractions :P Point is that it can go infinitely far if you want it to.
16:43 <galderz> thx glguy, after that I don't need the type def for f anymore but i'll keep it
16:43 aarvar joined
16:43 Ayey_ joined
16:45 <nitrix> Vzox01: data Foo a = Bar a; `Bar` is a value constructor, `Bar 42`, `Foo` is a type constructor, `Foo Int` is a concrete type, `a` is a type variable.
16:46 <nitrix> *`Bar 42` is a value
16:46 <Vzox01> Either way, thank you guys, I'm gonna go cook to let my head cool down for a while and then will keep reading the docs.
16:46 <Akii> kinda starting to get somewhere http://lpaste.net/353568
16:47 <Akii> but now my type-foo ran out
16:47 <Vzox01> nitrix: I see, it's because we can have type variables there that we call Foo a constructor, that actually makes sense!
16:47 <nitrix> Vzox01: As pointed out earlier by glguy, the `a` argument of `Foo` isn't what makes is a constructor.
16:48 <Vzox01> nitrix: I'm confused again
16:48 pilne joined
16:48 <nitrix> Just like `42` can construct a value of type `Int`, if `Foo` has no parameter, it could still construct a type of kind `*`.
16:49 <glguy> Vzox01: What makes something a constructor is that it isn't scoped to a particular type signature
16:49 bluepixel joined
16:49 <glguy> if I write: map :: (a -> b) -> List a -> List b
16:49 <glguy> the type variables are all unique to this type signature
16:49 <glguy> but the type constructors (->) and List come from outside
16:50 <glguy> type constructors are always capitalized names, so they're easy to spot
16:50 <glguy> length :: [a] -> Int
16:51 <glguy> [], (->), and Int are type constructors. They're defined outside of this type signature and are just used by it
16:51 <glguy> but a is a type variable, it's a fresh 'a' unique to this type signature
16:53 <Vzox01> glguy: I think I'm beginning to get it, but I have to admit that it doesn't feel easy thinking about things this way. I'm used to thinking: I've types and I have values of types, a more primitive 2D view I suppose
16:53 <glguy> "always capitalized names" unless they're the special cases of things like [] and (->) that are hard coded into the language
16:53 Gurkenglas joined
16:54 <glguy> You still just have values and types and kinds, the three levels aren't compromised by having a constructor/variable distinction
16:55 <glguy> The other exception is that for operator symbols you distinguish contructor from variable by a leading colon
16:55 <benzrf> Vzox01: it is roughly correct to think of type constructors as functions from types to types, fyi
16:55 <glguy> no
16:56 <benzrf> glguy: wait, hmm?
16:56 <glguy> Int is not a function from a type to a type, being a function is a separate concern
16:56 <benzrf> Int is not a type constructor
16:56 <glguy> it is
16:56 <benzrf> oh wait, what
16:56 <glguy> constructor and variable are two kinds of names
16:56 <benzrf> fuck
16:56 <benzrf> ive misused the term "type constructor" for years now D:
16:56 <glguy> nothing whatsoever to do with types or kinds
16:57 <glguy> It's really clear in the Haskell Report
16:57 <benzrf> rip
16:57 <glguy> (which is a pretty easy read, I recommend it)
16:57 <benzrf> whoops
16:59 Ayey_ joined
16:59 <Vzox01> Yeah, I gotta read through the Report. Is it ok to start with 2010 version, or?
17:00 <benzrf> i mean... i've never really read the Report, and i only make stupid mistakes like that semi-frequently :)
17:04 jorris joined
17:05 Ayey_ joined
17:06 mengu joined
17:06 pie_ joined
17:06 neophytes joined
17:06 <neophytes> Can anyone explain steps 5 and 6 here: http://i.imgur.com/1grOkPu.png -- λz(λn.z)((λp.p)z)) to λz.z -- book says bind n to ((λp.p)z)), but that confuses me since there is no other n in the expression other than λn which is at the head
17:07 <nitrix> benzrf: It's a decent starting point but it's not the whole story, which leads to arguments like the ones I'm having occasionally with glguy in regards to what we think is best for beginners.
17:07 Cthalupa joined
17:07 hvr joined
17:08 <nitrix> glguy: No hatred by the way. I'm very maleable. I'll eventually settle on subtile wordings that works for everyone :]
17:08 nacon joined
17:08 nacon joined
17:17 Ayey_ joined
17:19 liam__ joined
17:21 <Cale> neophytes: Well, n gets bound to that, but then goes unused
17:21 <Cale> and you just get z
17:22 Uniaika joined
17:23 <Geekingfrog> Is there a haskell module doing the same thing as https://pursuit.purescript.org/packages/purescript-validation/2.0.0/docs/Data.Validation.Semigroup ?
17:24 <Geekingfrog> Basically (Monoid a) => Either a b where Left x <*> Left y = Left (x <> y)
17:24 jorris joined
17:25 <Cale> yes
17:25 <Geekingfrog> ah, Data.Either.Validation ?
17:25 <Cale> https://hackage.haskell.org/package/Validation
17:25 <Cale> There may be some others
17:25 Ayey_ joined
17:25 <Cale> I know I've implemented a similar type myself
17:27 <Cale> ah, Data.Either.Validation is by ekmett
17:27 <Cale> use that :)
17:28 <Cale> It's more likely that the either package will already be a dependency ;)
17:29 faberbrain joined
17:29 hphuoc25 joined
17:31 Levex joined
17:31 wildlander joined
17:32 jorris joined
17:35 <Akii> Cale: played around some more with my idea of copying Servant for my purposes http://lpaste.net/353568
17:36 <Akii> idk I think if I eventually get it to work it might look decent
17:36 <Akii> and I'd not have to write sum types all the time
17:38 <Cale> What's HandlerT?
17:39 <Akii> I think that's defined here http://lpaste.net/353568#line27
17:39 <Cale> oh, it's a class associated type
17:40 <Akii> no idea how to actually run this in the end
17:41 <Akii> will have to come back to this later I fear
17:46 jmg joined
17:50 yellowj joined
17:55 liam__ joined
18:05 malaclyps joined
18:07 mizu_no_oto_work joined
18:08 Ayey_ joined
18:17 <Vzox01> I feel really stupid asking this, but what does it mean when they say A is isomorphic to B?
18:17 uglyfigurine joined
18:18 <geekosaur> "looks like" (literally "same shape"), in some way
18:18 <geekosaur> what way is usually specified by context, but often in mathematics means there is some operation that can reversibly convert A to B
18:19 <Vzox01> geeksaur: well it was this phrase: "Validation is isomorphic to Either" so they mean that Validation can be used just like Either would be?
18:19 <monochrom> "isomorphic" is overused by Haskell people. Often they just mean "bijection".
18:19 <geekosaur> pretty much, yes
18:19 <geekosaur> (to both! :)
18:21 cmos joined
18:22 <Vzox01> Oh, I see, well it would have made more sense if they just wrote "alternative"
18:23 <cmos> how would you folks go about getting a list of all possible lists containing m<n elements of [1..n]?
18:23 <monochrom> Except "alternative" comes with an extra connotation not intended.
18:23 <cmos> currently doing it with an explicit recursion, but it seems like there ought to be a simple way
18:24 <monochrom> Even two extra connotations. One is as in "I don't like this restaurant, is there any alternative?". Another is as in "alternative medicine".
18:24 <monochrom> In fact in both cases "alternative" means totally the opposite of "same".
18:25 <monochrom> I be damned if I name an "alternative" restaurant but it's isomorphic to the one you said you don't like, completely defeating your point. :)
18:27 pfurla joined
18:27 <Vzox01> monochrom: I'm a simple man, I use simple words ¯\_(ツ)_/¯
18:27 <monochrom> "same nature"
18:28 <monochrom> It is respectable to use simple words, but do not think that it is really easy and obvious.
18:29 <monochrom> "I use simple words" != "I simply use words".
18:29 Ferdirand joined
18:30 <monochrom> The latter implying "I do not actually know how other people interpret my wording".
18:31 <Vzox01> monocrom: well to be honest, I'm not sure how other people interpret my wording, English is my third language, so I'm not always sure I make sense to the native speakers, but I hope I do
18:33 jathan joined
18:36 Miroboru joined
18:42 Ayey_ joined
18:48 Ayey_ joined
18:54 Ayey_ joined
19:00 conal joined
19:00 Decoy__ joined
19:04 liam__ joined
19:09 jle` joined
19:09 Ayey_ joined
19:16 Ayey_ joined
19:19 blissdev joined
19:27 expo873 joined
19:27 takle joined
19:27 jle` joined
19:28 delexi joined
19:31 simendsjo joined
19:31 systemfault joined
19:32 Levex joined
19:34 jud^ joined
19:48 Glooomy joined
19:48 Ayey_ joined
19:57 madjestic joined
19:59 boris_rh joined
20:00 Ayey_ joined
20:00 jmg joined
20:01 mizu_no_oto_work joined
20:03 liam__ joined
20:04 jud joined
20:06 nomotif joined
20:07 dni- joined
20:10 Ayey_ joined
20:19 pie_ joined
20:24 <nitrix> Sweet thing. My haskell trading AI did its first trades today and it's looking very good.
20:24 <nitrix> Made 5 times what I normally earn in a day programming :P
20:24 <HaskellLord69> gimme plz
20:26 <monochrom> Why did it buy and sell? Bitcoins?
20:26 <nitrix> monochrom: USDCAD.
20:26 <jle`> Geekingfrog, Cale: there's a Validation in transformers already
20:26 <nitrix> monochrom: Its doing forex.
20:26 <monochrom> Good idea! Even though I'm Canadian. :)
20:26 <monochrom> Also s/Why/What/ but you already know.
20:27 <nitrix> monochrom: Well it was a sell position, so USD going low and CAD going high.
20:27 delexi1 joined
20:27 <nitrix> monochrom: Yay canadian power! c:
20:27 <jle`> so no need to depend on an extra package; transformers comes with ghc :)
20:27 <monochrom> I want CAD to go high of course.
20:27 <nitrix> monochrom: I don't care. Fluctuations are fine. There's money to be made both ways.
20:28 <monochrom> Yeah to make money you want that.
20:28 <nitrix> It's just so nice to finally see something come out of all the time invested in C.S. and AI. Also not working for someone else but for yourself with a direct return on time and money investments.
20:28 <nitrix> Hope this isn't just a fluke.
20:28 <nitrix> *luck
20:29 <nitrix> Time will tell c:
20:29 <MarcelineVQ> don't forget my 20% for being a positive influence despite not being involved in any fashion
20:29 <nitrix> The AI was smart enough to close the position before the retracement at the moment.
20:30 <Cale> jle`: Oh, cool
20:30 <nitrix> If it's smart, it'll re-open another one tomorrow morning before the other big move.
20:30 <nitrix> MarcelineVQ: It's quite impressive. The only problem with neural networks is that they're black boxes.
20:30 <nitrix> MarcelineVQ: I really wish I could translate its brain into an english description of the decision its making, but I didn't take a decision tree approach.
20:31 <nitrix> It's all time-series based :/
20:31 <MarcelineVQ> the only problem with neuron nets is that they're grey boxes
20:31 <monochrom> I have a strong belief (with only the slightest evidence) that artificial neural networks work the same way as our brains.
20:31 faberbrain joined
20:32 <MarcelineVQ> if it quacks like a duck
20:32 <kadoban> Well that was certainly the intent of them, and it seems to be working pretty well in practice.
20:32 <Vzox01> Speaking of transformers, there's also mtl, if I only want RWST which one would be better?
20:32 <nitrix> monochrom: You mean like, we're nothing more than a organic computer with chemical reactions and we happen to be able to reflect on what's happening, fooling ourselves thinking we have a concience and we "decided" to take a decision?
20:32 <nitrix> monochrom: While in reality, it's a very deterministic process?
20:33 <nitrix> monochrom: If so, I agree.
20:33 <jle`> Vzox01: mtl and transformers are different libraries
20:33 <Vzox01> jle`: yes
20:33 <jle`> Vzox01: RWST comes from transformers
20:33 <jle`> mtl re-exports RWST from transformers
20:33 <jle`> but it re-exports it with a cute interface
20:33 <Vzox01> jle`: ooooh
20:34 <jle`> the itnerface lets you work with it as if it were just a normal State or Writer or Reader
20:34 <nitrix> monochrom: Theorically, if you know all the states in a system, you would be able to predict its next phases?
20:34 <jle`> but if you don't care about that then transformers is fine
20:35 <jle`> the important thing is that they are the same type; mtl is just a re-export
20:35 <nitrix> monochrom: Oh actually no, I think you also need to understand the rules/transformations that are happening.
20:36 <nitrix> He left :<
20:36 <MarcelineVQ> you did this
20:36 <Vzox01> jle`: I see, thanks! When I saw the docs I thought they are different implementations of the same concept.
20:36 <jle`> i agree that it's not documented very well
20:36 <jle`> i wrote a whole blog post complaining about this heh
20:37 <MarcelineVQ> nitrix: It's been a lonmg time since I thought about ai stuff, you've got me interested again, any resources you could mention?
20:38 curious_corn joined
20:38 <Vzox01> are you guys talking about automata theory?
20:40 curious_corn joined
20:41 monochrom joined
20:42 <MarcelineVQ> no idea :>
20:43 louispan joined
20:44 Ayey_ joined
20:53 _cyril_ joined
20:55 <Vzox01> MarcelineVQ: Well, that stuff about states and changes sounds a lot like it. There's this channel on YouTube called "Computerphile" they have some interesting but basic videos about deep learning, AI and other stuff: https://www.youtube.com/user/Computerphile/videos
20:55 Ayey_ joined
20:55 curious_corn joined
20:58 mengu joined
20:58 <MarcelineVQ> thanks
21:04 Ayey_ joined
21:07 curious_corn joined
21:08 mattyw joined
21:09 <mattyw> hi folks, I wonder if someone can help me work out where I'm going wrong: In this project https://github.com/mattyw/dofn I'm trying to run cabal test. When I do it says tests/BackendTests.hs:5:8: Could not find module `Backend.Backend'. I can't work out what I'm doing wrong
21:10 <geekosaur> cabal build --enable-tests
21:10 <geekosaur> otherwise it ignores dependencies of the tests
21:10 pie_ joined
21:11 <mattyw> geekosaur, I'm believe I'm doing that. it's running make test that fails for me: https://github.com/mattyw/dofn/blob/master/Makefile#L1
21:11 Ayey_ joined
21:11 <geekosaur> ...oh. you need to split into a library and an executable, and both executable and test suite must depend on the library
21:11 <geekosaur> an executable is not automatically a library the test suite can link against
21:13 <geekosaur> (I see the library but no dependency on it in the test suite. the executable should probably have that dependency as well)
21:14 <mattyw> geekosaur, I've added Backend.Backend to the build-depends in the test suite - is that the right thing to do?
21:14 <mattyw> (it doesn't seem to work)
21:14 <geekosaur> no, the dependency is a package not a module
21:15 <geekosaur> (this is somewhat screwy, I admit, and almost everyone trips over it)
21:15 <geekosaur> the library package is dofn, so that is what the dependency should be
21:16 pie_ joined
21:16 <jmg> so while learning about the difference between foldl and foldl' I tried it out in ghci, and I see that there isn't a foldl' but there is a foldl1 ? is it the same thing?
21:17 <geekosaur> no, foldl1/foldr1 use the first element of the list as the seed value (and thus require nonempty lists)
21:18 <jmg> oh yah I head that once now I remember, but where is foldl'
21:18 delexi1 joined
21:18 <mattyw> geekosaur, thanks very much!
21:19 <geekosaur> jmg, Data.Foldable I think
21:19 Ayey_ joined
21:19 <geekosaur> just because a function is in the base library does not mean Prelude exports it
21:19 yellowj joined
21:19 <jmg> oh ok, so then foldl is the non strict version then?
21:21 <geekosaur> yes
21:27 Ayey_ joined
21:28 Levex joined
21:31 <MarcelineVQ> Data.List exports it as well, which is nice if you're using other functions from there anyway
21:31 hphuoc25 joined
21:32 jmiven joined
21:33 faberbrain joined
21:37 <mattyw> can anyone tell me why my test is passing when I expect it to fail https://github.com/mattyw/dofn/blob/master/tests/AllTests.hs (it's likely to be a test setup issue)
21:49 <mattyw> I've tried adding tests, but I seem to always see 1 of 1 test suites (1 of 1 test cases) passed.
21:49 <MarcelineVQ> no idea, recreating it in ghci fails with "expected: 4 but got: 3" I can't run your project as-is because my ghc is too new atm
21:50 conal joined
21:51 <MarcelineVQ> has it perhaps not been recompiled from a change you did earlier?
21:53 hiratara joined
21:54 <mattyw> MarcelineVQ, apparently I needed this stuff around the test runner: https://github.com/mattyw/dofn/blob/master/tests/AllTests.hs
21:54 louispan joined
21:54 <MarcelineVQ> hmm interesting, with cabal the test does pass without incident because it fulfills the "exitcode-stdio-1.0" test type I guess, the failure is in the log it mentions at the end appearantly
21:55 <mattyw> MarcelineVQ, it seemed weird to me
21:55 <mattyw> MarcelineVQ, but I'm here to learn :)
21:56 dni- joined
21:57 <nacon> Suppose I have a list of futures and I want to wait for all of them to be ready. Then sequence :: Monad m => [m a] -> m [a] can be thought of as returning a Future for when all futures are ready. Now in this mental model, what would be the "wait for the first future to be ready" complement? Its type should be Monad m => [m a] -> m a I think. Hoogle suggests msum for MonadPlus m. Is this the co
21:57 <nacon> nceptual complement?
21:58 <MarcelineVQ> noo matty come back
21:58 <MarcelineVQ> @tell mattyw it seems weird to me too, you can bypass it being quiet with an option cabal test --show-details=direct but idk is that's normal to have to use
21:58 <lambdabot> Consider it noted.
22:00 t0by joined
22:00 Ayey_ joined
22:02 <MarcelineVQ> nacon: it depends on the m, if m is Maybe then msum (or asum) will return the first Just result if there is one. I duno about futures so ymmv
22:02 <MarcelineVQ> > msum [Nothing, Just 3, Just 12, Nothing]
22:02 <lambdabot> Just 3
22:07 <MarcelineVQ> I'm not sure if it's relevant to your issue but there's a common package called async for running things and waiting on their results, http://hackage.haskell.org/package/async-2.1.1/docs/Control-Concurrent-Async.html waitAny from it sounds a bit like you describe
22:09 <jmg> is this O(n) like I think it is http://lpaste.net/353576 suggestions on how to improve it?
22:12 <kadoban> jmg: What's it do? Put the lists that don't start with zero first in the list?
22:12 <qu1j0t3> jmg: I'd probably avoid using `head` and just do it with pattern matching cases
22:12 <MarcelineVQ> > nonZeroFirst [[0..2],[1..3],[2..5]]
22:12 <jmg> kadoban yes thats what it does
22:12 <lambdabot> [[2,3,4,5],[1,2,3],[0,1,2]]
22:12 <MarcelineVQ> > nonZeroFirst [[]]
22:12 <lambdabot> mueval-core: Time limit exceeded
22:12 <lambdabot> mueval: ExitFailure 1
22:12 <MarcelineVQ> robut :(
22:12 <MarcelineVQ> > nonZeroFirst [[]]
22:13 <lambdabot> mueval-core: Time limit exceeded
22:13 <lambdabot> mueval: ExitFailure 1
22:13 <MarcelineVQ> well so much for that :> anyway that's supposed to show what qu1j0t3 meant by avoiding head
22:13 <kadoban> jmg: I think that's fundamentally Ω(n) worst-case
22:13 <kadoban> You have to at least check each list to see which ones start with zero
22:16 liam__ joined
22:19 <jmg> I somehow got ghc to use all of my memory lol what
22:19 cmos joined
22:19 <qu1j0t3> oh, yeah -- if this is happening a lot, set a ulimit so you don't go swapping or OOM'ing
22:20 <jmg> I'm not running any haskell programs as far as I know, I messed up somewhere guess I'll kill ghc
22:21 <kadoban> > sortBy (comparing $ Down . (== [0]) . take 1) [[2,3,4], [0,1,2],[]]
22:21 <lambdabot> [[0,1,2],[2,3,4],[]]
22:21 <kadoban> I think that's what I'd use
22:21 <kadoban> But it's Θ(n lg n) of course. You could do a counting sort kinda thing, but ... lazy
22:23 <MarcelineVQ> oooh I like that take 1 == [0]
22:23 <MarcelineVQ> :t uncurry (++) . partition (maybe True (/=0) . listToMaybe) -- maybe is much more verbose than that
22:23 <lambdabot> (Num a, Eq a) => [[a]] -> [[a]]
22:23 <kadoban> Oh ya partition, that's a good idea
22:24 <jmg> so if I want to put 0 in my pattern then a needs to be of type Eq then?
22:24 <kadoban> If we combine our powers I think that's a good solution xD
22:25 <MarcelineVQ> it depends a bit if you want [] to be grouped with the 0's
22:26 <MarcelineVQ> wait no, it's fine, we just need a not
22:26 <MarcelineVQ> > uncurry (++) . partition (not . (==[0]) . take 1) $ [[0..3],[4..7],[1..3],[0..6],[]]
22:26 <lambdabot> [[4,5,6,7],[1,2,3],[],[0,1,2,3],[0,1,2,3,4,5,6]]
22:26 <kadoban> > uncurry (++) . partition ((/=[0]) . take 1) $ [[0..3],[4..7],[1..3],[0..6],[]]
22:27 <lambdabot> [[4,5,6,7],[1,2,3],[],[0,1,2,3],[0,1,2,3,4,5,6]]
22:27 <kadoban> I should have done that in my original, heh ... /= is easier than Down or not
22:27 <MarcelineVQ> :>
22:28 <MarcelineVQ> big-O notation is a little mysterious to me, it seems to be comprised of more caveats than computation, salt grains to be taken with
22:29 Ayey_ joined
22:29 <monochrom> It ought not be mysterious if you do the math. But after that, you have even more reason for the point about caveats.
22:30 <kadoban> It made way way more sense to me once I read CLRS instead of trying to do what most programmers seem to do (make up what it means)
22:30 <monochrom> Because "10000000000000000000000000 * log n in O(log n)" is very suspicious.
22:30 <MarcelineVQ> I lack the principles mostly, if you have a resource on it I'd be quite interested
22:30 <MarcelineVQ> kadoban: I think I have that book somewhere, thank you
22:31 hiratara joined
22:31 <kadoban> IMO, CLRS and then the part of purely functional data structures that talks about execution traces, for making sense of wtf haskell's model is that makes sense
22:31 <monochrom> Try my http://www.cs.utoronto.ca/~trebla/CSCB63-2016-Summer/lecture-00.pdf (but the big-O stuff begins at slide 12 or 13)
22:32 freechips joined
22:32 <MarcelineVQ> nice
22:32 <qu1j0t3> Skiena's The Algorithm Design Manual also has a good sectiion on it
22:34 faberbrain joined
22:41 Ayey_ joined
22:50 metalbot joined
22:55 cmos joined
22:56 bungoman_ joined
22:57 louispan joined
23:01 Gurkenglas_ joined
23:02 Ayey_ joined
23:04 cmos joined
23:04 Levex joined
23:09 vaibhavsagar joined
23:13 cschneid_ joined
23:13 louispan joined
23:17 Ayey_ joined
23:19 louispan joined
23:22 louispan joined
23:28 ederign joined
23:29 louispan joined
23:37 obh15 joined
23:40 conal joined
23:41 skeet70 joined
23:45 dni- joined
23:49 louispan joined
23:54 TCZ joined
23:58 suls joined
23:59 louispan joined