<    April 2017    >
Su Mo Tu We Th Fr Sa  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 _2_5 26 27 28 29  
00:01 infinity0 joined
00:02 dfordivam joined
00:04 infinity0 joined
00:07 jer1 joined
00:07 infinity0 joined
00:07 vaibhavsagar_ joined
00:10 infinity0 joined
00:14 skeet70 joined
00:16 hamishmack joined
00:16 mrcrjs joined
00:16 zcourts joined
00:16 jmcarthur joined
00:16 plutoniix joined
00:17 newhoggy_ joined
00:20 ryxai joined
00:20 Tourist joined
00:20 Tourist joined
00:20 carlosda1 joined
00:21 netheranthem joined
00:22 fgaz joined
00:23 le_frogballs joined
00:27 jer1 joined
00:27 arpl left
00:32 sid_fules joined
00:32 augur joined
00:33 p9s joined
00:34 oaao joined
00:34 maxirater joined
00:36 alue-42 joined
00:37 ertes joined
00:38 oaao joined
00:40 blender joined
00:41 nighty-- joined
00:42 Koterpillar joined
00:43 dramforever joined
00:46 <Sgeo__> Was there any malicious activity in here or anyone pasting in malware signatures? My AV thinks the #haskell logs are malicious
00:47 <kadoban> Sgeo__: Someone's quit message a while back included some stuff that seemed designed to trip anti-virus
00:48 jer1 joined
00:48 muff1nman_ joined
00:48 Micamo joined
00:54 <c_wraith> I probably shouldn't paste the whole EICAR-STANDARD-ANTIVIRUS-TEST-FILE string in here, right?
00:56 <kadoban> Seems like a bad idea xD
00:58 r1m4n joined
00:59 aarvar joined
01:00 andyhuzhill joined
01:01 codesoup joined
01:02 Tourist joined
01:02 Tourist joined
01:02 Stanley00 joined
01:02 bhiliyam joined
01:02 bloodpeach joined
01:03 bloodpeach left
01:05 netheranthem joined
01:06 mrjake joined
01:07 <mrjake> Does anyone have a working emacs config for getting offline haddocks, hlint, etc?
01:12 jer1 joined
01:14 conal joined
01:15 abhiroop joined
01:17 baldrick1 joined
01:18 le_frogballs joined
01:18 Destol joined
01:21 carlosda1 joined
01:21 robkennedy joined
01:22 feynhat joined
01:24 dennisvennink joined
01:28 kenobi_ joined
01:28 meba joined
01:28 urodna_ joined
01:29 urodna_ joined
01:30 dsh joined
01:31 guest16325 joined
01:31 jer1 joined
01:33 guest432842 joined
01:34 <sm> http://haskell.hackage.org/package/tweet-hs is great
01:35 <Welkin> hackage is down
01:35 <sm> and by that I mean http://hackage.haskell.org/package/tweet-hs
01:35 <Welkin> oh lol
01:36 seagreen joined
01:36 dan_f joined
01:36 <* sm> attempts to be hackagebot
01:37 <sm> oh! hackagebot is here
01:37 <sm> but I gave it to a new maintainer. But I failed to shut down the keep-me-up jobs
01:37 Supersonic112_ joined
01:38 guest8739274 joined
01:39 newhoggy joined
01:40 <sm> fortunately it was polling a special url which had gone away
01:40 uuplusu joined
01:41 blender joined
01:43 guest5894 joined
01:48 dachary1 joined
01:52 jer1 joined
01:55 systemfault joined
01:55 edmundsecho joined
01:56 Durbley joined
01:58 siiky joined
01:58 ericsagnes joined
02:00 hucksy_ joined
02:01 <siiky> hello haskellers, can someone explain a few things? im defining a class and trying to instanciate it (https://paste.rs/Hpp) but ghci complains about Maybe b not being of general type c
02:01 urodna joined
02:01 <siiky> shouldnt anything match type c?
02:02 takle joined
02:02 <siiky> i havent used haskell in a while and maybe i have a few wrong assumptions
02:03 <geekosaur> in this case, c is a type specified by the caller, not by you
02:04 <geekosaur> so it ends up working like
02:04 <geekosaur> :t undefined
02:04 <lambdabot> a
02:04 <geekosaur> a type you have no control over and know nothing about, so the only value it can have is bottom/nontermination
02:06 <siiky> if c its the type of the value returned by the function, how can it be specified by the caller? it cant be specified
02:07 <ChaiTRex> siiky: A lower-case type variable means it can be anything. You're trying to force it to be a Maybed type, which can't be anything, since it can't be a non-Maybed type.
02:07 <siiky> and since this is obviously wrong, is there a way to do this? it seems so simple to me, but maybe because im missing something
02:07 <siiky> aaah
02:08 sproingie joined
02:08 <dramforever> That's... not how it works
02:08 <dramforever> Can you explain in English?
02:09 <dramforever> Can you explain what you want to do in English?
02:09 <ChaiTRex> It looks like `inject` is `fmap`.
02:10 <ChaiTRex> Or the intent of it is `fmap`.
02:10 <ChaiTRex> Hmm, not really.
02:10 <ChaiTRex> My brain isn't working well this late.
02:11 <siiky> what i want inject to do? given a type of this class, i want to change the value inside it (if possible, as with Maybe _ in this example)
02:11 Habib joined
02:11 <Sornaensis> looks more like `pure x <*` ?
02:11 connrs joined
02:11 <siiky> or do nothing (as with Nothing in this example)
02:11 <Sornaensis> er no
02:11 <Habib> Hey, does anyone know why some packages expose a type to be used like (undefined :: Type) instead of just defining a unary constructor, Type?
02:11 <Sornaensis> fmap (const x)
02:12 <Sornaensis> > fmap (const 5) $ Just 6
02:12 <lambdabot> Just 5
02:12 <geekosaur> Habib, generally it's intended to be a type without values, where only the type is important. using undefined for that is actually obsolescent; these days one uses Proxy
02:12 <sproingie> Habib: if a constructor isn't exported, you can't pattern match on it, which makes it an opaque type
02:12 jer1 joined
02:13 <sproingie> which makes it "private"
02:13 <* siiky> looking at Functor instance of Maybe
02:13 takle joined
02:13 <Habib> geekosaur what do you mean by Proxy?
02:14 <geekosaur> https://downloads.haskell.org/~ghc/8.0.2/docs/html/libraries/base-
02:14 <Sornaensis> siiky: I think you are trying to do something that doesn't make much sense in haskell
02:14 a3Dman joined
02:14 <sproingie> @faq can haskell compute nonsense?
02:14 <lambdabot> https://wiki.haskell.org/FAQ
02:14 <sproingie> aww did i mess that up?
02:14 <Sornaensis> :t absurd
02:14 <lambdabot> Void -> a
02:14 <Sornaensis> ^
02:15 <geekosaur> sproingie, the old thing ("Yes!") hasn't existed in some years
02:15 <ChaiTRex> siiky: This is one potential solution: http://lpaste.net/354793
02:15 <sproingie> absurt (unsafeCoerce 1 :: Void)
02:15 <sproingie> *absurd
02:16 <sproingie> geekosaur: i've been away a while. kinda sad to see that one go.
02:16 <siiky> Sornaensis: think what im looking for is Functor, at least fmap does exactly what im trying to do with inject
02:16 <geekosaur> :t fmap
02:16 <lambdabot> Functor f => (a -> b) -> f a -> f b
02:18 le_frogballs joined
02:18 <Habib> geekosaur, so Proxy would be used like (Proxy :: Proxy Type), instead of (undefined :: Type)?
02:18 <geekosaur> yes
02:18 <geekosaur> if that's what they are doing with it
02:18 <geekosaur> it's safer than having `undefined` running around loose
02:19 <Habib> for more context, I'm trying to set up AES256/CTR encryption https://hackage.haskell.org/package/cryptonite-0.22/docs/Crypto-Tutorial.html
02:19 <Habib> The construct just looks ugly, with or without Proxy.
02:19 <siiky> ChaiTRex: didnt remember `m a`...
02:20 <siiky> but yeah, seems what im looking for is Functor. inject is a special case of fmap
02:20 <dramforever> Habib: agreed
02:20 <geekosaur> yes, it will, haskell has gained type level features but it'll likely never be pretty
02:21 <Habib> I don't understand why it's so important to make it unable to be pattern-matched on
02:21 <dramforever> geekosaur: I think in this case just exporting data AES256 = AES256 would be cleaner
02:22 <sproingie> same reason as any private data, so it can be changed without breaking APIs
02:22 carlosda1 joined
02:22 <Habib> dramforever My thoughts exactly.
02:22 <dramforever> If you don't like it: Go -> https://github.com/haskell-crypto/cryptonite/issues
02:22 <dramforever> sproingie: but the data isn't used at all
02:22 <dramforever> only the type
02:23 <sproingie> phantom type maybe. dunno.
02:23 <Habib> Why not just export an aes256 value, and don't export the constructors?
02:23 fgaz joined
02:23 <glguy> Habib: What part are you stuggling with?
02:23 <dramforever> But tagging *is* a safe solution IIUC
02:23 <Habib> I'm not struggling with using it, I'm just trying to understand why it's necessary to, in my eyes, complicate things.
02:23 <glguy> Habib: which part seems complicated?
02:24 <Habib> Well, the part where I can't just pass a value in (AES256), and have to pass in undefined where I specify a type (undefined :: AES256)
02:24 <glguy> You don't pass an undefined
02:24 <sproingie> having to pass in undefined would be a very bad API
02:24 <glguy> An AES256 actually is the key
02:24 <Habib> Or Proxy, whatever.
02:24 <glguy> No, Proxy won't do
02:25 <Habib> Well, the tutorial passes in undefined https://hackage.haskell.org/package/cryptonite-0.22/docs/Crypto-Tutorial.html
02:25 <sproingie> ew
02:25 <Habib> Exactly
02:25 <Habib> Specifically, this part: cipherMakeKey (undefined :: AES256) secret
02:25 <vaibhavsagar> I would also like to know what to replace this with
02:25 <sproingie> undefined shouldn't exist. it does because it's convenient. but normally, no.
02:25 <Habib> Tell that to the package author.
02:25 <glguy> Habib: You get one like this: cipherInit :: ByteArray key => key -> CryptoFailable cipher
02:25 <glguy> the key is embedded in the AES256 value assuming it validates
02:26 tripped joined
02:26 <sproingie> sounds like the tutorial isn't so hot
02:26 jer1 joined
02:27 <Habib> glguy: don't I have to cipherMakeKey first?
02:27 blender joined
02:27 <dramforever> There should be better ways of passing in the type...
02:27 <Habib> Wait, hold on.
02:27 anohigisavay joined
02:27 <glguy> Habib: No, I don't think that 'cipherMakeKey' is even defined by the library
02:28 <geekosaur> that's defined in place by the example
02:28 <Habib> Ah, yeah, so it is.
02:28 <Habib> Wow, this tutorial really complicates things.
02:29 connrs joined
02:30 <glguy> I think that this tutorial might have been written as part of an earlier version of the library and just wasn't updated
02:31 hybrid joined
02:34 Wizek_ joined
02:35 LHoT10820 joined
02:35 orhan89 joined
02:36 darjeeling_ joined
02:37 abhiroop joined
02:37 <Habib> cipherInit :: ByteArray key => key -> CryptoFailable cipher
02:37 na_th_an joined
02:37 <Habib> I'll write a aes256Init :: ByteString -> CryptoFailable AES256
02:38 <glguy> like: aes256Init = cipherInit :: ByteString -> CryptoFailable AES256 ?
02:38 watabou joined
02:39 sleffy joined
02:39 <Cale> btw, Typeable instances used to do a very similar thing (passing undefined as an argument in order to fix a type parameter)
02:39 <Habib> Well, like aes256Init = cipherInit, but just give it a type signature. It'll be a top-level function, so the type signature won't look weird
02:39 <glguy> I've since given up on cryptonite and have gone to HsOpenSSL
02:40 <Habib> HsOpenSSL seems restricted to OpenSSL “Partial OpenSSL binding for Haskell”
02:41 <sproingie> i could see it for Typeable since that's about types at runtime. why would a crypto lib need undefined?
02:41 <glguy> Yeah, it's possible that whatever you were trying to do isn't part of the binding
02:41 <glguy> sproingie: No, passing undefined as an argument doesn't help with runtime
02:42 <Cale> sproingie: Because it was abusing type classes where it really wanted to be passing around records of functions
02:42 <sproingie> well, (undefined :: Foo) does ... kinda
02:42 <glguy> Nope, that's just there to help with the type at compile time
02:42 Rodya_ joined
02:44 <sproingie> compile time makes me think of phantom types. but i guess i'm still a novice at Evil Type Trickery
02:44 splanch_ joined
02:45 <glguy> Yeah, "phantom" types are another example
02:46 chao-tic joined
02:46 <AfC> Habib: be aware that if you're trying to make a library that uses (depends on) HsOpenSSL and that is needs to run on multiple platforms you need to jump through some hoops.
02:46 iameric joined
02:47 <Habib> AfC, I'm using cryptonite for AES256, not HsOpenSSL
02:48 mac10688 joined
02:48 <AfC> Habib: ie https://github.com/afcowie/http-streams/blob/master/lib/Network/Http/Inconvenience.hs#L235
02:48 splanch joined
02:49 <AfC> Oh, sorry, it was glguy that said they'd gone to HsOpenSSL
02:50 justanotheruser joined
02:51 jer1 joined
02:52 chao-tic joined
02:52 fgaz_ joined
02:53 takle joined
02:54 exferenceBot joined
02:56 meandi joined
02:57 tnks joined
02:57 conal joined
02:58 godfreygyz joined
02:58 <pmn> Obligatory shoutout to Noise (https://hackage.haskell.org/package/cacophony) and NaCl (https://hackage.haskell.org/package/saltine)
02:58 hexagoxel joined
02:59 <godfreygyz> can anybody explain "((+) . (+)) <$> (*100) <*> (+) <*> (+100) <*> (- 100)" to me pls ?
03:00 mrjake left
03:01 <Cale> @unpl ((+) . (+)) <$> (*100) <*> (+) <*> (+100) <*> (- 100)
03:01 <lambdabot> (((((\ x -> (+) ((+) x)) <$> \ a0 -> a0 * 100) <*> (+)) <*> \ a0 -> a0 + 100) <*> (-100))
03:01 <Cale> heh, thought it would do a better job
03:01 <Cale> oh, but this (-100) is probably wrong
03:02 <Cale> Well, nope, that's not the only problem
03:02 <Habib> Take a number, apply (+) to it, which gives us (n +) partially applied. Apply (+) to that, which…
03:02 bhiliyam joined
03:02 <Habib> Should be a type error, right?
03:02 YongJoon_ joined
03:02 <Habib> (+) expects a number, not a partially applied function.
03:03 <godfreygyz> at least :t doesn't complain about it
03:03 <MarcelineVQ> not an error exactly, just an instance mess
03:03 <monochrom> @type ((+) . (+)) <$> (*100) <*> (+) <*> (+100) <*> (- 100)
03:03 <Habib> So that first ((+) . (+)) doesn't typecheck, does it?
03:03 <lambdabot> (Num ((a -> b) -> a -> b), Num ((a -> b) -> a), Num (a -> b)) => (a -> b) -> b
03:03 nick123_ joined
03:03 <Habib> @type ((+) . (+))
03:03 <lambdabot> (Num (a -> a), Num a) => a -> (a -> a) -> a -> a
03:03 <Cale> oh, well, :t won't complain, but it will require instances which won't likely exist
03:03 <Habib> Lol, Num (a -> a)
03:04 flatmap13 joined
03:04 vaibhavsagar joined
03:04 cyborg-one joined
03:04 <monochrom> instance Num a => Num (Cont r a) where ... :)
03:05 <Habib> i mean, what would a sensical definition for (+) look like for functions?
03:05 <Habib> that return the same value as they were passed in.
03:05 <Habib> Only id does that, right?
03:05 <Cale> @let instance (Num b) => Num (a -> b) where fromInteger n x = fromInteger n; (f + g) x = f x + g x; (f * g) x = f x * g x; negate f x = negate (f x); abs f x = abs (f x); signum f x = signum (f x)
03:05 <lambdabot> Defined.
03:05 <sproingie> just watched bartosz milewski's videos on category theory and i'm finally starting to get half the shit that's eluded me about haskell for 10 years :)
03:05 <Cale> > cos^2 + sin^2 $ 5
03:05 <lambdabot> 0.9999999999999999
03:06 <Habib> whoaaa
03:06 hiratara joined
03:07 <godfreygyz> completely lost ;(
03:07 <sproingie> plus it's awesome when he goes off on philosophical tangents
03:07 <Cale> > (((+) . (+)) <$> (*100) <*> (+) <*> (+100) <*> (- 100)) id
03:07 <lambdabot> -10100
03:08 <Cale> heh
03:08 <Cale> So, we can force it to typecheck, but probably someone meant to write something different than what they actually wrote
03:08 ericsagnes joined
03:08 <monochrom> I don't think anyone is meant to understand this clearly deliberately obscure code.
03:09 yogsototh joined
03:09 ryxai joined
03:09 felixsch__ joined
03:10 <monochrom> Well let's see if it's better if we fix the (- 100) problem.
03:10 <Cale> :t ((((+) .) . (+)) <$> (*100) <*> ((+) <$> (+100) <*> (subtract 100)))
03:10 <Cale> ((((+) .) . (+)) <$> (*100) <*> ((+) <$> (+100) <*> (subtract 100)))
03:10 <lambdabot> Num a => a -> a -> a
03:10 pera joined
03:10 <Cale> Possibly they meant to write that
03:10 <monochrom> OK that's better.
03:10 baldrick1 joined
03:11 <Cale> @unpl ((((+) .) . (+)) <$> (*100) <*> ((+) <$> (+100) <*> (subtract 100)))
03:11 <lambdabot> (((\ x x0 -> (+) (x + x0)) <$> \ a0 -> a0 * 100) <*> (((+) <$> \ a0 -> a0 + 100) <*> subtract 100))
03:11 <sproingie> kids and their new math
03:11 <Cale> so close
03:11 <Cale> heh
03:12 codesoup joined
03:12 <Cale> anyway (+) <$> (+100) <*> (subtract 100) is just (\x -> (x + 100) + (x - 100))
03:12 <Cale> which is basically (\x -> x + x)
03:13 <Habib> which is basically…
03:13 <Habib> (+)
03:13 <sproingie> but sparklier
03:13 <Habib> nice one
03:13 <godfreygyz> lol
03:13 <Cale> no
03:13 <Habib> whoops, meant (* 2)
03:13 <Cale> sure
03:13 <Habib> late here
03:13 <Habib> ;)
03:13 crobbins joined
03:14 <sproingie> i suggest an automated transform for such shiny code :)
03:14 <Cale> and then we're passing the same argument to (*100)
03:14 <Cale> and adding those things together with another argument
03:15 <Cale> So all in all, it amounts to (\x y -> 102 * x + y)
03:15 <Cale> But is needlessly convoluted
03:15 <sproingie> if that kind of obfu code had some nice 2d visualization...
03:16 Edith joined
03:17 <Cale> godfreygyz: How much do you know about Monad/Applicative already?
03:17 <godfreygyz> I just finished "Function as Applicative Functor" in learn you a haskell for great good
03:17 <Cale> ah
03:17 <Cale> Well, yeah, this uses the Applicative instance for (->) e
03:18 <Cale> For whatever reason, I find it easier to start with the Monad instance
03:18 <Cale> and then work out what the Applicative does from there
03:19 le_frogballs joined
03:19 <godfreygyz> it gives me an example of (+) <$> (+3) <8> (*100)
03:19 <Cale> yeah
03:19 <sproingie> slot machine code
03:19 <Cale> So, in this Monad/Applicative instance, "running" an action means applying it to the argument that the whole function has been applied to
03:20 <Cale> do x <- (+3); y <- (*100); return (x + y)
03:20 <Cale> Is an equivalent way to write that
03:20 <sproingie> that fits way easier into my brane
03:20 <godfreygyz> yeah I understand that
03:21 fgaz joined
03:21 <Cale> > (do x <- id; y <- reverse; z <- map toUpper; return (x,y,z)) "hello"
03:21 <lambdabot> ("hello","olleh","HELLO")
03:21 <sproingie> oh neat, named composition steps
03:21 <sproingie> self documenting code
03:21 <sproingie> (potentially)
03:22 justin3 joined
03:23 carlosda1 joined
03:23 <godfreygyz> but what if I want to, say, creating something equivalent to \x -> (x+3) + (x*100) + (x - 50) using applicative
03:23 <godfreygyz> in a pattern similar to (+) <$> (+3) <*> (*100)
03:24 BlueRavenGT joined
03:24 <Cale> :t (\x y z -> x + y + z) <$> (+3) <*> (*100) <*> (+ (-50))
03:24 <lambdabot> Num b => b -> b
03:24 otto_s_ joined
03:24 godfreygyz left
03:25 justan0theruser joined
03:25 godfreygyz joined
03:25 <Cale> heh, ragequit? :)
03:25 <pacak> @pl \x -> (x+3) + (x*100) + (x - 50)
03:25 <lambdabot> ap ((+) . liftM2 (+) (3 +) (100 *)) (subtract 50)
03:25 <godfreygyz> nope
03:25 <godfreygyz> accidents
03:26 <Cale> > (\x y z -> x + y + z) <$> (+3) <*> (*100) <*> (+ (-50)) $ 17
03:26 <lambdabot> 1687
03:26 takle joined
03:26 <Cale> > (\x -> (x+3) + (x*100) + (x - 50)) 17
03:26 <lambdabot> 1687
03:26 <pacak> lambdabot suggests something similar I think
03:26 <pacak> just more ugly
03:26 <godfreygyz> lol
03:26 <Cale> This is exactly the kind of expression which is not aided very much by this Applicative instance
03:27 <pacak> > join (*) 4
03:27 Sgeo joined
03:27 <lambdabot> 16
03:27 <pacak> yuck.
03:28 <sproingie> i never did get into applicatives, just sort of dove straight into monads
03:28 blender joined
03:28 <godfreygyz> well......then i wonder when would Applicative (r ->) become helpful
03:29 <vaibhavsagar> f <*> g == f x (g x)
03:29 <Cale> It's pretty rare to be honest, but it is kind of nice that it lines up perfectly with the SK calculus
03:30 <vaibhavsagar> and it's Reader
03:31 <godfreygyz> alright then, I think it's kind of useless to me since I have no idea what is SK calculus lol
03:31 aarvar joined
03:31 <godfreygyz> anyway I think I should move into monad
03:31 <vaibhavsagar> https://en.wikipedia.org/wiki/SKI_combinator_calculus
03:32 <Cale> Well, yeah, don't worry about it much for now
03:32 sleffy joined
03:32 <godfreygyz> true
03:33 flatmap1_ joined
03:33 <godfreygyz> thx a lot ;)
03:33 <Cale> godfreygyz: Sometimes, when you're manipulating a bunch of functions in particular ways, sometimes it's possible to provide a variation or two on <*> and actually build up a useful little language...
03:34 baldrick1 joined
03:35 sid_fules joined
03:36 <godfreygyz> lol
03:36 <Cale> ah, I thought I had a handy example, but I misremembered it, the one I was thinking of was with a composite of Dynamic (for values changing over time) and some Applicative for accumulating validation failures.
03:38 <godfreygyz> Cale: How did you learn and practice haskell? I just know learn you a haskell, real world haskell and haskell99
03:38 <pmn> check out haskellbook.com
03:38 <Cale> I started learning Haskell back in 2001-2002 or so
03:38 <Cale> The set of resources available was rather different.
03:39 <godfreygyz> true....
03:39 jer1 joined
03:39 <Cale> I learned from a variety of things. One of which was https://www.haskell.org/tutorial/
03:39 <Cale> The "Gentle" bit is kind of a lie
03:40 <Cale> It leaves a lot out and it's pretty short, but it is a good tutorial nonetheless to get a start on a bunch of ideas.
03:41 <godfreygyz> haskellbook.com looks nice
03:41 <Cale> I think Graham Hutton's book is pretty good
03:41 <godfreygyz> ummmmm
03:41 <Cale> http://www.cs.nott.ac.uk/~pszgmh/pih.html
03:42 <godfreygyz> hah
03:42 fgaz joined
03:43 <godfreygyz> I saw this one when I was looking up books about haskell in kindle store
03:43 <godfreygyz> think im gonna read that latter
03:43 ericmath1son joined
03:43 takle joined
03:44 <godfreygyz> thx a lot guys ;)
03:46 baldrick1 joined
03:46 greeen joined
03:48 brynedwards joined
03:51 ihavsn joined
03:53 fakenerd joined
03:57 matt179 joined
03:57 jer1 joined
03:58 insitu joined
04:00 splanch joined
04:01 conal joined
04:01 takle joined
04:03 fieldsofgold joined
04:04 cyborg-one joined
04:04 Rodya_ joined
04:08 uglyfigurine joined
04:09 BartAdv joined
04:11 infinity0 joined
04:14 splanch joined
04:14 hsk3 joined
04:15 <hsk3> I have built my Haskell web app using Stack. I use Stack's Docker functionality, so the binary will work both locally and on the server.
04:15 <hsk3> The question is, what is the best way to deploy the binary + source code to the server?
04:16 <hsk3> I can get the source code on to the server, because that's on the GitHub repo
04:16 <hsk3> (well, i only need a subset of the code on the server, such as HTML template files etc.)
04:16 m3adi3c joined
04:17 <hsk3> the question is, how to get the binary to the server
04:17 <hsk3> the binary is buried somewhere inside .stack-work
04:17 <hsk3> so I wonder if there are best practices here
04:17 <Koterpillar> hsk3: copy it out of `stack path --local-install-root`
04:18 abhiroop joined
04:18 jer1 joined
04:19 takle joined
04:19 mels joined
04:20 <hsk3> Koterpillar do i need to worry about relative paths? in other words, how exactly does "stack exec" run the binary?
04:20 govg joined
04:20 <hsk3> (i'm wondering if i need to keep that same long path on the server by creating that same folder structure for the binary)
04:23 carlosda1 joined
04:25 <Koterpillar> no, it runs it in the current directory
04:25 <Koterpillar> there are no absolute or relative paths hardcoded into it
04:27 sproingie joined
04:27 sproingie joined
04:29 blender joined
04:29 ublubu joined
04:29 takle joined
04:29 connrs joined
04:30 Sh4rPEYE joined
04:30 jer1 joined
04:31 darjeeling_ joined
04:31 codesoup joined
04:34 <hsk3> Koterpillar so after getting the binary path, it's just a matter of making a script that runs scp for the binary and all other files i need?
04:34 jhrcek joined
04:34 <hsk3> (i'm wondering if there's a more standard, recommend way of doing it)
04:35 juhp joined
04:35 <hsk3> recommended*
04:36 seagreen joined
04:36 splanch joined
04:36 takle joined
04:37 <Koterpillar> Yes. I've actually compiled all the templates inside the binary, so I just needed to copy one
04:37 govg joined
04:37 <hsk3> Koterpillar nice, how did you compile those into the binary?
04:38 vlatkoB joined
04:38 <Koterpillar> hsk3: https://github.com/koterpillar/multiblog/blob/master/src/Views.hs#L159
04:39 soniku joined
04:39 Goplat joined
04:39 baldrick1 joined
04:40 <hsk3> what mechanism here compiles it into the binary? i wonder if the same is possible with Heist
04:40 <Koterpillar> TH
04:41 matt179 joined
04:42 <Koterpillar> this might be useful: https://hackage.haskell.org/package/include-file
04:43 <hsk3> Thank you!
04:43 <hsk3> great stuff
04:43 ilyaigpetrov joined
04:44 forgottenone joined
04:45 eklavya joined
04:47 abra0 joined
04:50 takle joined
04:54 le_frogballs joined
04:55 wallnuss joined
04:55 bsima left
04:56 darjeeling_ joined
04:57 jer1 joined
05:00 newhoggy_ joined
05:01 splanch joined
05:02 locallycompact joined
05:02 bhiliyam joined
05:03 splanch_ joined
05:04 splanch__ joined
05:04 fgaz joined
05:04 m3adi3c joined
05:04 mels joined
05:05 caumeslasal joined
05:05 mels joined
05:07 steeze joined
05:14 jer1 joined
05:19 abhiroop joined
05:20 abhiroop joined
05:22 scottj joined
05:23 takle joined
05:24 carlosda1 joined
05:25 darjeeling_ joined
05:28 osa1 joined
05:28 osa1 joined
05:29 blender joined
05:30 sssilver joined
05:32 yellowj joined
05:33 insitu joined
05:34 laplacian joined
05:36 takle joined
05:37 Guest48456 joined
05:38 leat joined
05:39 <Lokathor> stack seems to have put "ghc-options: -threaded -rtsopts -with-rtsopts=-N" in my new project for the testing and exectuable parts
05:39 <Lokathor> is this normal? or have i left some old config some place?
05:40 Sh4rPEYE joined
05:40 <cocreature> Lokathor: that’s normal
05:40 <MarcelineVQ> yep very normal
05:40 soniku joined
05:41 <cocreature> apart from debugging the rts there is very little reason to use the non-threaded rts. and automatically choosing the right number of cores is also a good thing
05:41 orhan89 joined
05:41 <Lokathor> oh sure, but sometimes seemingly good ideas magically are bad in Haskell Land
05:41 <dfordivam> If I have two Data constructors (D1 :: String -> D1) and (D2 :: String -> D2), and I do serialization of (D1 "text"), then I can construct both D1 and D2 from the bytestring. Is there some way to restrict this so that (decode (encode (D1 "text")) :: D2 is not possible.
05:41 <Lokathor> like, "don't use -O2 unless you need to, just use -O, sometimes -O2 makes things slower instead"
05:42 <kadoban> Lokathor: If you like you can change your default template, that stuff is all configurable.
05:42 <cocreature> dfordivam: what’s the type of encode and decode?
05:43 le_frogballs joined
05:43 <dfordivam> Lets say I use Data.Serialize or Data.Aeson
05:43 <Lokathor> dfordivam, it's probably possible, because once it's passed through "encode" it's the same as any other <whatever text-like data type you encode and decode from>
05:43 <cocreature> dfordivam: you probably can’t get "decode (encode (D1 "text")) :: D2" to not typecheck but you can make it fail at runtime during deserialization
05:44 mstruebing joined
05:44 <dfordivam> Yes I want the decode to be Nothing / Left ie runtime failure..
05:44 xtreak joined
05:44 <dfordivam> But it is not a runtime failure right now
05:45 <cocreature> oh wait decode (encode (D1 "Text")) :: D2 doesn’t even make sense
05:45 <cocreature> D2 is a constructor not a type
05:45 <dfordivam> I mean if I use the default instances of cereal/aeson library
05:45 <dfordivam> data D2 = D2 String
05:45 abhiroop joined
05:46 caumeslasal joined
05:46 <cocreature> just write a custom instance
05:47 <jchia> How can I define Generic instance for Data.Vector.Sized.Vector 3 a that's isomorphic to the Generic instance for (a, a, a)? I'm quite confused about D1, C1, S1, Rec0, etc.
05:47 abhiroop joined
05:47 <cocreature> e.g. encode D2 s to {"tag": "d2", "value": s}
05:48 <dfordivam> :( I expected the serialization/de-serialization would maintain type info
05:48 <cocreature> dfordivam: how should it do that? there could be multiple types called "D2".
05:49 <cocreature> now you can add the module info but there can also be multiple modules with the same name containing the same type
05:49 <cocreature> adding the package, module and type name would probably be sufficient but at that point the overhead starts to matter
05:49 <dfordivam> cocreature: May be I will introduce a tag type in constructor... I dont want to write instances manually
05:50 <cocreature> dfordivam: also I’m not quite sure when that would be useful. do you have some minimal example of this?
05:50 juhp joined
05:50 <cocreature> in most case I would expect that switching to "data D = D1 String | D2 String" is more appropriate
05:50 takle joined
05:51 ThomasLocke joined
05:51 ThomasLocke joined
05:51 fakenerd_ joined
05:51 xormor joined
05:52 fakenerd joined
05:54 abhiroop joined
05:54 <dfordivam> cocreature:Right this looks the proper way of doing this...
05:55 fakenerd joined
05:57 guiben joined
05:57 jer1 joined
05:58 takle joined
05:58 uglyfigurine joined
05:59 abhiroop joined
05:59 ogrady joined
06:01 ali_bush joined
06:01 ali_bush joined
06:01 wallnuss joined
06:03 trudyjane joined
06:04 sleffy joined
06:05 hurkan joined
06:07 blender joined
06:09 Gurkenglas_ joined
06:09 raichoo joined
06:10 ArchaicLord joined
06:11 fizruk joined
06:11 <ArchaicLord> hello, I am here becuase I have been dabbling with tiling mangers. Somone suggested xmonad over i3. I read xmonad needs haskell knowledge which i know nothing about. so wondering if anyone can point in a good direction to get started please
06:11 takle joined
06:13 connrs joined
06:14 ali_bush joined
06:14 ali_bush joined
06:14 abhiroop joined
06:14 jer1 joined
06:15 kritzcreek joined
06:15 <peddie> ArchaicLord: try #xmonad perhaps -- not sure xmonad needs much haskell knowledge to configure, and it certainly doesn't need any to use apart from configuration :)
06:16 takuan joined
06:16 <ArchaicLord> ok
06:16 <peddie> ArchaicLord: at least I was using xmonad for over a year before I knew how to write "hello world" in haskell
06:19 govg joined
06:19 takle joined
06:20 RayNbow`TU joined
06:20 juhp joined
06:21 thunderrd_ joined
06:23 AfC joined
06:23 xtreak joined
06:23 ralu joined
06:25 carlosda1 joined
06:25 ridho joined
06:26 freusque joined
06:27 BartAdv joined
06:28 ralu_ joined
06:28 xormor joined
06:29 auscompgeek1 joined
06:29 edsko joined
06:29 matt179 joined
06:29 newhoggy joined
06:31 jer1 joined
06:31 rockkid777 joined
06:32 orhan89 joined
06:32 takle joined
06:34 alfredo joined
06:36 abhiroop joined
06:37 ralu_ joined
06:38 somewone joined
06:39 <ArchaicLord> is worth the pain xmonad
06:40 fieldsofgold joined
06:40 zeroed joined
06:40 zeroed joined
06:41 <ArchaicLord> I followed a guide to instlal it but the setup on the guide is crap. I wanted to start again but this time learn it so i understand it
06:41 saurabhnanda joined
06:42 le_frogballs joined
06:43 saurabhn_ joined
06:44 <trudyjane> I just used other peoples configs and have been modifying those over time.
06:45 etehtsea joined
06:45 newhoggy joined
06:46 ubsan_ joined
06:47 <trudyjane> In fact, had to modify my .xmobarrc file tonight because xmonad has been freezing on me lately.
06:47 <trudyjane> So far so good...
06:48 ralu joined
06:48 quchen joined
06:48 _sras_ joined
06:48 <peddie> ArchaicLord: I've been using it since early 2008 and barely ever touch the configuration file. so I guess unless the config file is extremely painful for you, I'd say it's worth it
06:50 <hsk3> Are there Haskell packages with multi-word names that use _ instead of - ?
06:50 <hsk3> I'm wondering if using _ would break conventions
06:51 <Koterpillar> hsk3: https://www.stackage.org/lts-8.11 search for "_" on that page
06:51 <hsk3> lol
06:52 <hsk3> Koterpillar and for those that produce executable binaries, do those binaries also tend to use - instead of _ ?
06:52 M_ joined
06:53 <Koterpillar> not sure how to check that, but I think you are right, "-" is more common
06:53 takle joined
06:54 <hsk3> cool, thanks
06:54 somewone joined
06:54 <_sras_> Is there a way to visualize dependencies between various local modules in a stack project?
06:55 <_sras_> some thing like `stack dot`, but for local, user modules?
06:57 <cocreature> _sras_: https://github.com/yav/graphmod
06:57 augur joined
06:57 sibi joined
06:57 forgottenone joined
06:58 <Koterpillar> hsk3: ls /bin | grep - | wc -l -> 947; ls /bin | grep _ | wc -l -> 229
06:58 <hsk3> :)
06:58 jer1 joined
06:58 sproingie joined
06:59 ryxai joined
07:00 ichor joined
07:00 somewone joined
07:00 hvr joined
07:00 hvr joined
07:00 <_sras_> cocreature: Thanks. let me try.
07:01 abhiroop joined
07:01 skeuomorf joined
07:02 somewone_ joined
07:02 bhiliyam joined
07:04 yoneda joined
07:05 connrs joined
07:06 oaao joined
07:06 newhoggy joined
07:08 Swizec joined
07:10 raichoo joined
07:10 Itkovian joined
07:12 Cir0X joined
07:12 vlatkoB_ joined
07:12 newhoggy joined
07:12 indi_ joined
07:14 yogsototh joined
07:14 watabou joined
07:14 raichoo joined
07:15 indi_ joined
07:15 fgaz joined
07:16 jer1 joined
07:17 takle joined
07:17 tobiasBora joined
07:18 fragamus joined
07:18 iross_ joined
07:18 bennofs joined
07:18 abhiroop joined
07:19 freusque joined
07:20 ventonegro joined
07:20 MoALTz joined
07:20 __paul0 joined
07:22 vaibhavsagar_ joined
07:23 insitu joined
07:23 C-16 joined
07:23 connrs joined
07:26 carlosda1 joined
07:29 xmonader2 joined
07:30 TheLemonMan joined
07:30 <ArchaicLord> thats interesting pebble becuase one of the plus of xmonad over i3 is that is ment to crash less
07:30 takle joined
07:33 <peddie> ArchaicLord: I assume you're addressing me (sorry, my nick is neither a rock nor any other common word) . . . never tried i3, but I don't think I've ever had xmonad crash. and whenever a new version comes out I can just upgrade in place without restarting anything :D
07:34 grayjoc joined
07:35 connrs joined
07:35 <ArchaicLord> cool.. Sorry I am kinnda new.. just finish uni, currently at home on Windows but have a linux virtual box instance. I have ajob offer who are using Ubunut 14.04 so trying to play with it more. I can't see how in this Chrome client to tag people
07:38 xcin joined
07:38 jer1 joined
07:40 raichoo joined
07:40 soniku joined
07:42 gmhafiz joined
07:43 detrumi joined
07:44 ixxie joined
07:45 blender joined
07:47 mjora7 joined
07:48 fizruk joined
07:49 <Unode> Is (fmap customfunction []) returning "" a violation of the Functor laws? i.e an empty "" is equivalent to [] but does it still qualify as the same type?
07:49 thc202 joined
07:50 <jle`> Unode: fmap can change the type
07:51 <jle`> fmap customFunction [] should return an empty list of whatever type customFunction returns
07:51 fgaz joined
07:51 LAZAR joined
07:51 <jle`> what the functor laws dictate is that fmap can't change the length of []
07:51 <jle`> *the length of the input list
07:52 <jle`> that's one of the free theorems :)
07:52 <Unode> jle`: hum I'm reading "Haskell programming from first principles" and the emphasis is on identity and composition. You now mentioned length which seems like a different "law".
07:53 <jle`> length being preserved is a consequence of identity and composition
07:53 <jle`> admittedly, it's a surprising consequence
07:54 <jle`> but starting from the functor laws, you can prove that fmap must preserve the length of the input list
07:54 <jle`> math is power ~
07:54 <Unode> :)
07:54 cjheath joined
07:54 somewone joined
07:54 <Unode> ok, I'll keep reading with that in mind. Thanks!
07:54 <jle`> but yes, "" is just syntactic sugar for []
07:54 <jle`> if that was what your original question was (i'm not exactly sure)
07:55 <jle`> so returning "" is just returning [] :: String
07:55 mfukar joined
07:55 blender1 joined
07:55 <jle`> > fmap id ""
07:55 <lambdabot> ""
07:55 <jle`> > fmap id [] :: String
07:55 <lambdabot> ""
07:55 takle joined
07:55 albertid joined
07:55 abhiroop joined
07:55 <jle`> the Show instance for lists implements `show ([] :: String)` as ""
07:56 <jle`> so even though it's printing "", be aware that the result is really just []
07:56 <jle`> > show ([] :: String)
07:56 <lambdabot> "\"\""
07:56 ogrady_ joined
07:56 <jle`> it's just a quirk of the Show instance for lists :)
07:56 magneticduck joined
07:56 edmundsecho joined
07:57 marr joined
07:57 <jle`> the Show instance for list is kind of crazy in general
07:58 jer1 joined
07:58 ogrady_ joined
07:58 cordawyn joined
08:00 augur joined
08:00 augur joined
08:01 <liste> :t showList
08:01 <lambdabot> Show a => [a] -> ShowS
08:01 <liste> > showList "123"
08:01 <lambdabot> <[Char] -> [Char]>
08:02 <mjora7> Is there any point in using [Char] over String?
08:02 takle joined
08:02 ccomb joined
08:02 <jle`> do you mean, typing one over the other?
08:02 <mjora7> Yeah
08:03 <jle`> might as well ask if there's any point in typing String over [Char]
08:03 <jle`> the two are interchangeable
08:03 <mjora7> So they're exactly identical then?
08:03 <jle`> sometimes [Char] can be nice if you want to explicitly document that you are working over a list of things, which happen to be Char
08:04 <jle`> but it's not a big deal either way
08:04 <jle`> they are identical to Haskell
08:04 <liste> String is a synonym of [Char]
08:04 <jle`> it's more or less a lexical alias
08:04 xtreak joined
08:04 <mjora7> Ok cool.
08:04 <liste> @src String
08:04 <lambdabot> type String = [Char]
08:04 <jle`> if you're familiar with C/Cpp, it's like #def String [Char]
08:04 <jle`> * #define
08:04 <mjora7> Right.
08:04 cobreadmonster joined
08:05 <mniip> typedef [char] string;
08:05 yellowj joined
08:06 xtreak joined
08:07 <mjora7> Well it would be `typedef char * String` in C++. But I get it, thanks for the example.
08:09 petermw joined
08:09 <mniip> * is not really synonymous with []
08:09 ragepandemic joined
08:10 dennisvennink joined
08:10 <mniip> typedef std::forward_list<char> string;
08:10 <mniip> not sure you can write that though
08:10 <mniip> because template parameters
08:10 <mjora7> Ok then it would be `typedef char String[]`?
08:11 <mniip> hmm
08:11 <liste> lists are not arrays
08:11 <mniip> not that either
08:11 <mfukar> There is no direct analogue.
08:11 <mniip> well, if we're talking about translating haskell lists into C
08:12 Yuras joined
08:12 <mjora7> What is a difference between Haskell lists and C-style arrays?
08:12 <mniip> then it's more like a uniform interface over a singly linked list and a generator
08:12 fractalsea joined
08:12 <mniip> mjora7, haskell is lazy, it uses a different evaluation strategy
08:12 ericsagnes joined
08:13 <mjora7> Right
08:13 tennix joined
08:13 <mjora7> Haskell is the coolest language I've ever encountered, only 2 days into learning it atm.
08:13 <mniip> if we disregard evaluation and question what lists look like
08:13 <liste> mjora7: lists don't support random access, just iteration and non-destructive prepend (ie. creating a new list with another element in front)
08:13 <mniip> then it's a singly linked list
08:13 <mniip> yeah
08:14 <mniip> the "fundamental" operations are head, tail, cons
08:14 <mniip> all done in O(1) time
08:15 <mjora7> Ok
08:15 <mjora7> Does Haskell have arrays?
08:15 <liste> mjora7: yes
08:15 <mniip> yes
08:15 <mniip> though there is a catch
08:15 <mniip> they are akin to an intrinsic
08:15 zero_byte joined
08:16 <mniip> they aren't exactly built into the language, so they have an implementation, yet that implementation is not very nice
08:16 <mjora7> Ok
08:16 starmix joined
08:16 abhiroop joined
08:17 tusj joined
08:17 <liste> and arrays are less useful than in other languages, because either they're immutable, or require working in IO/ST
08:17 fgaz_ joined
08:17 <mjora7> What do you guys use Haskell for?
08:17 <mniip> ST is underrated
08:18 <mniip> it's not as bad as IO
08:18 chbatey joined
08:18 eklavya joined
08:18 abhiroop joined
08:18 tusj joined
08:19 jer1 joined
08:19 cloudhead joined
08:20 skeuomorf left
08:20 <mniip> mjora7, as a general purpose language
08:21 cfricke joined
08:21 <Iceland_jack> mjora7: As a tool to explore ideas (and (work (I (guess))))
08:21 merijn joined
08:21 laz joined
08:23 <ArchaicLord> Thank you for the help /msg peddie [Finaly worked out how to tag people ] :D
08:23 mattyw joined
08:23 takle joined
08:23 lep-delete joined
08:24 dbeacham joined
08:24 fgaz left
08:25 Itkovian joined
08:25 cordawyn joined
08:25 <hsk3> I'm wondering emacs vs. vim. Now with inerto, I guess there's no contest is it?
08:25 <mjora7> Any example projects?
08:25 <hsk3> since inerto is emacs
08:25 locallycompact joined
08:26 <MarcelineVQ> hsk3: there's intero for nvim as well, possibly vim idk
08:26 charco joined
08:26 dbeacham joined
08:26 <MarcelineVQ> tbh I've been using just ghcid lately and it's really nice, I don't miss the mouse-over-types from ghc-mod as much as I thought I would
08:26 <hsk3> is it maintained as much?
08:26 carlosda1 joined
08:26 <hsk3> hmmok
08:27 abhiroop joined
08:27 <sophiag> someone suggested i use dante since i use nix instead of stack, but dante appears currently broken for nix :(
08:28 Sampuka joined
08:28 <sophiag> but yeah, he said intero was grea
08:28 amosbird joined
08:28 meandi joined
08:29 petermw joined
08:29 <amosbird> hi, why am I getting this when trying to install yi editor https://paste.wentropy.com/7aXU
08:29 whiteline joined
08:30 bvad joined
08:31 merijn joined
08:31 fotonzade joined
08:32 alios joined
08:33 whiteline joined
08:34 <cocreature> amosbird: because you haven’t installed alex
08:35 abhiroop joined
08:35 tusj joined
08:37 govg joined
08:38 <merijn> Is there a way to get GHC/cabal to print a dependency/import graph of a project?
08:38 takle joined
08:38 biglama joined
08:39 mohsen_ joined
08:39 <cocreature> merijn: I use https://github.com/yav/graphmod for that
08:39 ndzndz joined
08:39 om joined
08:39 <bvad> merijn: seconding graphmod.. if you're using stack https://docs.haskellstack.org/en/stable/dependency_visualization/
08:39 jer1 joined
08:39 nickolay joined
08:41 le_frogballs joined
08:41 <hvr> merijn: if you use cabal new-build, and you care about package deps, here's something that prints a text-tree dep: http://hackage.haskell.org/package/cabal-plan
08:41 <merijn> hvr: No, just module dependencies
08:42 <merijn> hvr: Basically, diving into a new codebase and trying to figure out which files I can start without dependencies ;)
08:42 <hvr> merijn: oh... for that I used http://hackage.haskell.org/package/SourceGraph long time ago
08:42 binaryplease joined
08:42 <hvr> merijn: not usre if that still works
08:42 <amosbird> cocreature: hm
08:43 <amosbird> why does it not install alex for me
08:43 <merijn> I'll try graphmod :)
08:43 <cocreature> amosbird: alex is a build-tool not a runtime/link dependency and cabal doesn’t install these
08:43 <hvr> cocreature: actually...
08:44 <hvr> cocreature: cabal new-build does auto-install alex/happy if it's declared a build-tool or build-tool-depends... and makes it available at build-time
08:44 <amosbird> ok
08:44 <* merijn> sighs
08:44 <merijn> hvr: Where can I find a write-up of new-build?
08:44 <cocreature> hvr: I know but "cabal new-build" is not usable in any released version of cabal so recommending that is not really useful
08:45 <merijn> blah
08:45 <merijn> graphmod crashes with "too many open files" with a mere 49 files >.>
08:45 <hvr> merijn: basic documentation is at http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html
08:45 mattyw joined
08:46 tomboy64 joined
08:46 <ArchaicLord> The learning curve is so high I havn't used any of these while I been studyign but I really want to
08:46 <ArchaicLord> http://spacemacs.org
08:46 <hvr> (fwiw, the section http://cabal.readthedocs.io/en/latest/nix-local-build.html#unsupported-commands is not fully accurate; some of those commands already work)
08:46 <merijn> hvr: In released cabal-install or just the dev version?
08:47 <hsk3> ArchaicLord the learning curve of what? spacemacs?
08:47 <hvr> merijn: released cabal would be 1.24; that documentation however is supposed to be for cabal 2.1 :-)
08:47 <hvr> merijn: and yeah, cabal 1.24 lacks quite a bit of features regarding new-build
08:47 fizruk joined
08:48 <merijn> *sigh* guess I'll clone chrisdone's graphmod repo to fix this
08:48 uve joined
08:48 <uve> Hey guys
08:48 mada joined
08:49 <merijn> Anyone know how I can jump from a Pull Request to the PRs origin repo on GitHub?
08:50 <hvr> merijn: some time ago I hacked up some tool I never polished, which would work by using -ddump-minimal deps to analyse inter-module deps
08:50 <hvr> (and given graphmod's existence I never bothered to)
08:51 iulian joined
08:51 <merijn> I'm just confused 49 files is exceeding the fd count, unless it's being stupid and repeatedly opening the same files
08:52 <hvr> the benefit was that it would look through TH & CPP
08:52 ski joined
08:52 uve left
08:53 <merijn> I'm...not impressed with graphmod's speed...
08:53 <hvr> I guess you're experience "Haskell tooling still sucks" :-)
08:54 <merijn> hvr: Well, this seems more a matter of "braindead implementation"
08:54 <hvr> (re https://www.reddit.com/r/haskell/comments/66m06j/death_by_a_thousand_cuts/ )
08:54 coot__ joined
08:54 <merijn> Because I would expect "rendering a DAG of 49 nodes" to take substantially less than several minutes of 90+% CPU utilisation
08:54 <hvr> merijn: I would have guessed lazy I/O usage causing fds to get used up
08:55 <merijn> hvr: Sure, but that still does not explain why it runs out of fds when inspecting only 49 files
08:55 <hvr> yeah, that doesn't sound good :)
08:55 <merijn> Open files is limited to 256 according to ulimit
08:56 cordawyn joined
08:56 juliagoda joined
08:56 ogrady joined
08:56 <merijn> I'm passing it 49 haskell source files and it first runs out of fds, then with chrisdone's patch it works but takes actual minutes of 90+ CPU utilisation. Now, I'm not a performance wizard, but my instinct says that you have to be doing REALLY silly things to perform this bad..
08:57 <hvr> yeah... unless it's doing some weird NP-imcomplete computation on a 49-node graph... but I'd still be surprised
08:57 Iceland_jack joined
08:57 tusj joined
08:57 coot__ joined
08:57 <hvr> does it terminate?
08:57 <merijn> hvr: But, if you blindly assume a lack of hs-boot files you don't even need NP stuff, ordering a DAG is pretty trivial
08:58 <merijn> hvr: Well, not yet...
08:58 <hvr> maybe there *is* a cycle?
08:58 <hvr> or graphmod *thinks* there is a cycle?
08:58 <hvr> (and doesn't detect it)
09:00 mthek joined
09:00 <merijn> hvr: I don't think so?
09:00 ogrady__ joined
09:00 <merijn> I certainly don't see any boot files
09:00 dennisvennink joined
09:00 cdidd joined
09:00 <merijn> ok, I'm killing this, since it's actually affecting the responsiveness of my terminal
09:00 oish joined
09:00 <merijn> Right, so any alternatives to graphmode? :p
09:01 <hvr> merijn: ...writing your own tool... :-) it's quite easy to parse out the module deps
09:01 chbatey joined
09:01 <merijn> hvr: But I don't wanna :(
09:02 <merijn> hvr: This way lies infinite yak shaving, and I'm already like 50 yaks in...
09:02 <merijn> hvr: Incidentally, are you also a Hackage admin?
09:02 <hvr> more or less... :-)
09:02 bhiliyam joined
09:02 takle joined
09:03 <hvr> merijn: fwiw, you could easy get https://github.com/hvr/packunused/blob/master/packunused.hs to spit out the module->[module] edges
09:03 <merijn> hvr: I can't manage to reset my password. The reset link claims to send me a reset link, but it never arrives
09:03 <hvr> you're on gmail?
09:03 <merijn> Nope
09:03 jer1 joined
09:03 <hvr> we had some similiar issue recently already
09:04 <merijn> I don't see anything in spam/whatever either, so I'm thinking something is borked in the email setup
09:04 <hvr> merijn: can you plz write an email to admin@haskell.org about it?
09:05 osa1 joined
09:05 osa1 joined
09:05 <hvr> merijn: when did you trigger the email reset?
09:05 <hvr> merijn: if it's not recent, can you try again now? so I can look at the logs
09:06 guiraldelli joined
09:06 bennofs joined
09:06 <merijn> hvr: Yesterday afternoon and again this morning
09:06 <merijn> So, like 1 or 2 hours ago tops
09:06 takle joined
09:06 <hvr> merijn: ok, please write an email to admin@ I see the reason, but I want to keep the other admins in the loop
09:07 <hvr> johnw: ping?
09:07 binaryplease joined
09:07 <merijn> Just did :)
09:08 sid_fules joined
09:09 <hvr> thx
09:10 ub joined
09:14 <hvr> merijn: somebody should get back to you
09:14 <hvr> I need to get ahold of our mail configuration gurus
09:15 ragepandemic joined
09:15 Yuras joined
09:15 <merijn> hvr: Sure :)
09:15 tusj joined
09:15 fieldsofgold joined
09:16 fotonzade joined
09:16 dqd joined
09:17 <merijn> oh, I think I mailed admin@haskell.org lemme update that to hackage.haskell.org :)
09:17 <merijn> hvr: Actually, do you know what sender address hackage uses?
09:19 <hvr> merijn: I know it didn't get accepted by our mail relay...
09:19 <hvr> so you definitely didn't get it in your inbox/spam
09:20 <hvr> it *should* have from=<hackage@hackage.haskell.org> as sender
09:20 fbergmann joined
09:22 michielb joined
09:23 sid_fules joined
09:23 <merijn> hvr: If it's only gmail and some others I wonder if it's not something like wrongly/missing DKIM/SPF
09:24 jer1 joined
09:25 mekeor joined
09:25 Aku joined
09:25 xtreak joined
09:27 <Aku> Can somebody help me convert one instance of a particular data type into other? I will post the code -->
09:27 <hvr> merijn: yeah, the SPF looks a bit incomplete; but I'd have to look at the mail.h.o logs to know if that's the real reason
09:27 carlosda1 joined
09:27 ixxie joined
09:28 <merijn> hvr: See -infrastructure response
09:31 <lpaste> Aku pasted “No title” at http://lpaste.net/4186157945983074304
09:32 <Aku> I want to convert Nfa Int to the earlier Dfsa st sy
09:32 <Aku> I don't understand how to do it!
09:33 <Aku> Can somebody look at the code
09:33 bjz joined
09:33 zeroed joined
09:34 le_frogballs joined
09:34 uglyfigurine joined
09:34 <Aku> Is anybody free and take a look at my code?
09:36 <Aku> I am using the Halex.Dfa library
09:36 <Aku> But they haven't defined how the delta function should actually be
09:36 <pacak> Aku: Don't mix tabs with spaces...
09:37 <Aku> okay
09:37 ogrady joined
09:37 <Aku> I just copied the code in ahurry
09:37 kuribas joined
09:37 tusj joined
09:37 takuan joined
09:37 ogrady joined
09:38 doomlord joined
09:38 <Aku> pacak: Up there looking at it?
09:39 <pacak> Aku: Kind of. It's hard to suggest anything without knowing which library you are using
09:40 <Aku> Just a sec, I will post the full code and the name of library as well
09:40 <Aku> https://hackage.haskell.org/package/HaLeX-1.2.6/docs/Language-HaLex-Dfa.html
09:40 <Aku> Here is the link
09:40 <pacak> That probably won't help me since I'm not familiar with that library.
09:40 <Aku> Can u just tell me what the delta function is?
09:41 <Aku> In the constructor of Dfa
09:41 cordawyn joined
09:41 <Aku> Dfa [sy] [st] st [st] (st -> sy -> st)
09:41 <Aku> the last one
09:41 abhiroop joined
09:42 <pacak> Looks like something that takes state, next symbol and creates a new state
09:42 <Aku> Ya but then look at the code I posted earlier
09:43 <Aku> They have defined one machine named ex1
09:43 jeltsch joined
09:43 <Aku> And look at delta over there
09:43 <Aku> How can they have multiple deltas inside the where clause
09:44 <pacak> lines 11..14? IT's just one function
09:44 <pacak> Do you know about pattern matching?
09:44 <Aku> Ya that part can u explain a bit?
09:45 <pacak> Or how to write functions?
09:45 <Aku> yes I know
09:45 <Aku> yes
09:45 jer1 joined
09:45 zeroed joined
09:45 zeroed joined
09:45 <pacak> So those lines with delta - it's just one function declared
09:45 <Aku> okay
09:46 marfoldi joined
09:46 <Aku> How do I convert my machine to that form
09:46 <Aku> ?
09:47 balor__ joined
09:47 mmn80 joined
09:48 govg joined
09:48 <Aku> pacak: ??
09:48 <pacak> I dunno. Are you taking a course about state machines? In that case they should have some explanations
09:48 Glooomy joined
09:49 <Aku> Actually I have completed the implementation
09:49 slomo joined
09:49 <Aku> I just want to visualize the automata
09:49 <Aku> using graphviz
09:50 <Aku> but they want the DFA to be defined as in the library
09:50 <Aku> And mine is a different version
09:50 <Aku> So just want to convert
09:50 HoierM joined
09:51 <pacak> Try reading documentation and figuring out convert it
09:51 <pacak> Ability to read documentation is useful.
09:51 <Aku> The documentation is not complete
09:51 <Aku> They just give the type definition
09:51 <pacak> Read the source code and theory behind NFA and DFA
09:51 <Aku> okay
09:52 <pacak> If you have any specific questions - feel free to ask
09:52 <pacak> How do I convert - answer to this question won't help your understanding.
09:53 simukis__ joined
09:53 zcourts_ joined
09:54 balor_ joined
09:55 m1dnight_ joined
09:55 <Aku> okay
09:56 orhan89 joined
09:58 zeroed joined
09:58 zeroed joined
09:59 sproingie joined
10:00 willprice joined
10:02 mekeor joined
10:02 zeroed joined
10:02 zeroed joined
10:03 fizruk joined
10:05 seveg joined
10:05 jer1 joined
10:06 nilof joined
10:07 splanch joined
10:08 sepp2k joined
10:10 beerdrop joined
10:12 splanch_ joined
10:13 theelous3 joined
10:14 ixxie joined
10:14 splanch joined
10:16 splanch__ joined
10:17 splanch_ joined
10:18 dan_f joined
10:21 splanch joined
10:22 balor joined
10:23 splanch_ joined
10:23 zeroed joined
10:23 zeroed joined
10:24 Micamo joined
10:24 balor_ joined
10:25 splanch__ joined
10:25 locallycompact joined
10:27 Shock_ joined
10:28 splanch joined
10:28 carlosda1 joined
10:28 rcat joined
10:29 xinming joined
10:29 roconnor joined
10:30 abhiroop joined
10:30 xtreak joined
10:31 slomo joined
10:31 osa1 joined
10:37 bjz joined
10:38 balor__ joined
10:38 Glooomy joined
10:42 mada joined
10:47 fizruk joined
10:48 om left
10:52 Durbley joined
10:55 ichor joined
10:58 matt179 joined
10:59 ogrady joined
11:00 binaryplease joined
11:02 Snircle joined
11:02 bhiliyam joined
11:06 Sh4rPEYE joined
11:07 ragepanda joined
11:07 fotonzade joined
11:07 Glooomy joined
11:07 oisdk joined
11:09 NyanPasu joined
11:09 osa1 joined
11:09 osa1 joined
11:12 Sh4rPEYE joined
11:14 <Sh4rPEYE> Hey. I've an article that praises lazy dynamic programming in Haskell and advises to use Data.Array for it. I wanted to ask if that's the best way and also if LDP is generally a good way to build algorithms in Haskell (meaning: if I have some alternatives, similarly effective, should I use LDP)
11:14 <Sh4rPEYE> The article in question: http://jelv.is/blog/Lazy-Dynamic-Programming/
11:15 splanch joined
11:16 gawen joined
11:17 Fendor joined
11:18 <merijn> Sh4rPEYE: Lazy Dynamic Programming boils down to "memoised dynamic programming, without having to implement complex memoisation" :)
11:19 AfC joined
11:19 Sh4rPEYE_ joined
11:20 tsmish joined
11:21 <Sh4rPEYE> merijn: Fair enough, that sounds good. What about the arrays? Is there a better way?
11:21 <merijn> Sh4rPEYE: Lazy Map would work just as well
11:22 JagaJaga joined
11:23 Faucelme joined
11:24 soniku joined
11:25 ziocroc joined
11:27 cdidd_ joined
11:29 carlosda1 joined
11:31 newhoggy joined
11:32 fractalsea joined
11:32 OnkelTem joined
11:33 <OnkelTem> Hi all
11:33 <OnkelTem> How to run executables from ~/.stack/programs/x86_64-linux/ghc-8.0.2/bin using stack?
11:33 <OnkelTem> For example PHPStorm needs ghc-pkg for intergration
11:35 <quchen> OnkelTem: Instead of running »prog«, use »stack exec prog«. This adds the appropriate directories to your $PATH.
11:36 <quchen> And then, »stack exec phpstorm« will have access to »ghc-pkg«.
11:36 abhiroop joined
11:36 <OnkelTem> ahh
11:36 <quchen> The reason for this is that you can tell »stack exec« which LTS to use (i.e. which compiler and ecosystem).
11:37 <quchen> So if you want to switch compilers, just say »stack exec phpstorm --resolver lts-7« and you’ll get a LTS-7 environment.
11:37 <OnkelTem> I see. Smart. But in my case it's not a solution, since I'm running stack inside a docker container
11:37 <OnkelTem> yes, I understand
11:37 <quchen> I don’t know anything about Docker I’m afraid.
11:39 <cocreature> OnkelTem: how does docker cause problems here?
11:40 ichor joined
11:40 jeltsch joined
11:41 <OnkelTem> cocreature: PHPStorm is running on the host, while stack and project - in a container
11:41 <OnkelTem> so I can't run host program inside a container :)
11:43 netheranthem joined
11:43 <cocreature> OnkelTem: ah ok, that sounds like it’s unrelated to stack
11:43 abhiroop joined
11:46 ft3 joined
11:46 <bvad> OnkelTem: If I understand correctly, you need to mount a docker host folder inside you container (e.g. .stack), otherwise PHPStorm will not be able to see the files in it
11:46 NoCreativity joined
11:47 oisdk joined
11:49 pavonia joined
11:50 blender1 joined
11:51 Gloomy joined
11:53 <Sh4rPEYE_> WHat does this piece of code mean: data Val e = Val Int
11:53 jeltsch joined
11:54 Wuzzy joined
11:55 <ggVGc> Sh4rPEYE_: It declares a type Val with one type constructor taking an Int. The 'e' is a phantom type variable
11:55 oisdk joined
11:55 <ggVGc> e.g a type variable that isn't used in any constructor, but is still part of the type
11:55 ziocroc joined
11:55 <ggVGc> Sh4rPEYE_: https://wiki.haskell.org/Phantom_type
11:57 orhan89 joined
11:57 <Sh4rPEYE_> ggVGc: Thanks
11:57 insitu joined
11:57 balor joined
11:59 Fendoer joined
11:59 ixxie joined
11:59 <Sh4rPEYE_> ggVGc: So, I can define a function
11:59 <Sh4rPEYE_> f :: Val String -> Int
11:59 <Sh4rPEYE_> f (Val i) = i + 1 ?
12:00 fractalsea joined
12:00 <Sh4rPEYE_> Which takes only Val String types, but returns their value of Integer?
12:00 ichor joined
12:01 <AfC> yes
12:01 Swizec joined
12:01 <Sh4rPEYE_> So it'd be only used to somehow give another attribute to the value
12:01 asmyers joined
12:02 <AfC> The String in `Val String` there is being used as a marker to differentiate that type from say `Val WashingMachine` but at term level the code is identical. It's got nothing to do with String or WashingMachine or any other e
12:03 <AfC> The only time I've seen Phantom Types used was in the ZeroMQ library, where the author used one to ensure you didn't mistakingly pass one open connection to another unrelated one.
12:04 abel-abel joined
12:04 <AfC> I'm sure there are better reasons, but that's the first time I encountered it.
12:04 whiteline joined
12:05 balor_ joined
12:07 oisdk joined
12:08 ziocroc joined
12:09 Swizec joined
12:09 ExpHP joined
12:09 Swizec joined
12:11 mmn80 joined
12:12 oisdk joined
12:13 balor_ joined
12:13 vlatkoB joined
12:14 fieldsofgold joined
12:16 Sh4rPEYE joined
12:18 blender1 joined
12:22 leat joined
12:24 <quchen> AfC: Pointers in the FFI are phantom in what they contain
12:24 <quchen> It’s basically all »void* with a phantom«
12:24 <quchen> :t castPtr
12:24 <lambdabot> error: Variable not in scope: castPtr
12:24 <AfC> foiled again
12:24 <quchen> : Ptr a -> Ptr b
12:25 <quchen> ?hoogle castPtr
12:25 <lambdabot> Foreign.Ptr castPtr :: Ptr a -> Ptr b
12:25 <lambdabot> Foreign.Ptr castPtrToFunPtr :: Ptr a -> FunPtr b
12:25 <lambdabot> Foreign.StablePtr castPtrToStablePtr :: Ptr () -> StablePtr a
12:25 <quchen> Hah!
12:26 Jesin joined
12:26 harfangk joined
12:28 <tabaqui> I want to make and remove function dynamically in run-time
12:29 <tabaqui> based on some config file that can changed in the future
12:29 <tabaqui> from which point can I start?
12:29 carlosda1 joined
12:30 <AfC> You don't have to make or remove anything. You've got a set of possible actions, and some of them will be available [enabled] at any given time. Probably a Map of actions to enabled y/n would do,
12:30 tobiasBora joined
12:30 chbatey joined
12:30 <AfC> i.e. Map Action Enabled where type Enabled = Bool
12:31 <AfC> then lookup in the map and/or change the value in the map depending on runtime config [changes]
12:32 grayjoc joined
12:32 bjz_ joined
12:33 acarrico joined
12:33 xtreak joined
12:33 maxirater joined
12:34 danthemyth joined
12:34 wallnuss joined
12:35 oisdk joined
12:36 kmels joined
12:38 ziocroc joined
12:40 segmond joined
12:41 <AfC> Meanwhile. I have a function that goes from [[a]] -> Matrix a
12:41 <OnkelTem> bvad: that's true, I mount it
12:41 <AfC> Nothing wild about that. I'm trying to turn it into a typeclass method, though,
12:42 <AfC> class Calculator a where
12:42 <AfC> create :: Num b => [[b]] -> a
12:42 Swizec joined
12:42 <AfC> which seemed reasonable enough, but when I try to define an instance for it I get b not same as a errors.
12:43 <AfC> I sorta want create :: Num b => [[b]] -> (a b) but that's not valid, is it?
12:44 inad922 joined
12:44 cordawyn joined
12:45 <tabaqui> AfC: I have no set of predefined actions
12:46 <tabaqui> I can predict some of them, but I don't want to lose uptime if some client will use specific action
12:47 matt179 joined
12:47 <tabaqui> if I should use Lisp, I don't ask, but maybe haskell have some powerful metaprogramming
12:49 mettekou joined
12:51 exferenceBot joined
12:52 <Rembane> AfC: Shouldn't create be (Num a, Num b) => [[b]] -> Matrix a ?
12:54 oisdk joined
12:55 coot__ joined
12:59 tomphp joined
12:59 <AfC> Rembane: aaaaaaah
12:59 <AfC> Rembane: (that's useful, but as a typeclass, what's the type of method create?
13:00 nbro joined
13:00 Maxou joined
13:00 insitu joined
13:01 <Rembane> AfC: I see. So the typeclass should be for types that can take two dimensional lists and turn them into themselves?
13:02 eyen joined
13:02 bhiliyam joined
13:03 <AfC> yeah
13:03 <AfC> I'm working on a benchmark to add to the haskell-perf suite comparing [pure] matrix with [native binding] hmatrix
13:04 <AfC> and I needed something that abstracts over different matrix algebra operations as supplied by the different libraries. Easy peasy, but for the create case. Maybe it just shouldn't be in the typeclass. I can live with that, I guess
13:05 oisdk joined
13:06 <Rembane> AfC: You could also remove the (Num b) constraint.
13:07 _sras_ joined
13:10 nbro left
13:11 soniku joined
13:12 <_sras_> Using digestive functors, Is there any way to incluide validation procedures sequently to a Form, instead of defining all validations from a single place. Foe example, if I have a form to validate email address, an initial validation may validate the address using regex, and further down the line, there might be validation for domain name, which runs in IO. How can I run both of these validation one after another, and collect the er
13:12 mizu_no_oto_work joined
13:14 Gloomy joined
13:14 oisdk joined
13:14 <Rembane> :t sequence
13:14 <lambdabot> (Monad m, Traversable t) => t (m a) -> m (t a)
13:14 <Rembane> :t sequenceA
13:14 <lambdabot> (Applicative f, Traversable t) => t (f a) -> f (t a)
13:15 <Rembane> _sras_: What about this: (sequenceA . map (\f -> f emailfield)) [test1, test1]
13:16 <Rembane> _sras_: Or use traverse instead of sequenceA . map
13:17 raichoo joined
13:18 starmix joined
13:18 <merijn> Well...this will be fun...fixing APIs across 2 different upstream packages >.>
13:19 SlashLife joined
13:20 ft3 joined
13:20 AfC joined
13:22 arpl joined
13:22 oisdk joined
13:23 nighty-- joined
13:25 descender joined
13:25 ziyourenxiang joined
13:26 eschnett joined
13:26 xall_ joined
13:26 _sras_ joined
13:27 muff1nman joined
13:28 <quchen> merijn: …and one of them is Base? :-þ
13:28 blender1 joined
13:29 <merijn> quchen: I wish, at least getting fixes into base is fairly straightforward (albeit slow)
13:29 <quchen> merijn: Seeing how I can’t contact the wl-pprint maintainer for half a year now I can feel you
13:30 bertschneider joined
13:30 <quchen> Been thinking about just releasing yet another new package. Meeeh
13:30 <merijn> quchen: These dependencies seem to be by people who are no longer active here and one by bos who is overworked anyway :)
13:30 <quchen> Problem is it works really well for myself already, so there is no real pressure ;-)
13:30 <_sras_> Rembane: Is this for Digestive functors?
13:30 <merijn> quchen: Did you attempt to get yourself added as maintainer via hackage admins?
13:30 carlosda1 joined
13:30 <merijn> quchen: If the current maintainer isn't responsive you could just take it over
13:31 <quchen> Yes, I could do that, but then I’d be alone with all breakages and I’m not sure whether I can handle that right now
13:31 <merijn> This actually makes this my 2nd project blocked on bos being too busy :p
13:32 <quchen> I don’t expect breakages, but still – it’s got lots of revdeps and politics in it
13:32 cpennington joined
13:32 pgiarrusso_ joined
13:32 <quchen> merijn: On the plus side, I can keep worrying about whether I want annotations or not in the Doc type :-)
13:32 <merijn> Dooooo it....Doooooo it :p
13:32 sproingie joined
13:32 <merijn> Bump the version and burn it all :p
13:33 <quchen> Hah yeah it’s a major version bump for sure. Mainly for marketing reasons.
13:33 <Rembane> _sras_: Yes, or rather everything that are Applicative.
13:34 jangsutsr joined
13:35 fotonzade joined
13:36 Zoddo joined
13:36 <merijn> quchen: I wanna revive opaleye-sqlite, but that means fixing opaleye, which means getting sqlite-simple more in sync with postgresql-simple, which means fixing the API of direct-sqlite...so...fun times :p
13:36 <quchen> Opaleye is by umm
13:36 <quchen> Tony Morris?
13:37 <quchen> I remember meeting him, nice guy, but I can’t remember the name
13:37 <merijn> quchen: Well, by fixing opaleye I mean fixing opaleye-sqlite. Opaleye is working fine, but only supporting Postgres, the SQLite stuff is bitrotted (not too badly, it seems)
13:37 <cocreature> opaleye is by tomjaguarpaw
13:37 <merijn> Yeah, I already talked to him :)
13:38 meba joined
13:38 <kosmikus> quchen: Tom Ellis
13:39 <quchen> kosmikus: Ah, thanks
13:39 eklavya joined
13:41 mudri joined
13:41 tomphp joined
13:42 iliastsi joined
13:43 MoALTz joined
13:43 Habib joined
13:44 chlong joined
13:44 ChristopherBurg joined
13:45 jathan joined
13:53 <LHoT10820> Is there any way to get unfiltered keyboard input? Just the raw matrix location of a key that is depressed?
13:54 <merijn> Is there a way? Sure. But whether there's a portable library that does that? No idea
13:54 freusque joined
13:54 oisdk joined
13:55 dennisvennink joined
13:55 leat joined
13:56 dbmikus joined
13:58 orhan89 joined
13:58 dbmikus joined
13:58 raichoo joined
13:58 ExpHP joined
13:59 <maerwald> depressed keys? :P couldn't resist
13:59 whiteline joined
13:59 <LHoT10820> merijn: No need to be portable. I should have mentioned that it's for a utility that doesn't exist in what I feel is a sufficient capacity for Windows.
14:00 <merijn> LHoT10820: In the terminal on unix you can probably get by using vty
14:00 <merijn> LHoT10820: If you need something more general than that...that's a matter of figuring out how people are doing it in other languages and copying that approach
14:01 <earthy> LHoT10820: there is the Win32 package
14:01 ystael joined
14:02 Swizec joined
14:02 <merijn> hvr: Is there a way to trigger your MatrixBuilder thing by hand for a package? What are the restrictions on what it can test?
14:02 m3adi3c joined
14:03 <LHoT10820> earthy: Thanks, I'll check it out. | merijn: I figured that I may end up doing something like that. Hopefully earthy's suggestion works for me.
14:03 mthek joined
14:03 Swizec joined
14:03 <merijn> LHoT10820: FWIW, Haskell's FFI is pretty simple and straightforward, so porting whatever works in other languages to Haskell is generally fairly straightforward
14:04 Swizec joined
14:04 <magneticduck> @dijnn (\(a, b) -> case b of Nothing -> Nothing; (Just b) -> Just (a, b))
14:04 <lambdabot> Cannot parse command
14:04 <magneticduck> @pl (\(a, b) -> case b of Nothing -> Nothing; (Just b) -> Just (a, b))
14:04 <lambdabot> (line 1, column 33):
14:04 <lambdabot> unexpected '>'
14:04 <lambdabot> expecting operator
14:04 <magneticduck> why does @pl not accept this, and what is this function?
14:05 <quchen> magneticduck: Djinn is type -> value
14:05 <quchen> value -> type is :t :-)
14:05 <magneticduck> yes I messed up fir the first time
14:05 <magneticduck> I'm trying to write this point-free
14:05 <quchen> I don’t think Djinn knows about fst/snd
14:06 Rodya_ joined
14:06 <LHoT10820> merijn: Great, I'll keep that in mind.
14:06 <magneticduck> @pl (\(a, b) -> a)
14:06 <lambdabot> fst
14:06 <quchen> Oh.
14:06 <magneticduck> but in any case, the problem is that pl simply isn't parsing this valid code
14:06 <quchen> Nevermind.
14:07 <quchen> `case` can’t be made pointfree I guess
14:07 <ahihi> @pl \(a, b) -> fmap (a:) b
14:07 <lambdabot> uncurry (fmap . (:))
14:07 eyen joined
14:07 <ahihi> err
14:07 <quchen> ?pl would have to Böhm-Beraducci your constructors for that
14:07 <lambdabot> (line 1, column 17):
14:07 <lambdabot> unexpected '\182'
14:07 <lambdabot> expecting variable, "(", operator or end of input
14:07 <ahihi> @pl \(a, b) -> fmap (a,) b
14:07 <lambdabot> (line 1, column 19):
14:07 <lambdabot> unexpected ","
14:07 <lambdabot> expecting letter or digit, variable, "(", operator or ")"
14:07 <ahihi> no tuple sections :(
14:09 carlomagno1 joined
14:11 sepp2k joined
14:12 mpickering joined
14:12 soniku joined
14:13 mmhat joined
14:13 <ski> @type uncurry (fmap . (,))
14:13 <lambdabot> Functor f => (a1, f a) -> f (a1, a)
14:13 flatmap13 joined
14:13 <ski> sometimes known as `strength', iirc
14:14 cpennington joined
14:15 <magneticduck> neat
14:17 oisdk joined
14:20 slomo joined
14:21 burtons joined
14:23 _Mzungu_ joined
14:23 takle joined
14:27 fakenerd joined
14:27 freusque joined
14:28 <merijn> mmmm, I need a combination of foldMap and forM_, but I don't think that exists, right?
14:28 <merijn> Basically, I want "fmap sum (forM list fun)", but without the cost of building an intermediate list for no reason
14:28 eyen joined
14:28 pera joined
14:29 <glguy> foldM?
14:29 <merijn> hmmm, maybe
14:30 <glguy> :t foldlM
14:30 <lambdabot> (Monad m, Foldable t) => (b -> a -> m b) -> b -> t a -> m b
14:30 <merijn> bleh
14:30 <merijn> foldM isn't strict though. ALthough I guess I can fix that
14:31 raichoo joined
14:31 <glguy> as long as you're using a strict>>= Monad instance that's fine
14:31 carlosda1 joined
14:31 <merijn> Wait, I can't even make it strict, since it uses foldr internally
14:31 qguv joined
14:32 <merijn> glguy: No, because then instead of building up a list upfront I simply end up building a large thunk up front, same problem
14:32 <glguy> no, that doesn't follow
14:32 <ski> is `foldlM' an alias for `foldM' ?
14:32 makalu joined
14:32 <makalu> I assume there's a library for this: how to turn a URI query (eg "?foo=bar&baz=quux") into a key-value pairs
14:32 <glguy> foldr can implement foldl' just fine
14:33 justin3 joined
14:33 <c_wraith> it can, but only if you get to control exactly what's passed to it
14:33 crobbins joined
14:34 <merijn> hmmm
14:34 <merijn> Yeah, foldM seems to use foldlM
14:34 <glguy> and in this case as long as you have a strict >>= , it's fine
14:34 <* ski> can't recall seeing `foldlM' before, only `foldM'
14:34 <glguy> foldlM is from Foldable, foldM was Control Monad
14:35 <ski> ok
14:35 <lyxia> makalu: https://hackage.haskell.org/package/http-types-0.9.1/docs/Network-HTTP-Types.html#v:parseQuery
14:35 <makalu> lyxia: thank you!
14:36 <lyxia> you're welcome!
14:36 insitu joined
14:36 rmbd joined
14:37 rmbd left
14:37 trism joined
14:37 le_frogballs joined
14:37 Gentilhomme joined
14:41 shlevy joined
14:42 modal joined
14:42 eyen joined
14:43 <shlevy> Is there any way to tell GHC to use an equality constraint in kindchecking? http://sprunge.us/YZMj <- this fails because x is a Type but it's expected to be an AssociatedKind (k1 -> k2), but I have a constraint marking those equal...
14:46 LHoT10820 joined
14:49 fizruk joined
14:50 Argue joined
14:50 Habib left
14:51 edmundsecho joined
14:52 newhoggy joined
14:52 m3adi3c joined
14:53 Yuras joined
14:54 chlong_ joined
14:55 <lyxia> shlevy: http://lpaste.net/354800 it's not quite what you asked but would that work for you
14:56 oisdk joined
14:57 na_th_an left
14:57 <shlevy> lyxia: Ah, maybe, let me try to adopt it to my actual use case
14:57 <shlevy> lyxia: Not a huge fan of functional dependencies, but ah well :)
14:57 <shlevy> lyxia: thanks!
14:59 flatmap13 joined
15:01 <lyxia> I didn't manage to make it work otherwise, I'm not sure whether that would be a bug in kind-checking.
15:01 flatmap13 joined
15:01 crobbins joined
15:02 <shlevy> lyxia: Hmm, but with this there's no way have the dependent type variable be derived from some other type class instance lookup, right? I mean you can in an instance, but not in the class definition
15:02 bhiliyam joined
15:02 Nicmavr joined
15:03 <shlevy> Well, I guess I can put an equality constraint on the class definition...
15:05 le_frogballs joined
15:06 dcoutts_ joined
15:06 Guest62004 joined
15:09 sproingie joined
15:09 <lyxia> what dependent type variable
15:11 <shlevy> lyxia: Never mind, I think I got it
15:11 binaryplease joined
15:11 <shlevy> lyxia: (sorry, X/Y problem)
15:12 Gurkenglas_ joined
15:12 oisdk joined
15:14 freusque joined
15:14 HarveyPwca joined
15:15 <shlevy> lyxia: Got something typechecking that I *think* is what I want :D
15:15 <shlevy> lyxia: http://sprunge.us/aAXX
15:15 _sras_ joined
15:16 <_sras_> is there a way to replace a form, with a form of same type, at a certain path in a nested form
15:18 <lyxia> shlevy: do you really want an associated type family, rather than a simple type family
15:19 <shlevy> lyxia: Possibly not :D
15:19 <shlevy> lyxia: But I need to recurse
15:19 uglyfigurine joined
15:20 sssilver joined
15:20 mudri joined
15:21 <lyxia> you can define type family instances recursively
15:23 <shlevy> lyxia: Can I do functional dependnecies on multi-parmaeter type families?
15:23 <lyxia> type family Saturated (t :: k) (u :: k') :: * where { Saturated t '() = t ; Saturated t '(a, b) = Saturated (t a) b }
15:23 <shlevy> lyxia: I'm trying to express a relationship between a kind and an instance of that kind
15:24 <lyxia> Unfortunately not
15:24 <shlevy> I guess if it's closed I get it for free
15:25 <shlevy> If I write it correctly :D
15:26 rockfordal joined
15:27 <lyxia> I'm not really exploiting the closedness of that family though
15:27 ralu joined
15:28 raichoo joined
15:29 newhoggy joined
15:29 <shlevy> lyxia: http://lpaste.net/354803 <- this is failing (with or without the tick for the argument to Saturated Type), I guess because 'argKind' can't vary?
15:29 <_sras_> is there a way to replace a form, with a form of same type, at a certain path in a nested form?
15:30 <shlevy> Oh, wait
15:30 <shlevy> I think I want to add a arg :: argKind...
15:32 carlosda1 joined
15:32 <lyxia> _sras_: what form are you talking about
15:33 <_sras_> lyxia: Oh. Missed to mention it. Forms in Digestive Functors package.
15:33 nilof joined
15:34 eazar001 joined
15:34 splanch joined
15:34 dustmote joined
15:34 darlan joined
15:34 newhoggy joined
15:34 ubsan_ joined
15:34 sproingie joined
15:35 <byorgey> _sras_: I doubt it.
15:36 ralu joined
15:36 electrostat joined
15:37 Boomerang joined
15:37 ralu joined
15:38 {emptyset} joined
15:38 <jchia_> Is there a package like binary-conduit for but Data.Store instead of Data.Binary?
15:38 eacameron joined
15:38 wrengr joined
15:39 <mudri> What's a good way of repeating an IO action (that may take a few seconds) every ~30 seconds, roughly?
15:41 <Rembane> mudri: Interleave it with threadDelay. How important is every 30 seconds?
15:41 cordawyn joined
15:41 yellowj joined
15:41 skeet70 joined
15:41 <Rembane> mudri: Or rather, how important is interval?
15:41 obadz joined
15:41 <Rembane> mudri: Can it be for instance 29 or 31 seconds?
15:41 newhoggy joined
15:41 <mudri> Rembane: yeah, not too important. A few seconds either way is fine.
15:42 mariusG joined
15:42 phale joined
15:42 <Rembane> mudri: Take a look at these: https://hackage.haskell.org/package/base-
15:42 <mudri> I'd mildly prefer it not to be biased one way or the other.
15:42 afarmer joined
15:43 <mudri> Thanks!
15:43 <Rembane> mudri: No worries, good luck!
15:43 <phale> is <- just variable assignment? currently reading Learn You A Haskell for Great Good
15:43 <phale> so I got a bit confused seeing that operator
15:44 <lyxia> no, it's syntactic sugar for using the >>= operator
15:44 dennisvennink joined
15:44 <phale> hmm what does >>= do then ?
15:44 <frontendloader> draws the rest of the owl
15:45 <mudri> phale: yes, it is a form of variable assignment. The book should really explain it.
15:45 oisdk joined
15:45 <Rembane> phale: It gives an effect a name so you can work with that effect easier.
15:46 <Rembane> phale: It's a bit like binding demons.
15:46 <phale> oh i see now
15:46 <phale> i'm coming from C btw so this is new to me
15:46 <glguy> What >>= depends on the type of things you're using it with. If you're using it with 'IO a' things, then m >>= f executes the action 'm', and then if that suceeds it applies f to the result of executing 'm' and executes that new action
15:46 <lyxia> oh I see, lyah introduces do before >>= ...
15:46 shlevy left
15:47 flatmap13 joined
15:47 <sproingie> IO is also not necessarily the best intro to monads
15:48 <mudri> Monads is also not necessarily the best intro to IO. ;-)
15:48 <glguy> phale: Where are you seeing <-? It also comes up in list comprehensions
15:48 <sproingie> true. but IO is just weird even then.
15:49 <phale> Yeah glguy , its in list comprehensions which is where im at now
15:49 <Rembane> > [x*2 | x <- [1..]]
15:49 <lambdabot> [2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,5...
15:50 jeltsch joined
15:50 pgiarrusso_ joined
15:50 <phale> also what is the idiomatic to name variables ?
15:50 <phale> camelCase ?
15:50 <byorgey> phale: oh, heh, you should ignore what everyone said about >>= and effects for now =)
15:50 <byorgey> phale: yes, idiomatic Haskell style is to use camelCase
15:50 <Rembane> phale: Camelcase, and as few letters as possible. :D
15:51 <phale> alright :)
15:51 <sproingie> camelCase. CamelCase would be for types.
15:51 <byorgey> phale: <- is not variable assignment, in a list comprehension x <- zs means that x will loop through all the elements of the list zs
15:51 <sproingie> types and type constructors have to start with uppercase, other identifiers with lowercase
15:51 mada joined
15:51 DemiMarie joined
15:51 <phale> oh i see byorgey , it wasnt really explained there so i got confused
15:52 <phale> and my last question is if there is something similar to structs in haskell ?
15:52 <DemiMarie> I am writing Haskell bindings to a C IPC library, and I am trying to figure out how to deal with async exceptions in the presense of blocking calls
15:52 newhoggy joined
15:53 <sproingie> phale: yes, those are "product types", or if they have named fields, "records"
15:53 <DemiMarie> my understanding is that you can’t have async exceptions blocked during blocking FFI calls, but in my case the blocking call allocates a resources that must later be freed
15:53 <phale> sproingie: i see, so there can be a product type array that you can loop over to make your program data-driven i.e depending on data rather than program logic ?
15:54 <sproingie> sure, that's basically how i write everything
15:54 Goplat joined
15:54 <sproingie> "product type" is the really general name, not every product is necessarily used as a struct tho
15:55 <mudri> Looping over fields of a struct?
15:55 simukis__ joined
15:55 strykerkkd joined
15:56 <sproingie> not looping over fields, no, i'll leave that for libraries to do. looping over lists.
15:56 <phale> oh great, i usually write these struct arrays in c that have other fields along with a function pointer and it does if checks and then executes that function
15:56 <sproingie> haskell does have random-access arrays when you need 'em, but the usual thing you reach for should be a list
15:57 <sproingie> which are linked lists and thus O(n) access but they also take full advantage of laziness
15:57 stevenxl joined
15:57 stevenxl joined
15:57 stevenxl joined
15:58 Maxou joined
15:59 <phale> yeah i see now
15:59 <phale> there are also hash tables too ?
16:00 orhan89 joined
16:00 urodna joined
16:00 newhoggy joined
16:01 abhiroop joined
16:02 sellout- joined
16:02 eyen joined
16:02 binaryplease joined
16:04 phale left
16:04 crobbins joined
16:04 ludat joined
16:05 MindlessDrone joined
16:05 OnkelTem joined
16:06 Sonolin joined
16:07 splanch joined
16:07 jangsutsr joined
16:07 <sproingie> there's hashtables too, basically all the data structures you've heard of and then some
16:09 newhoggy joined
16:09 jangsutsr joined
16:09 felixsch_ joined
16:09 <sproingie> oh he left
16:10 Sampuka joined
16:11 zeroed joined
16:11 zeroed joined
16:11 zeroed joined
16:11 meandi_2 joined
16:13 soniku joined
16:13 connrs joined
16:13 mariusG left
16:14 Maxou joined
16:16 Itkovian joined
16:16 nicknovitski joined
16:16 newhoggy joined
16:17 Gentilhomme joined
16:17 G13 joined
16:19 mariusG joined
16:20 abhiroop joined
16:22 Velpoman joined
16:24 newhoggy joined
16:24 Maxou joined
16:24 conal joined
16:24 gehmehgeh joined
16:25 thatguy joined
16:26 <_sras_> I cannot get the :type-at command in ghci to work. It keeps saying "Couldn't guess that module name. Does it exist?"
16:27 gcross_ joined
16:28 uuplusu joined
16:29 al-damiri joined
16:30 LHoT10820 joined
16:30 pungi-man joined
16:32 HarveyPwca joined
16:32 carlosda1 joined
16:35 abhiroop joined
16:35 newhoggy joined
16:36 mac10688 joined
16:37 blender1 joined
16:38 <_sras_> I cannot get the ":type-at" command in ghci to work. It keeps saying "Couldn't guess that module name. Does it exist?".
16:38 <_sras_> What am I doing wrong?
16:39 <_sras_> This is what I have been trying ":type-at Common.Types 134 6 134 7 c1"
16:40 splanch joined
16:41 augur joined
16:44 <DemiMarie> What is the best way to handle a finalizer that might block for a long time on filesystem operations?
16:44 <MarcelineVQ> _sras_: you need to :set +c then load the module
16:44 xkapastel joined
16:45 <_sras_> MarcelineVQ: I have that set.
16:46 beerdrop joined
16:46 <MarcelineVQ> And the modules were loaded after it was set?
16:47 dsh joined
16:47 xall joined
16:48 <MarcelineVQ> :r after :set +c should work if not. Is that the whole error you get btw?
16:49 <_sras_> MarcelineVQ: http://lpaste.net/5794885041016274944
16:50 newhoggy joined
16:50 sleffy joined
16:50 blender1 joined
16:51 <MarcelineVQ> Ah alright that's a different error, at least it's working now, just gotta figure out the right way to use it
16:53 <MarcelineVQ> idk how it's used exactly beyond what the docs say
16:53 <_sras_> MarcelineVQ: It is not working.
16:54 <_sras_> MarcelineVQ: It just prints out the type of the last expression. Not the type at the location in the source file.
16:55 <MarcelineVQ> That suggests to me that your span is wrong, "The last string parameter is useful for when the span is out of date, i.e. the file changed and the code has moved. In which case :type-at falls back to a general :type like lookup." Not that I know for sure
16:55 fieldsofgold joined
16:55 newhoggy joined
16:56 siddharth2610 joined
16:57 siddharth2610 left
16:57 peterbecich joined
16:57 cobreadmonster joined
16:57 chrissl joined
16:57 fizbin joined
16:58 <fizbin> Is anyone aware of any guides or blog posts on the topic of writing Haskell for other people to code review?
16:59 <fizbin> I mean, other than "if you feel mentally tickled by a particularly clever way of phrasing some piece of code, maybe don't do that to your reviewers"
16:59 <fizbin> which is advice that applies in any language but that I have to repeatedly remind myself of in Haskell.
17:00 connrs joined
17:01 abhiroop joined
17:02 ccomb joined
17:03 bhiliyam joined
17:04 dennisvennink joined
17:04 acowley_work joined
17:05 hc_ joined
17:05 SpinTensor joined
17:05 fizbin joined
17:05 cyborg-one joined
17:07 newhoggy joined
17:08 e14 joined
17:09 tigerfinch joined
17:09 insitu_ joined
17:10 steeze joined
17:11 blender1 joined
17:11 tigerfinch left
17:16 SpinTensor joined
17:17 zcourts joined
17:17 whaletechno joined
17:17 newhoggy joined
17:18 _sg joined
17:19 bvad joined
17:19 m3adi3c joined
17:19 meandi joined
17:20 OnkelTem joined
17:21 camm joined
17:21 SpinTensor joined
17:21 fizbin joined
17:22 whiteline joined
17:22 cpennington joined
17:22 <shapr> fizbin: wouldn't that depend on your peers?
17:23 <shapr> fizbin: for example, newbies get lost with <$> but most Haskellers nearly require understanding of Applicative
17:23 <camm> Hello guys. Does anyone know how etags work for static-files in Yesod? Does anyone know if there is a way to disable them so the server requests without adding the etag query parameter?
17:23 <shapr> and lens, and other things
17:24 fizbin joined
17:25 <fizbin> shapr: Well, there's <$> uses and there's <$> uses.
17:25 OnkelTem_ joined
17:25 <fizbin> I mean, <$> when the Applicative in question is Maybe? No problem.
17:25 <EvanR> known knowns and known knowns
17:26 <shapr> fizbin: my shortcut is to look at glguy's code and assume everything there should be readable to me and the Haskellers who work with me.
17:26 <EvanR> fmap really feels the same regardless of the particular functor
17:26 <EvanR> monad not so much
17:26 <fizbin> When you just casually throw out <$> over the Applicative (->) though...
17:27 <EvanR> functor (->) is pretty obviuos
17:27 <glguy> Yikes, I'll have to be more careful what I throw up on github!
17:27 <EvanR> <$> is about functors
17:27 <shapr> fizbin: sounds like you should write up what you think in a github repo, and ask for PRs
17:27 connrs joined
17:27 Maxou joined
17:28 <shapr> I've seen some discussion in stylish' PRs and comments
17:28 <fizbin> I mean, I guess this is pretty obvious as to what it means, but I could see needing to stop and figure out how this worked the first time you saw it: filter ((||) <$> (`S.member` s1) <*> (`S.member` s2))
17:29 insitu joined
17:29 abhiroop joined
17:29 <Gurkenglas> filter (`S.member` S.union s1 s2)
17:29 insitu joined
17:30 <fizbin> Indeed, I was going to follow this with "arguably, that should be written with a call to S.union instead of using the Applicative instance on (->)"
17:30 dfeuer joined
17:31 kadoban joined
17:32 abhiroop joined
17:32 ralu joined
17:32 <EvanR> function <*> is the s combinator, and indeed i have avoided using it to demonstration implementations of simple things
17:32 <EvanR> since it seems overly clever or cutesy
17:33 <fizbin> Well, but the idiom f <$> arg1 <*> arg2 <*> arg3 ... is well established.
17:33 carlosda1 joined
17:33 <fizbin> <*> in isolation is pretty obscure.
17:33 <EvanR> what <*> means isnt clear in general, it depends on the type
17:34 <EvanR> i was saying <$> is pretty obvious in general because of functors laws
17:34 <fizbin> In that idiom though, it's just liftA2 (liftA3, liftA4, etc)
17:34 <EvanR> you were trying to discourage <$> because of the Applicative
17:35 <EvanR> i say fmap kind of cant be misundertood
17:35 <EvanR> liftAwhatever is indeed a big time idiom
17:36 <shapr> fizbin: sounds like this document needs a bunch of broad stroke summaries with specific examples for support
17:36 <fizbin> Maybe, but using fmap for (->) is kind of weird because that's just composition, and why wouldn't you use composition?
17:36 <EvanR> you wouldnt
17:36 <shapr> fizbin: see, that's a good specific example
17:36 <EvanR> unless it was a library that is going generic over any Applicative
17:36 <EvanR> similar to "give me any Monoid"
17:36 <fizbin> Sure.
17:37 whiteline joined
17:39 alfredo joined
17:39 Maxou joined
17:40 <fizbin> So, part of this is "be wary of using typeclass functions when you are dealing with concrete types where their implementations of the typeclass functions are well-known. E.g., don't use (<$>) over functions when you can use (.) "
17:40 <nshepper1> (.) is a typeclass function too
17:41 Xanather joined
17:41 <fizbin> nshepper1: Prelude.. isn't.
17:42 <fizbin> At least, not yet. I'm sure there's some future version of GHC where they'll make (.) from Control.Arrow the one that Prelude gives you and rename what is currently (.) to something else.
17:43 dennisvennink joined
17:43 <fizbin> Sorry, from Control.Category.
17:44 <lyxia> There's a lot of inertia to keep the current (.) because of type inference
17:45 newhoggy joined
17:45 <lyxia> and why not (.) = (<$>)
17:45 <* ski> . o O ( `(.) = fmap' )
17:46 <lyxia> :)
17:46 <nshepper1> Well, that would be silly because we already have <$>
17:46 <EvanR> everything is anything
17:46 <nshepper1> We don't need two
17:46 <* ski> . o O ( `flip :: Functor f => f (a -> b) -> (a -> f b)' )
17:47 fizruk joined
17:47 <EvanR> map = fmap
17:47 codesoup joined
17:48 <nshepper1> I think whether to <$> or . depends on context.
17:48 <nshepper1> There are times when you are treating a thing in a functory way
17:48 fizruk joined
17:49 <nshepper1> And times when you are using things in a categoryish way. (And other times when you should just use a lambda)
17:50 Kreest__ joined
17:50 epsilonhalbe joined
17:50 fizruk joined
17:53 newhoggy joined
17:55 Itkovian joined
17:56 iomonad joined
17:56 govg joined
17:58 caumeslasal joined
18:00 dustmote joined
18:01 newhoggy joined
18:01 maarhart joined
18:01 orhan89 joined
18:02 replay joined
18:04 alfredo joined
18:06 alfredo joined
18:06 Swizec joined
18:07 raynold joined
18:08 insitu joined
18:08 camm joined
18:08 newhoggy joined
18:11 USBoss joined
18:11 connrs joined
18:11 <fizbin> ski: I don't think you can in fact generalize flip in that fashion.
18:11 <fizbin> I think you need at least an Applicative restriction, not merely a Functor restriction.
18:11 <ski> > let f `flip` a = fmap ($ a) f in flip (,) 0 1
18:12 <lambdabot> (1,0)
18:12 <ski> works fine here
18:12 balor joined
18:12 <fizbin> Hrm. Okay.
18:13 <ski> (this is related to `uncurry (fmap . (,))')
18:14 balor_ joined
18:14 soniku joined
18:14 <fizbin> Huh. I'd written that function as (\(a, b) -> (a,) <$> b)
18:14 camm left
18:15 <ski> it came up around four hours ago
18:15 <xintron> Any input on a good haskell+neovim setup? Currently looking at the haskell-vim, neco-ghc and ghcmod-vim plugins.
18:15 {emptyset} joined
18:16 <fizbin> Then again, I generally find pointfree style a fun puzzle to play with but not actually that useful. (Increasing laziness is almost never something I want to do)
18:16 <c_wraith> what does pointfree have to do with laziness?
18:17 olivierw joined
18:17 olivierw left
18:18 <monochrom> Perhaps it came from a statistical survey. "Correlation between pointfree and laziness is 0.7" or something.
18:19 <monochrom> The same way correlation is high between cellphone signal towers and baby birth rates.
18:19 <monochrom> True high correlation but the reason is not what you're thinking. :)
18:19 freusque joined
18:20 <fizbin> I think I've seen "can increase laziness" listed as an advantage of pointfree style. Can't remember where though, so there is the possibility that I imagined it.
18:20 <monochrom> Oh the Internet is so large with so many people I'm sure 1 out of 4 billion people must have written it.
18:20 <monochrom> Doesn't mean it's right.
18:20 <glguy> I heard fizbin claim it just today
18:21 <monochrom> 90% of Internet rumours are wrong. OK I made 90% up.
18:21 <EvanR> positively true, unconstructively true, statistically true
18:21 mikecaruso joined
18:21 <c_wraith> hmm. we shouldn't talk about increasing laziness or strictness. we should talk about increasing productivity.
18:22 <c_wraith> that makes it more obvious that the ideal isn't either direction
18:22 <fizbin> In general, sure. Sometimes though your code is going to be run at such massive scale that it's actually worth a programmer-side productivity hit for faster running code.
18:23 <fizbin> So to the extent that strictness or laziness affects performance...
18:23 <c_wraith> (I've dealt with just as much bad code that was too strict as I have bad code that was too lazy)
18:23 <EvanR> that mentality is ridiculous
18:23 <c_wraith> I don't mean programmer productivity.
18:23 <monochrom> Learn laziness for real.
18:23 <c_wraith> I mean in terms of calculation productivity.
18:24 <fizbin> Right, okay. I'm more familiar with the word "performance" for that measure.
18:24 newhoggy joined
18:24 <monochrom> Instead of merely statistically true correlations such as "70% of high strictness code contains the capital letter S more than average".
18:24 <c_wraith> that's a different measure.
18:24 <EvanR> i do not want the ghost of "webscale" to influence day to day productivity gains, it seems like a bigger issue is future comprehensibility and "maintainability" (modifiability)
18:24 <c_wraith> I mean productivity. does it do the right amount of work for each constructor produced?
18:25 <c_wraith> that's not the same as performance.
18:25 <monochrom> Also, today's xkcd.com
18:25 thc202 joined
18:26 <EvanR> thats why i dont do inspirational speeches
18:26 <EvanR> im pretty sure no one can be as successful as me
18:26 <monochrom> heh
18:27 <fizbin> c_wraith: That seems like adjusting the amount of strictness or laziness to the right balance.
18:27 yogsototh joined
18:27 <fizbin> And in order to do that adjustment, it would be helpful to know "these techniques can be used to increase laziness" and "these techniques can be used to increase strictness".
18:28 <monochrom> Yes, the capital letter S can be used to increase strictness.
18:28 danthemyth joined
18:28 <EvanR> i know how to increase strictness, what are ways to increase laziness
18:28 <monochrom> Statistically true.
18:28 <monochrom> Fewer S's and more L's.
18:28 <EvanR> ByteString.Lazy
18:28 <c_wraith> fizbin, yep. which is why you shouldn't ever say that the goal is either one of those.
18:28 <monochrom> Yes, like that.
18:29 <monochrom> I guess lowercase q is also correlated to higher strictness.
18:30 <fizbin> And I suppose also "these techniques can be used to inspect the amount of laziness your calculation currently has, and where". That would be useful too.
18:30 <EvanR> what is the unit of measure for laziness
18:30 mszczygiel joined
18:31 <EvanR> nanohaskells?
18:31 <EvanR> more seriously how do you measure it
18:31 <fizbin> EvanR: some techniques can be found by searching https://github.com/ndmitchell/hlint/blob/master/data/hlint.yaml for "IncreasesLaziness"
18:31 <Tuplanolla> It's measured in bytes, by the heap profiler.
18:32 blocky joined
18:32 <EvanR> the more thunks, the more lazy?
18:32 <fizbin> EvanR: I suspect there's only a partial order on laziness, and not a strict numeric measure.
18:32 <monochrom> Now here is a more serious correlation. Every person I have seen who correctly predict laziness and strictness can read GHC core.
18:33 <monochrom> I used to be an exception, but then I also learned to read GHC core. Now there is no exception left.
18:33 newhoggy joined
18:33 <EvanR> throwIO monochrom
18:33 mac10688 joined
18:33 <monochrom> And more than 90% of them read the STG paper.
18:33 <fizbin> That is, you can sometimes say definitively "this construct is more lazy/more strict than this other construct" but oftentimes two different things are incomparable.
18:34 <monochrom> (Oh, I used to be in the 10%, too.)
18:34 Destol joined
18:34 <monochrom> Yes it's a non-linear partial order.
18:34 carlosda1 joined
18:34 <monochrom> In fact it's a CPO.
18:34 <EvanR> monochrom: im guessing that this is because GHC doesnt strictly follow uniform laws about what it will do with a given algorithm and its types
18:34 ptvirgo joined
18:34 mszczygiel joined
18:35 <monochrom> Sorry, what is "this"?
18:35 <fizbin> monochrom: Which definition of complete partial order are you using?
18:35 sproingie joined
18:35 <monochrom> Has bottom.
18:35 <EvanR> being unable to predict laziness without reading core
18:35 ubsan joined
18:37 <EvanR> i behaves differently with Int, Integer, ByteStrings, Either Bool (Maybe [()])
18:37 <EvanR> it*
18:37 OnkelTem_ joined
18:37 <monochrom> Yes, that's part of it. But another part is when the program is tricky, it's easier to just ask GHC than predict yourself, even if your model and GHC agree.
18:37 <fizbin> Well, now, he didn't say that. He implied that the ability to predict laziness and the ability to read core were correlated, but didn't say that you needed to apply the core-reading ability to predict laziness.
18:37 <nshepperd> I have never resorted to reading core to understand the lazinesss of a function. however, learning core / stg is probably a good step to understanding ghc's evaluation model
18:37 <monochrom> In other words "I am too lazy".
18:38 <monochrom> Also, like I said, it's a correlation. The hidden variable is "these are people who actually bother to learn the real thing".
18:38 <dolio> The point is, learn the operational semantics.
18:39 <monochrom> Where my "real thing" means the negation of cargo culting.
18:39 pitcomplete joined
18:39 <fizbin> So is a fair summary: "Sometimes one has to read core to predict laziness, but when one does not one needs to understand GHC's evaluation model deeply. Understanding GHC's evaluation model deeply makes it easier to then learn to read core"
18:39 <Tuplanolla> I like it.
18:40 <EvanR> negation of cargo culting is undecidable
18:40 pera joined
18:40 klottie joined
18:40 newhoggy joined
18:40 <monochrom> Oh, cargo culting is decidable, in fact decidably wrong.
18:40 <EvanR> fizbin: i heavily simplified the assertion for posterity
18:40 <monochrom> Like astrology.
18:40 <EvanR> while were taking "statistically true" to be a valid version of truth
18:41 maarhart joined
18:42 <monochrom> Anyway, it's like how chemists do things. You could whip out Schrödinger's equation to predict the reaction between two substances. But why bother, just let them react and then spectro-analyze or something.
18:42 <nshepperd> by rice's theorem, everything good and true is undecidable
18:43 BlueRavenGT joined
18:44 hackebeilchen joined
18:45 pbogdan joined
18:45 bennofs joined
18:46 thatguy joined
18:48 newhoggy joined
18:48 selthas joined
18:49 ubsan_ joined
18:50 balor_ joined
18:50 Rodya_ joined
18:52 balor__ joined
18:53 Kuros joined
18:53 jason85 joined
18:53 jud joined
18:54 mkoenig joined
18:55 abhiroop joined
18:56 insitu joined
18:57 uglyfigurine joined
18:57 orhan89 joined
18:57 AndreasK joined
18:58 gawen joined
18:59 sellout- joined
18:59 newhoggy joined
18:59 <klottie> I have a data type "data T a = A a a [T a] | B a a [T a]". But it gives me an error when I pattern match a function "foo (_ _ _ t) = ...". Why is this not allowed? Do I have to explicitly type "foo (A _ _ t) = ..." and "foo (B _ _ t) = ..."?
19:00 <lyxia> yes
19:00 mikecaruso joined
19:01 <ski> klottie : factor : `data T a = MkT AB a a [T a]; data AB = A | B; foo (MkT _ _ _ t) = ..t..'
19:01 <geekosaur> ^
19:01 abhiroop joined
19:01 <geekosaur> refactor, it's a bit silly to have things that differ only by the data constructor
19:02 mizu_no_oto_work joined
19:03 <* ski> . o O ( `(a * a * [T a]) + (a * a * [T a]) = (1 * a * a * [T a]) + (1 * a * a * [T a]) = (1 + 1) * a * a * [T a]' )
19:04 bhiliyam joined
19:05 <klottie> thank you.
19:05 <lyxia> that's a lot of work to say that x + x = 2x :P
19:05 <monochrom> Sometimes it is useful to differ by only the data constructor. But you still can't wild-card the data constructor itself.
19:06 <ski> lyxia : yes. just pointing out why i used the word "factor"
19:08 freusque joined
19:12 jer1 joined
19:12 coot__ joined
19:14 enitiz joined
19:14 Hexagenic joined
19:14 blender1 joined
19:15 newhoggy joined
19:15 <EvanR> is x + x = 2x true for Double
19:15 soniku joined
19:15 <EvanR> ignoring NaN
19:16 <geekosaur> you also have to ignore Inf to get to the really scary part :)
19:16 <pikajude> yeah you just shift the whole thing up by a bit
19:16 Sonolin joined
19:16 crobbins joined
19:17 <EvanR> > (-0.0) + (-0.0)
19:17 <lambdabot> -0.0
19:17 <EvanR> interesting
19:18 aarvar joined
19:18 Itkovian joined
19:19 meditans joined
19:19 meditans left
19:19 m3adi3c joined
19:20 <klottie> > (-0) + (-0)
19:20 <lambdabot> 0
19:20 niez joined
19:21 <klottie> IEEE 754 represeantation for floating-point numbers have 2 zeros, whereas two's complement integer representation have one zero. I believe so, at least.
19:21 <geekosaur> yes
19:22 <geekosaur> because you need to propagate sign when working with trig functions in rectangular mode, or you end up in the wrong quadrant
19:22 <geekosaur> this is also why atan2 exists
19:22 <EvanR> two zeros is better than one, but not greater than one zero
19:23 <Tuplanolla> This has always felt unsatisfying to me. What could a better design look like?
19:23 inav joined
19:23 newhoggy joined
19:23 <EvanR> by taking it more seriously
19:24 merijn joined
19:24 <Tuplanolla> My eyebrows can only frown so much.
19:24 <EvanR> if you imagine negative zero represents some very small negative value "under the radar", great. but we dont get this kind of thing anywhere else in the domain
19:24 <EvanR> like, very small positive value even
19:25 Maxou joined
19:25 oisdk joined
19:26 <merijn> EvanR: Actually, you do in IEEE754 floating point...
19:26 <EvanR> eh? what is that
19:26 <EvanR> i mean, the very small positive value under the radar
19:26 dfeuer joined
19:26 insitu joined
19:26 ragepanda joined
19:26 <EvanR> +0.0 "is" zero
19:28 <merijn> EvanR: Well first of all, there's positive zero as complement of negative zero. Secondly, IEEE754 has a bunch of stuff dealing with infinitesimals that I can't remember
19:28 <EvanR> really?
19:28 <Tuplanolla> Dubious.
19:29 msks joined
19:30 <mnoonan> do you mean denormals, or something else?
19:30 <merijn> tbh, IEEE-754 is far more scientifically and elaborately specified than many people seem to assume
19:30 <merijn> mnoonan: Oh, maybe, I try to not actually use IEEE754 if I can help it, so my terminology is rusty :p
19:31 <EvanR> positive denormals is something else
19:31 <EvanR> they have a known value
19:31 sleffy joined
19:32 sssilver joined
19:33 <merijn> Completely unrelatedly: Am I the only one missing hackagebot? Why did it get killed? (Besides the amazonka spam >.>)
19:33 <dolio> I'm definitely not missing it.
19:33 <Tuplanolla> I wouldn't mind a less verbose version.
19:34 <merijn> dolio: I liked discovering new funny packages from it
19:34 <EvanR> a daily link to everything you missed on hackage wouldnt be that bad
19:34 <geekosaur> that, and its maintainer handed it off and the new maintainer hasn't reactivated it yet
19:34 <merijn> dolio: The only real problem I had was the 50 amazonka all updating in sync
19:34 <geekosaur> there was some discussion on -cafe a couple months ago, then silence
19:35 <merijn> And spamming the channel, but I think blacklisting spammy packages from hackagebot would've been nicer than simply dropping it altogether
19:35 carlosda1 joined
19:35 albertus1 joined
19:35 <geekosaur> for that I'd rather it collect and output one for the problematic ones. prefix match would catch them
19:35 newhoggy joined
19:36 <merijn> geekosaur: I'm not too worried about the specific implementation, just saying that I only ever noticed 1 or 2 package groups resulting in noise to begin with
19:36 <geekosaur> "* amazonka-* (54 packages) ..." or some such
19:36 <geekosaur> I think I spotted four
19:36 <geekosaur> but those four updated often enough to be annoying
19:37 <merijn> And speaking of infrastructure disappearing...
19:37 <geekosaur> (in particular gi-* was updating a lot)
19:37 <merijn> What happened with ircbrowse? It seems completely broken
19:37 <Tuplanolla> Filter revision number bumps too?
19:37 juliagoda joined
19:37 ScRaMbLe joined
19:37 <geekosaur> same issue :) both chrisdone things that were not adopted
19:37 <cocreature> merijn: chrisdone recently abandoned a lot of his projects so I would expect that this was included
19:38 umib0zu joined
19:38 <merijn> cocreature: It's slowly breaking further and further. The user info page was broken first, now even the logging is broken
19:38 <orion> cocreature: Why did Chris Done abandon many of his projects?
19:38 <Tuplanolla> I don't particularly care if Pandoc goes from to
19:38 <geekosaur> too busy to maintain them
19:38 <cocreature> orion: lack of time and rsi iirc
19:38 <merijn> It's a shame, ircbrowse was amazing
19:38 <orion> RSI?
19:38 <geekosaur> it was a fairly large list of packages so I can see "too busy"
19:38 <cocreature> repetitive strain injury
19:39 <orion> Like carpal tunnel syndrome?
19:39 <cocreature> also user-facing packages like intero tend to take a up a lot more time due to support requests
19:39 <geekosaur> that and a few other things (like, there's a nerve in the elbow that can get RSI... I have that one)
19:40 fizbin joined
19:40 soLucien joined
19:40 <merijn> geekosaur: Might wanna look into weight training. I used to have some intermittent RSI-like symptoms, but managed to eliminate almost all of it that way
19:41 <geekosaur> sadly this one is genetics and age
19:41 <cocreature> can’t you just crispr it away? :)
19:42 hsk3 joined
19:42 <cocreature> has anyone seen the following issue in profiling builds? http://lpaste.net/354811
19:43 <cocreature> it goes away with -O0 so I’m relatively sure it’s a GHC bug but maybe it’s at least a known one
19:43 meetingology1 joined
19:43 <cocreature> all the issues I could find point to TH and -fno-code but -fno-code should not be involved here
19:43 <cocreature> TH definitely is
19:43 <merijn> More haskell related: Anyone know how I can set some criterion benchmarks to "default enabled"
19:43 <merijn> eh
19:44 <merijn> default disabled, I mean
19:45 locallycompact joined
19:46 sepp2k joined
19:46 <Clint> merijn: you mean you want them to not be enabled if someone runs cabal configure --enable-benchmarks ?
19:46 zdenal joined
19:47 <merijn> Clint: No, I mean I have a criterion benchmark executable which contains several groups of benchmarks and I want some to only run when explicitly enabled
19:47 conal joined
19:47 <ExpHP> I have a yaml file that is several gigabytes large. Is it possible for me to even /touch/ this thing with any existing libraries without blowing the heap?
19:48 <merijn> Like, I have "defaultMain [ group1, group2, group3 ]", but I want some of those groups to only run if explicitly asked for
19:48 newhoggy joined
19:48 klottie left
19:48 <merijn> ExpHP: Depends. Does it like, contain a list of many independent YAML objects?
19:49 <ExpHP> merjin: ah, I think I see where you are going
19:49 <ExpHP> with this
19:49 <cocreature> ExpHP: I’m tempted to ask how you ended up with such a file but I’m scared of the answer :)
19:49 <ExpHP> merjin: yes it does :)
19:49 <cocreature> ExpHP: on a more serious note, https://hackage.haskell.org/package/yaml-0.8.22/docs/Text-Libyaml.html provides a streaming interface
19:49 <merijn> ExpHP: Google something along the lines of "haskell yaml conduit" or "yaml pipes" to see if someone implemented a streaming library
19:50 <ExpHP> cocreature output of some program that computes phonon band structure
19:50 <ExpHP> it's, bizarrely, a yaml encoding of very large complex vectors
19:50 <merijn> Clint: But if you have any other suggestions I'm open :)
19:51 <Tuplanolla> Sounds like someone needs to learn about HDF5, ExpHP.
19:51 <ExpHP> cocreature: oh goody, an excuse to learn conduit :)
19:51 <cocreature> ExpHP: what confuses me is why you would use yaml for such a thing. I tend to see yaml as targeted at input made by humans which should never reach those dimensions. but I’m not being helpful here so I’ll shut up now :)
19:51 <ExpHP> Tuplanolla: the program does actually use HDF5 for some of its data, just not this :V
19:51 fizbin joined
19:52 <merijn> cocreature: Historical accident by some PhD prototype with no time to fix it >.>
19:52 <cocreature> merijn: heh that’s a pretty good reason
19:52 <cocreature> gotta love research quality software
19:52 <geekosaur> i.e. where too many commercial products come from (looking at you, matlab and cadence!)
19:52 <merijn> cocreature: Same reason I got 15 million lines of plain text measurement results :)
19:53 fieldsofgold_ joined
19:53 <cocreature> merijn: I’m sure plaintext was fine when the output was 15 lines long :P
19:53 Rodya_ joined
19:53 <merijn> cocreature: Parsed in python to nested dictionaries >.>
19:53 <merijn> Takes like 15 minutes to load in my input...should've used SQLite
19:53 <ExpHP> merijn: close, though if it ever constructed the dictionary then the Python would OOM
19:54 <ExpHP> so it actually rolls its own yaml output
19:54 <Tuplanolla> I'm actually working with something like that at the moment, because it's so difficult to get the tech support to install `libnetcdf-dev` for me.
19:54 <merijn> ExpHP: It's only a few GB, not too hard to get a machine that can deal with that :p
19:54 mudri joined
19:54 <ExpHP> merijn: of dictionaries and refcounted floats?
19:55 <merijn> ExpHP: dictionaries don't have that much overhead, neither do floats. I'd suspect a couple tens of GB RAM at most unless it's doing weird things?
19:55 <ExpHP> merijn: A couple of tens of GB ram is what I would call "disk thrashing"
19:56 <ExpHP> and what my comptuer would call [quiet clicking noises for 20 minutes]
19:56 <dolio> Get a new computer. :P
19:56 <merijn> ExpHP: No compute cluster/servers? :)
19:56 <ExpHP> I'm too lazy to deal with their ancient build tools :f
19:57 <merijn> The nodes in ours have 64GB RAM, so I just go YOLO on the RAM usage if I think it'll save me time
20:00 Gurkenglas joined
20:01 newhoggy joined
20:01 <cdornan> Orion: which projects do you have in mind?
20:01 __mu__ joined
20:02 jeltsch joined
20:02 justin3 joined
20:03 fieldsofgold joined
20:03 <merijn> bleh...I wish criterion had an interface for benchmarking "single run" benchmarks too :\
20:04 <cdornan> To answer your question, a combination of being too busy, packages being superseded by better alternatives and lack of interest/demand
20:06 <cdornan> And packages not needing any maintenance
20:06 <davean> merijn: "single run"?
20:07 noan joined
20:08 <merijn> davean: So currently criterion benchmarks things by running them N times, using the same input (when using "env"), however, many things you want to benchmark don't fit this mold
20:08 <cdornan> Sorry -- just reread above -- wrong Chris! Bah -- thought it was strange!
20:08 <geekosaur> heh
20:08 <merijn> davean: In many cases you want to either have the input allocated per "batch" of runs, or even per single invocation
20:08 Deide joined
20:08 <cdornan> Agree with the others about too much to do and RSI
20:09 <merijn> davean: Simplest example being, mutable vector benchmarks for sorting. Clearly the current "env" setup doesn't work, you need a new unsorted vector for every run!
20:10 <merijn> davean: I have a local (simple) patch that lets me allocate (and cleanup!) resources per batch of N runs (since Benchmarkable boils down to "Int64 -> IO ()", simply allocating/cleaning per batch was easiest to fix. But that still doesn't work for, e.g., sorting vectors
20:11 grayjoc joined
20:11 hybrid joined
20:12 newhoggy joined
20:12 Rodya_ joined
20:12 replay joined
20:12 <merijn> davean: In my case I wanted to benchmark Chan, MVar, and similar things. I can't simply allocate a single Chan using "env" as, suppose criterion ends up going up to 1000 iterations, all the previous "sum [1..999]" messages written to Chan would still be in there, bloating the RES memory and thus GC times, ruining the benchmark.
20:12 ubsan_ joined
20:13 <merijn> Currently I'm trying to benchmark the speed of synchronising a bunch of threads, but this requires me to: launch a bunch of threads, wait for them to sync, repeat. It's hard to turn that into something that can easily be repeated N times like Benchmarkable wants
20:14 meck joined
20:14 vlatkoB joined
20:14 insitu joined
20:15 sssilver joined
20:17 uglyfigurine joined
20:17 texasmynsted joined
20:21 newhoggy joined
20:21 <c_wraith> merijn, just in that a single case takes more than a few milliseconds?
20:21 Gloomy joined
20:21 <merijn> c_wraith: No, in the sense that I require setup to run a single step, but that setup shouldn't be measured
20:22 sleffy joined
20:22 <c_wraith> can the setup be shared?
20:22 <merijn> So I guess I should just yak shave and generalise my "per batch" setup/cleanup to work per run too
20:23 <c_wraith> Oh, I see. it can't.
20:23 <merijn> c_wraith: Well you could setup N repetitions in advance and run them sequentially, but that risks throwing off your measurements
20:23 <merijn> c_wraith: Since extra live data == slower GC == biasing your results
20:24 eschnett joined
20:24 <c_wraith> yeah.. criterion kind if treats IO benchmarkables as an afterthought
20:24 iomonad joined
20:25 <dolio> It was an afterthought.
20:25 <merijn> Like I said, patching it to work for stuff you can batch was ok
20:25 <merijn> i.e., for benchmarking writeChan I can simply do N writeChan's (N being the value criterion supplies to a Benchmarkable) and share a single alloc/cleanup for that batch
20:27 wildlander joined
20:29 newhoggy joined
20:30 meandi joined
20:30 sproingie joined
20:31 <merijn> So, one more yak to shave :p
20:32 AndiK joined
20:32 <cocreature> shave 9 yaks and you’ll get 1 additional yak to shave for free!
20:32 <c_wraith> it's more the other way around. shave 1 yak, get 9 free.
20:32 <monochrom> The last 20 yaks take 80% of your time.
20:32 <merijn> cocreature: I'd settle for merely some groupies and a cult of personality
20:32 <sproingie> there's always more yak to shave. it's like zeno's paradox.
20:33 <merijn> If not me, then who? No one else is this unreasonable about things. Everybody else just gives up on benchmarking instead >.>
20:33 <* cocreature> starts cheering for merijn
20:33 <sproingie> or it's an infinite yak. hm, can you comb an infinite yak smooth?
20:33 <monochrom> You need 4 dimensions.
20:33 <sproingie> ah, a hyperyak
20:34 <merijn> I also accept payment in single malt scotch...
20:34 <merijn> sproingie: A hyperyak could be any number of dimensions!
20:34 <c_wraith> well, yaks aren't topological spheres. they have multiple discontinuities
20:34 <sproingie> assuming a perfectly spherical yak
20:34 <monochrom> Remove the discontinuities.
20:34 <merijn> Common misconception is that hypercubes are 4D cubes, whereas they're in fact "cubes in some unspecified dimensionality" (including squares!)
20:35 <merijn> c_wraith: Pretty sure yaks are donuts, like most living things
20:35 <EvanR> whats a quick way to solve sin x = sin (x + phi) for x
20:35 <merijn> EvanR: Wolfram Alpha
20:35 <merijn> >.>
20:35 <EvanR> mkay
20:35 <c_wraith> merijn, as far as shaving them goes, things like hooves matter too.
20:35 Uakh joined
20:35 <c_wraith> merijn, or combing!
20:36 carlosda1 joined
20:36 <merijn> c_wraith: I'd expect the horns to matter more :p
20:38 <EvanR> that actually worked
20:38 newhoggy joined
20:40 <merijn> EvanR: Of course it did. My answers maybe borderline impractical and/or completely unrealistic, but mostly they're not wrong :p
20:40 <merijn> Also, everyone always forgets Wolfram Alpha is pretty amazing :)
20:41 Riviera_ joined
20:42 <EvanR> i dont forget, but something about the hiding extra digits or graphical chart features behind a paywall annoys me
20:42 <monochrom> EvanR: Use an identity under https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Product-to-sum_and_sum-to-product_identities
20:43 <monochrom> You want the one about sin - sin = product. Then you have product = 0 and it's much better.
20:43 <EvanR> product = 0
20:43 splanch joined
20:43 <EvanR> ok
20:44 Boomerang joined
20:44 <monochrom> Yes, Wolfram Alpha did low-pass filter for me once.
20:44 PennyNeko joined
20:46 <monochrom> Oh yikes, before they discovered log, they used these product-to-sum formulas instead?!
20:47 <monochrom> I guess "if all you have is a trig table..."
20:47 newhoggy joined
20:47 <merijn> hmmm, do I use a simple ADT, leading to confusion what the different fields mean. Or use records, but end up with partial field accessors?
20:48 gillesmajor joined
20:48 gillesmajor left
20:49 <monochrom> I use records but I don't use the field accessors I get.
20:49 gillesmajor joined
20:50 takle_ joined
20:50 <monochrom> Yes, I actually write out "f X{left=l, key=k, right=r} = f l + 1 + f r "
20:50 <lyxia> you can also make a sum of proper records
20:51 <Tuplanolla> I'm disappointed you didn't push prisms already.
20:51 slomo joined
20:53 moth joined
20:53 gillesmajor joined
20:54 <monochrom> OK! Consider prisms!
20:54 takle joined
20:56 <monochrom> One day I should write a really huge lens library, 100 times bigger than lens. Then call it "Very Large Telescope Array".
20:56 newhoggy joined
20:57 <lyxia> Hubble
20:59 insitu joined
21:00 <bshelden> Then make another, call it Webb.
21:01 <geekosaur> ALMA?
21:01 netheranthem joined
21:01 blender1 joined
21:03 e14 joined
21:03 na_th_an joined
21:03 na_th_an left
21:05 bhiliyam joined
21:05 <Nolrai> Does (return .) have a name?
21:05 <monochrom> fmap
21:06 newhoggy joined
21:07 <Nolrai> monochrom: fmap has type (a->b)-> f a -> f b, I want (a->b)->a -> f b.
21:07 raichoo joined
21:07 <monochrom> Oh, oops.
21:08 <Tuplanolla> :t fmap pure -- I don't think this has a name, Nolrai.
21:08 <lambdabot> (Functor f1, Applicative f) => f1 a -> f1 (f a)
21:09 <Nolrai> Okay.
21:10 sssilver joined
21:10 <merijn> Speaking of names
21:10 <merijn> Is there a good alternative to "const (return ())"?
21:11 umib0zu joined
21:11 <Nolrai> Hm.
21:11 <Tuplanolla> There's an alternative formulation of applicative in terms of `unit` and `zipA`, where that would be `const unit`, merijn.
21:12 lukky513 joined
21:12 <Nolrai> merjin: what's the context?
21:13 jer1 joined
21:13 <Tuplanolla> It's such that `pure x = fmap (const x) unit` and `f <*> x = fmap (uncurry ($)) (zipA (f, x))`. I use it every now and then.
21:13 lukky513_ joined
21:14 newhoggy joined
21:15 thc202 joined
21:15 <merijn> Nolrai: Cleanup action that needs a no-op cleanup, i.e. take a value and do nothing
21:16 theorbtwo joined
21:17 <merijn> @hoogle Monad m => a -> m ()
21:17 <lambdabot> Pipes discard :: Monad m => a -> m ()
21:17 <lambdabot> Control.Monad.Extra discard :: Monad m => a -> m ()
21:17 <lambdabot> Control.Monad.HT void :: (Monad m) => m a -> m ()
21:17 soniku joined
21:17 <Nolrai> Monad.Extra discard looks right.
21:18 <merijn> Nolrai: Yeah, but not worth picking up a random extra dependency for :)
21:19 <Nolrai> I might define "do_nothing _ = return ()"
21:20 <Nolrai> Its not much shorter, but is pretty clear.
21:20 machinedgod joined
21:21 b3it3 joined
21:22 Cale joined
21:23 b3it3 left
21:23 <Nolrai> or maybe "ignore _ = return ()"
21:24 newhoggy joined
21:24 <monochrom> "void" already exists for that :)
21:24 <merijn> monochrom: Not the same thing
21:24 abrar joined
21:25 <monochrom> Err, maybe it's called "ignore" afterall.
21:25 <monochrom> @type void
21:25 <lambdabot> Functor f => f a -> f ()
21:25 <monochrom> @type ignore
21:25 <lambdabot> error:
21:25 <lambdabot> • Variable not in scope: ignore
21:25 <lambdabot> • Perhaps you meant one of these:
21:25 <EvanR> adding to the confusion between void, Void, () and ()
21:25 <monochrom> void is close enough.
21:25 <EvanR> where void might mean ()
21:26 <monochrom> Oh! I see, different effects.
21:26 peterbecich joined
21:27 epsilonhalbe left
21:27 stobix joined
21:29 fizruk joined
21:29 newhoggy joined
21:29 insitu joined
21:30 fotonzade joined
21:31 <merijn> Bleh, there's no way to use e.g. try/finally on a value MonadIO without using something like exceptions or the MonadBaseControl stuff, right?
21:32 <monochrom> MonadIO is way too general (weak API) for cunning control flow.
21:33 abhiroop joined
21:33 <merijn> A pox upon whoever decided the type of this thing to be MonadIO...
21:33 <merijn> So, any advice on picking bounds when adding a new dependency to some package?
21:33 <monochrom> Allowing you to contrive counterexamples such as LogicT IO for which you don't even want to ask what does it mean to throw or catch.
21:34 <glguy> merijn: It depends on how defensive you are with your imports if you want to set the bound "correctly"
21:34 kmels joined
21:34 newhoggy joined
21:34 <merijn> glguy: I generally am not, but since I hope to actually see this merged... :p
21:35 <monochrom> I would start with "== x.y.*" in my first version. Relax when demanded.
21:35 <monochrom> Unless it's base. Then it's "base < 10" because I use base 10.
21:36 <Nolrai> I think you mean base >= 10?
21:36 <monochrom> The "I use base 10" part was a joke.
21:36 carlosda1 joined
21:36 <Nolrai> Oh, riht!
21:36 <Nolrai> Sorry.
21:36 <monochrom> http://cowbirdsinlove.com/43
21:37 <monochrom> I use base-10. What is base- :)
21:37 hybrid joined
21:37 <c_wraith> all systems are base-10
21:37 <Nolrai> Shouldn't that be "what is 4?"
21:37 <monochrom> I found a dons package that had "base < 10" and I much admire it. :)
21:38 <c_wraith> amusingly, that package broke when base 4.0 was released
21:38 <monochrom> haha
21:39 aueuaio joined
21:40 <merijn> @quote dcoutts practise
21:40 <lambdabot> dcoutts says: ...These packages all use "build-depends: base >= 3 && < 4" (except for ghc-core which cheekily uses "build-depends: base < 10" --- a practise we will ban if it becomes any more
21:40 <lambdabot> popular).
21:40 <merijn> :p
21:40 aueuaio left
21:40 <dcoutts_> @yarr!
21:40 <lambdabot> What be a priate's favourite cheese?
21:40 <lambdabot> Yarrlsburg!
21:40 <Tuplanolla> How is that related to primates?
21:41 <merijn> dcoutts_: cabal-install 2.x will never get released if you're slacking off on IRC! *ducks*
21:42 newhoggy joined
21:43 <merijn> Can I put inline pragma's on where clauses? Or will GHC liberally inline those anyway?
21:44 netheranthem joined
21:44 Itkovian joined
21:44 <monochrom> The intersection between primates and pirates is non-empty. :)
21:45 nicknovitski joined
21:45 <monochrom> I think yes for the first question.
21:46 abhiroop joined
21:46 boombanana joined
21:46 zcourts joined
21:47 tomboy64 joined
21:48 newhoggy joined
21:49 cpup joined
21:50 peterbecich joined
21:53 hiratara joined
21:54 <Nolrai> How hard would it be to make a function take any of (a->m b, b -> m a), (a-> m b, b -> a), or (a->b, b->a)?
21:55 SpinTensor joined
21:55 <monochrom> change a->b to a -> Identity b
21:56 <Nolrai> Yeah but then I still need to write "(return . g)" where I use it.
21:57 newhoggy joined
22:00 darjeeling_ joined
22:01 newhoggy joined
22:02 Aruro joined
22:02 <Nolrai> I guess what I really want is a type class: "class Foo b b' where foo : (a -> b)-> (a -> b')" and "instance Applicative m => Foo a (m a) where foo f = pure . f" and "instance Foo a a where foo = id"? Will this confuse the typechecker too much?
22:04 <Aruro> why show "abc" escapes quotation sign?
22:04 <merijn> Aruro: Why wouldn't it?
22:04 ChaiTRex joined
22:04 <Aruro> thus making (read "abc" :: String) == "abc" impossible
22:04 Guest17 joined
22:05 <Aruro> merijn: because there are no quotation signs in string "abc"
22:05 abhiroop joined
22:05 <dolio> Why did you write two of them, then?
22:05 <Aruro> > read "abc" :: String
22:05 <lambdabot> "*Exception: Prelude.read: no parse
22:06 <Tuplanolla> > fix show :: String
22:06 <lambdabot> "\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\...
22:06 <merijn> What even is the point of "read" to convert to String?
22:06 <Aruro> dolio: show instance and object are not same , where is problem?
22:06 Aruro_ joined
22:06 <Aruro> merijn: its not plausible to ask such question unless u know all cases
22:07 <merijn> > show "abc"
22:07 <lambdabot> "\"abc\""
22:07 <merijn> > read (show "abc") :: String
22:07 <lambdabot> "abc"
22:07 <merijn> Looks fine to me?
22:07 <Aruro> so why read is not capable or reading actuall string?
22:07 <Aruro> > read "abc" :: String
22:07 <lambdabot> "*Exception: Prelude.read: no parse
22:07 <lyxia> Many other instances use read/show on their fields.
22:07 <Aruro> seems not fine to me
22:08 <merijn> Aruro: Well what would you expect it to do?
22:08 <Aruro> i would want it to be "abc"
22:08 <Aruro> identity
22:08 <Aruro> somehow
22:08 <dolio> Why not use the identity function if that's what you want?
22:08 <merijn> Aruro: Why would it do that?
22:08 <Aruro> dolio: because i use read on other types
22:09 <merijn> I don't suppose there's a replicateM that accepts Int64
22:09 <Aruro> merijn: ok i would reply in your logic, why wouldn't it do that?
22:09 <merijn> Aruro: Because that's not how the behaviour of Read is defined?
22:09 boombanana joined
22:09 <Aruro> i read command line argument and if its string read is broken
22:10 <hexagoxel> the string `show`n when doing `show "abc"` contains no quotation marks. the initial question seems to stem from some misunderstand already.
22:10 <Aruro> hexagoxel: read is incapable of reading command line string
22:10 <hexagoxel> the escapes are an artifact from `show`ing twice, the second happening implicitly.
22:10 jer1 joined
22:10 <Aruro> > read "123" :: String
22:10 <lambdabot> "*Exception: Prelude.read: no parse
22:10 <Aruro> no showing here
22:10 newhoggy joined
22:11 <Aruro> :t getArgs
22:11 <lambdabot> error: Variable not in scope: getArgs
22:11 <hexagoxel> > read "(\"abc\", 1)" :: (String, Int)
22:11 <lambdabot> ("abc",1)
22:11 <hexagoxel> if you omitted the quotation marks when showing, something like that could never parse
22:12 <merijn> Aruro: So don't use getArgs and use a proper library like optparse-applicative
22:12 <hexagoxel> show=read=id for String would not work if composed.
22:12 <Aruro> i understand, but simple string is not being parsed either
22:12 fizbin joined
22:12 <Tuplanolla> @let newtype AsIs a = AsIs a -- You could do this and define `instance Read (AsIs String)`, Aruro. However that's rather disgusting.
22:12 <lambdabot> Defined.
22:13 thang1 joined
22:13 <Aruro> merijn: read is perfectly fine if u know how to use it
22:13 <Aruro> no need of useless dependencies
22:13 <merijn> I agree with the statement that read is perfectly fine
22:15 <Aruro> Tuplanolla: but then i can not abstract over usual string functions like reverse for example
22:15 <Aruro> i will need to switch them to new type
22:15 <Tuplanolla> You can derive `Functor` to get all that for free, Aruro.
22:15 texasmynsted joined
22:15 <Aruro> ok, seems promising
22:16 <Tuplanolla> @let deriving instance Functor AsIs -- Can our robotic maid do this?
22:16 <lambdabot> Defined.
22:17 <Aruro> so then reverseAsIs = fmap reverse
22:17 <Aruro> ok, i think its much better than nothing, ty
22:18 e14 joined
22:19 noddy joined
22:19 safe joined
22:21 Gloomy joined
22:23 flashytheflash joined
22:23 bjz joined
22:23 newhoggy joined
22:24 <hexagoxel> finally, a total read implementation.
22:25 <Nolrai> :P
22:26 <hexagoxel> .. i still doubt that it is what you want. if you want id, use id, not read. having a parsing function return rest-of-input makes rarely sense.
22:26 <Tuplanolla> They're gone, hexagoxel.
22:27 <EvanR> heres a case where parsing function return "rest-of-input" (with a useful answer too) makes sense when the parser doesnt directly support streaming
22:27 texasmynsted joined
22:31 hiratara joined
22:33 dan_f joined
22:34 <Nolrai> Yeah the more I think about it the less I think Aruro actually wants "read = id".
22:35 newhoggy joined
22:37 <monochrom> If String's Read and Show did not put in quotes (or generally use string-literal syntax), then "data M a = a :*: a deriving (Read, Show)" would royally break for M String.
22:37 carlosda1 joined
22:37 sigmundv__ joined
22:39 <monochrom> or (String, String)
22:40 vektorweg1 joined
22:44 <monochrom> Also yes, read=id for your own string type is likely a bug waiting to happen.
22:44 jdt joined
22:46 prophile joined
22:46 newhoggy joined
22:47 markasoftware joined
22:48 havenwood1 joined
22:49 pera joined
22:50 <Nolrai> I guess they are doing something like (onArgs f = do {[a,b,c] <- getArgs; f (read a) (read b) (read c))?
22:51 <monochrom> That one benefits from f (read a) (id b) (simply c)
22:53 abel-abel joined
22:53 <Nolrai> Right, but the first can take both (f :: Int -> String -> Int -> IO d) and (f::String -> String -> Float -> IO d) and so could save a tiny bit of code duplication.
22:53 <monochrom> Oh! f is a parameter.
22:54 <Nolrai> Right.
22:54 <Nolrai> I still agree that its a terrible idea.
22:54 newhoggy joined
22:54 abel-abel joined
22:54 <monochrom> Then wrong abstraction. The parameters should be 3 parsers.
22:54 mjora7 joined
22:54 <Nolrai> Yes.
22:55 <mjora7> Is there a difference between `let thing = 123` and `thing = 123`?
22:55 <Nolrai> Yes.
22:56 <merijn> mjora7: Yes, depending on where you type them, one of the two is a syntax error
22:56 <Nolrai> The first is part of an expression of one of two forms, the other is a declaration.
22:57 ludat joined
22:57 eschnett joined
22:58 Goplat joined
22:59 newhoggy joined
23:00 <abel-abel> Hello, I use Emacs in windows. When I start haskell repl in Emacs, it shows https://snag.gy/1lGPT9.jpg . My configuration: https://snag.gy/A0gGSj.jpg . And I also tried: https://snag.gy/B6VRz9.jpg Neither of them works. :( Any suggestions?
23:01 markus1189 joined
23:01 markus1199 joined
23:02 <abel-abel> Besides, the path `C:\Program Files\Haskell Platform\8.0.2\bin\ghci.exe` exists. I can start it on windows.
23:03 cloudhead joined
23:03 <Nolrai> (The two forms are "'let' name pattern* = exp 'in' exp" which is just a normal expression, and the form "let x = y" which can be used in do blocks (but can't be the last 'statement' in a do block))
23:04 pgiarrusso joined
23:06 theDon_ joined
23:06 bhiliyam joined
23:07 crobbins joined
23:07 fizbin joined
23:07 newhoggy joined
23:08 dedicated joined
23:08 DTZUZU joined
23:12 soniku joined
23:13 allenj12 joined
23:14 soLucien joined
23:14 jdt joined
23:15 newhoggy joined
23:17 sleffy joined
23:19 blym joined
23:20 tomboy64 joined
23:21 <abel-abel> :(
23:21 <bshelden> I see your question, but unable to help, sorry :(
23:23 bennofs joined
23:23 <abel-abel> bshelden, you use Linux or macos?
23:23 mjora7 joined
23:23 <bshelden> Linux.
23:23 newhoggy joined
23:24 <bshelden> But I use vim and an external terminal to invoke things.
23:24 <bshelden> I haven't yet taken the time to learn emacs.
23:24 <mjora7> Hey, could someone help me understand why this code doesn't work? I must be misunderstanding how Type Classes work. https://gist.github.com/aryaforghani/955a0051aff281f4fb1614e0c91b0b4c#file-showpersoninfo-hs
23:24 <abel-abel> bshelden, yeah. My Emacs configuration works well in Linux.
23:25 <thang1> There are emacs configurations that don't work well in Linux?
23:27 jdt joined
23:27 <abel-abel> thang1, I mean my haskell emacs configuration doesn't work well in Windows. :(
23:27 mckeankylej joined
23:28 <AWizzArd> In a blog posting I read that monads have “strong limitations”, and something more powerful had to be invented: arrows. Is that true? Or could this be the interpretation of somebody who only spent some months with Haskell?
23:28 <bshelden> Yeah, I try very hard not to develop on windows. To the point where I'll fire up a linux VM to avoid it.
23:28 <bshelden> That strikes me as an odd statement...
23:29 nighty-- joined
23:29 <Sornaensis> strong limitations?
23:29 <bshelden> It's not so much that monads have "strong limitations". Monads are applicable where you see >>='s type signature. They're not when you don't. Like any abstraction...
23:29 <bshelden> (I'm being a little lose here, I know)
23:29 <Sornaensis> loosey goosey
23:30 <mckeankylej> Is it possible to construct law abiding monad instances for mutually recursive datatypes? Like the ones in this: http://lpaste.net/354818
23:30 <LHoT10820> Regarding Haskell's lazy evaluation: In the following formula: Does Haskell generate the whole list before iterating through each tuple? Or does it evaluate each tuple as it's created, before the list is completed?
23:30 <thang1> Nothing works well in windows :p
23:30 <LHoT10820> [ (a,b,c) | c <- [1..10], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a+b+c == 24]
23:30 oisdk joined
23:30 <AWizzArd> The „limitation” factor was something like: bind can’t look deeper into the structure. A monad can’t see a full do block before evaluating it.
23:30 <Sornaensis> > [ (a,b,c) | c <- [1..], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a+b+c == 24]
23:31 <lambdabot> mueval-core: Time limit exceeded
23:31 <LHoT10820> rip
23:31 <mjora7> Sorry I'm a noob but I don't understand why my code isn't working and I don't understand the error message or know what to look up.
23:31 <Sornaensis> > take 1 [ (a,b,c) | c <- [1..], b <- [1..c], a <- [1..b], a^2 + b^2 == c^2, a+b+c == 24]
23:31 <lambdabot> [(6,8,10)]
23:31 <Sornaensis> anyway
23:31 abhiroop joined
23:31 newhoggy joined
23:31 <mjora7> It seems like Haskell isn't very beginner friendly, kind of getting discouraged.
23:32 <Sornaensis> mjora7: code and error?
23:32 <bshelden> Depends on what you're looking for when you say "Beginner friendly"
23:32 <blym> mjora7, if you’re using ghci, try using :t <expr>
23:32 <LHoT10820> mjora7: Programming as a whole typically isn't beginner friendly. You're gonna keep walking into walls until it all of a sudden clicks one day.
23:32 <mjora7> Sornaensis https://gist.github.com/aryaforghani/955a0051aff281f4fb1614e0c91b0b4c#file-showpersoninfo-hs
23:32 <EvanR> arrows arent more powerful than monads, they are actually not as powerful
23:32 <blym> like this: :t showPersonInfo
23:32 <LHoT10820> That's regardless of language.
23:32 <blym> it will show you the most general inferred type, and you can compare that with your current implementation to see what’s wrong
23:32 <bshelden> Let us know what you're missing and we can help you find the tools you need.
23:33 <bshelden> :t is one of the more important ones for sure
23:33 <mjora7> Trying to understand how to properly declare the typeclasses
23:33 <lambdabot> error: parse error on input ‘of’
23:33 <LHoT10820> Don't be afraid to ask for help outright, we've all been there.
23:33 <EvanR> but can be made equivalent to monads expressiveness with ArrowApply
23:33 <Sornaensis> mjora7: your function produces a String
23:33 <Sornaensis> not an a
23:33 Durbley joined
23:33 {emptyset} joined
23:33 <Sornaensis> also it looks like you want 'show name' and not 'name' in the body
23:34 <EvanR> mckeankylej: theres no reason why a recursive type cant be a monad
23:34 <AWizzArd> EvanR: okay. Then I would think that this blog author simply didn’t study Haskell deeply enough and just straight-ahead wrote his monad tutorial.
23:34 <ChaiTRex> mjora7: Also, you need Show b as a constraint, since you're using show on it.
23:34 <EvanR> AWizzArd: yeah thats a thing that happens... the monad tutorial after you try to figure out monads and nothing else
23:34 <mjora7> Ugh, I'm lost lol.
23:34 darjeeling_ joined
23:35 <EvanR> AWizzArd: a more important theme here is that you actually dont want power if you can avoid it, you want the thing that matches exactly what you are trying to do
23:35 <mckeankylej> EvanR: can you point me in the direction I need to go to write the monad instance I get stuck when I hit a case that has the other datatype because I have a function that goes from a -> A a but I have a B a
23:36 soniku joined
23:37 <mjora7> Sornaensis: So if I want a tuple that contains this data ("Bill", 1990), how would I declare the type of the function?
23:37 <EvanR> mckeankylej: im not sure your particular types can be monads... the definition of "pure" isnt inspiring me
23:37 <Sornaensis> :t ("Bill", 1990)
23:37 <mjora7> Sornaensis: showPersonInfo (String, Int) -> String ?
23:37 <lambdabot> Num t => ([Char], t)
23:37 <mckeankylej> EvanR: yea I feel the same way :/
23:38 carlosda1 joined
23:38 <mjora7> What does Num t => mean?
23:38 <bshelden> Some type 't' for which an instance of the Num typeclass exists
23:38 <EvanR> mckeankylej: whats the a param supposed to be for this?
23:38 <ChaiTRex> mjora7: It means that the type t in your signature can be anything that implements Num.
23:38 <Sornaensis> some type t that has a Num typeclass instance
23:38 newhoggy joined
23:38 <mjora7> Ok, why is it 't' and not 'a'?
23:38 <Sornaensis> it's a variable
23:38 <bshelden> just a label
23:39 <Sornaensis> so the name isn't that important
23:39 <mckeankylej> EvanR: its the type of varaibles
23:39 <mjora7> But why is 'a' used sometimes and 't' used othertimes? Are they interchangeable?
23:39 <EvanR> youre expecting a to be the same throughout the AST ?
23:39 <Sornaensis> in haskell, type signatures can contain variables
23:39 <mckeankylej> EvanR: yes
23:39 <EvanR> how should fmap work?
23:39 <c_wraith> mjora7, type variables assigned by ghc are t. type variables taken from a sub expression with an explicit type use those labels.
23:40 <mjora7> Ok
23:40 <c_wraith> :t 1
23:40 <lambdabot> Num t => t
23:40 <c_wraith> no explicit signature, so it gets t
23:40 <c_wraith> :t map
23:40 <lambdabot> (a -> b) -> [a] -> [b]
23:40 <bshelden> :t fromInteger
23:40 <lambdabot> Num a => Integer -> a
23:40 Destol joined
23:41 <c_wraith> map was defined with an explicit signature, so it uses those labels.
23:41 <bshelden> So that one's interesting. Literal numbers in haskell are effectively wrapped in fromInteger
23:41 sophiag joined
23:41 <c_wraith> bshelden, not as far as the labeling is concerned. :)
23:41 <ChaiTRex> bshelden: Except for the ones with a dot in them.
23:41 <EvanR> -1 is also wrapped in negate
23:41 <bshelden> True
23:41 <c_wraith> :t map show
23:41 <lambdabot> Show a => [a] -> [String]
23:42 <c_wraith> mjora7, map show keeps the 'a' type variable it gets from both the map and the show sub expressions
23:42 <c_wraith> mjora7, ultimately, it doesn't mean anything. they important part is what labels are the same.
23:43 <mckeankylej> EvanR: the idea is the monad instance does subsitution on variables
23:43 <EvanR> mjora7: why type variables are automatically chosen to be certain letters really shouldnt distract you from learning... that they are anything you want, you could even use words instead of letters
23:43 <mjora7> Alright
23:43 <EvanR> sometimes that helps explain what theyre for
23:44 <mjora7> I'm just frustrated cause I can't even write a function that takes a tuple ("Bill", 1992) and returns "Bill was born in 1992", now I'm getting errors with " was born in " ++ show birthYear
23:45 <EvanR> mckeankylej: ah
23:45 <monochrom> Then you should put your current code on lpaste.net and show us.
23:45 <* geekosaur> bets it's precedence
23:45 <mjora7> One sec
23:45 <geekosaur> specifically application vs. everything else
23:45 newhoggy joined
23:46 <EvanR> mckeankylej: well to get started writing the implementation of >>=, you would do case analysis on the argument rather than assume _
23:46 <monochrom> We know that education systems have failed to teach science when we see that so many people have not been taught the value of conveying a reproducible experiment.
23:46 <mjora7> https://gist.github.com/aryaforghani/ae8c8e0e5c32fb55f534e8d98ee57241#file-code-hs
23:47 <monochrom> change Num to Show
23:47 <EvanR> mckeankylej: presumably you want to do something different in different circumstances
23:47 <monochrom> The function is not doing any arithmetic anyway.
23:47 <EvanR> whether or not to use f, what to pass f
23:47 Maxou joined
23:47 <mckeankylej> EvanR: not sure what that is I will think of the semantics some more
23:47 <mjora7> monochrom: I don't need to be told how to fix my code, I wish I could just get a resource to learn from the proper way, or have someone explain *why*
23:48 <EvanR> and what to do with the result of f, if anything besides return it as is
23:48 <mjora7> monochrom But thanks, I appreciate it
23:48 <EvanR> and finally check that it obeys the monad laws
23:48 <monochrom> I can explain why. show uses the Show typeclass rather than the Num typeclass.
23:49 <monochrom> Most costs-money textbooks are proper.
23:49 <mjora7> So using :t ("Bill", 1996) was not a good way to intuit this
23:49 <mjora7> as I misled myself
23:49 <geekosaur> well. if this came from an older tutorial, then Num implied Show
23:49 IanKelling joined
23:50 <geekosaur> (and Eq)
23:51 <monochrom> A more accurate way to discover this is to have GHC infer the type of showPersonInfo instead. It will say what I said.
23:52 <monochrom> In general XY problems are XY problems.
23:52 <blym> mjora7, that’s because (“Bill”, 1992) and your code (ignoring your type declaration) have different sets of constraints that overlap each other
23:53 <mjora7> So is there a particular Haskell textbook that is recommended? I'm using Learn You a Haskell at the moment and I think it's not a very good resource (for me at least).
23:53 <blym> haskellbook.com, but it costs money
23:54 <monochrom> Graham Hutton's book. Richard Bird's book. Chris Allen's book (which is haskellbook.com)
23:54 <geekosaur> @where learnhaskell
23:54 <lambdabot> https://github.com/bitemyapp/learnhaskell
23:54 <EvanR> :t ("Bill", 1996)
23:54 newhoggy joined
23:54 <lambdabot> Num t => ([Char], t)
23:54 <EvanR> :t ("Bill", 1996) :: (String, Integer)
23:54 <lambdabot> (String, Integer)
23:54 gigamonkey joined
23:54 <geekosaur> ^ also some non-textbook stuff like the online cis194 andf NICTA courses
23:55 <EvanR> beginner mode might be interesting
23:55 <glguy> mjora7: Hutton's Programming in Haskell as mentioned above is worth looking at
23:55 <monochrom> I think I like Paul Hudak's book too but it's getting old. (And Hudak is no longer around.)
23:55 <EvanR> polymorphism is either too obvious for veterans of typed languages, or too scary for veterans of dynamically typed languages
23:55 <mjora7> Ok well thanks for the information everyone, I'll look into these resources.
23:56 <monochrom> I think I also know some lecture series on Youtube.
23:56 infinity0_ joined
23:56 infinity0_ joined
23:57 <monochrom> This one: https://www.youtube.com/playlist?list=PL4C1D41CB47EED318
23:58 <monochrom> I have only bookmarked it, I have not actually sat through it to evaluate.
23:58 <monochrom> Lazy evaluation is waiting for bitcoin input to start.
23:58 nakal joined
23:58 <monochrom> Ah but no not this summer, I have just signed a contract to do something else this summer.
23:59 infinity0 joined
23:59 markus1209 joined
23:59 markus1219 joined