<  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 24 25  
26 27 28
00:00 atk joined
00:00 bydo joined
00:00 kiltzman joined
00:01 rcat joined
00:02 <MarcelineVQ> Squarism: specifically, regarding your implicits problem earlier, bindind sites of implicit parameters can define bindings only for implicit parameters, you can't mix, re the bullet points here: https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#implicit-parameter-bindings
00:02 Fairy joined
00:03 louispan joined
00:03 Apocalisp joined
00:03 kiltzman joined
00:03 bruschkov joined
00:03 kiltzman joined
00:04 kiltzman joined
00:06 markus1209 joined
00:06 <MarcelineVQ> basically the vague parse error you were getting was due to the next thing in the let not starting with ? as it expected :>
00:06 kiltzman joined
00:07 pasukon joined
00:07 desku joined
00:07 markus1219 joined
00:07 StoneToad joined
00:07 programo joined
00:08 kiltzman joined
00:08 kiltzman joined
00:10 chpatrick left
00:10 desku joined
00:10 ddere joined
00:11 yeshacker2 joined
00:11 davezd joined
00:13 greglearns joined
00:13 greglearns joined
00:14 jle` joined
00:15 Apocalis_ joined
00:16 kav joined
00:16 jao joined
00:17 marr joined
00:17 pasukon joined
00:17 greglearns joined
00:17 jluttine joined
00:17 arjanb joined
00:18 nakal_ joined
00:19 louispan joined
00:19 kmelva joined
00:19 buttbutter joined
00:21 nomicflux joined
00:21 Catalect` joined
00:22 latro`a joined
00:23 xinming joined
00:25 cschneid_ joined
00:28 rcsole joined
00:29 andyhuzhill joined
00:30 anuxivm left
00:30 oisdk joined
00:31 JeanCarloMachado joined
00:31 plutoniix joined
00:32 plutoniix joined
00:33 lambda-11235 joined
00:33 Jeanne-Kamikaze joined
00:35 MrJazz_ joined
00:36 theDon_ joined
00:39 edwinvdgraaf joined
00:40 Fairy joined
00:41 svgDelux joined
00:41 kiltzman joined
00:42 hololeap joined
00:44 pleax joined
00:46 IRCFrEAK joined
00:46 tfc joined
00:48 oconnorct1 joined
00:48 davezd joined
00:49 nomicflux joined
00:50 maksim__ joined
00:51 greglearns joined
00:51 abhiroop joined
00:52 <nanocoder> Hi, could anyone please help me with installing haskell stack on nixos? I'm trying that for some days without success
00:52 louispan joined
00:53 <nanocoder> Clarifying, stack install ok, but you can't install ghc or anything else with it...
00:53 twomix joined
00:53 <MarcelineVQ> did you ask in #nixos? I only ask because they seem to be super helpful in there so it's worth a try if you haven't yet
00:54 ba205 joined
00:54 <hpc> nanocoder: i was having the same issue, it seemed like it was trying to write to stack's nix store
00:54 <nanocoder> I didn't think doing that there, it make more sense :) tks, i will try there
00:54 <Cale> My friend, re: nanocoder's situation "hoo boy, he might want to sit down for this one"
00:55 <hpc> haha
00:55 <hpc> yeah, i switched back to fedora yesterday because of this
00:55 <Cale> I think if you're using nixos, probably your best bet is just to use nix's haskell stuff rather than stack
00:56 <hpc> nix packages stack though, is the odd thing
00:56 <nanocoder> I *really* liked nixOS, but apparently both nix and stack are making assumptions about the underlying system without talking to each other :)
00:56 <hpc> i think i blame stack in this case, but nix in general
00:57 <Cale> I haven't yet been able to stand using nixos itself, but we use nix for all our projects where I work.
00:57 <Cale> (I just have the package manager installed for that)
00:57 <hpc> if they move more configuration into the package expressions and expose damn near everything in the language, then it could be something great
00:57 <hpc> like some sort of pure functional puppet or something
00:58 <nanocoder> I have done thing in *seconds* with nixos that for doing elsewhere will take very long time, but when you dong get something is a real pain to discover what get wrong
00:58 <Cale> Yeah, what Ryan wants to do is to add something to cabal/GHC to emit build plans in a machine readable format, from which nix derivations can be constructed.
00:58 <Cale> (at least at the module-by-module level)
01:01 yeshacker2 joined
01:02 greglearns joined
01:02 tfc joined
01:03 <Cale> but yeah, the actual nix expression language is kind of awful -- it badly needs a type system so that you can learn anything without having to read the source code of everything.
01:03 <hpc> even just enough to know where the effects are coming from would help
01:03 plutoniix joined
01:03 <hpc> or how files map from the nix store to what you see in userspace
01:03 crobbins joined
01:04 <Koterpillar> Did you try Propellor instead?
01:04 bruschkov joined
01:05 plutoniix joined
01:05 <hpc> or how to know which version of vim_configurable is the right one
01:05 <hpc> er, vim-configurable
01:05 <Cale> Well, I could be mistaken, but I don't think Propellor is really aimed at being a hashed build system.
01:05 <Cale> Maybe it could be extended in that direction.
01:06 <hpc> ... did vim-configurable disappear?
01:06 nathanic joined
01:06 chlong joined
01:07 harfangk joined
01:07 Fairy joined
01:08 plutoniix joined
01:09 louispan joined
01:09 juhp__ joined
01:10 reoo joined
01:11 abrar joined
01:14 nemorichard joined
01:15 nanocoder left
01:20 MrJazz joined
01:21 oisdk joined
01:21 <pikajude> i think it's an underline isn't it
01:22 Fairy joined
01:22 abhiroop joined
01:22 cpennington joined
01:22 vergil_s joined
01:23 nighty joined
01:27 cschneid_ joined
01:28 takle joined
01:28 systadmin joined
01:30 olivierw joined
01:35 Majiir joined
01:36 JoshS joined
01:36 mr_sm1th joined
01:36 takle joined
01:38 markasoftware joined
01:39 sdothum joined
01:40 roconnor joined
01:43 raycoll joined
01:44 systadmin joined
01:44 codesoup joined
01:44 Fairy joined
01:45 takle joined
01:46 yeshacker2 joined
01:49 FreeBirdLjj joined
01:50 Fairy joined
01:51 gfixler joined
01:51 P1RATEZ joined
01:52 sz0 joined
01:55 StoneToad joined
01:56 polyaletheia joined
01:56 defaultnick joined
01:58 takle joined
01:58 Foras joined
01:58 <Wizek_> Is there an online haskell code formatter/beautifier?
01:59 <Koterpillar> hindent is an installable one
02:00 skeuomorf joined
02:00 JeanCarloMachado joined
02:00 jaja1 joined
02:01 fcpga_te joined
02:01 harfangk joined
02:02 Cooler joined
02:02 <Wizek_> looking into it
02:02 justinfokes joined
02:03 stelleg joined
02:04 systadmin joined
02:04 pleax joined
02:04 conal joined
02:05 takle joined
02:06 bruschkov joined
02:06 contiver joined
02:06 begriffs joined
02:07 conal joined
02:09 <stevenxl> Hi folks. A lot of definitions of a pure function state that a pure function an’t depend on reading any hidden value outside of the function scope. Of course, if that's the bar for a pure function, even something like myFunc a b = a + b is not a pure function, since it relies on a value (+) that is not defined in that function's scope.
02:10 <stevenxl> I ran into another definition that modifies the "no reading any hidden value..." to say, instead relies on "no external mutable state".
02:10 <monochrom> I'm pretty sure "hidden" is wrong. "mutable state variable" is right.
02:11 <stevenxl> Under that definition, myFunc a b = a + b is a pure function.
02:11 <stevenxl> monochrom: that's what I'm thinking too.
02:11 <monochrom> "external" is also wrong. In C "int f(void) { static int i = 0; return i++ }" reads an internal mutable state variable and is clearly impure.
02:12 oisdk_ joined
02:12 <barrucadu> A nice simple definition is: a pure function always gives the same result for the same argument values.
02:12 <monochrom> Actually I think it's all wrong to look at what it does and doesn't read.
02:12 TxmszLou joined
02:12 <stevenxl> Right.
02:13 janos joined
02:13 <monochrom> What barrucadu just said.
02:13 <stevenxl> I agree with both of you (monochrom, barrucadu).
02:13 <hpc> stevenxl: there's a similar but orthogonal concept of free and bound variables which is what you are thinking of
02:13 <hpc> a and b are bound in \a b -> a + b
02:13 <hpc> specifically they are bound by the lambda
02:13 <hpc> but (+) is free
02:13 <stevenxl> The thing is that this definition seems to be pretty pervasive. I found it here: http://scalafp.com/book/definition-of-pure-functions.html
02:13 <stevenxl> And on wikipedia
02:13 <stevenxl> https://en.wikipedia.org/wiki/Pure_function
02:14 <hpc> and a combinator is (iirc) a definition that does not contain any free variables
02:14 <monochrom> Pretty sure this is an instance of "misconception is pervasive".
02:14 <stevenxl> ok cool.
02:14 <stevenxl> This was not letting me rest.
02:15 <stevenxl> Because I started thinking about closures, and by that definition, they'd be impure too, even if the closure always returned the same value given the same arguments.
02:15 <barrucadu> stevenxl: I think your problem might be a slightly different reading of "hidden value" to what the authors meant. That definition on scalafp.com also says "A pure function depends only on [...] its algorithm to produce its result."
02:15 CoderPuppy joined
02:16 <barrucadu> I would consider the functions that make up another function to be the definition of its algorithm
02:16 <barrucadu> And the examples of hidden values that could be read are all state: "Its result can’t depend on reading any hidden value outside of the function scope, such as another field in the same class or global variables."
02:16 Rodya_ joined
02:17 <stevenxl> barrucadu: I see your point yes.
02:17 janos__ joined
02:17 nemorichard joined
02:17 conal joined
02:17 <stevenxl> but I like your definition much better - pure function always returns the same value given the same arguments (plus no side effects)
02:17 <stevenxl> :-)
02:18 takle joined
02:18 sword865 joined
02:19 stelleg joined
02:19 tom7942 joined
02:20 staffehn joined
02:20 maksim__ joined
02:21 athan joined
02:23 abhiroop joined
02:24 olivierw joined
02:24 doodlehaus joined
02:25 stelleg joined
02:25 clmg joined
02:25 <clmg> How do I get a pure value from an fclabel?
02:26 <clmg> nvm
02:26 hyperthunk_ joined
02:27 <hyperthunk_> is this the right place to ask a question about GHC 8.* handling type classes a bit… differently to previous versions!?
02:28 bobbypriambodo joined
02:28 conal joined
02:29 hyperthunk_ left
02:29 rcsole joined
02:30 lambdamu joined
02:30 tom7942 joined
02:30 hamishmack joined
02:31 mjs2600 joined
02:34 crobbins joined
02:34 FreeBirdLjj joined
02:35 shinX joined
02:39 haskman joined
02:39 <roconnor> I wouldn't say that (+) is free in \a b -> a + b
02:39 <roconnor> (+) is a defined constant.
02:40 JeanCarloMachado joined
02:40 <pyon> QuickCheck question: Is there some way to automatically derive Arbitrary instances?
02:42 <Koterpillar> pyon: there are options with TH
02:42 solenodic joined
02:42 <Koterpillar> pyon: https://hackage.haskell.org/package/derive-2.5.26/docs/Data-Derive-Arbitrary.html
02:42 <pyon> Koterpillar: Ah, thanks! :-)
02:43 takle joined
02:43 <Koterpillar> pyon: also https://hackage.haskell.org/package/generic-random-
02:43 edwinvdgraaf joined
02:44 <pyon> Checking.
02:44 <Koterpillar> pyon: https://github.com/nick8325/quickcheck/pull/112
02:45 pasukon joined
02:46 justinfokes joined
02:46 mkoenig joined
02:47 stelleg joined
02:48 <ReinH> roconnor: fwiw, the report uses that wording
02:48 <pyon> roconnor: (+) is a defined constant... in a(n admittedly very common) context. Without that context, it seems to me that it's fair to say it appears free in the expression you gave.
02:49 nemorichard joined
02:50 <ReinH> roconnor: e.g., in Chapter 3 they write, "Free variables and constructors used in these translations always refer to entities defined by the Prelude."
02:50 <ReinH> (https://www.haskell.org/onlinereport/haskell2010/haskellch3.html)
02:50 haskman joined
02:52 haskman joined
02:53 JeanCarloMachado joined
02:53 abhiroop joined
02:53 <roconnor> pyon: yes.
02:53 solenodic joined
02:55 <pyon> Could anyone please tell me why I get a stack overflow when running this code? https://gist.github.com/eduardoleon/89937fc083e69f50e70e76b1fd8718b3 (Ignore the SML version, it's just the same program, minus the QuickCheck test.)
02:55 CoolerExtreme joined
02:57 conal joined
02:58 <pyon> Alternatively, how can I get QuickCheck to produce a sample of values from a type, and just return that sample, without testing anything on it?
02:58 michael2 joined
02:59 <hpc> for the second question, look at the operations on Gen
02:59 <Koterpillar> pyon: http://hackage.haskell.org/package/QuickCheck-2.9.2/docs/Test-QuickCheck-Gen.html#v:generate ?
02:59 <pyon> Ah, thanks!
03:00 Fairy joined
03:00 hucksy joined
03:02 <pyon> Ah, the problem is with my generator, not with the code being tested.
03:02 <pyon> Perhaps I shouldn't use generics as a replacement for thinking. :-|
03:03 enthropy joined
03:04 Fairy joined
03:04 xcmw joined
03:07 <xcmw> Is it bad to use & and <&> instead of $ and <$>? I never see any programs wirtten with & and <&> but that style is easier to read for me.
03:07 tom7942 joined
03:07 bruschkov joined
03:07 takle joined
03:07 <kadoban> xcmw: It's ... unusual.
03:08 <kadoban> You should get used to reading the other way for sure. Which one you actually use probably depends, I'd probably default to what everyone else does though.
03:08 deepfire joined
03:08 <peddie> xcmw: if you consider that an important aspect of programs is having people read them, it might make sense to go with the flow
03:09 <kadoban> I use a flipped version of (.) and (&) in some coding contexts, but I'd never do it for like a library I'm publishing.
03:10 <kadoban> Or code I'm asking questions on or anything I hoped someone would read.
03:11 <xcmw> I find [1,2,3] <&> (+3) & filter (>4) easier to read than filter (>4) . map (+3) $ [1,2,3]
03:11 <kadoban> Keep using the common way until you can read either.
03:11 conal joined
03:12 hexagoxel_ joined
03:12 conal joined
03:12 <kadoban> I don't really see how it could be that much harder to read though, you just start at the right instead of the left. Otherwise really no different. Only reason I use flipped (.) sometimes is ease of typing quickly, don't have to type backwards when I'm thinking forwards from the input.
03:13 takle joined
03:13 pyon joined
03:16 <xcmw> kadoban: I have to mentally reorder it to read it
03:17 Argue_ joined
03:17 exferenceBot joined
03:17 lspitzner joined
03:17 systemfault joined
03:17 systadmin joined
03:18 pandeiro` joined
03:19 <xcmw> Is there a program that can automatically switch between styles?
03:19 <kadoban> If you keep practicing at it, it'll become natural.
03:19 <Koterpillar> xcmw: you can hack something out of hlint, I suppose
03:20 <kadoban> Can hlint automatically change code?
03:20 sssilver joined
03:20 <kadoban> Oh it can, huh. How did I never know that.
03:20 conal joined
03:20 <monochrom> Yikes
03:20 <kadoban> That sounds a bit scary though.
03:21 <* enthropy> remembers it being a feature that hlint didn't
03:21 <kadoban> Looks like --refactor, unless I'm misunderstanding what that does.
03:23 <enthropy> I have a groupish function http://lpaste.net/352742 . Is there some way to write it in terms of sort/sortBy?
03:23 <xcmw> kadoban: "when I'm thinking forwards from the input" When do you think backwards from the input?
03:23 <kadoban> xcmw: The alternative would be backwards from the output.
03:24 <xcmw> kadoban: That is what I meant
03:24 <kadoban> Pretty rarely, but it happens. Can't say I can think of an example.
03:24 <monochrom> English is backwards from the input. The square root of the sine of x.
03:24 shayan_ joined
03:25 <Koterpillar> enthropy: I have a feeling you need to zip the 2nd and 3rd arguments first, then apply groups
03:27 <xcmw> monochrom: English is both
03:29 <enthropy> Koterpillar, by groups you mean Data.List.group?
03:30 rcsole joined
03:30 <Koterpillar> yes
03:30 <Koterpillar> can you show some examples with groupish id?
03:31 <Koterpillar> i.e. is groupish id x y === x?
03:32 <enthropy> no, == y
03:32 nanocoder|2 joined
03:33 <Koterpillar> that does not typecheck
03:33 abhiroop joined
03:33 <Koterpillar> because groupish id :: [a] -> [b] -> [a]
03:33 <enthropy> works in my ghci
03:34 <kadoban> Oh, I see what that function does. That was very confusing initially.
03:34 <Koterpillar> oh, sorry
03:34 tom7942 joined
03:34 <Koterpillar> groupish id :: [a] -> [a] -> [a]
03:35 andyhuzhill joined
03:37 alx741 joined
03:37 <Koterpillar> I very much suspect that groupish f x y = map (map fst) $ group (\(x, y) -> f x == y) x y
03:37 <Koterpillar> but I haven't read the definition, only the type and examples
03:37 <enthropy> I might describe it as "groupish getB as bs" reorders `as` such that "map getB as == bs", and keep the ordering from `as`"
03:38 <Koterpillar> ooh
03:38 <Koterpillar> enthropy: groupish id [1, 1, 1] [2, 2, 2]
03:38 deepfire joined
03:39 MrJazz_ joined
03:41 <enthropy> that's an error right now, but I think some idea of parametricity suggests it might be allowed to be [1,1,1]
03:41 benl23 joined
03:42 conal joined
03:42 <enthropy> I mean it would be a type error to put any 2 from the `bs` argument in the output
03:43 <Koterpillar> then it's a stable sort
03:43 <Koterpillar> by (index in bs . getB)
03:43 <Koterpillar> :t indexOf
03:43 <lambdabot> error:
03:43 <lambdabot> • Variable not in scope: indexOf
03:43 <lambdabot> • Perhaps you meant one of these:
03:43 <Koterpillar> :t index
03:43 <lambdabot> Ix a => (a, a) -> a -> Int
03:43 <enthropy> :t elemIndex
03:43 <lambdabot> Eq a => a -> [a] -> Maybe Int
03:44 edwinvdgraaf joined
03:45 fabianhu joined
03:45 <Koterpillar> > let groupish f x y = sortBy (flip elemIndex y . f) x y in groupish (\x -> x `mod` 10) [1..100] [1..10]
03:45 <lambdabot> error:
03:45 <lambdabot> • Couldn't match expected type ‘[a1] -> t1’ with actual type ‘[a]’
03:45 <lambdabot> • The function ‘sortBy’ is applied to three arguments,
03:46 <Koterpillar> > let groupish f x y = sortBy (flip elemIndex y . f) x in groupish (\x -> x `mod` 10) [1..100] [1..10]
03:46 <lambdabot> error:
03:46 <lambdabot> • Couldn't match type ‘Maybe Int’ with ‘a1 -> Ordering’
03:46 <lambdabot> Expected type: a1 -> a1 -> Ordering
03:46 nanocoder|2 joined
03:46 <kadoban> Koterpillar: How could elemIndex be correct though? Doesn't that just give you the first element that matches?
03:46 stelleg joined
03:46 <Koterpillar> > let groupish f x y = sortBy (compare `on` (flip elemIndex y . f)) x in groupish (\x -> x `mod` 10) [1..100] [1..10]
03:47 <enthropy> probably sortOn would typecheck
03:47 <lambdabot> [10,20,30,40,50,60,70,80,90,100,1,11,21,31,41,51,61,71,81,91,2,12,22,32,42,5...
03:47 <Koterpillar> kadoban: you're right
03:47 nanocoder|2 joined
03:47 romanandreg joined
03:48 <romanandreg> Hey, do you know if there is a way to have a .ghci file per project?
03:48 <kadoban> enthropy: IMO your basic idea seems right. It's possible you can do this via group or sort or something, but ... I'm not seeing it.
03:48 <Axman6> romanandreg: yes, just put it in the root of the project
03:48 <romanandreg> I'm just trying a .ghci file that defines some :cmd in the top of a project dir with no luck
03:49 <Axman6> is it in the directory you're executing ghci from?
03:49 <romanandreg> s/:cmd/:def/
03:49 <romanandreg> I'm using Stack
03:49 <romanandreg> from intero's mode
03:49 <romanandreg> so, not sure if that would skew it up
03:50 nanocoder|2 joined
03:50 takle joined
03:50 <romanandreg> yeah, it is likely, GHCi is not running at the top of the project when running inside emacs
03:50 chg1 joined
03:50 <Koterpillar> is it even GHCi running?
03:51 hamishmack joined
03:52 <romanandreg> I think so
03:52 madgoat joined
03:52 <romanandreg> this gives me the impression intero ignores .ghci file on purpose => https://github.com/commercialhaskell/intero/blob/adb30bfcd4b280005dc6bf505cb9ff0326f7fbc5/src/test/Main.hs#L503
03:53 <romanandreg> :(
03:53 <Koterpillar> this is a test file
03:54 <Koterpillar> https://github.com/commercialhaskell/intero/commit/80707d2db2ee8e73c5aaaa62ecde9c6959f4c320
03:55 cschneid_ joined
03:55 tom7942 joined
03:55 <Koterpillar> but see https://github.com/commercialhaskell/intero/issues/355
03:56 <geekosaur> romanandreg, arguments can be made in both directions, personally I suspect it'd be better to have a project specific file and let .ghci be solely for interactive use
03:56 megacoder joined
03:57 <geekosaur> (or possibly a stanza in cabal file / stack.yaml as appropriate)
03:58 <enthropy> thanks Koterpillar and kadoban
04:00 nanocoder joined
04:00 takle joined
04:01 xaviergmail_ joined
04:02 augur joined
04:02 JeanCarloMachado joined
04:06 athan joined
04:06 vergil_s joined
04:07 forgottenone joined
04:07 romanandreg joined
04:07 takle joined
04:08 <romanandreg> geekosaur: what you mean with a stanza?
04:09 <geekosaur> I mean whatever the appropriate syntax is for each one
04:09 tom7942 joined
04:10 <geekosaur> like a ghci-options: (or intero-ghci-options: or whatever) in the cabal file, or the equivalent YAML
04:10 bruschkov joined
04:10 conal joined
04:10 kiltzman joined
04:11 kiltzman joined
04:11 jvliwanag joined
04:11 Fairy joined
04:12 augur joined
04:12 kiltzman joined
04:12 JeanCarloMachado joined
04:13 Argue__ joined
04:13 olivierw joined
04:13 kiltzman joined
04:13 abhiroop joined
04:13 kiltzman joined
04:14 esph joined
04:14 kiltzman joined
04:16 Argue_ joined
04:16 Rodya_ joined
04:19 Catalect` joined
04:21 <romanandreg> Oh, the reason why it was not working is because of the file mod of the project directory
04:21 <romanandreg> if it can be read by others, GHCi won't load the .ghci file
04:22 cschneid_ joined
04:23 systadmin joined
04:25 conal_ joined
04:25 Micamo joined
04:26 nemorichard joined
04:27 takle joined
04:27 electrostat joined
04:29 edvorg joined
04:29 JeanCarloMachado joined
04:31 rcsole joined
04:32 robotroll joined
04:32 shinX joined
04:35 markasoftware joined
04:36 otto_s_ joined
04:37 JeanCarloMachado joined
04:39 raycoll joined
04:39 Rainb joined
04:41 <lpaste_> threshold pasted “Requesting help with Servant” at http://lpaste.net/352744
04:42 <Koterpillar> threshold: liftIO?
04:44 abhiroop joined
04:44 <Axman6> pretty sure you do not want to be running getArgs for every request...
04:45 halogenandtoast joined
04:45 edwinvdgraaf joined
04:45 <Koterpillar> pretty sure it's some experimental code anyway...
04:46 <Axman6> liftIO is the answer though
04:46 <halogenandtoast> Hmm for some reason I thought the whole OverloadedRecordFields thing was solved in ghc 8, but that doesn't seem to be the case. It's mostly become DuplicateRecordFields and it's still ambiguous when accessing internal data
04:46 isenmann joined
04:46 <lpaste_> halogenandtoast pasted “DuplicateRecordFields.hs” at http://lpaste.net/352745
04:47 <threshold> Koterpillar: Hi, thanks for responding. If the last line of postUser is "liftIO (return (u ++ " on server " ++ (head args)))", the error then changes, but is similar: Expected type: Server Routes Actual type: [Char] -> IO b0
04:47 <halogenandtoast> So that paste for instance errors with name being ambiguous
04:47 <Koterpillar> threshold: liftIO getArgs
04:48 JeanCarloMachado joined
04:48 <threshold> Koterpillar: This? args <- liftIO getArgs
04:48 govg joined
04:48 <geekosaur> halogenandtoast, it's only started, not completed
04:48 <geekosaur> another chunk, but still not the whole thing iirc, is slated for 8.2.1
04:49 <Koterpillar> threshold: correct
04:49 takle joined
04:49 <halogenandtoast> geekosaur: yeah I'm just surprised. I guess it's far more difficult than I could imagine.
04:50 <halogenandtoast> Or perhaps it's not difficult, but it's difficult to make safe, fast, and easy.
04:50 <geekosaur> my impression is that it looks easy but has edge cases all over the place
04:50 <threshold> Koterpillar: That did cause it do something different: Expected type: Server Routes Actual type: [Char] -> Control.Monad.Trans.Except.ExceptT ServantErr IO [Char]
04:50 <geekosaur> but that's just my impression, I do not know details
04:51 <halogenandtoast> geekosaur: thanks
04:51 <Koterpillar> threshold: repaste?
04:51 bobbypriambodo joined
04:51 poizen joined
04:52 conal joined
04:52 <lpaste_> threshold pasted “Repaste” at http://lpaste.net/352746
04:53 abhiroop joined
04:53 <Koterpillar> ok, well, now the problem is you're adding User and String
04:54 <Axman6> probably need show u
04:54 <threshold> Koterpillar: Thanks. I'll try T.pack
04:54 <Koterpillar> no, the return type is still User
04:54 <Koterpillar> so you need to somehow add User and String and get back a User
04:54 <Koterpillar> what are you actually trying to do? This sounds like an abomination in using Servant
04:54 <Axman6> oh right, yes you need to return a User
04:55 madgoat left
04:55 <threshold> Koterpillar: How did you know that I need to return a User? That would help me quite a bit. My primary confusion is in what exactly is the expected return type.
04:55 <Koterpillar> Post '[JSON] User
04:56 <Axman6> because of the type Routes
04:56 <Koterpillar> this part says you return a User, encoded in JSON
04:56 <Axman6> `Server Routes` translates into User -> Handler User
04:56 <Koterpillar> this is your input: ReqBody '[JSON] User
04:56 serendependy joined
04:57 mrkgnao1 joined
04:57 nemorichard joined
04:57 ner0x652 joined
04:59 cyanobacteria joined
04:59 <threshold> Koterpillar and Axman6, that helps. It's strange that the return type is a Post
04:59 JeanCarloMachado joined
04:59 <Axman6> threshold: if you run :kind! Server oputes in GHCi, you'll see what type you need
04:59 <Koterpillar> I agree, that bit is actually part of the input
05:00 takle joined
05:00 <angerman> how do I selectively enable an Executable in the cabal file based on a flag?
05:00 MP2E joined
05:00 <angerman> e.g. do not build this executable unless -xyz is specificed.
05:04 takle_ joined
05:04 <MarcelineVQ> good question, if's aren't allowed between stanza's appearantly, hmm...
05:05 <threshold> :kind! Server results in Server :: k -> * = Server while :kind! Routes.Routes results in Routes.Routes :: * = Routes
05:06 <Koterpillar> did you mean :kind (or :type?) Server Routes?
05:06 <MarcelineVQ> angerman: and moving to Custom build feels like a step too far
05:07 andyhuzhill joined
05:07 <threshold> Koterpillar: Thanks again. That results in Server Routes :: *
05:07 <Koterpillar> no luck
05:07 mkoenig joined
05:08 <threshold> I need to understand how to transform * -> * to * probably.
05:08 <Koterpillar> well, Server has an associated data type
05:08 <Koterpillar> *is
05:08 <Koterpillar> every Route has one, and when they are combined, the type changes
05:11 <threshold> Koterpillar: This is confusing. Maybe I should start out with something simpler such as a simple WAI app
05:11 <threshold> I do like the idea of not having to serialize JSON
05:11 bruschkov joined
05:11 takle joined
05:12 <threshold> Koterpillar: Do you have experience with this. Is it that difficult to handle JSON?
05:12 <lpaste_> MarcelineVQ pasted “angerman” at http://lpaste.net/9168932458794582016
05:13 <Koterpillar> threshold: you'll get combinators to serve it in every framework
05:14 <MarcelineVQ> angerman: relevant http://cabal.readthedocs.io/en/latest/developing-packages.html#conditional-blocks
05:14 FreeBirdLjj joined
05:14 <angerman> MarcelineVQ: thanks. And now I'm handicaped by ghc-cabal. AHH!!
05:14 mbuf joined
05:15 Argue_ joined
05:15 <Koterpillar> threshold: but I do think you need to try some other framework before servant, just to get a feel
05:21 minn joined
05:21 staffehn joined
05:22 JoshS joined
05:22 shinX joined
05:22 takle joined
05:23 vicfred joined
05:24 <MarcelineVQ> angerman: is it much different?
05:24 <angerman> MarcelineVQ: supports only a single stanza it seems :-/
05:24 <angerman> MarcelineVQ: so maybe it would work, maybe not... but I don't want to go down that rabbit hole now.
05:25 kazagistar joined
05:26 takle joined
05:26 abhiroop joined
05:30 fcpga_te joined
05:30 <piyush-kurur> is there a reason why unboxed vector from the vector library does not have a foldable instance ?
05:31 <piyush-kurur> or is it that the author missed it?
05:32 rcsole joined
05:33 fcpga_te joined
05:33 Rodya_ joined
05:33 erlandsona joined
05:34 montagy joined
05:34 <erlandsona> What's a function with the signature [(a,b)] -> [(a,c)] ? It's definitely a map over a list of pairs... is there a nice way to do this?
05:34 <Koterpillar> :t second -- erlandsona
05:34 <lambdabot> Arrow a => a b c -> a (d, b) (d, c)
05:35 <Koterpillar> map (second negate) [(1, 2), (3, 4)]
05:35 <Koterpillar> > map (second negate) [(1, 2), (3, 4)]
05:35 <lambdabot> [(1,-2),(3,-4)]
05:35 <threshold> Koterpillar: What is the most straightforward framework?
05:35 <erlandsona> second! Yes! I love irc! and you too Koterpillar thanks so much!
05:36 <Koterpillar> threshold: scotty?
05:37 serendependy joined
05:37 DTZUZO joined
05:39 vlatkoB joined
05:40 xall joined
05:40 <threshold> Koterpillar: I'll try it out. Thanks again
05:41 takle joined
05:42 MP2E joined
05:42 juhp__ joined
05:43 andyhuzhill joined
05:45 erlandsona joined
05:45 edwinvdgraaf joined
05:48 harfangk joined
05:48 JeanCarloMachado joined
05:49 ali_bush joined
05:49 ali_bush joined
05:50 Argue__ joined
05:51 olivierw joined
05:51 solenodic joined
05:52 <jvliwanag> guys, is there a generic way of flattening out a tuple with arbitrary lengths? meaning: (((a, b), c), d) -> (a, b, c, d) and the other way around
05:52 fcpga_te joined
05:55 BartAdv joined
05:56 takle joined
05:56 Deide joined
05:57 abhiroop joined
05:59 <jchia> jvliwanag: The only way I can think of is TH.
05:59 fcpga_te joined
06:00 Jeanne-Kamikaze joined
06:00 <jchia> jvliwanag: Or maybe type classes can help let me se
06:02 <jchia> jvliwanag: (((a, a), a), a) -> [a] maybe be doable without TH but I don't know about your original question.
06:02 zariuq joined
06:02 jake1 joined
06:03 raycoll joined
06:05 dec0n joined
06:05 juhp__ joined
06:05 Textmode joined
06:06 takle joined
06:07 xaviergmail_ joined
06:08 osa1 joined
06:10 xcmw joined
06:11 mrkgnao1 joined
06:11 Edith joined
06:13 bruschkov joined
06:13 JeanCarloMachado joined
06:13 zargoertzel joined
06:14 howdoi joined
06:14 <pacak> jvliwanag: You can try ghc generics
06:15 maybefbi joined
06:15 <maybefbi> how hard is the standard chartered interview?
06:17 armyriad joined
06:19 Itkovian joined
06:20 <jvliwanag> yeah jchia, I'd need the original types. pacak - any useful resources for ghc generics? been looking at the hlist stuff as well
06:20 systadmin joined
06:21 bidbudid joined
06:22 takle joined
06:22 <osa1> I wish we had a search bar in Haddock pages for searching for a definition in a library
06:23 cschneid_ joined
06:23 <osa1> currently the closest thing is to go to the index page, list "all", and C-f
06:23 <pacak> jvliwanag: I don't think there are any good tutorials that are up to date, but the idea is to represent datatypes as sums and products of size 2 and all you need is to write a function that operates on those sums and products
06:23 davezd joined
06:24 <pacak> It also provides typeclasses that allow you to extract things like constructor names or field accessors
06:24 Cale joined
06:25 systemfault joined
06:25 <pacak> On small datatypes ghc can generate nice code
06:25 <pacak> But compilation cost is quadratic or more
06:26 <erlandsona> quit
06:26 safe joined
06:29 <jvliwanag> pacak: nice. i've been using shapeless as well on scala which drew inspiration form syb i believe. I hope ghc generics will be similar
06:29 <jvliwanag> i've seen generics-sop as well though. i wonder how that compares
06:30 takle joined
06:32 jedws joined
06:34 rcsole joined
06:36 mrkgnao1 joined
06:37 takle joined
06:37 abhiroop joined
06:38 JeanCarloMachado joined
06:38 Rodya_ joined
06:38 takuan joined
06:39 zeroed joined
06:40 CaptainLex_ joined
06:41 raycoll joined
06:42 systadmin joined
06:44 takle joined
06:45 djellemah_ joined
06:45 CurryWurst joined
06:47 edvorg joined
06:49 LordBrain joined
06:51 roconnor joined
06:51 calincru joined
06:53 JeanCarloMachado joined
06:53 justinfokes joined
06:55 thc202 joined
06:56 fcpga_te joined
06:57 ThomasLocke joined
06:57 ThomasLocke joined
06:58 takle joined
07:00 zeroed joined
07:01 Fairy joined
07:01 raichoo joined
07:01 LucaTM joined
07:04 laz joined
07:04 jutaro joined
07:05 t_h joined
07:05 takle joined
07:06 FreeBirdLjj joined
07:06 abhiroop joined
07:06 freusque joined
07:08 pelegreno joined
07:10 JeanCarloMachado joined
07:12 takle joined
07:15 bruschkov joined
07:15 romanandreg joined
07:16 iphy joined
07:16 text1 joined
07:17 plutoniix joined
07:19 FreeBirdLjj joined
07:19 cur8or joined
07:23 quchen joined
07:23 jhrcek joined
07:24 Argue_ joined
07:24 bjz joined
07:24 raycoll joined
07:28 takle joined
07:28 cyborg-one joined
07:28 connrs joined
07:29 HanlonsRazor joined
07:30 aarvar joined
07:30 JeanCarloMachado joined
07:32 biglama joined
07:33 mbuf joined
07:34 rcsole joined
07:35 edsko joined
07:36 SpinTensor joined
07:37 _sg joined
07:39 bruschkov joined
07:40 Xanather joined
07:40 bruschkov joined
07:41 calincru joined
07:41 olivierw joined
07:41 clmg joined
07:42 <clmg> How do I use `lookupExtent` in Brick? It's basic monadic stuff but the example gives me errors: https://github.com/jtdaugherty/brick/blob/7d2fc92405a74816d4c3f8b9e2d4a00f42704bf0/docs/guide.rst#extents
07:43 greglearns joined
07:43 bruschkov joined
07:43 Rodya_ joined
07:43 <clmg> using a <- will make my entire do block "into" that monad. How do I work with this?
07:44 <c_wraith> oh, hey. I used to work with brick's author
07:44 <clmg> c_wraith: hi
07:45 <clmg> brick is pretty cool. if only I could figure out how to use it!
07:45 connrs joined
07:45 takle joined
07:45 <kosmikus> jvliwanag: do you have questions about generics-sop?
07:47 edwinvdgraaf joined
07:47 <c_wraith> clmg: it looks like you should be using lookupExtent in appStartEvent and/or appHandleEvent
07:47 <c_wraith> clmg: since those are required to be in EventM anyway
07:48 <clmg> c_wraith: ah I see. thanks.
07:48 <c_wraith> clmg: if you need the extent data elsewhere, I guess you need to throw it into your state value.
07:49 <clmg> c_wraith: I think that's whats going to have to happen :-(
07:49 plutoniix joined
07:50 JeanCarloMachado joined
07:50 zeroed joined
07:52 <lpaste_> threshold pasted “example” at http://lpaste.net/352752
07:53 <threshold> Ignore ^
07:54 fcpga_te joined
07:54 mrkgnao1 joined
07:54 abhiroop joined
07:56 xaviergmail_ joined
07:56 juhp__ joined
07:56 xall joined
07:57 free_beard joined
07:58 mszczygiel joined
07:59 <Cooler> i have been following this https://youtu.be/RDalzi7mhdY?t=2699 video on parser combinators
07:59 takle joined
07:59 <Cooler> how do you deal with recursive definitions for the parser?
08:00 <Cooler> in the json spec http://www.json.org/ an object parser needs a value parser and so does an array parser
08:00 <Cooler> but a value parser needs an object and an array parser
08:00 jhrcek joined
08:03 raichoo joined
08:03 masterguru joined
08:04 <Cale> Cooler: You just use recursion.
08:05 <Cooler> Cale, well i am actually doing this in javascript but in a functional way
08:05 <Cooler> https://plnkr.co/edit/eppjircbxmwL47lLlMsR?p=preview
08:05 <Cooler> i am building parsers for various things
08:06 <Cooler> basically that means returning functions that take a string as input
08:06 raichoo joined
08:07 takle joined
08:09 <Cooler> so in order to build a value parser i need an object and array parser
08:09 <Cooler> but in order to build those i need a value parser
08:10 <Cooler> so its gonna go into an infinite loop
08:11 nemorichard joined
08:11 mfukar joined
08:11 Beetny joined
08:11 afarmer joined
08:11 xcmw joined
08:12 systadmin joined
08:12 <cocreature> Cooler: that’s not an infinite loop, that’s mutual recursion
08:13 <cocreature> it can of course turn into an infinite “loop” if you have no basecase
08:13 mzf joined
08:14 kiltzman joined
08:14 Itkovian joined
08:14 takle joined
08:14 kiltzman joined
08:15 kritzcreek joined
08:15 buckowski joined
08:15 andyhuzhill joined
08:15 thatguy joined
08:16 Kuros joined
08:17 bruschkov joined
08:17 insitu joined
08:18 kiltzman joined
08:18 jle` joined
08:18 jle` joined
08:19 kiltzman joined
08:20 slomo joined
08:20 kiltzman joined
08:21 kiltzman joined
08:21 ishtu joined
08:22 takle joined
08:22 Iskarlar joined
08:22 kiltzman joined
08:25 JeanCarloMachado joined
08:26 connrs joined
08:27 minn joined
08:27 andyhuzhill joined
08:28 CurryWurst joined
08:29 tfc joined
08:29 mohsen_ joined
08:31 connrs joined
08:31 freusque joined
08:32 thatguy joined
08:34 armyriad joined
08:34 mrkgnao1 joined
08:34 ramzifu joined
08:35 rcsole joined
08:35 raichoo joined
08:36 castlelore joined
08:36 tripped joined
08:37 kthnnlg joined
08:38 <gfixler> Bartosz keeps talking about C x C -> C in his bifunctors video, but I don't get why it's not C x D -> E
08:38 takle joined
08:38 zeroed joined
08:39 JeanCarloMachado joined
08:39 coot joined
08:40 bobbypriambodo joined
08:41 <Cooler> any ideas?
08:41 <Cale> gfixler: It could be, but maybe he's just not interested in bifunctors of that sort
08:42 <gfixler> Cooler: I feel like he just took everything from C, D, and E, and smooshed them into one category C
08:42 <gfixler> and that's a cartesian category...?
08:42 <gfixler> oh, I found it
08:43 <Cale> gfixler: If he's talking about Haskell, there's practically only one category we're usually concerned with anyway
08:43 <gfixler> he says "Because we're talking Haskell, it will be a category of C with itself"
08:43 <gfixler> Cale: yep
08:43 <gfixler> I must have dozed off @35:00
08:43 <gfixler> I did like that C x C -> C looked monoidal
08:43 <gfixler> and at the end of the talk he mentions something about its monoidalness
08:44 <gfixler> this answers a question I had earlier in the talk
08:44 FreeBirdLjj joined
08:44 <gfixler> which was "But aren't all of these the same category in Haskell?"
08:45 <tdammers> 19
08:45 Rodya_ joined
08:45 <tdammers> hrrngh, ignore that
08:46 <gfixler> oh, right, it was because he said C x C -> C is really a functor from a *product* of 2 Hasks to Hask
08:46 <gfixler> and I thought "But aren't products of Hask still just Hask?"
08:46 fbergmann joined
08:46 <gfixler> so far, this is what's been tough about CT - all these little teeny details
08:47 graygoose124 joined
08:47 Rodenbach joined
08:48 <gfixler> and if C x C -> C, then it follows that (C x C) x (C x C) -> C x C -> C
08:48 <gfixler> and so on
08:48 albertid joined
08:48 <gfixler> infinite recursion
08:48 <gfixler> unless I'm missing something
08:48 systadmin joined
08:49 Iskarlar joined
08:50 insitu joined
08:52 fizbin joined
08:52 nshepperd joined
08:53 <Cale> Hm?
08:53 <Cale> I'm confused about what you mean.
08:53 <gfixler> I may be as well
08:53 <Cale> C x C is a category whose objects are pairs of objects of C
08:53 <gfixler> right
08:53 <gfixler> but we're reusing C
08:53 <Cale> and whose arrows are pairs of arrows
08:53 <gfixler> which means some elements of C are C x C
08:53 <gfixler> no?
08:54 <gfixler> C is made of objects, some of which are products of things in C
08:54 <Cale> i.e. an arrow (X,Y) -> (Z,W) consists of some pair (f,g) with f: X -> Z and g: Y -> W
08:54 takle joined
08:54 <Cale> We're taking a product of categories, not a product on objects of those categories
08:55 <gfixler> this is a constant source of confusion for me
08:55 <gfixler> mixing up levels
08:56 pleax joined
08:56 alfredo joined
08:56 nemorichard joined
08:57 <gfixler> now I'm confused about the ->
08:57 <gfixler> C x C -> C
08:58 <gfixler> I thought it meant that the product of two categories C was itself in C
08:59 mmn80 joined
09:00 FreeBirdLjj joined
09:00 govg joined
09:02 <gfixler> I think it's Hask tripping me up
09:02 takle joined
09:02 <gfixler> Bartosz wrote C x C -> C as a kind of stand-in for Hask, I think
09:02 <gfixler> in which case, what I was trying to say is [mostly?] right
09:03 <Cale> Well, it would be Hask x Hask -> Hask
09:03 <gfixler> yeah
09:03 <Cale> So, such a functor would take pairs of types to types
09:03 <gfixler> yep
09:03 Yuras joined
09:03 <gfixler> which he goes over
09:03 <gfixler> and it is recursive, because you can keep doing that, and always stay in types
09:03 <gfixler> and that's where the monoidal nature of the category comes in
09:03 <gfixler> although you need an identity
09:04 <gfixler> I suppose it's a semigroup category otherwise?
09:04 harfangk joined
09:04 <gfixler> maybe the word cartesian needs to go in there, too?
09:04 solenodic joined
09:05 AndreasK joined
09:06 kakashiAL joined
09:06 mbuf joined
09:06 albertid joined
09:06 janos joined
09:07 unK_ joined
09:07 janos joined
09:07 takle joined
09:08 Cooler joined
09:10 mattyw joined
09:10 unK_ joined
09:14 marr joined
09:14 cschneid_ joined
09:15 tomphp joined
09:15 takle joined
09:15 mszczygiel joined
09:16 louispan joined
09:17 justinfokes joined
09:17 JeanCarloMachado joined
09:19 rcsole joined
09:19 zeroed joined
09:19 zeroed joined
09:20 Itkovian joined
09:22 mstruebing joined
09:23 mdarse joined
09:23 janos joined
09:23 gregman_ joined
09:23 ilja_kuklic joined
09:24 JeanCarloMachado joined
09:25 janos joined
09:26 danza joined
09:27 <maybefbi> im unable to avoid mistakes without a type checker. is that acceptable for a live coding interview?
09:27 <maybefbi> did the interviewer forgive minor type errors?
09:27 <maybefbi> in your case?
09:28 augur joined
09:30 mrkgnao1 joined
09:32 <maybefbi> example using (:) instead of (++)
09:36 castlelore joined
09:36 castlelore joined
09:37 Atrumx joined
09:38 fcpga_te joined
09:38 takle joined
09:40 castlelore joined
09:40 castlelore joined
09:41 srbaker joined
09:43 FreeBirdLjj joined
09:44 greglearns joined
09:44 takle joined
09:44 marfoldi joined
09:48 avn joined
09:48 edwinvdgraaf joined
09:48 janos joined
09:49 Rodya_ joined
09:50 bobbypriambodo joined
09:52 olivierw joined
09:53 xeviox joined
09:54 bobbypriambodo joined
09:55 <xeviox> is it possible to put every dependency into the repository (in source form like it's handled by Go) with any of the package managers?
09:55 <xeviox> (or build tools)
09:56 _sg joined
09:57 tfc[m] joined
09:57 pleax joined
09:57 bjz_ joined
09:57 shurick joined
09:57 Wizek joined
09:58 Wizek__ joined
09:58 KiwiAP joined
10:00 Hafydd joined
10:00 Hafydd joined
10:00 whaletechho joined
10:00 systadmin joined
10:01 BernhardPosselt joined
10:01 <BernhardPosselt> what is *> used for
10:02 <BernhardPosselt> deprecated?
10:03 <jle`> BernhardPosselt: *> is 'andThen'
10:03 mszczygiel joined
10:03 <jle`> used for 'sequencing' applicative actions
10:03 maffh joined
10:03 jgertm joined
10:04 <jle`> BernhardPosselt: putStrLn "hello" *> putStrLn "world" will return an IO action that prints 'hello', then 'world'
10:04 calincru joined
10:04 bruschkov joined
10:05 <maybefbi> in case of applicative parsers it can be used to skip spaces
10:05 <maybefbi> skipSpaces *> parseSomethingElse
10:05 <tfc[m]> isn't *> for applicatives, what >> is for monads?
10:05 <jle`> tfc[m]: *> is for Applicatives what *> is for Monads
10:05 <mauke> >>
10:06 <jle`> *> works for Monads too
10:06 dsr[m] left
10:06 teufel7[m] left
10:06 <jle`> so "*> for monads" is just *>
10:06 ryantriangles[m] left
10:06 rcat joined
10:06 phaji joined
10:06 Ugzuzg[m] left
10:06 ashaman[m] left
10:06 bennofs_matrix left
10:06 KiwiAP left
10:06 ntrn[m] left
10:06 tiltec[m] left
10:06 <mauke> only because Applicative is now a superclass of Monad
10:06 rhuobhe[m] left
10:06 pawel[m] left
10:06 cgfloare[m] left
10:06 dpluy[m] left
10:06 fazil[m] left
10:06 boj left
10:06 saetokuz[m]1 left
10:06 brian[m] left
10:06 samsam999[m] left
10:06 ashish3805[m] left
10:07 <maybefbi> tfc[m], *> can be parallelized unlike >>, and *> cannot avoid the values inside their applicative functors
10:07 <gfixler> :t (*>)
10:07 <lambdabot> Applicative f => f a -> f b -> f b
10:07 <tfc[m]> i see
10:08 <tfc[m]> but when i am using stuff like MyType <$> (string "foo" *> many1 digit) then "*>" also cannot be parallelised?
10:08 mettekou joined
10:08 <maybefbi> in that context no
10:08 <jle`> it depends on the Applicative instance you're using
10:08 <maybefbi> in that context you are using a parser
10:09 <maybefbi> which is an applicative instance
10:09 <maybefbi> but i dont think it allows any form of parallel computing
10:09 <gfixler> that's something I've wondered; how can parsers be applicative if they're reading characters in sequentially?
10:09 <jle`> every instance gets to implement *> however it wants, so whether or not *> is parallel is up to the specific instance
10:10 <jle`> gfixler: applicative doesn't necessarily mean parallel
10:10 <jle`> the Applicative instance for IO sequences IO action sequentially
10:10 <gfixler> jle`: sure
10:10 <gfixler> I guess my real question is about the point of applicative parsing in general
10:11 <gfixler> but I'm just wondering aloud now
10:11 ragepandemic joined
10:11 <tfc[m]> gfixler: well the syntax is really nice.
10:12 calincru joined
10:12 <maybefbi> gfixler, i guess it allows parsers to be reused to generators. but im not sure
10:12 <maybefbi> iirc one of the laws of <*> allow this
10:12 <maybefbi> s/to generators/as generators/
10:12 <gfixler> I wondered about things like parsing non-sequential things
10:12 <gfixler> e.g. trees of information
10:13 chpatrick joined
10:13 chpatrick left
10:13 xaviergmail_ joined
10:13 <tfc[m]> yeah but in unparsed form they are sequential, no matter how non-sequential they are after parsing
10:14 nemorichard joined
10:14 <gfixler> parsers don't have to be only of text, though
10:14 <gfixler> you can have parsers of sensor input, e.g.
10:14 dhil joined
10:15 xcmw joined
10:15 <gfixler> I could imagine parsing something from its center outward
10:15 <gfixler> especially if it were already some kind of binary tree - you could keep doing that, recursively, perhaps
10:16 locallycompact joined
10:17 <BernhardPosselt> jle`: oh nice :)
10:17 <BernhardPosselt> haskell people have a strange fetish for weird infix functions
10:18 <BernhardPosselt> names*
10:19 justinfokes joined
10:19 JeanCarloMachado joined
10:22 staffehn joined
10:22 aarvar joined
10:23 DuckSoft joined
10:23 dramforever joined
10:24 Xanather joined
10:24 Schrostfutz joined
10:25 oish joined
10:26 bobbypriambodo joined
10:27 jaspervdj joined
10:28 <dramforever> What are some convincing arguments that show the benefits of non-strict semantics outweigh the performance penalty of a lazy implementation?
10:29 <ezyang> I always notice the thing where the naive definition of 'map' doesn't take O(n) space
10:29 <ezyang> streams are everywhere
10:29 <tdammers> transparent eta reduction, infinite lists, "TCO" for "free"
10:30 <Rembane> Working with infinity in a reasonable way
10:30 <dramforever> Uh, actually I asked it badly. I'm more interested arguments in the other direction, showing that lazy evaluation isn't really inefficient
10:31 <dramforever> What are some convincing arguments that show the performance penalty of a lazy implementation is small enough to be worth it?
10:31 <ezyang> there's this thing called strictness analysis which is all about optimizing away the cost of lazy evaluation when it's not needed
10:32 drdo left
10:32 <tdammers> dramforever: to me, the kicker argument in this context is that the lazy evaluation overhead is linear, but the gain, when it exists, is exponential-ish
10:33 <dramforever> Do we have something like Debunking the 'Expensive Lazy Evaluation' Myth?
10:33 <dramforever> (Akin to Debunking the 'Expensive Procedure Call' Myth, or, Procedure Call Implementations Considered Harmful, or, Lambda: The Ultimate GOTO)
10:34 <ezyang> dramforever: Well, laziness is kind of expensive
10:34 CoolerExtreme joined
10:34 <tdammers> afaik, procedure calls *are* expensive, just not in an interesting way that would make for a good argument against using them
10:34 psychicist__ joined
10:34 <ezyang> But it's all relative. Tell me why the overhead of a PHP interpreter is worth it
10:35 esssing joined
10:35 janos__ joined
10:36 JeanCarloMachado joined
10:37 <dramforever> ezyang: What does your experience tell you about strictness analysis? How well does it work in practice?
10:37 marfoldi joined
10:37 rgr joined
10:37 <ezyang> I don't know, because for the things I work on CPU is basically never the bottleneck
10:37 twanvl joined
10:38 dramforever_ joined
10:41 <dramforever> Sorry, was disconnected earlier
10:41 rossberg joined
10:41 <tdammers> ezyang: the overhead of a PHP interpreter is worth it because PHP is all you know, and all you will ever be comfortable with, and besides, PHP7 is fast now, yolo
10:42 janos__ joined
10:43 pleax joined
10:44 oisdk joined
10:45 bjz joined
10:45 <dramforever> tdammers: Sadly too many are obsessed with making their 3s-run-time network-intensive apps 10us faster, even if it's just about a *claim* that 'strict evaluation is faster than lazy evaluation'
10:45 livingbeef joined
10:46 Ch3ck joined
10:48 JeanCarloMachado joined
10:48 oisdk_ joined
10:49 coot joined
10:49 edwinvdgraaf joined
10:53 <ezyang> Ooh, programming with Brick is fun
10:54 Rodya_ joined
10:55 Salih joined
10:55 mrkgnao1 joined
10:57 <gargawel> Hi, is there something like a priority queue in base ?
10:57 cchalmers joined
10:57 cchalmer_ joined
10:57 JeanCarloMachado joined
10:59 bruschkov joined
10:59 <ezyang> gargawel: Not publically. (There actually is a priority queue for the event manager but you're not supposed to use it)
11:00 <gargawel> ezyang: OK. Seems quite surprising.
11:01 Claudius1aximus joined
11:02 FragByte joined
11:03 systadmin joined
11:03 cchalmers joined
11:08 cloudhead joined
11:10 <jophish_> Is there a way to install a packages documentation only, so I can browse documentation without building the package?
11:13 vektorweg1 joined
11:13 halogenandtoast joined
11:13 augur joined
11:15 caumeslasal joined
11:15 doomlord joined
11:16 pleax joined
11:18 xcmw joined
11:19 justinfokes joined
11:22 JagaJaga joined
11:27 mpsag joined
11:28 greglearns joined
11:28 mettekou_ joined
11:29 janos joined
11:29 maybefbi joined
11:30 cschneid_ joined
11:31 mettekou_ joined
11:31 t_h joined
11:31 vergil_s joined
11:32 alanb99 joined
11:32 silver joined
11:32 <systadmin> heyo
11:32 alanb99 left
11:33 ishtu joined
11:34 merijn joined
11:35 bruschkov joined
11:36 <quchen> gargawel: You can easily build a priority queue as a wrapper around a »Map Double a«. Map has an API function to get the element with the largest/lowest index.
11:36 <quchen> Map isn’t in base, but part of the used-everywhere-de-facto-standard.
11:36 <systadmin> Is there a way to remove a certain element from a list?
11:36 <quchen> :t delete
11:37 <lambdabot> Eq a => a -> [a] -> [a]
11:37 <systadmin> Like an expression that removes the 2nd and 4th element?
11:37 <quchen> > delete 3 [1..10]
11:37 <lambdabot> [1,2,4,5,6,7,8,9,10]
11:37 ziocroc joined
11:37 lukaramu joined
11:37 <systadmin> > delete 2, 4 [1, 2, 3, 4]
11:37 <lambdabot> <hint>:1:9: error: parse error on input ‘,’
11:37 <quchen> I don’t think there’s a standarf function for indexed deletion.
11:37 janos joined
11:38 <gfixler> > foldr delete [2,4] [1,2,3,4]
11:38 <lambdabot> []
11:38 <gfixler> done
11:38 <yushyin> :t deleteBy
11:38 <lambdabot> (a -> a -> Bool) -> a -> [a] -> [a]
11:38 fcpga_te joined
11:39 mr_sm1th joined
11:39 <quchen> > let deleteNth n xs = let (as,b:bs) = splitAt n xs in as ++ bs in deleteNth 4 "hello world" -- Delete index N.
11:39 <lambdabot> "hell world"
11:39 <gfixler> guess that should have been reversed
11:39 <gfixler> > foldr delete [1,2,3,4] [2,4]
11:39 <lambdabot> [1,3]
11:40 <systadmin> :t foldr
11:40 <quchen> systadmin: You can write the function yourself as an exercise.
11:40 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
11:40 halogenandtoast joined
11:40 <gfixler> what about take and drop?
11:41 <quchen> It’s similar to how »drop« and »take« are implemented, only that you’re not dropping everything up to/beginning from your element.
11:41 <gfixler> > let x = 3 in xs = [0..9] in take x xs ++ drop x xs
11:41 <lambdabot> <hint>:1:17: error:
11:41 <lambdabot> parse error on input ‘=’
11:41 <lambdabot> Perhaps you need a 'let' in a 'do' block?
11:41 <gfixler> > let x = 3, xs = [0..9] in take x xs ++ drop x xs
11:41 <lambdabot> <hint>:1:10: error: parse error on input ‘,’
11:41 <gfixler> > let x = 3; xs = [0..9] in take x xs ++ drop x xs
11:42 <lambdabot> [0,1,2,3,4,5,6,7,8,9]
11:42 <gfixler> I give up
11:42 <gfixler> > let x = 3; xs = [0..9] in take x xs ++ drop (x + 1) xs
11:42 <lambdabot> [0,1,2,4,5,6,7,8,9]
11:42 <quchen> ?check \n xs -> xs == take n xs ++ drop n (xs :: Int)
11:42 <lambdabot> error:
11:42 <lambdabot> • Couldn't match expected type ‘Int’ with actual type ‘[()]’ • In the second...
11:42 magthe joined
11:43 <quchen> ?check \n xs -> xs == take n xs ++ drop n (xs :: [Int])
11:43 <lambdabot> +++ OK, passed 100 tests.
11:43 <quchen> Take plus drop is id :-)
11:43 <gfixler> :)
11:43 petermw joined
11:44 <quchen> gfixler: And splitAt n xs = (take n xs, drop n xs)
11:44 <quchen> (But more efficient)
11:47 <gfixler> > let x = 3; xs = [0..9] in map snd $ filter ((/=x) . fst) (zip [0..] xs)
11:47 <lambdabot> [0,1,2,4,5,6,7,8,9]
11:47 groscoe joined
11:51 Mortomes|Work joined
11:51 wlemuel joined
11:52 chpatrick joined
11:52 JeanCarloMachado joined
11:52 <chpatrick> is it possible to have a buildEnv that has the dependencies of haskell packages A and B without building either?
11:53 prkc joined
11:54 _sg joined
11:55 chpatrick left
11:55 <ongy> if you can get the sources for A and B you can `cabal install --dependencies-only` both of them
11:55 <ongy> aaand I'm to late
11:56 nxtr joined
11:56 Miroboru joined
11:57 Rodya_ joined
12:01 <flxw> Hi. Could somebody please tell me if I am wrong, or if ghc-mod's refine command is not working for me. :-) Minimal example:
12:01 <flxw> f :: [Int] -> [Int]; f x = _a; main=return()
12:01 <flxw> When I try to refine _a by (:) it refines _a to (:) _a1 _a2.
12:02 <flxw> but when I try to refine by "filter", it does put in the word filter, but wothout the new holes fo rthe argumetns.
12:02 Snircle joined
12:03 jones__ joined
12:04 <flxw> ie. $ ghc-mod$ ghc-mod refine t.hs 1 28 filter
12:04 <cocreature> flxw: maybe it only works for constructors? I don’t use ghc-mod so I sadly can’t be of more help
12:04 <flxw> 1 28 1 30 "filter"
12:04 <flxw> but the ad showed it with filter! ;_)
12:05 <flxw> *on
12:05 <cocreature> flxw: in that case reporting a bug is probably not a bad idea :)
12:07 <flxw> yeah. I haven't used ghc-mod before, so I wanted to at least check whether I'm completely off or not.
12:08 Itkovian joined
12:08 <flxw> Just for completeness sake: www.mew.org/~kazu/proj/ghc-mod/en/emacs.html
12:09 <flxw> but you'reright, I'll file a bug tonight. (I waswwant to try the repos HEAD before)
12:10 <flxw> *want
12:11 <tabaqui1> hi all
12:11 <gfixler> > liftA2 (++) fst snd $ (take 3 &&& drop (3 + 1)) "hello"
12:11 <Schrostfutz> The type of foldl is foldl :: Foldable t => (b -> a -> b) -> b -> t a -> b. What is the -> t a doing in the definition? foldl takes only two paramerters, not three, doesn't it?
12:11 <lambdabot> "helo"
12:11 <tabaqui1> where can I find concurrency patterns in haskell?
12:11 <tabaqui1> I have to write some code, but in my naive implementation it's too complicated
12:12 <gfixler> tabaqui1:http://chimera.labs.oreilly.com/books/1230000000929
12:12 NickHu joined
12:12 <tabaqui1> gfixler: looks fine, thanks
12:12 <gfixler> Schrostfutz: no, it takes 3
12:13 quchen joined
12:13 <Schrostfutz> gfixler: Oh, you're right, thanks.
12:13 <gfixler> Schrostfutz: it takes the fold function, the starting value/accumulator, then the value to operate on
12:14 <gfixler> Schrostfutz: have a look at the behavior of foldr, foldl, and foldl' if you haven't encountered anything about them yet
12:15 <Schrostfutz> gfixler: I'm currently trying to understand the implemenation of foldl using foldr which is described in readl world haskell.
12:15 <quchen> Hah, that’s a tough one.
12:16 <gfixler> Schrostfutz: okay, I'm guessing that RWH goes over the issues with strictness and such
12:16 <quchen> I use it as a mental exercise every now and then ;-)
12:16 <Schrostfutz> quchen: Yeah, I noticed...
12:16 <gfixler> I should probably look through that again - it's been a couple of years, and I remember it being tough back then
12:17 <quchen> (And foldr does not have an accumulator by the way.)
12:18 <quchen> Schrostfutz: I wasn’t able to come up with the solution when I heard about foldr-for-foldl, but studying the solution proved useful.
12:18 <quchen> Schrostfutz: Try evaluating foldrViaFoldl (+) 0 [1,2,3] by hand.
12:19 <gfixler> it doesn't?
12:19 <gfixler> :t foldr
12:19 halogenandtoast joined
12:19 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
12:19 <gfixler> what's that b?
12:19 <quchen> (If you have the solution already. I could give it to you if you want.)
12:19 <quchen> b is the type of the resulting structure.
12:19 <quchen> ?src foldr
12:19 <lambdabot> foldr f z [] = z
12:19 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
12:19 <Schrostfutz> gfixler: I think it's not an accumulator but you rather use an 'init' value
12:19 <quchen> This accumulates nothing.
12:20 <gfixler> alright, semantics
12:20 <Schrostfutz> But my terminology is likely way of
12:20 <gfixler> I think of all the bs as b at different times
12:20 Itkovian joined
12:20 <gfixler> in the (a -> b -> b) it's the current and next b
12:20 <quchen> Semantics describe the meaning of things, and it’s fairly important.
12:20 <gfixler> the b arg is the starting b
12:20 <gfixler> and the final b is the ultimate/resultant b
12:22 richardcq joined
12:22 pavonia joined
12:23 <quchen> No, the b arg is not the starting b.
12:23 <quchen> There is no starting b. There is an ending b.
12:23 kiltzman joined
12:23 <quchen> (The 2nd argument to foldr)
12:23 <gfixler> > foldr (+) 0 [1,2,3,4]
12:23 <lambdabot> 10
12:23 <gfixler> > foldr (+) 5 [1,2,3,4]
12:23 <lambdabot> 15
12:23 <gfixler> sure looks like a starting value to me
12:24 <merijn> > foldr f z [1..5] :: Expr
12:24 <quchen> > foldr (:) [] [1,2,3,4] -- [] is not a starting value.
12:24 <lambdabot> f 1 (f 2 (f 3 (f 4 (f 5 z))))
12:24 <lambdabot> [1,2,3,4]
12:24 <merijn> gfixler: Looks like an ending to me...
12:24 <gfixler> is that why I got out 0 and 5?
12:25 <merijn> > foldr (+) 5 [1..5] :: Expr
12:25 <quchen> In »foldr f z xs«, »z« is not touched until the entire list »xs« is traversed.
12:25 <lambdabot> 1 + (2 + (3 + (4 + (5 + 5))))
12:25 xaviergmail_ joined
12:25 <gfixler> are you talking about evaluation order?
12:26 cchalmers joined
12:26 deank joined
12:26 <quchen> No. »foldl f z xs« recursively calls itself, and modifies the »z« in the process. That’s why we say that »z« accumulates something.
12:26 <quchen> Foldr does not do this.
12:27 <quchen> There is no recursion in foldr that modifies part of it. It builds up a chain of function calls (as merijn demonstrated).
12:27 <cocreature> if you want to be pedantic: foldr for lists doesn’t do this :)
12:27 <quchen> There is no field that is repeatedly modified to hold the result.
12:27 <quchen> cocreature: foldr for Foldable can do anything it wants because Foldable has no laws, so yeah.
12:28 <gfixler> I see where you're coming from now
12:28 <gfixler> and it was semantics
12:28 <gfixler> I wasn't concerned with the implementation of foldr under the hood
12:28 <quchen> Yes, it was semantics. Like calling »value« »rabbit« is semantics.
12:28 <gfixler> you sure are upset
12:28 <quchen> It likely leads to misunderstandings.
12:29 <gfixler> it's good, though, what you're doing
12:30 <gfixler> makes sure a lot of people more shy than me will never dare ask questions in here
12:30 lep-delete joined
12:30 <Cooler> why does fmap length $ (,) <$> getLine <*> getLine return 1?
12:31 <Cooler> >let x = fmap length $ (,) <$> getLine <*> getLine
12:31 <liste> Cooler: because the Foldable instance of (,) concerns just the first element
12:31 <liste> > length (1,2)
12:31 <lambdabot> 1
12:31 abhiroop joined
12:32 <liste> Cooler: http://hackage.haskell.org/package/base-
12:32 <liste> the second element*
12:32 <liste> not the first
12:33 <liste> foldMap id (1,2)
12:33 <liste> > foldMap id (1,2)
12:33 <lambdabot> error:
12:33 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M161567402854...
12:33 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
12:33 Ch3ck joined
12:33 <merijn> liste: Numbers aren't monoids :p
12:33 <liste> yeah
12:33 <liste> :/
12:33 <liste> > toList (1,2)
12:33 <lambdabot> error:
12:33 <lambdabot> Ambiguous occurrence ‘toList’
12:33 <lambdabot> It could refer to either ‘F.toList’,
12:33 <liste> results in [2]
12:33 Argue_ joined
12:34 <quchen> > F.toList (1,2)
12:34 <lambdabot> [2]
12:34 <richardcq> Hi guys. I'm building an application using hedis (for the redis key-value store) and control.concurrent, and I'm thinking that the best way to handle locking/unlocking would be with setup, tear down, and rollback on error functions and a global list of keep-lock-alive lambdas that the main thread goes through every so often. I think this is a use case for making my own monad, but I just wanted some suggestions to make sure I'm
12:34 janos joined
12:35 codesoup joined
12:35 Iskarlar joined
12:38 jluttine joined
12:38 prkc joined
12:40 <quchen> Schrostfutz: Anyway, foldr in terms of foldr is a good riddle, but probably not necessary as a beginner. But it’s a very interesting thing to learn about. The basic idea is that you can »add another parameter« to foldr that holds an arbitrary value, and then use that to implement an accumulator.
12:41 <quchen> Here are a bunch of simpler versions of the same idea: https://github.com/quchen/articles/blob/master/useful_techniques.md#bouncy-folds
12:43 jones__ left
12:43 redShadow joined
12:43 <quchen> Schrostfutz: In the »find2nd« example, there is a Bool parameter which says whether something has been found already.
12:43 <mbrock> can I tell ghci to please optimize and compile the module I'm fiddling with?
12:44 <quchen> mbrock: You have to compile it externally, GHCi will load the compiled version if it’s there I think
12:44 <cocreature> shouldn’t -fobject-code help?
12:44 <quchen> Should it? That sounds interesting
12:44 <cocreature> I thought it does, but maybe I’m wrong
12:45 <cocreature> -fobject-code and -O2 if you want to optimize
12:45 NickHu joined
12:45 <quchen> When you start GHCi with -O it complains that this conflicts with --interactive :-/
12:45 <cocreature> quchen: after -fobject-code it doesn’t complain anymore
12:46 <quchen> Woah
12:46 psychicist__ joined
12:46 <mbrock> I think it does work, thanks. Using cabal repl --ghc-options='-fobject-code -O2'
12:47 <cocreature> the main advantage of -fobject-code however is that it reloads significantly faster since it only recompiles a single module instead of all modules
12:47 <Schrostfutz> quchen: Thanks, I'll look into that.
12:48 <quchen> Schrostfutz: The good news is that once you understand foldl-via-foldr, you probably know everything about foldl/foldr there is to know. :-)
12:48 <Schrostfutz> quchen: Haha, question is just in how many weeks that will be :D
12:49 NickHu joined
12:49 <cocreature> working through a solution for foldl-via-foldr is not that hard. coming up with it yourself is really hard (I don’t think I’ve come up with a solution myself)
12:50 <quchen> Schrostfutz: I can’t recommend evaluating »foldlViaFoldr (+) 0 [1,2,3]« by hand enough. The key is understanding foldr’s »fourth parameter«, and once you have that, everything becomes clear.
12:51 gawen joined
12:51 edwinvdgraaf joined
12:51 vergil_s joined
12:52 <Cooler> is there an ide for haskell that lets you click on functions to get their source?
12:52 wei2912 joined
12:52 <Cooler> like the source for foldr for instance
12:52 sdothum joined
12:52 <Schrostfutz> quchen: So far I as I understand it the step function does not implement the step but binds the n+1 parameters to n...
12:52 <quchen> Cooler: None that I know of. But Lambdabot has lots of common functions in simple notation stored.
12:52 <quchen> ?src foldr
12:52 <lambdabot> foldr f z [] = z
12:52 <lambdabot> foldr f z (x:xs) = f x (foldr f z xs)
12:52 laxdog_ joined
12:53 <quchen> Schrostfutz: Right, the step function uses the excess parameter.
12:53 deepfire joined
12:53 <cocreature> Cooler: I think https://github.com/aloiscochard/codex can do that (it’s not an idea but you can integrate tags with at least emacs & vim and probably most other editors)
12:53 <quchen> Schrostfutz: foldr f z (x:xs) foo = f x (foldr f z xs) foo
12:54 <quchen> The foldr ignores the foo, but the f uses it :-)
12:54 <quchen> (Or may use it, rather)
12:55 Salih joined
12:55 pleax joined
12:56 xeviox joined
12:56 davezd joined
12:57 Miroboru joined
12:58 cmsmcq joined
12:58 calincru joined
13:02 Rodya_ joined
13:02 <Cooler> do you need to import something for liftA2?
13:02 <Cooler> Control.Applicative?
13:06 janos joined
13:06 ccomb joined
13:08 maksim__ joined
13:09 <ski> @index liftA2
13:09 <lambdabot> Control.Applicative
13:10 jluttine joined
13:10 <Schrostfutz> quchen: I think I'm stuck here: http://sprunge.us/HURM The last two steps are likely wrong
13:11 thunderrd joined
13:11 xcmw joined
13:12 halogenandtoast joined
13:12 jutaro joined
13:14 asthasr joined
13:16 oish joined
13:16 Kreest__ joined
13:18 dequbed joined
13:21 justinfokes joined
13:21 bobbypriambodo joined
13:22 Gloomy joined
13:22 <Schrostfutz> quchen: Now I've got it: http://sprunge.us/dBSE Thanks for the help!
13:23 dhil joined
13:24 mrleet joined
13:24 <Schrostfutz> So you basically hack the accumulator onto the foldr function. I don't have much experience with haskell yet but this smells for me like bad style since I rely on how the foldr function is implemented such that I can pass the excess parameter to my step parameter, don't I?
13:25 shookees`alt joined
13:26 fcpga_te joined
13:27 travv0 joined
13:29 shookees`alt joined
13:31 lukiramu joined
13:32 halogenandtoast joined
13:32 pleax joined
13:33 <Squarism> After dealing with haskell for 8 months this is my interpretion of haskells deal with IO Monad. Correct me if im wrong. The IO Monad (modelling "an effect") main purposes are - 1. Makes valus from io inaccessible outside the Monad - thus makes it impossible to do io computations wo returning IO values. And further lets 2. provides a single point callback to track interactions with the outside. So, atleast in theory, one can set up an execution that is
13:33 <Squarism> completely deterministic.
13:34 <merijn> Squarism: Rather relevant: https://blog.jle.im/entry/io-monad-considered-harmful.html
13:34 adeohluwa joined
13:34 <Squarism> ops should be "And further ... makes IO computations explicit in the type signatures of function"
13:35 <merijn> And no, point 2 isn't really (and by that I mean: really isn't) true
13:35 mmn80 joined
13:36 newbie1 joined
13:36 <merijn> Squarism: One of the key insights is that in Haskell we distinguish two things: 1) evaluation (which covers the behaviour of Haskell as described in the standard) and 2) execution (which covers IO). The 2nd is unobservable from the first and thus cannot influence the behaviour of how expressions reduce
13:37 <merijn> So the thing that makes Haskell pure is that the IO behaviour of execution cannot be observed inside the non-IO expressions that are evaluated
13:38 esad joined
13:38 <Squarism> merijn, ah ok. That was a nice summary.
13:39 stefR joined
13:39 shinX joined
13:42 <stefR> hi everyone. In my code I define default value myDefaultList = [] the compiler advise me to define it with explicit type this way myDefaultListForAll :: forall t. [t] whereas a simple myDefaultList :: [a] seems to suffice to satisfy the compiler warning. What is the difference between the two definition ?
13:43 cchalmers joined
13:43 <merijn> stefR: Nothing, basically. In basic (as in, no extensions) Haskell ALL type variables implicitly have a "forall" on the left. The forall doesn't normally exist in Haskell, but is used in the underlying theory (and some extensions)
13:44 <merijn> stefR: So "myDefaultList :: [a]" is treated, internally as "myDefaultList :: forall a . [a]"
13:45 <Cooler> why do this const <$> Identity [1, 2, 3] <*> Identity [9, 9, 9] when you can do const [1, 2, 3] [9, 9, 9] ?
13:46 <stefR> merijn thx
13:47 <quchen> Schrostfutz: Congratulations!
13:48 <quchen> Schrostfutz: The »bolted on accumulator« is fairly useful to know about :-)
13:48 mrkgnao1 joined
13:48 <quchen> Schrostfutz: It’s often not as readable as an explicit recursive implementation of the same feature though.
13:49 <quchen> Schrostfutz: foldr is a somewhat fundamental function on lists, so relying on the implementation of it isn’t bad style.
13:49 <quchen> Schrostfutz: foldr captures what it means to consume a list element-wise to build a result.
13:50 harfangk joined
13:50 edsko joined
13:50 <quchen> Anything that walks a list element-wise can be written using foldr :-) map, filter, sequence, …
13:50 <Schrostfutz> quchen: Okay, thanks again :)
13:50 esad joined
13:51 kadoban joined
13:51 <quchen> Schrostfutz: It’s kind of like »relying on the implementation of id« is not bad style when you write »id f x«.
13:52 edwinvdgraaf joined
13:52 bobbypriambodo joined
13:52 alexknvl joined
13:52 Gurkenglas joined
13:52 shookees`alt joined
13:52 <quchen> I’m not sure whether foldr is unique, but I strongly suspect there is no other (total) function with its type.
13:53 <quchen> Well, no other nontrivial ones.
13:53 <quchen> foldr f z xs = z -- would also have the right type, but is clearly nonsense.
13:54 <stefR> I have another question. During compilation I have tons of this warning for many modules, (not only Control.Monad, also my own modules): The qualified import of 'Control.Monad' is redundant except perhaps to import instances from 'Control.Monad'. To import instances alone, use: import Control.Monad(). I clearly do not understand the warning. What does it mean ?
13:54 Rainb joined
13:55 mrkgnao joined
13:55 <quchen> stefR: GHC warns about unnecessary imports. When you don’t need anything from Control.Foo, you should not import it. GHC detects this by checking whether you make use of any of the definitions made in the Foo module in your own (importing) module.
13:55 groscoe joined
13:55 <quchen> stefR: For type classes, this mechanism may be undesirable: maybe you’re importing the module because it contains an instance definition that you want to use.
13:55 srbaker_ joined
13:55 <stefR> Ok, so it is a message about unecessary imports. I'm gonna check that immediatly. Thx.
13:55 <ongy> so if you used void from Control.Monad before and then removed the use of it, the compiler will warn about an unused import Control.Monad
13:56 <stefR> I like this
13:56 <quchen> If you *only* want to import instances from a module, you can make this explicit, you can write »import Foo ()«. This imports nothing except the instances, so to speak.
13:56 mbuf joined
13:56 <quchen> (Instances are always exported/imported.)
13:56 saolof joined
13:56 <quchen> (Known as the open world assumption)
13:56 <saolof> What is cheaper, evaluating a thunk or dereferencing a cons?
13:57 bamurphymac joined
13:57 <quchen> »Dereferencing«? Do you mean »pattern matching on«?
13:57 pleax joined
13:57 <saolof> right, deconstructing
13:58 <Cooler> why doesn't Integer have a monoid?
13:58 <quchen> Pattern matching on something may require evaluation of a thunk, so you could say it may be more expensive the first time
13:58 <quchen> Cooler: There are two possible Monoids for Integer (sum and product), and by default none is chosen
13:58 Rainb joined
13:58 <saolof> But is calculating something that's easy to evaluate necessarily more expensive than accessing a stored value on the heap?
13:58 <Cooler> quchen, that didn't stop list from getting an applicative
13:59 jluttine joined
13:59 <quchen> Cooler: Heh, good point. But there is a law that says that the Applicative has to match the Monad of a type, and there is only one list monad.
13:59 <quchen> So here we have something that helps us pick one of the two (equally valid) Applicatives.
14:00 <ongy> what are the 2 valid applicatives for lists?
14:00 <quchen> saolof: Well, it depends. Pattern matching might be expensive, like in »Just x = expensive« requires a long computation to be done before matching it.
14:00 <merijn> quchen: Eh, there's a LOT more monoids for Integer than two :p
14:00 <quchen> merijn: I didn’t say »exactly« :-þ
14:00 <quchen> ongy: zip lists and umm cartesian-product-lists (or whatever the standard behaviour is called)
14:01 <AndreasK> saolof: Not neccesarily, but depends on a lot of factors, from cache hits to what it is your matching on and if you use the variables bound by it (Just _ -> 1 vs Just a -> a)
14:01 <Schrostfutz> How do I properly write list literals? This fails: ["foo" "bar"], this works: ("foo":"bar":[])
14:01 <AndreasK> Schrostfutz: You forgot the ,
14:01 <kadoban> ["foo", "bar"]
14:02 <ongy> ["foo", "baar"]
14:02 <Tuplanolla> ["foo", "baaar"]
14:02 <Schrostfutz> AndreasK, kadoban: ah, thanks
14:02 <saolof> But if I write something like lazylist = iterate (*2) and pow2 n = lazylist !! n , will it actually be less expensive the first time I call it?
14:02 <Schrostfutz> ongy, Tuplanolla: Those give the wrong result! :P
14:02 <ongy> > ["foo", 'b': drop 2 "baar"]
14:02 <ongy> better?
14:03 <lambdabot> ["foo","bar"]
14:03 <Schrostfutz> ongy: Yes! And very concise, too :)
14:03 ziyourenxiang joined
14:04 <saolof> sorry, lazylist = iterate (*2) 1
14:04 travv0 left
14:04 xcmw joined
14:05 <AndreasK> saolof: Unlikely usually the first call is the most expensive one. It's usually only cheaper to recalculate for primitive unboxed operations like adding two unboxed integers and things like that
14:05 Rodya_ joined
14:06 danharaj joined
14:06 <saolof> I see
14:06 mroman joined
14:07 <Cooler> are there default values for types?
14:07 <Cooler> *Main> pure 1 :: Constant String Int
14:07 <Cooler> Constant {getConstant = ""}
14:07 <Cooler> how did it get ""?
14:08 <saolof> Is there a lazy datastructure that I can use like lazy linked lists, but with O(1) access to computed values?
14:08 <ongy> Cooler: the mempty from monoid is a sort of default value
14:08 <ongy> and I think there's a Defaults class aswell
14:08 insitu joined
14:08 Gloomy joined
14:09 <ongy> > mempty :: String
14:09 <lambdabot> ""
14:09 pleax joined
14:09 <Tuplanolla> > def :: String
14:09 <mroman> What's the command again to construct a function based on a type?
14:09 <Cooler> what does pure have to do with monoid mempty?
14:09 <lambdabot> ""
14:09 <Schrostfutz> I've been writing mostly C++ lately, GHCs error messages are a blessing...
14:10 <hpc> Schrostfutz: they really are
14:10 <ongy> Cooler: I think djin(n) not sure exactly
14:10 <ongy> whoops ^ is for mroman
14:10 <hpc> Schrostfutz: my favorite are the language extension errors which tell you exactly what to do to fix it
14:10 <kadoban> saolof: Either Data.Array comes to mind or something like Data.Map, but the latter is O(lg n) access, not O(1).
14:11 <AndreasK> saolof: Sequence comes probably closest, but it's logarithmic. True O(1) access would require you to convert the structure something that can be offset accessed as you go which sounds possible but probably won't be worth the overhead and complexity
14:11 moljac024 joined
14:11 <moljac024> hey guys
14:11 <moljac024> is there a blog post or page where i can see an example implementation of future/promise monad?
14:11 <mroman> (and mempty is the identity element in the monoid.)
14:11 <ongy> Cooler: what's the exact header of the Applicative instance for Constant? If it's something like `instance Monoid a => Monad (Constant a) where` then it probably uses the monoid instance (and therefore mempty)
14:11 biglama joined
14:11 <mroman> (not really a default value imo)
14:11 <mroman> @djinn a -> b -> a
14:11 <lambdabot> f a _ = a
14:12 <mroman> yep. that's it.
14:12 <kadoban> Hmm, Sequence is probably a better suggestion.
14:12 <Cooler> ongy, not sure, in this book they actually tell you to write the functor and applicative instances
14:12 <Cooler> yourself
14:12 <ongy> mroman: it's (ab)used as a way to get a "default" value in a bunch of places
14:12 nomicflux joined
14:13 StoneToad joined
14:13 <mroman> ongy: oh. Good to know :)
14:14 <mroman> wouln't that break the monoid laws in some instances though?
14:14 <Cooler> oh would you look at that, they give you this "instance Monoid a => Applicative (Constant a) where
14:14 <Cooler> "
14:14 <ongy> monoid shouldn't be defined for that use, but if it exists it works. And probably is useful most of the
14:14 beanbagula joined
14:15 <Cooler> they want you to use mempty
14:15 <Tuplanolla> :t def -- There's this thing for when things aren't quite monoids, mroman.
14:15 <lambdabot> Default a => a
14:16 ClaudiusMaximus joined
14:16 srbaker_ joined
14:16 foxbored joined
14:16 <foxbored> hoi
14:17 tlaxkit joined
14:17 <padre_angolano> is it possible to install the 'cabal' binary using stack? '--package cabal-install' doesn't seem to do this
14:18 <kadoban> padre_angolano: 'stack install cabal-install' works
14:18 <kadoban> It will install to ~/.local/bin/ , so make sure that's on your $PATH
14:18 mpsag joined
14:19 Mortomes|Train joined
14:19 <padre_angolano> kadoban: thanks, working now :-)
14:19 <kadoban> Anytime.
14:20 <Schrostfutz> > groupBy (\a b -> (a `mod` 3) == (b `mod` 3)) [0..10]
14:20 cereal_killer_ joined
14:20 <lambdabot> [[0],[1],[2],[3],[4],[5],[6],[7],[8],[9],[10]]
14:20 cmsmcq joined
14:20 <Schrostfutz> What am I doing wrong here? I'd expect something like [[0, 3, 6, 9], [1, 4, 7, 10], [2, 5, 8]]
14:21 janos joined
14:21 <kadoban> Schrostfutz: group/groupBy only looks at adjacent values.
14:21 shookees`alt joined
14:21 <saolof> Ah, thanks for the advice, I can live with O(log n) access, just not linear ^^
14:21 <Schrostfutz> kadoban: Ah, thanks
14:21 shwouchk joined
14:21 xeviox joined
14:22 <kadoban> > groupBy (\a b -> (a `mod` 3) == (b `mod` 3)) . sortBy (comparing (`mod`3)) $ [0..10]
14:22 justinfokes joined
14:22 <lambdabot> [[0,3,6,9],[1,4,7,10],[2,5,8]]
14:22 <kadoban> Schrostfutz: That's a common fix ^
14:23 <Cooler> is there something weird going on? fmap :: (a -> b) -> Constant e a -> Constant e b
14:23 <Cooler> fmap _ x = x
14:23 <Cooler> x is returned as is but its type changes
14:23 <hpc> does that compile?
14:23 greglearns joined
14:23 <Schrostfutz> kadoban: Ty
14:24 <Cooler> no it doesn't compile
14:25 <hpc> there you go ;)
14:25 <Cooler> so you have to unwrap it just to wrap it again
14:25 <hpc> what ends up happening is unifying x :: Constant e a and x :: Constant e b gives you a = b
14:25 <hpc> which is an invalid equation
14:26 <hpc> when you wrap and unwrap it, you never get that equality and it works
14:27 shookees`alt joined
14:27 joco42 joined
14:28 fcpga_te joined
14:28 <Cooler> so the fmap and <*> are the exact same
14:28 <Cooler> fmap _ (Constant a) = Constant a
14:28 <Cooler> (<*>) _ (Constant e) = Constant e
14:29 <Cooler> is there a way to repeat?
14:29 <Cooler> i mean is there a way to say <*> = fmap
14:29 <Cooler> the types don't match
14:31 danthemyth joined
14:31 joco42 left
14:31 <Cooler> (<*>) _ = fmap doesn't work
14:32 <Cooler> oh nvm
14:32 Shatnerz0 joined
14:33 <Cooler> is there a way?
14:33 janos joined
14:34 danza joined
14:35 <Cooler> no there doesn't seem to be
14:35 netheranthem joined
14:37 <* sudoreboot[m]> sent a long message: sudoreboot[m]_2017-02-20_14:37:29.txt - https://matrix.org/_matrix/media/v1/download/matrix.org/JhuUBzWduzspdnNiOLaGlRbK
14:38 <ahihi> Cooler: you could define something like rewrap :: Constant e a -> Constant e b; rewrap (Constant a) = Constant a and then have fmap _ = rewrap, (<*>) _ = rewrap
14:38 <ahihi> but I'm not sure it's worth it :)
14:39 t_h joined
14:40 <mroman> Are there some clever algorithms to turn a number in base N to base N+1?
14:40 beanbagula joined
14:40 eschnett joined
14:40 calincru joined
14:41 <ongy> there's alwasy unsafeCoerce if you want hate :)
14:42 t0m0 joined
14:42 <hexagoxel> coerce should be sufficient in this case.
14:42 ystael joined
14:44 jmcarthur joined
14:44 <kadoban> mroman: I suspect not, unless you count the usual base-conversion algorithm as clever.
14:45 foxbored joined
14:45 oisdk joined
14:45 beanbagu1 joined
14:46 oconnorct1 joined
14:46 Kreest_ joined
14:46 <foxbored> hello
14:47 <mroman> the only one I know is to convert them to from base_n -> native -> base_n+1 :)
14:47 <foxbored> do what?
14:47 <mroman> which involves too many divisions.
14:48 <mroman> (but not really a haskell question)
14:48 <foxbored> *looks cunfoosed at yoo*
14:48 <foxbored> whats a haskel?
14:48 doodlehaus joined
14:49 fizbin joined
14:49 freusque joined
14:49 <Theophane> foxbored: the topic of this channel :P
14:49 <ongy> sudoreboot[m]: your message became a link through the matrix gateway on our side... If you are familiar with how C# interacts with static C libraries, you may have a good idea of how things work. If C# has it's own runtime, then the haskell RTS and the C# runtime will probably compete for some resources (both running a thread pool, trying to work around foreign calls). I think there was some discussion
14:49 <ongy> around this a while ago in here, you may want to check the logs
14:50 <foxbored> uuuuh... i know ome HTML/CSS/Batch and some JS
14:50 <foxbored> but no C
14:50 <ongy> foxbored: haskell is a general purpose programming language. The main difference to most others is that it's purely functional
14:51 <foxbored> oh. ok :)
14:51 <mroman> Haskell is like batch. Except there's no @echo off.
14:51 <ongy> comparing to those, haskell gives you the nice property of a static and strong type system
14:51 cloudhead joined
14:51 <foxbored> huh. you know you dont have to use @echo off... that just hides the code form the user
14:52 esad joined
14:52 davezd joined
14:52 <foxbored> i came cuz i wanted to talk :)
14:53 <ongy> this channel isn't intended for smalltalk, but rather for haskell (and ecosystem) related problems.
14:53 <foxbored> ok. ill be on #furry
14:54 vicfred joined
14:55 <sudoreboot[m]> ongy: My whole message became a link (dead I presume)?
14:55 <sudoreboot[m]> I'm not sure I have the whole runtime thing down, as I am not sure what would make machine code compiled from haskell and machine code compiled from csharp different in terms of how it is run.
14:56 <ongy> sudoreboot[m]: the link is live (on the matrix website) and yes. IRC has a maximum message length of 512chars, so anything longer has to be split (like mine did) or worked around
14:56 chlong joined
14:57 bodisiw joined
14:57 <sudoreboot[m]> ongy: Is it readable or should I repeat it in parts?
14:58 <ongy> it's readable for people that care to follow the link. You should probably cut it down to the essential question and post it
14:59 rc4588 joined
15:00 dfeuer joined
15:01 ccomb joined
15:01 sword865 joined
15:01 <mroman> (except that C# is bytecode -> jit and Haskell is not?)
15:03 <ongy> also the rts can intercept allocations done by haskell code and reschedule, while the C# (is it a C# vm?) probably does something else with thread managing
15:03 <sudoreboot[m]> Here's the tldr of my question:
15:03 <sudoreboot[m]> I want to compile my Haskell code into a static linked library with an FFI wrapper and use this as a plugin in Unity3D, by calling the library from C# during runtime and get the desired results back. Am I going to have to spend weeks on trying to get this to work?
15:03 <ongy> I guess intercept is the wrong word here, the code calls into rts code on to co allocations and the RTS can decide to run another thread
15:03 foxbored left
15:04 Guest9696 joined
15:05 mjs2600 joined
15:05 <sudoreboot[m]> mroman: Unity3D has support for compiled plugins, so the fact that it's compiled to machine code while C# is bytecode shouldn't be a problem?
15:05 <mroman> C# can do native calls
15:05 <mroman> using DllImport and Marshalling.
15:05 ragepandemic joined
15:06 <mroman> but I sadly don't know how this works together with Haskells RTS.
15:06 <merijn> This is rather misleading
15:06 insitu joined
15:06 <merijn> Calling Haskell from C# is the exact same as calling C from C# (since C FFI is the only thing that exists)
15:06 <sudoreboot[m]> mroman: So, in theory, making it work should involvelittle more than following the typical FFI docs?
15:06 wraithm joined
15:07 <merijn> The only difference is that the Haskell library might introduce a bit of overhead in the form of it's own scheduling and memory managment
15:07 ChristopherBurg joined
15:07 <merijn> sudoreboot[m]: Yes
15:07 <mroman> You can invoke C functions from C#. That's not a problem.
15:07 <mroman> If haskell can expose them as C functions.
15:07 <mroman> which I take from merijn's answer it can.
15:07 Rodya_ joined
15:08 <merijn> sudoreboot[m]: I have a minimal example of calling haskell from C here: https://gist.github.com/merijn/4a0fee2b3a5ef3476aa4
15:08 <merijn> sudoreboot[m]: Simply replace the C code with C# using C#'s C FFI to call the same functions
15:08 rgr joined
15:08 <sudoreboot[m]> Thank you, I'm going to try your examples out
15:09 <merijn> sudoreboot[m]: Might require a bit of fiddling, but should be rather straightforward, mostly
15:09 SpaceGazebo2 joined
15:09 <sudoreboot[m]> I'm struggling with linking because ghc is telling me ghc needs to be compiled with -fPIC, which is giving me a headache
15:10 <sudoreboot[m]> All examples thus far have all given me errors about linking errors
15:10 fosskers joined
15:10 <sudoreboot[m]> s/linking errors/-fPIC/
15:11 <ongy> have you tried to pass -fPIC to ghc?
15:11 beanbagula joined
15:11 <sudoreboot[m]> ongy: Yeah. libHSbase is the one saying it needs to be recompiled
15:12 wraithm joined
15:13 _sg joined
15:13 <ongy> then you are probably trying to link the static library into a dynamic object (if you are on windows that's .lib (I think) into a .dll)
15:14 sternmull joined
15:14 Big_G joined
15:15 Jesin joined
15:17 mudri joined
15:18 <sudoreboot[m]> Trying to compile using `ghc -O2 --make -no-hs-main -optl '-shared' -o Foo.so Foo.hs` should work according to https://stackoverflow.com/questions/16615641/calling-haskell-from-c-sharp#16618038
15:18 <sudoreboot[m]> ongy: I'm on Ubuntu 16.04.4
15:18 <mauke> why do people still use --make?
15:18 <merijn> mauke: Because the internet is littered without outdated examples that people blindly copy
15:18 <ongy> because it shows up on the internet in tutorials
15:19 <sudoreboot[m]> mauke: I usually omit it, but I just copy pasted
15:19 <ongy> sudoreboot[m]: have you tried to add -fPIC to that line?
15:19 <ongy> ah sorry, not where the problem is
15:19 <ongy> I should think first
15:20 rc4588 left
15:20 <sudoreboot[m]> ```Linking Foo.so ...
15:20 <sudoreboot[m]> /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':
15:20 <sudoreboot[m]> (.text+0x20): undefined reference to `main'```
15:21 <mauke> it's trying to create an executable
15:21 SpinTensor joined
15:21 <ongy> https://downloads.haskell.org/~ghc/7.8.4/docs/html/users_guide/using-shared-libs.html mentions -dynamic/-shared as ghc arguments
15:22 <sudoreboot[m]> mauke: Why is it doing that with the -shared and -no-hs-main flags
15:22 <ongy> mauke: that for example also has the -make and it's ghc docs from 7.8.4. Since when is -make not required anymore?
15:22 HarveyPwca joined
15:23 <ongy> sudoreboot[m]: you are passing the -shared to the linker not ghc itself
15:23 jaffachief joined
15:23 pleax joined
15:23 <sudoreboot[m]> ongy: Should I pass it both?
15:25 jluttine joined
15:25 <mauke> ongy: 7.0
15:25 ragepandemic joined
15:25 prkc joined
15:26 eschnett joined
15:27 cschneid_ joined
15:27 wraithm_ joined
15:28 locallycompact joined
15:29 <ongy> sudoreboot[m]: trial and error? It shouldn't take that long. I would try both and see
15:29 Gloomy joined
15:31 <merijn> ongy: --make hasn't been required for years
15:31 <merijn> ongy: It exists, but --make is the default unless you override it, so "ghc" and "ghc --make" do the exact same thing
15:31 SpaceGazebo2 joined
15:31 <sudoreboot[m]> ongy: Trial and error is how I tend to do things because I don't understand enough about how the linker, compiler, runtime system, etc work
15:33 <ongy> merijn: ah. I think the first ghc I used was 7.8 and when I looked around I found more with --make than without so I default to use it when I remember to
15:33 <ongy> sudoreboot[m]: :) I know the C toolchain a bit better, but with GHC I trial&error aswell
15:33 coot joined
15:34 dhil joined
15:34 sellout- joined
15:34 ishtu joined
15:35 <sudoreboot[m]> merijn: Trying to build your ffi example tells me `-strict` is not a recognized option
15:36 <merijn> I know how the C parts work too and I know roughly what GHC does, but I never remember all the right flags/incantations to make GHC do exactly what I want
15:36 <merijn> sudoreboot[m]: That flags isn't necessary, but means your C compiler sucks ;)
15:37 <mudri> Is there a standard typeclass containing just an elem function?
15:37 Catalect` joined
15:37 <sudoreboot[m]> merijn: I'll talk to it
15:37 <merijn> sudoreboot[m]: honestly you could remove all the C flags in the cabal file and it should work :)
15:38 <merijn> sudoreboot[m]: They're just the default warnings I used when I wrote that
15:38 Schrostfutz joined
15:38 <cocreature> mudri: afaik there isn’t. "elem" works on any Foldable however, so if you have that you get it for free
15:38 <merijn> mudri: You mean like
15:38 <merijn> :t elem
15:38 alx741 joined
15:38 <lambdabot> (Foldable t, Eq a) => a -> t a -> Bool
15:39 defaultnick__ joined
15:39 inad922 joined
15:39 <sudoreboot[m]> merijn: ongy: Thank you for all the help :)
15:39 wraithm joined
15:40 raycoll joined
15:40 xaviergmail_ joined
15:40 TseiTsei joined
15:41 solenodic joined
15:42 razi1 joined
15:42 <mudri> cocreature: Okay, thanks. I'll consider Foldable. I don't think I actually want to use containers like Eq a => (a -> Bool), but it somehow seems nice to include them.
15:42 doodlehaus joined
15:43 <mudri> (Or even not Eq a in that case.)
15:43 ragepandemic joined
15:44 govg joined
15:46 minn joined
15:47 shurick joined
15:47 electrocat joined
15:48 deeplearner joined
15:48 doomlord joined
15:49 jluttine joined
15:49 LiaoTao joined
15:51 ragepandemic joined
15:53 davama joined
15:53 edwinvdgraaf joined
15:53 sqrt2 joined
15:54 conal joined
15:56 mada joined
15:56 TseiTsei left
15:56 greglearns joined
15:57 raycoll joined
15:59 begriffs joined
16:00 crobbins joined
16:03 <srhb> Is there a module-scoping-alike proposal somewhere? A la with Data.Text { ... }
16:04 <merijn> srhb: ezyang's backpack?
16:04 <merijn> Or are you meaning something else?
16:04 osa1 joined
16:05 slack1256 joined
16:05 aib joined
16:05 <slack1256> On Pipes.Core, I don't see what is the semantic differece between the request and pull category. Anybody can lend me a hand?
16:06 <merijn> I think pull is () and request uses something other than ()?
16:08 <slack1256> merijn: it seems you are thinking in `await` which is `request ()` ?
16:08 <merijn> slack1256: Yeah
16:09 contiver joined
16:10 Glooomy joined
16:10 yrid joined
16:10 <Tuplanolla> Is anyone up for some lens polishing? Find the given key `k :: Int`, return the value `x :: Char` and delete the key from the submap `n :: Map Int Char`. Do not delete keys from the supermap `m :: Map Ordering (Bool, Map Int Char)`.
16:10 <Tuplanolla> @let m = Map.fromList [(LT, (False, Map.fromList [(1, 'a'), (2, 'b')])), (EQ, (True, Map.empty)), (GT, (False, Map.fromList [(3, 'c'), (4, 'd')]))] :: Map Ordering (Bool, Map Int Char)
16:10 <lambdabot> .L.hs:161:5: error:
16:10 <lambdabot> Not in scope: ‘Map.fromList’
16:10 <lambdabot> Perhaps you meant one of these:
16:10 Rodya_ joined
16:10 WolvesAreWatchin joined
16:10 <slack1256> but you're in the right direction, is the return type what changes
16:10 <Tuplanolla> I don't really know how to "search" with lenses.
16:11 lambdafan joined
16:13 Glooomy joined
16:13 justinfokes joined
16:14 raichoo joined
16:15 janos joined
16:15 fcpga_te joined
16:15 CoolerExtreme joined
16:15 <ClaudiusMaximus> Tuplanolla: i don't know enough lens to answer, but perhaps considering what should happen if the Int key occurs multiple times in those maps might help reach a sensible answer
16:16 CoolerExtreme joined
16:16 <Tuplanolla> That should be impossible, so I'd accept any behavior, ClaudiusMaximus.
16:16 <Tuplanolla> Ideally the search would stop on the first match though.
16:16 SpaceGazebo2 joined
16:21 mr_sm1th joined
16:21 solenodic joined
16:21 Fairy joined
16:24 mohsen_ joined
16:24 wraithm joined
16:25 jbalint joined
16:25 jbalint joined
16:26 cyborg-one joined
16:28 handyc joined
16:32 carlomagno joined
16:33 gcross joined
16:33 <* lambdafan> bounces around
16:34 moongazer joined
16:35 jathan joined
16:36 desktop joined
16:36 nwf joined
16:38 wraithm joined
16:38 <Tuplanolla> > preview (each . _2 . ix 3) m -- At least this works for getting.
16:38 <lambdabot> error:
16:38 <lambdabot> Ambiguous occurrence ‘m’
16:38 <lambdabot> It could refer to either ‘Debug.SimpleReflect.m’,
16:38 mada joined
16:39 Rainb joined
16:39 dsh joined
16:39 <Tuplanolla> > preview (each . _2 . ix 3) L.m
16:39 <lambdabot> Just 'c'
16:41 fnurglewitz joined
16:41 quchen joined
16:43 _kit_ joined
16:44 sh0rug0ru__ joined
16:44 vektorweg1 joined
16:45 forgottenone joined
16:46 <glguy> > let m = Map.fromList [(LT, (False, Map.fromList [(1, 'a'), (2, 'b')])), (EQ, (True, Map.empty)), (GT, (False, Map.fromList [(3, 'c'), (4, 'd')]))] in (traverse . _2 . at 3) (\old -> ([old], Nothing)) m
16:46 trism joined
16:46 urodna joined
16:46 <lambdabot> ([Nothing,Nothing,Just 'c'],fromList [(LT,(False,fromList [(1,'a'),(2,'b')])...
16:47 esad joined
16:47 <glguy> (traverse . _2 . at 3) (\old -> (First old, Nothing)) L.m
16:47 <glguy> > (traverse . _2 . at 3) (\old -> (First old, Nothing)) L.m
16:47 thatguy joined
16:47 <lambdabot> (First {getFirst = Just 'c'},fromList [(LT,(False,fromList [(1,'a'),(2,'b')]...
16:48 JagaJaga joined
16:48 ccomb joined
16:48 <Tuplanolla> Very nice, glguy. I was kind of expecting `First` to pop up.
16:49 <Tuplanolla> It's surprising to see no operator like `preview` there.
16:49 <glguy> :t preview
16:49 <lambdabot> MonadReader s m => Getting (First a) s a -> m (Maybe a)
16:49 <glguy> The preview is "inlined" via the use of First
16:49 <pikajude> why doesn't the `highlighter` package exist in any stack build plan?
16:49 <pikajude> it's clearly on hackage
16:49 <pikajude> what do I do in this scenario?
16:50 <glguy> add it to your extra-deps
16:50 <Tuplanolla> What did you change when inlining it, glguy?
16:50 <merijn> pikajude: Because stack uses stackage and not everything on hackage is on stackage?
16:50 <pikajude> oh, ok
16:50 <pikajude> i didn't know that
16:50 <glguy> Tuplanolla: It's inlined into the merged operation that both previews your result and removes that key from the maps
16:50 <Tuplanolla> Let me meditate over this for a while.
16:51 <glguy> Tuplanolla: While medatating consider that preview typically works with Const, and set works with Identity
16:51 <glguy> Here those two are smashed together into (,)
16:51 AustinMatherne joined
16:51 minn joined
16:52 <quchen> pikajude: Stack has only Stackage in scope by default; anything not in stackage you have to add to the extra dependencies. You can use »stack solver« to do this for you, see »stack solver --help«.
16:52 <pikajude> thanks everyone
16:52 <pikajude> that fixed it
16:52 <pikajude> why are packages on hackage not on stackage
16:52 <pikajude> are they manually curated
16:52 <Tuplanolla> Would it make sense to isolate the idea into a `preset`, glguy?
16:52 sz0 joined
16:53 <quchen> pikajude: Yes, Stackage is a vetted set of packages that are all buildable together, giving a guaranteed-to-be-working subset of Hackage.
16:53 <glguy> Tuplanolla: possibly locally, but I don't think it needs to be in the lens package. There are lots of combinations like this
16:53 <pikajude> oh ok
16:53 <quchen> Upside: works, downside: deviating from the vetted set can be tricky.
16:53 <Tuplanolla> Locally indeed. Let's see what happens.
16:53 aemilie joined
16:53 hackebeilchen joined
16:53 cmsmcq joined
16:53 debian joined
16:54 cchalmers joined
16:54 romanandreg joined
16:55 jtojnar joined
16:56 robotroll joined
16:56 pleax joined
16:57 rcsole joined
16:57 ludat joined
16:57 solenodic joined
16:58 <Tuplanolla> Certainly you mean `First` instead of `Const`, glguy.
16:59 <glguy> no
16:59 <glguy> I'm talking about the choice of types providing Applicative instances
16:59 <lambdamu> Are there any interesting instances for a Group type class apart from the obvious numerical ones?
17:00 jeltsch joined
17:00 tophatsteve joined
17:01 nomicflux joined
17:02 <nitrix> I have a curious question. An email thread at work meant to be helpful about a disctinction between "Composition vs. Inheritance" https://www.thoughtworks.com/insights/blog/composition-vs-inheritance-how-choose , yet I can't help but think that Inheritance is a form of composition (at least at the type level).
17:03 SpaceGazebo2 joined
17:04 <merijn> nitrix: In what way?
17:04 t4nk492 joined
17:04 sssilver joined
17:04 <nitrix> I'm not that great with CT, but if your objects are type classes and morphisms are dependencies between them, isn't (.) essentially inheritance?
17:04 <t4nk492> Hello, friends! Why this fails? let {listGen (x@(a:b):_) = x} in listGen [1,2,3,4]
17:04 <t4nk492> can you not extract two numbers this way?
17:05 <glguy> t4nk492: You've parenthesized it incorrectly
17:05 <glguy> (a:b) is a whole list where a is an element and b is a list
17:05 burp_ joined
17:06 <glguy> [1,2,3,4] is (1:(2:(3:(4:[]))))
17:06 <t4nk492> hmm, I see
17:06 spaceshi1s joined
17:07 cods_ joined
17:07 hxegon joined
17:07 liste_ joined
17:07 <t4nk492> Thank you!
17:07 glowcoil_ joined
17:07 Adeon_ joined
17:07 conal joined
17:08 <Benzi-Junior> hey I'm trying to generate tags for a library that uses a header file and the ghci parser always fails when it comes to the #include line
17:08 <glguy> Benzi-Junior: Did you add {-# Language CPP #-} to the top of the file?
17:08 <glguy> Oh, #include usually happens in .hsc
17:08 <glguy> not .hs files
17:09 eschnett joined
17:09 ccomb joined
17:09 scav_ joined
17:09 wraithm joined
17:09 altLeCamarade joined
17:09 <Squarism> Looking at package Data.Time here. Cannot find some clear candidate for a type carrying "unix-timestamp" / seconds-or-millis since 1970...
17:09 HappyEnte joined
17:09 kgadek_ joined
17:09 hodapp joined
17:09 djellemah joined
17:09 <Benzi-Junior> glguy, yes its in there
17:09 SoupEvil joined
17:09 jgertm joined
17:09 austinkeeley joined
17:09 dschoepe joined
17:09 <Squarism> anyone know a such
17:09 Cthalupa joined
17:09 lyxia joined
17:09 Immune joined
17:09 suzu joined
17:09 Wizek joined
17:09 xaviergmail_ joined
17:09 <glguy> Benzi-Junior: If you're trying to load a .hsc file, you'll need to process it with hsc2hs first
17:09 stevenxl joined
17:09 Belgarion0 joined
17:09 prophile joined
17:10 MoALTz joined
17:10 <quchen> Squarism: https://hackage.haskell.org/package/time-1.8/docs/Data-Time-Clock-POSIX.html
17:10 mdarse joined
17:10 <glguy> otherwise it might help to paste the code and error message
17:10 hamishmack joined
17:10 moongazer joined
17:10 lwm joined
17:10 <Benzi-Junior> cabal was able to build the package
17:10 <quchen> Squarism: POSIXTime is »Unix time« here.
17:10 sssilver joined
17:10 <Squarism> ah ok
17:10 <Benzi-Junior> so this appears to be something specific to ghci
17:10 Itkovian joined
17:10 mrkgnao joined
17:11 <Benzi-Junior> glguy, the code is the vector library on hackage
17:11 kini joined
17:11 mstruebing joined
17:12 <glguy> Benzi-Junior: You can open vector package in GHCi with "cabal repl"
17:12 JuanDaugherty joined
17:13 Sonolin joined
17:13 Schrostfutz joined
17:13 OfficialLeibniz joined
17:13 Cooler joined
17:13 <Benzi-Junior> glguy, ah
17:13 <* Benzi-Junior> is a novice with cabal
17:14 EvanR joined
17:14 EvanR joined
17:14 jackhill joined
17:14 ClaudiusMaximus joined
17:14 livingbeef joined
17:14 ner0x652 joined
17:15 Rodya_ joined
17:15 wraithm joined
17:16 RegEchse joined
17:16 <Benzi-Junior> glguy, ok sweet that works
17:16 _sg joined
17:18 Rodya_ joined
17:18 <Tuplanolla> @let presetBad l = asks (first getFirst . l (\ x -> (First x, Nothing))) -- I can define it like this, but this doesn't quite match the way `preview` is defined, glguy.
17:18 <lambdabot> Defined.
17:18 <Tuplanolla> There's no `foldMapOf` there.
17:19 <glguy> That means you haven't meditated enough on the idea that Const + Identity = (,)
17:19 govg joined
17:20 yorick_ joined
17:22 <nitrix> edwardk: This is just a thought experiment, but is it remotely possible to have a category whose objects are type classes and morphisms, dependencies between them? If so, does composition becomes inheritence?
17:24 simendsjo joined
17:26 raynold joined
17:27 srbaker_ joined
17:27 SpaceGazebo2 joined
17:28 Bish joined
17:28 serendependy joined
17:29 cchalmers joined
17:30 byorgey joined
17:30 byorgey joined
17:31 anry joined
17:31 pleax joined
17:33 k0001 joined
17:33 mkoenig joined
17:34 cyberlard joined
17:36 contiver joined
17:36 afarmer joined
17:37 l33t27 joined
17:39 <spaceshi1s> any recommendations on a library to use for manipulating polynomials?
17:39 contiver_ joined
17:39 initiumdoeslinux joined
17:39 <JuanDaugherty> any basic alg?
17:40 Polarina joined
17:40 <JuanDaugherty> or just hs
17:42 danthemyth joined
17:42 <spaceshi1s> we need expansion - i hope thats what it's called. for instance translating (x+y)(x+y) into x^2 + 2xy + y^2
17:43 zeroed joined
17:43 ffilozov joined
17:44 <ffilozov> How do I report a broken link on haskell.org?
17:45 chrisdotcode joined
17:46 <Tuplanolla> Well, I don't see how `foldMapOf` would be needed here.
17:46 <JuanDaugherty> it's the revers of factoring
17:46 <spaceshi1s> yeah
17:47 danharaj joined
17:47 theDon joined
17:47 <JuanDaugherty> don't recall a name for that, evaluation, finding product
17:48 <ski> "expansion into terms" perhaps
17:48 Destol joined
17:49 t7 joined
17:49 <ski> "multiply out" ?
17:50 <spaceshi1s> multiply out? ah, something we could just do ourselves
17:53 <JuanDaugherty> or "find the polynomial"
17:53 ertesx joined
17:54 BlueRavenGT joined
17:55 <monochrom> sum of products
17:55 connrs joined
17:56 <nshepperd_> nitrix: constraints package has that, I think. There's a type for constraint implication that gets a category instance
17:56 <thatguy> what is the easiest way if I want a program that converts chars to ints in the following way: a to 1, b to 2, ...
17:56 <thatguy> nvm
17:57 <monochrom> HSTNF = highschool teacher normal form :)
17:57 shookees`alt joined
17:58 calincru joined
17:59 doodlehaus joined
18:00 <spaceshi1s> hah!
18:00 tom7942 joined
18:00 JagaJaga joined
18:00 mr_sm1th joined
18:01 conal joined
18:01 dhil joined
18:01 <nshepperd_> nitrix: newtype a :- b = Sub (a => Dict b)
18:02 t_h joined
18:02 <* ski> . o O ( `constraints' )
18:02 <nitrix> nshepperd_: Ah! An EdwardK package, who've thought :P
18:02 ocramz joined
18:02 <glguy> Tuplanolla: foldMapOf is just a use of Const, there's no magic. Instead of using Const we're using (,) here
18:03 <ocramz> hullo!
18:03 <nitrix> nshepperd_: Checking. Very appreciated.
18:03 raichoo joined
18:03 Lokathor joined
18:03 <nshepperd_> There's an edwardk package for that ™
18:04 <ocramz> Sending out a thought to edwardk for a prompt full recovery
18:05 steeze joined
18:06 mszczygiel joined
18:07 fcpga_te joined
18:09 eschnett joined
18:09 Frans-Willem joined
18:10 <Tuplanolla> :t presetBad -- I still have to clean up this type, glguy.
18:10 <lambdabot> MonadReader a m => ((Maybe a2 -> (First a2, Maybe a3)) -> a -> (First a1, d)) -> m (Maybe a1, d)
18:10 <Tuplanolla> There's clearly `(a -> f b) -> s -> f t` in there.
18:10 esad_ joined
18:12 alexknvl joined
18:13 <Squarism> anyone know if theres some trick to make aeson "to-json" conversion take a provided TimeZone in to account and convert date/time types into some timezone local datetime representation?
18:13 <nitrix> nshepperd_: I'm truely impressed. Turns out, it's called type entailment and someone thought of it before me :P
18:13 mr_sm1th joined
18:13 JuanMiguel joined
18:14 mudri joined
18:14 <Akii> johnw: thanks for your suggestion regarding rewriting my transformerstack, that should work
18:15 eacameron joined
18:15 <johnw> Akii: it will save you from storing a lambda inside an Either in many places, which *might* have a performance impact
18:16 <Akii> I thought I'd need to make this a monad http://lpaste.net/352780
18:16 <Akii> but all I really need to do is to make this state and have a function manipulate it
18:16 Deide joined
18:16 bab joined
18:17 spaceships joined
18:17 eacameron left
18:18 <Tuplanolla> Does `MonadReader r m => Lens r t (Maybe a) (Maybe b) -> m (Maybe a, t)` look right to you, glguy?
18:18 <johnw> sound right; plus, it can't be a monad
18:18 <Akii> johnw: as we figured out yesterday D
18:18 <Akii> :D
18:19 <Akii> was fun trying though
18:19 contiver__ joined
18:19 <glguy> Tuplanolla: Generally you shouldn't take an actual Lens as a parameter, you'd take some non-polymorphically typed argument
18:19 solenodic joined
18:20 <johnw> you can use ALens' to take a lens as a parameter
18:20 <johnw> (or ALens, in this case)
18:20 <johnw> just know that you have to call cloneLens on it before you can use it
18:20 <glguy> In this case it would be better to not take an ALens either, but the specific type you needed
18:20 <glguy> otherwise you'll have an unnecessary cloneLens in the definition
18:21 <Tuplanolla> What would that be? The explicit function type.
18:21 <glguy> for example: (<<.~) :: LensLike ((,) a) s t a b -> b -> s -> (a, t)
18:21 <glguy> this is a function very similar to what you're implementing
18:22 cpup joined
18:22 merijn joined
18:22 <Tuplanolla> Ah, I did take a look at that one earlier.
18:22 ziocroc joined
18:23 eacameron joined
18:23 <glguy> Also the operation you were using wouldn't have been compatible with the Lens version since what you were using wasn't a Lens
18:24 <Tuplanolla> So I have `MonadReader r m => LensLike ((,) (First a)) r t (Maybe a) (Maybe b) -> m (Maybe a, t)`.
18:24 harfangk joined
18:24 <glguy> That seems fine
18:26 ramzifu joined
18:26 xocolatl joined
18:27 <Tuplanolla> :t Data.IORef.atomicModifyIORef' -- Now the last annoyance is that the return value is swapped wrt this.
18:27 <lambdabot> GHC.IORef.IORef a -> (a -> (a, b)) -> IO b
18:27 chlong joined
18:27 tom7942 left
18:27 jgertm joined
18:28 Glooomy joined
18:30 lspitzner joined
18:30 davama joined
18:30 davama left
18:31 sparr joined
18:31 Galoyz joined
18:31 <Tuplanolla> This is similar to asking whether `StateT` should've been `s -> m (s, a)` instead of `s -> m (a, s)`.
18:31 <JuanDaugherty> does 8.0.2 actually have so many fixes as to make upgrade needful?
18:31 <JuanDaugherty> (from 8.0.1)
18:31 mr_sm1th joined
18:31 carc joined
18:31 rbocquet joined
18:32 <JuanDaugherty> s/so many/such/
18:33 bollu joined
18:33 <glguy> JuanDaugherty: You can look at the release notes to determine if the things that were fixed are important to you
18:33 <bollu> does anyone know of a standalone implementation of OutsideIn(X) type inference?
18:34 <bollu> (that is, not part of GHC)
18:34 shookees`alt joined
18:34 <JuanDaugherty> glguy, ty
18:37 vlatkoB_ joined
18:37 Lord_of_Life joined
18:38 noddy joined
18:40 ph88^ joined
18:41 mohsen_ joined
18:43 paolino joined
18:43 mjs2600 joined
18:45 pleax joined
18:46 wraithm joined
18:46 coot joined
18:48 bruschkov joined
18:48 davama joined
18:49 DTZUZU joined
18:49 Itkovian joined
18:50 davama left
18:50 wraithm joined
18:50 danthemyth joined
18:52 mjs2600 joined
18:53 littleBoss joined
18:53 <littleBoss> Hi
18:53 orizzonte joined
18:53 <orizzonte> ciao
18:54 <orizzonte> !list
18:54 littleBoss joined
18:54 pleax joined
18:54 orizzonte left
18:54 littleBoss left
18:54 bruschkov joined
18:55 ragepandemic joined
18:57 oisdk joined
18:57 jao joined
18:58 t_h joined
19:00 wildlander joined
19:01 roconnor joined
19:01 <Akii> johnw: this does _exactly_ what I had in mind, thanks again http://lpaste.net/352783
19:01 contiver_ joined
19:01 <johnw> great!
19:01 bollu joined
19:02 <johnw> you shouldn't need the first two extensions anymore
19:02 <Akii> the second one is to satisfy stylish-haskell
19:02 <Akii> but the first one definitely not
19:03 <Akii> (also this is just playground, gonna move that now xD)
19:03 pleax joined
19:03 RichardC joined
19:03 jtojnar___ joined
19:03 RichardC left
19:03 bruschkov joined
19:03 SpaceGazebo2 joined
19:04 JuanMiguel joined
19:04 <Akii> I so much love this line http://lpaste.net/352783#line36
19:04 <Akii> like the statement, not the line xD
19:06 <Akii> event sourcing in 36 lines
19:06 <johnw> st' <- maybe (appInit agg) (aggApply agg) st ev
19:06 <Akii> not a single day goes by where Haskell does not surprise me
19:06 <Akii> and there is always room for improvement xD
19:07 <johnw> we love to golf code here
19:07 contiver__ joined
19:08 <Akii> let me process that wow
19:09 <Akii> wow
19:09 <Akii> I can already see the next improvement: something with Applicative lifting
19:10 janos joined
19:10 Apocalisp joined
19:11 <Akii> as far as readability goes, I think this is pretty good
19:11 janos__ joined
19:11 <johnw> as long as you're happy with it :)
19:12 <Akii> working on this for a year now, at least
19:12 xaviergmail_ joined
19:12 osa1 joined
19:12 osa1 joined
19:13 danthemyth joined
19:13 janos joined
19:15 cods joined
19:15 bruschkov joined
19:16 <Tuplanolla> I just noticed that `uncurry (set (at i)) . preset (at i) = id`, so that's a good guideline for ordering the tuple.
19:16 janos__ joined
19:16 wraithm joined
19:17 mohsen_ joined
19:19 wraithm joined
19:20 ragepandemic joined
19:20 Destol joined
19:21 xcmw joined
19:21 <jpthing> so a tuple is like a set?
19:21 janos joined
19:21 <ski> no
19:22 <ski> a (sub)set can have arbitrarily many elements, which are given without order, and without counting multiplicity
19:22 Destol joined
19:23 <ski> a tuple is always an `n'-tuple, for some `n', so a fixed number (`n') of components, given in order (and multiplicity, if you want to think of it like that)
19:23 greglearns joined
19:23 <ski> in a subset, all the elements must come from the same ambient superset ("universe"/"domain of discourse")
19:23 <jpthing> It is just that Tuplanolla's form looks like the transform from a set to a sequence without recursive types.
19:23 <ski> in a tuple, each position/component has its own associated type, from which the component at that position must come
19:24 <jle`> jpthing: er, where is the set in what Tuplanolla wrote?
19:24 <Tuplanolla> That remark relates to some earlier lens polishing, jpthing.
19:24 <* ski> didn't realize jpthing was referring/responding to what Tuplanolla was talking about
19:24 replay joined
19:25 <jle`> jpthing: are you talking about the 'set' function, which means "make it this value" ?
19:25 <Tuplanolla> Sets aren't really involved at all, jpthing.
19:25 <jle`> maybe jpthing saw the word 'set' and thought it was referring to sets in set theory
19:26 <jle`> instead of '2. to put or bring into a specified state'
19:26 <jle`> https://www.google.com/search?q=define+set
19:26 ilja_kuklic joined
19:27 <jpthing> No they are not. I find sequences are a better match for how computers work. Even in so called set related definitions like SQL order is important to achieve performance. So It would have been better to define it as a relation of sequences.
19:28 <jle`> what is that in response to?
19:28 <ski> jpthing : but that precludes useful optimizations ..
19:28 <ski> (and makes it harder to reason about, declaratively)
19:28 <jpthing> In Haskell list can only have one type and a tuple many types but only a fixed length. I find this a fiddly restriction to work around so I am somewhat interested in lenses.
19:29 <* ski> doesn't see how optics would help there
19:29 <ski> however .. with dependent types, you could get more general
19:29 <jle`> in what way do you need to work around this?
19:30 SpaceGazebo2 joined
19:30 <Tuplanolla> Lenses don't give you heterogeneous lists, jpthing. They only get you tools for working with existing things as if they were.
19:30 <ski> e.g. you could easily have a sequence of `Maybe' trees, where each tree (if present) would be a perfectly balanced binary tree with `2^n' elements, `n' being the index of the `Maybe' tree in the sequence
19:31 solenodic joined
19:31 asivitz joined
19:31 <ski> (Okasaki had a datastructure like that in PFDS, though not using dependent types to ensure the sizing being related to the index)
19:32 <ski> @where PFDS
19:32 <lambdabot> http://www.amazon.com/Purely-Functional-Structures-Chris-Okasaki/dp/0521663504
19:32 <jpthing> thx
19:33 <ski> the `Just's/`Nothing's in the sequence would spell out a binary numeral, and e.g. merging of two such sequences into one would correspond to addition of binary numerals
19:34 conal joined
19:34 <jpthing> Yes a tree should work. And has a decent efficiency model. Even if a pure data structure.
19:34 AustinTasseltine joined
19:34 AustinTasseltine joined
19:34 mjs2600 joined
19:35 Berra joined
19:36 <ski> jpthing : "I find sequences are a better match for how computers work." -- if you by this refer to how in Zermelo-Fränckel set theory, they build everything (including tuples and functions) out of sets, only having such sets as elements .. then i'm sympathetic to preferring structures with more "stricture" (like tuples, trees, &c.) over (sub)set ..
19:36 mekeor joined
19:36 <ski> jpthing : .. but, for particular purposes, like relations (SQL), sets have their place
19:37 mudri joined
19:38 <ski> (if anything, i don't like SQL because it doesn't fit well enough with the relational model theory. e.g. the order of attributes sometimes making a difference)
19:38 emmanuel_erc joined
19:38 danthemyth joined
19:39 <Benzi-Junior> ok I think I'm going mad here
19:39 <Benzi-Junior> does there anywhere exist an implementation of basicUnsafeIndexM in the vector library ?
19:42 <Benzi-Junior> I'm trying to find where the inefficiency of indexing is coming from and have traced it all back to basicUnsafeIndexM which is declared and always implemented in terms of basicUnsafeIndexM (presumably from another module) but it seems not end on a concrete case
19:42 <Benzi-Junior> except for bool
19:43 pasukon joined
19:43 mohsen_ joined
19:44 augur joined
19:44 JagaJaga joined
19:45 noddy joined
19:45 <roconnor> set theory was supposed to be built out of predicates, but that doesn't work, so we get this weird construction that is ZF where sets are trees modulo ordering.
19:46 <ski> hello roconnor
19:47 <* ski> . o O ( Aczel's anti-foundation axiom )
19:47 <roconnor> Perhaps indexed sets being unordered isn't that strange, especially when the index becomes uncountable.
19:47 Gurkenglas_ joined
19:48 <ski> indexed sets = families, yes
19:49 <* ski> . o O ( sub-finite indexing )
19:49 doomlord joined
19:49 <roconnor> sure that too.
19:49 <Benzi-Junior> does anyone here know where the vector implementations for tuples are defined ?
19:50 <roconnor> though the notion of sub-finite doesn't really exist in ZF.
19:50 pleax joined
19:51 <roconnor> It exists, but it is identical to finite, so it doesn't get any attention
19:51 <ski> like overt
19:51 <roconnor> yes. except I understand subfinite, but not overtness.
19:52 vlatkoB joined
19:53 contiver_ joined
19:53 cyborg-one joined
19:54 <sternmull> it seams stack does not use source files that i add in the src/ subirectory that was created by it. Where do i have to add them?
19:54 <ski> what is a good name for glbs of images of endofunctions on naturals ? or glbs of subsets of naturals, if you want more general ?
19:54 <ski> for the former, you can only compute approximate upper bounds (except if you reach zero)
19:56 <kadoban> sternmull: In the .cabal file , you have to specify exposed modules and "other modules", whatever the real names for them are. They should be in the file already and you just add to the list, as I recall.
19:56 edwinvdgraaf joined
19:56 pleax joined
19:57 <sternmull> kadoban: Can i have multiple files that belong to the same module?
19:57 fcpga_te joined
19:58 <kadoban> sternmull: No. Each file is one module
19:58 JeanCarloMachado joined
19:59 <sternmull> kadoban: Oh ok.
19:59 fractalsea joined
20:00 cansis joined
20:00 bitf joined
20:01 janos joined
20:01 fractalsea joined
20:01 albertus1 joined
20:02 takle joined
20:03 safe joined
20:03 cdidd joined
20:05 fractalsea joined
20:06 phyrex1an joined
20:06 xcmw joined
20:06 Itkovian joined
20:08 davezd joined
20:08 twomix joined
20:09 <sgript> If I do say sqrt(25) in Haskell I get 5.0, any easy way to get 5?
20:11 <sgript> Would round $ sqrt $ fromIntegral 25 suffice?
20:13 <Tuplanolla> Does it matter if the result is a bit wrong sometimes, sgript?
20:14 <sgript> nope, but if there's a way to fix that, i would like to know anyway :d
20:14 <Tuplanolla> Number theory packages should provide integer square roots.
20:14 <kadoban> sgript: For reasonably sized inputs that should work fine, as long as you don't care much that it's off for a bit for non-squares.
20:14 <kadoban> Yeah, you can do integer square roots directly, but it doesn't seem to be in base.
20:15 <Nik05> w 4
20:15 <Nik05> im sorry
20:15 janos joined
20:15 descender joined
20:15 <roconnor> GMP supports integer square roots. It'd be nice to have that in base.
20:15 <Nik05> but sgript depends what you want for an answer when the argument is not a square
20:15 <Tuplanolla> Much more number theory ought to be in `base`.
20:16 <Tuplanolla> At least I often reach for logarithms, roots and factorization.
20:17 <sgript> oh the arg is always square
20:17 zygentoma joined
20:17 <sgript> answer *
20:17 sibi joined
20:17 takle joined
20:18 <sgript> I'm just doing this for trigonometrystuff
20:18 Tazca joined
20:19 janos joined
20:19 unK_ joined
20:19 <sgript> so is there no way to do it without packages?
20:19 <kadoban> Well, your way will work fine for reasonable inputs.
20:20 doodlehaus joined
20:20 <kadoban> as-in probably anything double can represent exactly, and maybe a bit more.
20:20 <sgript> I noticed, it is a bit off actually
20:21 <Nik05> So you already know that they are squares, sgript. What do you want to do with the return value?
20:21 <kadoban> sgript: Really? For what inputs?
20:21 greglearns joined
20:22 <ski> Tuplanolla : discrete logarithms ?
20:22 Yuras joined
20:22 <Tuplanolla> Rounding up or down, ski.
20:24 <kadoban> sgript: Anyway, if it's not quite right and if you can't use a library, you can implement it using binary search that'll likely perform acceptably.
20:25 <kadoban> But it seems to work fine for me for reasonable inputs I tried.
20:25 handlex joined
20:25 tomphp joined
20:25 <kadoban> > round . sqrt . fromIntegral $ (999999999999999^2)
20:25 <lambdabot> mueval-core: Time limit exceeded
20:25 <Tuplanolla> > floor (64 ** (1 / 3) :: Double)
20:25 <lambdabot> 3
20:25 <Tuplanolla> > 3 ^ 3 :: Int
20:26 <lambdabot> 27
20:26 <kadoban> > round . sqrt . fromIntegral $ (999999999999999^2)
20:26 <lambdabot> 999999999999999
20:26 <kadoban> Heh, the first one was just lambdabot being funny I think.
20:26 stepcut joined
20:26 <hpc> > floor (0/0)
20:26 <lambdabot> -269653970229347386159395778618353710042696546841345985910145121736599013708...
20:26 mjs2600 joined
20:28 <stepcut> Is there a way to pass extra cpp-options on the commandline with cabal? Specifically, I want to set, -DEMBEDDED_FILEPATH="/path/to/file"
20:29 takuan joined
20:29 chg1 joined
20:30 contiver__ joined
20:32 osa1 joined
20:32 osa1 joined
20:33 mada joined
20:35 merijn joined
20:35 k4rtik joined
20:35 merijn joined
20:36 MrWoohoo joined
20:36 <ski> Tuplanolla : ok
20:37 <dolio> stepcut: Is it CPP as run by GHC? Wouldn't it be a GHC option, then?
20:37 jomg joined
20:38 <stepcut> dolio: We currently have this set in .cabal and it works `cpp-options: -DEMBEDDED_FILEPATH="/path/tofile"`, but the problem is that the path is hardcoded, but to build on Nix, we need to specify the path since it changes
20:39 cmsmcq joined
20:39 DavidEichmann joined
20:40 SpaceGazebo2 joined
20:40 rcat joined
20:41 marfoldi joined
20:41 mohsen_ joined
20:42 epsilonhalbe joined
20:42 <dolio> Oh, I see. I misunderstood what you were asking.
20:43 justanotheruser joined
20:44 pleax joined
20:45 <dolio> Looks like --cpp-options=... is an accepted cabal flag.
20:45 oconnorct1 joined
20:45 <dolio> And should add to the cpp-options from the file.
20:49 crobbins joined
20:49 minn joined
20:50 contiver__ joined
20:51 Itkovian joined
20:52 doodlehaus joined
20:53 chudi joined
20:53 jaffachief joined
20:56 Nik05 joined
20:56 hessianknight joined
20:59 augur joined
20:59 prohobo joined
21:00 confounds joined
21:00 jtojnar___ joined
21:01 locallycompact joined
21:02 lambda-11235 joined
21:03 contiver_ joined
21:04 takle joined
21:04 thatguy joined
21:06 edwinvdgraaf joined
21:08 nxtr joined
21:11 DavidEichmann joined
21:11 fizbin joined
21:14 mohsen_ joined
21:14 bennofs joined
21:15 t_h joined
21:19 cchalmers joined
21:20 Itkovian joined
21:20 GGMethos joined
21:21 tomphp joined
21:22 tophatsteve joined
21:23 JagaJaga joined
21:23 greglearns joined
21:24 <sternmull> i have to read from two handles, wrap their data into messages and write that messages to a third handle. At the moment i use two threads to read the handles. How do i synchronize writes to the third handle? Are two reader threads a good idea at all?
21:24 ragepandemic joined
21:26 <merijn> two threads seems fine
21:26 <geekosaur> multiple reader threads and a TChan to send the resulting message packets to the third?
21:26 <merijn> ^^ that, except I'd probably use Chan
21:26 elperdut joined
21:26 <Tuplanolla> You probably want a bounded channel here, merijn.
21:27 <geekosaur> depends on the data flow
21:27 <merijn> Tuplanolla: True
21:27 <sternmull> i thought about using a channel. But then i have a third thread that processes the message and has to stop when both readers are done. I hoped it could be solved less complicated.
21:28 <geekosaur> and in particular, precisely *how* it gets bounded depends on the data flow and the application requirements. for video streaming, you drop stuff; for some other uses, you block the readers...
21:28 <merijn> Which is why I was working on a closable version of Chan (well, actually, it's mostly done, I just need to write benchmarks)
21:28 <merijn> Unfortunately, that means first fixing criterion, because as-is it's not good enough :\
21:28 afohqz joined
21:28 <merijn> Hence why I keep postponing it :p
21:28 <geekosaur> sternmull, so you define the message data as data Message = Done | Data yourData
21:28 <geekosaur> (first cut...)
21:30 <sternmull> geekosaur: yes something like that. And the writer has to count the Done messages it has seen and finish at the last one... ok.
21:30 oconnorct1 joined
21:30 <geekosaur> you can also have the Done message include a sender id and track until you've seen all senders
21:31 <Tuplanolla> Do the read threads quit when they're done, sternmull?
21:31 <sternmull> Tuplanolla: Yes they do.
21:31 <geekosaur> (which has the potential advantage that you can add more threads and have it autoadapt instead of having to change a hardcoded count)
21:31 <Tuplanolla> Another option presents itself: link the threads via exceptions.
21:31 <Tuplanolla> @hackage async
21:31 <lambdabot> http://hackage.haskell.org/package/async
21:32 <sternmull> geekosaur: There should be no need for more threads. I want to read stdout and stderr from a process and multiplex that to a TCP stream. Date should be stuff like log output and compiler messages. So no need for super high performance. Easy implementation is more important right now :)
21:32 tsmish joined
21:32 Schrostfutz joined
21:33 <merijn> Tuplanolla: For some workflows (most I have) that doesn't work out so nicely
21:33 <geekosaur> that's why I said "potential"
21:33 <Tuplanolla> Not all options are good options!
21:33 <Benzi-Junior> does anyone here know where the implementations for vector tuples are defined ?
21:33 <sternmull> Tuplanolla: I already found async and happily use it to wait for the two readers.
21:35 Micamo joined
21:35 seagreen joined
21:36 <Benzi-Junior> alternatively is there a way to look up instance declarations on hackage or with hoogle ?
21:36 Koterpillar joined
21:37 jeltsch joined
21:40 ljc joined
21:41 oisdk joined
21:44 janos joined
21:44 pasukon joined
21:45 ragepandemic joined
21:45 <dmwit> Benzi-Junior: The newest haddock will link instances to their sources, but some packages haven't had an upload since Hackage's haddock got that upgrade.
21:45 <dmwit> In that case, you're out of luck. You'll have to use the old way (grep!).
21:46 <Benzi-Junior> dmwit, its not in there
21:46 <dmwit> Actually, come to think of it, you can probably ask GHC.
21:46 <Benzi-Junior> dmwit, I've literally spent days looking for this
21:46 <dmwit> :i shows information about instances of a class (or classes a type instantiates) which I think mentions where the instance lives.
21:47 <Tuplanolla> Then it's in some `Internal` module that you have to dig up separately.
21:47 <dmwit> Benzi-Junior: What is the specific instance you're looking for source for?
21:47 <dmwit> "implementations for vector tuples" doesn't make much sense to me.
21:48 montag451_ joined
21:48 fcpga_te joined
21:48 <Benzi-Junior> dmwit, (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Vector Vector (a, b, c, d, e)
21:49 oisdk joined
21:50 <fizbin> If I have a library I'm importing qualified, and that library defines a function that's meant to be used inline (e.g. if that lib. defines a function called "&"), what's the syntax for invoking that function inline? a `(G.&)` b isn't working.
21:50 <dmwit> Benzi-Junior: In ghci, load `Data.Vector.Generic` and `Data.Vector.Unboxed`, then ask `:i Vector`.
21:51 <Tuplanolla> > f Data.Function.$ x -- Like this, fizbin.
21:51 <lambdabot> error:
21:51 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M785854188758...
21:51 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
21:51 <Benzi-Junior> if I clikc the #source link on hackage it points me to line 671 in Data.Vector.Generic.Base ... which is only 140 lines long
21:51 <dmwit> Benzi-Junior: It will tell you about that instance, followed by a comment that says `-- Defined in 'Data.Vector.Unboxed.Base'`
21:51 <fizbin> Tuplanolla: Huh. Ok...
21:53 hiratara joined
21:53 Itkovian joined
21:54 aarvar joined
21:54 jmiven joined
21:55 <dmwit> Benzi-Junior: In the source, look in `internal/unbox-tuple-instances`.
21:56 Gurkenglas joined
21:56 doux joined
21:57 <dmwit> Benzi-Junior: lines 537-730
21:57 tomphp joined
21:57 cpup joined
21:57 replay joined
21:57 nurupo joined
21:58 <Benzi-Junior> dmwit, oh god
21:58 <dmwit> ?
21:58 <Benzi-Junior> dmwit, I was to focused looking under the Data directory
21:59 <dmwit> Just read the source. It's what I did. At the end of the file that GHC pointed me at is a comment `-- Tuples` followed by `#include "unbox-tuple-instances"`.
21:59 xaviergmail_ joined
21:59 Rainb joined
22:00 mdarse joined
22:00 coot joined
22:00 <dmwit> Probably explains the whole "line 671 of 140" thing in the haddocks, too, come to think of it.
22:01 <hpc> haha
22:01 SpaceGazebo joined
22:02 <hpc> does template haskell have the same issue?
22:02 rgr joined
22:03 SpaceGazebo joined
22:04 srbaker_ joined
22:04 gaqwas joined
22:05 augur joined
22:06 jgertm joined
22:07 <Benzi-Junior> dmwit, ye that would explain it
22:08 chrisdotcode joined
22:09 doodlehaus joined
22:09 thatguy joined
22:15 louispan joined
22:17 <cheshircat> Hello, what is the simplest way to get haskell and rust IPC? I have JSON serialization and deserialization for the structures I want to send set up, but I don't know whether to use named pipes or unix domain sockets, and I don't know what libraries to use on either side. I care more about the Haskell interface because the bulk of my code is on that side, so whatever works best on Haskell's side I will make
22:17 <cheshircat> work on Rust's side
22:18 <jpthing> There are plenty of JSON libs. Like the one in Real world Haskell. Why do you need rust.
22:18 <dmwit> Both solutions should be relatively easy to use. There's also dbus bindings if you find yourself needing asynchronous communication.
22:19 <dmwit> jpthing: He's already done the JSON part. And why does it matter why he needs rust?
22:20 <dmwit> cheshircat: I should clarify that when I said "relatively easy to use" I meant "...in Haskell". No idea about the rust side of things but I'd be shocked if they don't have support for pipes and sockets.
22:21 janos joined
22:21 <cheshircat> yeah, the have support for either
22:22 <cheshircat> is there not any particular reason why I should favor one over the other, and are there particular haskell libraries you would recommend?
22:23 <dmwit> Boring old file IO functions work for named pipes, too (kind of the point of named pipes).
22:23 <dmwit> ?hackage bytestring is probably preferable for file IO
22:23 <lambdabot> http://hackage.haskell.org/package/bytestring is probably preferable for file IO
22:23 <dmwit> ?hackage network has socket operations
22:23 <lambdabot> http://hackage.haskell.org/package/network has socket operations
22:24 <dmwit> I expect there are higher-level wrappers around these, too; depends what you want, I guess.
22:25 <dmwit> e.g. I think conduit probably has something for both kinds of interaction
22:25 takle joined
22:25 <cheshircat> Oh, I've heard good things about conduit
22:26 <cheshircat> OK, thank you, I guess the answer is a little self-evident in retrospect but I didn't really know where to start
22:27 nomicflux joined
22:27 Edith joined
22:28 lambdafan joined
22:29 nate_ joined
22:29 Rodya_ joined
22:29 mzabani joined
22:30 <nate_> I'm trying to understand pretty-printed Core, and it's not clear what the meaning of the various sigils is ($, #, @) is there a legend somewhere?
22:30 shayan_ joined
22:31 louispan joined
22:31 hiratara joined
22:32 <megaTherion> strange question maybe, but is it possible to colorize the output of ghci - to let it be more friendly to the eyes? ^^
22:33 ccomb joined
22:34 defaultnick joined
22:36 <merijn> Is it possible? Yes!
22:36 <merijn> Do I remember how? No! :p
22:37 ramzifu joined
22:39 <mzabani> Hi everyone, I'm trying to instantiate http-client's ManagerSettings with custom connectionRead and connectionWrite functions. The problem is that these functions need to call a function that runs in a MonadState. Is this possible?
22:39 hessianknight joined
22:40 prohobo left
22:41 rekahsoft joined
22:41 Voldenet joined
22:41 Voldenet joined
22:42 rcat joined
22:44 louispan joined
22:45 twanvl joined
22:46 jutaro joined
22:46 oisdk joined
22:47 <megaTherion> merijn: :(
22:48 <megaTherion> merijn: dont worry, I'll google around
22:48 <merijn> google for like "ghci custom print" or something
22:48 anuxivm joined
22:49 <dmwit> megaTherion: What kind of coloring do you want?
22:49 <megaTherion> syntax hilighting, like for the things you write in ghci and also for type informations and stuff
22:50 <megaTherion> no color at all just seems to be a little unsatisfying
22:50 <megaTherion> Im checking this right now: https://wiki.haskell.org/GHCi_in_colour
22:50 <dmwit> You might like iHaskell.
22:50 <merijn> megaTherion: syntax highlighting for like writing?
22:50 TxmszLou joined
22:51 <ludat> after working in rust I really miss colors in my compiler output
22:52 jtojnar___ joined
22:52 <MarcelineVQ> next major ghc release has error colors :>
22:52 <megaTherion> dmwit: iHaskell?
22:52 <dmwit> https://camo.githubusercontent.com/8e92d2d571f80b17019e8e477cc29015cf57a4bd/68747470733a2f2f7261772e6769746875622e636f6d2f67696269616e736b792f494861736b656c6c2f6d61737465722f696d616765732f696861736b656c6c2d6e6f7465626f6f6b2e706e67
22:52 <dmwit> oh dear
22:53 <dmwit> That URL ended up being longish. Sorry about that.
22:53 <dmwit> https://github.com/gibiansky/IHaskell
22:53 <glguy> mzabani: makeConnection takes arguments with types "IO ByteString" and "ByteString -> IO ()". It's unlikely that you'd want to make a MonadState instance for those types
22:53 <ludat> MarcelineVQ, which one? 8.2? that would be so awesome
22:54 <dmwit> mzabani: You could consider storing your state in an `IORef`.
22:54 chg1 joined
22:55 <MarcelineVQ> ludat: yeah, it's in head already so I'd expect a presence in 8.2
22:56 Rodya_ joined
22:57 <ludat> :hardcore_party_parrot:
22:57 <ludat> now I have more incentive to get snap into the latest stackage
22:57 gnurp joined
22:58 conal joined
22:58 <MarcelineVQ> it's probbaly not as spectacular as you're imagining :>
22:59 <ludat> I really like colors on my cli things
22:59 infinity0 joined
23:01 <mzabani> dmwit: I thought of something like that.. is this the only way you see to make this happen?
23:01 <mzabani> glguy: I'm not sure I understand you correctly (I'm new to all this, sorry), but I'm not trying to make IO an instance of MonadState
23:02 <mzabani> what I'm trying to do is have http-client send and receive from a websockets tunnel, whose functions live in a custom monad (which is basically a MonadState).
23:02 deepfire joined
23:03 <glguy> makeConnection isn't interested in any custom types. You'll have to provide things with the specific types being requested of IO ByteString and ByteString -> IO ()
23:03 hololeap joined
23:03 vertz joined
23:05 <glguy> You could perhaps define something with type: MVar SomeState -> StateT SomeState IO ByteString -> IO ByteString and use that to adapt your MonadState constrained definition
23:05 <glguy> MVar SomeState -> StateT SomeState IO a -> IO a *
23:06 justan0theruser joined
23:06 nomicflux joined
23:06 earldouglas joined
23:08 oisdk joined
23:09 <MarcelineVQ> ludat: afaik this is about the sum of it currently https://phabricator.haskell.org/D2716
23:09 sellout- joined
23:11 <mzabani> glguy: if the tunnel is to be used by something other than http-client, shouldn't I make its implementation rely only on (MVar SomeState)? Any modifications to the State done by http-client should be accessible to others in the same tunnel..
23:11 zcourts joined
23:12 <glguy> mzabani: That's why you'd need to put the final state back into the MVar at the end
23:13 maksim__ joined
23:14 Lord_of_Life joined
23:14 netrom joined
23:15 handyc joined
23:15 augur joined
23:16 Drezil joined
23:16 reactormonk joined
23:16 <mzabani> glguy: could I just get rid of StateT entirely and do this inside my own Monad implementation (let's say MonadTunnel), always depending on (MVar SomeState)?
23:17 dunj3 joined
23:18 <glguy> Whether or not you make a new typeclass (is that what MonadTunnel was going to be?) isn't important. The main thing is that at the end what you've built has the type expected by makeConnection
23:19 tromp joined
23:19 sellout- joined
23:20 <mzabani> all right, I think I've got a lot of info on how to get on with this. Thank you very much for your help!
23:20 Paprikachu joined
23:21 cschneid_ joined
23:22 freusque joined
23:27 pleax_ joined
23:28 nxtr joined
23:28 vertz left
23:29 lambdafan joined
23:31 SCHAAP137 joined
23:32 Qommand0r joined
23:34 maybefbi joined
23:34 doodlehaus joined
23:34 xcmw joined
23:35 sellout- joined
23:35 ziocroc joined
23:36 doodlehaus joined
23:36 begriffs joined
23:37 pasukon joined
23:37 contiver__ joined
23:40 zcourts_ joined
23:40 lep-delete joined
23:43 buttons840 joined
23:45 <buttons840> could someone give me some feedback on my approach to wrapping some errors here? http://lpaste.net/352796 it's taken me quite awhile to get this far and I still don't have some obvious error cases covered
23:46 doodlehaus joined
23:48 doodlehaus joined
23:48 Paprikachu joined
23:50 solenodic joined
23:51 twanvl joined
23:52 mac10688 joined
23:53 Gloomy joined
23:54 Gloomy joined
23:54 ystael joined
23:54 begriffs joined
23:54 augur joined
23:54 <ongy> 3/quit
23:54 Gloomy joined
23:55 <johnw> buttons840: use decodeUtf8' if you want an Either result
23:55 Gloomy joined
23:55 acidjnk joined
23:56 begriffs joined
23:56 YongJoon joined
23:56 Gloomy joined
23:57 <buttons840> johnw: yeah, I'm doing that now -- am i way off the mark on how I'm handling things, or is this close to how good error handling might look?
23:57 anuxivm left
23:57 Gloomy joined
23:58 <johnw> it feels a bit heavy on the error handling, since the actual "code" is almost nothing compared to everything else; maybe ExceptT would help to lighten it up
23:58 cmsmcq joined
23:58 <johnw> gotta run
23:59 <buttons840> ty