<    June 2018     >
Su Mo Tu We Th Fr Sa  
                1  2  
 3  4  5  6  7  8  9  
10 11 12 13 14 15 16  
17 18 19 20 21 _2_2 23  
24 25 26 27 28 29 30
00:03 scottschmidt joined
00:04 fmixing joined
00:04 contiver joined
00:04 tabemann joined
00:05 darjeeling_ joined
00:05 dxld joined
00:05 troydm joined
00:06 averell joined
00:06 fizbin joined
00:10 lagothrix joined
00:10 dfeuer joined
00:13 jollygood2 joined
00:16 <jollygood2> I figured out my problem. my line parser never failed, since '\n' was optional
00:19 nighty-- joined
00:19 <* hackage> mbug 1.2 - download bugs mailboxes http://hackage.haskell.org/package/mbug-1.2 (DmitryBogatov)
00:19 nshepperd joined
00:20 rasusto_ joined
00:20 <butterthebuddha> I'm trying to compose an Either and State monad using transformers but I'm very confused; can someone demonstrate this with an example? Apparently I can use Either with Except?
00:20 exarkun_ joined
00:22 brocoli joined
00:25 scottschmidt1 joined
00:26 <lyxia> ExceptT e (State s) a
00:26 <lyxia> @mtl s -> (Either e a, s)
00:26 <lambdabot> Maybe you meant: url unmtl pl msg
00:26 <lyxia> @unmtl ExceptT e (State s) a
00:26 <lambdabot> ExceptT e (State s) a
00:26 <lyxia> pf
00:27 andyhoang1 joined
00:27 progfun joined
00:29 antsanto joined
00:30 SkyHawk joined
00:31 <Solonarv> :i ExceptT
00:33 <Solonarv> alright, I'll do it myself!
00:33 <Solonarv> ExceptT e (State s) a ~ State s (Either e a) ~ s -> (s, Either e a)
00:36 nitaigao joined
00:39 andyhuzhill joined
00:39 silver_ joined
00:40 <butterthebuddha> ExceptT gives me a monad with Either?
00:40 twopoint718 joined
00:40 twopoint718 joined
00:40 <butterthebuddha> I thought it gave me a monad with Except?
00:41 scottschmidt1 joined
00:43 <geekosaur> ExceptT is a newtype over Either, adding behavior
00:43 <Solonarv> `ExceptT m` is a monad whenever `m` is a monad
00:45 macrover joined
00:46 <butterthebuddha> Does ExceptT compose nicely with functions that return Either?
00:46 macrover left
00:47 emilypi joined
00:47 <Solonarv> sure
00:47 <Solonarv> @hoogle liftEither
00:47 <lambdabot> Control.Eff.Exception liftEither :: (Typeable e, Member (Exc e) r) => Either e a -> Eff r a
00:47 <lambdabot> Data.Aeson.BetterErrors.Internal liftEither :: (Functor m, Monad m) => Either err a -> ParseT err m a
00:47 <lambdabot> Control.Eff.Exception liftEitherM :: (Typeable m, Typeable e, Member (Exc e) r, SetMember Lift (Lift m) r) => m (Either e a) -> Eff r a
00:47 <Solonarv> ack, useless lambdabot
00:47 <Solonarv> https://www.stackage.org/haddock/lts-11.14/mtl-2.2.2/Control-Monad-Except.html#v:liftEither
00:48 <geekosaur> @hoogle liftEither package:mtl
00:48 <lambdabot> No results found
00:48 <geekosaur> bah
00:48 <butterthebuddha> Argh, I'm really confused right now. I think I'm gonna read a little bit more about transformers
00:49 justanotheruser joined
00:49 <jollygood2> was about to ask if there is a manyN equivalent of many1, but then I figured out I could just use replicateM. :-)
00:50 jmcarthur joined
00:51 SkyHawk joined
00:53 andreabedini joined
00:53 ericsagn1 joined
00:57 silver__ joined
00:57 oisdk joined
00:57 scottschmidt joined
00:58 enterprisey joined
00:58 chao-tic joined
00:59 justanotheruser joined
01:01 johnvonneumann joined
01:02 toovs joined
01:03 Khisanth joined
01:03 beauby joined
01:05 <mjrosenb> ok, now that I have cabal new-build working, does anyone happen to know how to get haskell-mode in emacs to use that for compilation?
01:08 daniel-s joined
01:09 infinisil joined
01:11 <mjrosenb> ahh, think I figured that one out.
01:11 <mjrosenb> possibly not the correct way to do it, but it works.
01:17 pranz joined
01:18 Tops21 joined
01:18 <wazdee> q/quit
01:19 zyla_ joined
01:21 <jollygood2> is there a parsec combinator like this? (Just <$> try parser <|> return Nothing). it is similar to optionMaybe, but it does not throw error if parser partially consumed input
01:21 blankhart joined
01:21 sclltr joined
01:22 tAy joined
01:23 saurabhnanda joined
01:23 <tAy> Howdy, I've got a function signature that I think is correct, but GHC keeps telling me its wrong. I can't figure out why
01:24 <tAy> StrictApplyN :: Integer -> (a -> a) -> a -> a
01:25 <tAy> StrictApplyN n f x = StrictApplyN (n - 1) f $! (f x)
01:25 <tAy> I have the break case too, so its not that
01:26 <tAy> Its saying the signature needs to be in the form <variable> :: <type>
01:26 SkyHawk left
01:26 <fakenullie> looks like there's wrong syntax somewhere else
01:27 <jollygood2> tAy functions should start with lower case letter
01:27 <Clint> tAy: why is the S capital
01:27 <tAy> Does that make a difference?
01:27 <fishythefish> tAy: yes
01:27 <tAy> Not sure why now that you mention it
01:27 connrs joined
01:27 <tAy> Welp that was it, thanks haha
01:31 hamishmack joined
01:32 chao-tic joined
01:33 xpycm joined
01:36 fmixing joined
01:38 pranz1 joined
01:38 dpyro joined
01:41 pranz2 joined
01:42 diwo joined
01:44 andreabedini joined
01:46 andyhoang1 joined
01:51 lainon joined
01:52 scottschmidt joined
01:53 klntsky joined
01:57 connrs joined
01:57 markus1199 joined
01:59 spear2 joined
02:00 <spear2> how to install haskell platform for a multi-user system?
02:00 ian_andrich_ joined
02:00 <spear2> *latest
02:00 hucksy_ joined
02:01 plugin joined
02:01 andyhuzhill joined
02:04 andyhuzhill joined
02:04 sid2k joined
02:06 <mjrosenb> it is so strange, whenever I look at maybe and fromMaybe, I always think of fromMaybe as being more useful, but invariably, I find myself using maybe instead.
02:08 diwo joined
02:08 plugin_ joined
02:08 fragamus joined
02:12 <spear2> hmm i guess i can create symlinks to primary user ~/.cabal and ~/.ghc and at least xmonad seems to work for my other users
02:14 <fresheyeball> so I am trying to convert this thing into Haskell
02:14 <fresheyeball> https://lpaste.net/7611431009204043767
02:15 <fresheyeball> Its C#
02:15 <fresheyeball> but so far not much is working
02:15 <fresheyeball> `Data.ByteString.Base64.decode` succeeds just fine
02:15 <fresheyeball> but I can't get it to *inflate*
02:15 <fresheyeball> I know its supposed to be a headerless deflate algorithm thing (edited)
02:15 <fresheyeball> `Codec.Compression.Zlib.Raw.decompress` which is semantic I think, fails with
02:15 <fresheyeball> ```*** Exception: Codec.Compression.Zlib: compressed data stream format error (invalid code lengths set)```
02:15 <Cale> mjrosenb: Oddly, I find myself replacing occurrences of maybe with case expressions often enough that I rarely even bother with it.
02:15 jollygood2 joined
02:15 <Cale> (though it's nice in code that you expect will never change)
02:16 <Solonarv> my current project (a game) has 7 occurences of maybe and 8 fromMaybe; only 3.8kloc though
02:16 <Solonarv> I'm amused by how even they are
02:16 amirpro joined
02:17 danso joined
02:17 <jollygood2> my function is handling multiple incompatible error types. what should it return? I am tempted to return Either String ActualData, converting both error types to error message
02:18 <fresheyeball> jollygood2: I think String is fine for that case
02:18 Linter joined
02:18 banc joined
02:18 <fresheyeball> if excessive percision is getting in your way, you can always be less percise
02:19 <Solonarv> if all you're going to do with an error is print it to stderr and exit, you might as well use String, yeah
02:19 bbrodriguez joined
02:19 <jollygood2> I am, can't do much more than report error and quit at that point
02:21 amirpro joined
02:21 scottschmidt joined
02:22 lortabac_ joined
02:22 creater joined
02:24 biGuPsToMe joined
02:26 tabemann joined
02:27 enterprisey joined
02:29 saurabhnanda joined
02:30 lagothri1 joined
02:34 <butterthebuddha> Why was the "fail" function a mistake?
02:34 AetherWind joined
02:34 <Cale> butterthebuddha: It doesn't belong in the Monad class
02:35 <Cale> Most monads can't implement it well
02:35 <geekosaur> ^ in many cases your only option is to throw an exception, which is often an overreaction at best
02:36 <Cale> also, before it was introduced, the type of do-blocks would tell you that the monad should support failure, via a MonadZero constraint
02:36 <Cale> Really it was part of a whole snowball of somewhat-questionable decisions that happened in Haskell 98
02:37 <geekosaur> and, well, mostly it's there to handle pattern match failures in (pat <- expr), which is a fairly bad reason
02:37 andyhoang1 joined
02:37 <fresheyeball> Well, I am about ready to give up on my inflation problem
02:37 <fresheyeball> anyone think they got this and want like $150?
02:38 <Cale> Monad-generalised list comprehensions were removed, and then because a major reason for the introduction of MonadZero was to support those, MonadZero got merged into MonadPlus, but then people later realised that it was also being used in the translation of the do-notation when pattern matches fail
02:38 <fresheyeball> I think it's a half hour of work for anyone how knows this kind of byteString stuff
02:38 <Cale> fresheyeball: btw, your lpaste doesn't seem to work
02:38 <fresheyeball> https://lpaste.net/7611431009204043776
02:39 <fresheyeball> Cale: I try again, does that also not work?
02:39 <Cale> that one worked
02:39 <fresheyeball> sweet
02:39 <fresheyeball> Cale: here an a sample input "c8zR8+K36eMwezksQ6ZBWeTdTZqy8bBkhh+Sf2XQtKXeAL42ob/2Ab+Mpy5m+WXWEKwsuabUJlb2NmYLw9yJ8ZGyyEJWxF9u4TFoGyKN9WEI84hZA3/tlcInk88E+cMQWeiW5g=="
02:42 tzemanovic joined
02:42 <butterthebuddha> Huh
02:43 <butterthebuddha> Haskell 2010 is the current standard right?
02:43 <fresheyeball> butterthebuddha: I love your handle
02:43 <Cale> butterthebuddha: Yes, though it is only trivially different from Haskell 98 + the FFI addendum to that
02:44 <butterthebuddha> fresheyeball: thanks
02:44 <Cale> The process of recording what Haskell is hasn't gone so well in recent years. There's an effort to get something out for 2020 :)
02:44 <Solonarv> the de-facto standard is haskell2010 + -XKitchenSink :P
02:45 <geekosaur> only if your name is Edward :p
02:46 <Cale> fresheyeball: Oddly enough, I get a different error
02:46 <Cale> > decompress (BSL.fromStrict x)
02:46 <Cale> "Al.J\SI<\142\b6\233*** Exception: Codec.Compression.Zlib: compressed data stream format error (invalid distance too far back)
02:46 <lambdabot> error:
02:46 <lambdabot> Variable not in scope: decompress :: BSLC.ByteString -> terror:
02:46 <lambdabot> • Couldn't match expected type ‘BSC.ByteString’
02:46 <Cale> oops :)
02:46 <fresheyeball> Cale: I get that one too
02:47 <Cale> Is there anything documenting what the zlib parameters should be?
02:47 <fresheyeball> I have thrown noodles all over my ceiling, nothing has stuck, but hey got many different errors
02:48 <fresheyeball> Cale: not that I can find, the only other doc I know of just says "uses deflate algorithm, no headers"
02:48 <fresheyeball> oh ok, so the (invalid block type) error was from a different version I was playing with where I Base16.encode before decompressing
02:49 <fresheyeball> so thats not right, sorry to send the wrong error
02:49 hastuur joined
02:49 <hastuur> woo
02:49 <hastuur> so hows haskell?
02:49 <hastuur> hask is fast right?
02:49 <fresheyeball> hastuur: Haskell is fast, and lovely
02:50 fragamus joined
02:50 <Solonarv> hey my name isn't edward... https://gitlab.com/Solonarv/perfect-flow/blob/master/package.yaml#L69-89
02:50 <Cale> Haskell is a language, so it wouldn't really be right to say that it's fast or slow :)
02:50 <Cale> Haskell programs compiled with GHC are often times fast, if they're well-written.
02:50 <fresheyeball> Cale: you are the best kind of correct
02:51 <Solonarv> GHC is pretty good at taking nice high-level functional code and turning it into a fast binary
02:51 <Solonarv> I can't speak for anyone else, but that's one of the things that drew me to Haskell
02:51 nitaigao joined
02:51 <Cale> (but it's also easy to write Haskell code which performs poorly if you don't know what you're doing or aren't careful)
02:52 <Cale> It's the same with almost anything of course
02:52 oisdk_ joined
02:52 <Cale> fresheyeball: Any chance you could check that the base64 decode result is the same?
02:53 <fresheyeball> Right "s\204\209\243\226\183\233\227\&0{9,C\166AY\228\221M\154\178\241\176d\134\US\146\DELe\208\180\165\222\NUL\190\&6\161\191\246\SOH\191\140\167.f\249e\214\DLE\172,\185\166\212&V\246\&6f\v\195\220\137\241\145\178\200BV\196_n\225\&1h\ESC\"\141\245a\b\243\136Y\ETX\DEL\237\149\194'\147\207\EOT\249\195\DLEY\232\150\230"
02:53 <fresheyeball> Cale: that is what I get
02:54 <Cale> Sorry, I mean with the C# code
02:54 <Cale> Do we know that's what C#'s base64 decoder would also give?
02:54 <fresheyeball> Cale: I don't have any C# things to test with
02:54 <Cale> ah, hmm
02:54 <fresheyeball> I did stare blankly at the offical C# docs for those methods
02:54 <fresheyeball> for quite some time
02:56 <fresheyeball> https://msdn.microsoft.com/en-us/library/system.io.compression.deflatestream(v=vs.110).aspx
02:59 <Cale> okay, I tried some online C# implementation, and it seems to get the same sequence of bytes after the base64 decode, so it's not that
02:59 <fresheyeball> Cale: oh nice, I was still trying to get that going
02:59 <fresheyeball> What did you use?
02:59 theDon joined
03:00 <Cale> http://rextester.com/
03:00 language_agnosti joined
03:01 <Cale> https://lpaste.net/1835439052581502976
03:01 <fresheyeball> Cale: nice!
03:02 Lokathor joined
03:04 <fresheyeball> Cale: wait, how is that the same output? I ran the C# you wrote, and it looks quite different from what I got in ghci
03:04 <Cale> oh, weird, those are the same bytes as I get after doing the base64 decode
03:04 <Cale> I just did a BS.unpack to get a list of Word8's to compare
03:05 <fresheyeball> Cale: oh!
03:05 <fresheyeball> ok yes, they are the same
03:06 tabemann joined
03:06 otto_s joined
03:07 AfC joined
03:07 <Cale> fresheyeball: Oddly, the C# code you gave seems to decompress the thing to a 0 byte string
03:07 <fresheyeball> Cale: wtf
03:07 <fresheyeball> let me try and find another input
03:07 fmixing joined
03:08 <Cale> It may be silently failing
03:08 <Cale> hah
03:08 <fresheyeball> Cale: there is also a chance it's a very encoded empty string
03:08 progfun joined
03:08 <fresheyeball> or more likely a very encoded version of this specific string -> "{}"
03:12 <Cale> Well, that's really odd. If I do Console.WriteLine(deflateStream.ReadByte()); it prints -1 (as in, it's at the end of the stream), but then instead of getting a 0 length copy, somehow the streamReader reads 970 bytes...
03:12 roconnor joined
03:12 <fresheyeball> Cale: here is another input
03:13 <fresheyeball> oo too big for irc
03:13 <fresheyeball> sec
03:13 <Cale> oh, weird
03:13 <fresheyeball> https://lpaste.net/841875695243100160
03:14 <fresheyeball> Cale: ^^ another sample
03:14 <Cale> those 970 bytes look an awful lot like the gibberish that I'm getting from GHCi
03:14 <Cale> at least the first few of them
03:14 <Cale> It starts off with "Al.J", and then is gibberish
03:15 <Cale> but it doesn't error out
03:15 <fresheyeball> what is the gibberish
03:15 <fresheyeball> it might be cryptic success
03:15 scottschmidt joined
03:16 <Cale> https://lpaste.net/3635222699715854336
03:16 <butterthebuddha> https://lpaste.net/433475875065823232
03:16 <Cale> uh, that's not quite right (that paste)
03:16 <butterthebuddha> Can I make the Either play nice with the ExceptT?
03:16 <butterthebuddha> (in eval)
03:16 <Cale> seems like lpaste ate a bunch of it
03:17 <fresheyeball> butterthebuddha: there is hoistEither
03:17 <Cale> butterthebuddha: I'm not sure what you mean, but you're using both head ys and tail ys -- you should probably pattern match :)
03:17 <fresheyeball> that or you can do like `x <- ExceptT $ return x`
03:18 <Solonarv> you might also be looking for liftEither
03:18 andreabedini joined
03:18 <Solonarv> all those functions can be found in Control.Monad.Except in the mtl package
03:18 <fresheyeball> essentially you need `Either x y -> ExceptT x m y`
03:19 <fresheyeball> > :t ExceptT . return
03:19 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
03:19 <fresheyeball> > :t (ExceptT . return)
03:19 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
03:19 <fresheyeball> > @t (ExceptT . return)
03:19 <lambdabot> <hint>:1:1: error: parse error on input ‘@’
03:19 <fresheyeball> grr
03:19 <Solonarv> :t ExceptT . return
03:19 <lambdabot> Monad m => Either e a -> ExceptT e m a
03:19 <fresheyeball> Solonarv: :)
03:20 <Solonarv> :t liftEither
03:20 <lambdabot> error: Variable not in scope: liftEither
03:20 <Solonarv> grr
03:20 <Solonarv> :t hoistEither
03:20 <lambdabot> error: Variable not in scope: hoistEither
03:20 <Solonarv> :t Control.Monad.Except.liftEither
03:20 <lambdabot> error:
03:20 <lambdabot> Not in scope: ‘Control.Monad.Except.liftEither’
03:20 <lambdabot> Perhaps you meant one of these:
03:21 amar_ joined
03:21 lassulus_ joined
03:21 andyhuzhill joined
03:21 <butterthebuddha> liftEither is not available on my computer either though I'm pretty sure I have mtl installed :/
03:21 <fresheyeball> liftEither :: MonadError e m => Either e a -> m a
03:22 <Solonarv> https://www.stackage.org/haddock/lts-11.14/mtl-2.2.2/Control-Monad-Except.html#v:liftEither
03:22 <Cale> tbh, I think the existing code looks fine with respect to using case
03:22 <fresheyeball> hoistEither :: Monad m => Either e a -> EitherT e m a
03:22 <Solonarv> yeah, case is fine
03:22 <Cale> except that I would use do-notation
03:22 <fresheyeball> https://hackage.haskell.org/package/either-4.4.1/docs/src/Control-Monad-Trans-Either.html#hoistEither
03:22 <Cale> and I would pattern match the ys differently
03:22 <butterthebuddha> I find do notation harder to read :/
03:22 AfC joined
03:22 <Cale> case ys of
03:23 <Cale> Func (f, _) : ys' -> ...
03:23 <fresheyeball> Cale: any luck with the new input?
03:23 <Solonarv> I'm a big fan of -XLambdaCase and `getSomething >>= \case ...`
03:25 <fresheyeball> Cale: do you have a hint as to what `invalid distance too far back` means?
03:26 whowillcode joined
03:27 whowillcode joined
03:28 <Cale> With the new data:
03:28 <Cale> > BSL.unpack (decompress (BSL.fromStrict x))
03:28 <Cale> [135,61,87,94,248,61,87,94,248,61,87,94,9,152*** Exception: Codec.Compression.Zlib: compressed data stream format error (invalid distance too far back)
03:28 <lambdabot> error:
03:28 <lambdabot> Variable not in scope:
03:28 <lambdabot> decompress :: BSLC.ByteString -> BSLC.ByteStringerror:
03:29 <Cale> grr, I should change my prompt :)
03:29 <Cale> and the same initial sequence of bytes seem to be the result of the C# decompression
03:30 <fresheyeball> Cale: have you matched the C# version?
03:30 <fresheyeball> how did you do that?
03:30 <Cale> they're immediately followed by 20 zeroes
03:30 nitaigao joined
03:30 <Cale> I copy pasted the code over and imported the System.IO and System.IO.Compression modules
03:30 <fresheyeball> oh no, you are getting the same invalid distance error
03:30 <Cale> I am, in ghci
03:30 <fresheyeball> me too
03:30 <fresheyeball> ok
03:31 <Cale> https://lpaste.net/7059374493004726272 -- try this in rextester
03:31 progfun joined
03:31 TipsyMe joined
03:32 floryst joined
03:32 <Cale> It would be helpful if you knew what this was supposed to decode to...
03:32 <Cale> :)
03:32 <Cale> But this doesn't look like text
03:32 <Cale> and the 0's are suspiciously right where the Haskell version stops decoding with an error
03:33 <Cale> It might be that C#'s decoder is more lenient to errors in the input
03:34 <fresheyeball> Cale: https://bittrex.github.io/#response-handling
03:35 <fresheyeball> Thank you for all the help, I am really at a loss
03:36 drbrule joined
03:36 chao-tic joined
03:40 <Cale> Just to be sure, I dug up the same code you did, and tried copy-pasting the lot of it over as a complete method. Calling that method produces the same garbage results.
03:40 <Cale> Is it possible that the documentation is simply incorrect?
03:40 <fresheyeball> Cale: That is always possible
03:40 <Cale> (along with this sample code)
03:40 <fresheyeball> sigh...
03:40 <Cale> It might be that they changed how they were encoding stuff
03:40 <fresheyeball> I mean, its been "out of beta" for 2 months
03:41 <fresheyeball> and virtually all messages are encoded this way
03:41 Destol joined
03:41 <Cale> Is the non-beta source code available?
03:41 <Cale> I can only find beta code
03:42 lastmanstanding joined
03:42 <fresheyeball> Its not an open source project
03:42 <fresheyeball> I had it working with the beta version, it was not encoded this way
03:42 <fresheyeball> but they are going to remove it, so... I dont want that
03:43 <Cale> Oh well, it's something which uses a blockchain, so it's almost certainly got to be useless anyway.
03:43 <Cale> ;)
03:43 <fresheyeball> Cale: haha
03:43 <fresheyeball> its not Lampix
03:44 <fresheyeball> But then again, only Lampix could be dumb enough to be Lampix
03:44 <Cale> I've become very jaded about any and all blockchain-related projects
03:44 <fresheyeball> Me too, but I have good reason to bind to this thing, I just can't get a damn thing to work post beta
03:44 <johnw> Cale: any particular reason?
03:45 <fresheyeball> While jaddes are valid, its a new space, and whenever there is a new space, we should expect a high degree of bad behavior
03:45 <Cale> johnw: Just that there don't seem to be any practical applications in which the fact that a blockchain is being used is at all relevant.
03:46 pranz3 joined
03:46 <fresheyeball> Cale: not yet anyway
03:46 <Cale> It doesn't provide the guarantees that most applications seem to want it to provide
03:46 <Cale> and instead it provides guarantees that nobody really cares about
03:47 deepfire` joined
03:48 <fresheyeball> Cale: can you send me your final C# repl thing?
03:48 <fresheyeball> I am going to try and contact them
03:48 chao-tic joined
03:48 <Cale> https://lpaste.net/548941376419528704
03:51 <fresheyeball> Cale: thanks for the help. I feel like if you didn't get it (as a senior Haskell person), and the C# example also doesn't work. Thats as far as we can reasonably go.
03:53 dodong joined
03:56 sdothum joined
03:56 <Cale> fresheyeball: It seems likely that they changed the compression.
03:56 <Cale> We could randomly try other stuff, but that's annoying :)
03:57 <fresheyeball> Cale: psssh I did
03:57 connrs joined
03:58 <dmwit> Cale: The use of branded cryptocurrency to create a "rewards card" where the reward can be transferred from customer to customer is... well, at least, not something that companies have offered before.
03:58 <DigitalKiwi> make quickcheck find the solution
03:58 <dmwit> Doesn't really seem like a killer app. But it's out there.
03:58 <dmwit> Very unclear whether it's something anybody wants, even the corporations that have rolled it out...
03:58 <DigitalKiwi> cryptocurrency is cancer
03:59 <mniip> every haskell list is a blockchain :p
03:59 <DigitalKiwi> https://twitter.com/smdiehl/status/1008688660152225793
04:00 <Cale> dmwit: It's unclear to me what advantage the blockchain aspect has there over a straightforward centralised database.
04:00 kuttifunk joined
04:00 <Cale> All the value of those "rewards card" tokens comes from trust in the company in question anyway
04:01 oisdk joined
04:04 <DigitalKiwi> cryptocurrency isn't even useful as currency because it's too volatile :|
04:04 Scip joined
04:06 jackdk joined
04:07 plutoniix joined
04:08 plutoniix joined
04:10 fmixing joined
04:10 scottschmidt joined
04:12 <dmwit> Cale: Right.
04:13 kvda joined
04:15 fmixing joined
04:15 fmixing joined
04:16 scottschmidt1 joined
04:16 Linter joined
04:17 pranz4 joined
04:17 progfun joined
04:17 sebastia2 joined
04:18 altjsus joined
04:21 scottschmidt1 joined
04:21 seizo joined
04:22 krokodil joined
04:22 <krokodil> Hey all! Can someone recommend me a tutorial into AD library? I can't find anything for AD specifically, only description fo audomatic differentiation in general
04:25 nitaigao joined
04:27 lanelet joined
04:34 AfC joined
04:34 xtreak joined
04:36 louispan joined
04:36 lastmanstanding joined
04:42 checkraiser joined
04:42 tombusby joined
04:42 languag__ joined
04:43 tcsiwula joined
04:44 scottschmidt1 joined
04:44 saurabhnanda joined
04:45 ian_andrich_ joined
04:45 t7 joined
04:46 kvda joined
04:48 <c50a326> what's indentation like this called https://i.imgur.com/xxcV2Mh.png and how do I do it in vim
04:53 <* hackage> o-clock 1.0.0 - Type-safe time library. http://hackage.haskell.org/package/o-clock-1.0.0 (shersh)
04:58 Ukari joined
04:59 MRd1 joined
05:00 ian_andrich_ joined
05:00 bhiliyam joined
05:01 language_agnosti joined
05:04 scottschmidt joined
05:06 armyriad joined
05:06 xtreak joined
05:11 pie__ joined
05:14 ddellacosta joined
05:15 louispan joined
05:16 inad922 joined
05:18 xtreak joined
05:18 scottschmidt1 joined
05:20 keepLearning512 joined
05:21 moei joined
05:21 amar joined
05:22 reggie_ joined
05:24 <rotaerk> cocreature, my initial draft of that scope mechanism (which I'll be using instead of resourcet): https://gist.github.com/Rotaerk/68a88c0456bb4286bdd137a2446200ec
05:25 andreabedini joined
05:26 <rotaerk> haven't actually tested yet... but it compiles
05:26 user5678 joined
05:27 <cocreature> rotaerk: stupid question because I’m too lazy to throw GHC at this, shouldn’t “finalizer” inline 21 be of type “m () -> IO ()”? how can you add that to the list of type [m ()]?
05:28 <rotaerk> hmm sec; addFinalizer used to have a result of m () instead of IO (); may be a mistake
05:28 <rotaerk> thinking through it...
05:29 <cocreature> if it compiles I’m definitely missing something :)
05:29 <rotaerk> oh, yeah it's fine
05:29 nitaigao_ joined
05:29 <rotaerk> the IO () is just adding the m () to the IORef [m ()]
05:30 <cocreature> oh right, I’m stupid
05:30 <cocreature> too early :)
05:30 <rotaerk> I initially had addFinalizer produce m (), but that ended up being a problem for line 27
05:30 <cocreature> rotaerk: looks neat! one thing that is slightly problematic is that if any of the finalizers fails you end up leaking resources
05:30 vmandela joined
05:31 <rotaerk> yeah, I'm not sure how I want to handle that
05:31 connrs joined
05:31 <rotaerk> definitely needs polish
05:31 <cocreature> gotta start somewhere :)
05:31 teuffy[m] joined
05:32 <rotaerk> I could swallow finalizer exceptions, or I could catch and collect them all, then rethrow an aggregate exception when all the resources that *can* be released are released
05:32 <cocreature> the latter sounds like the better option
05:32 <rotaerk> yeah
05:33 <cocreature> and matches the behavior of "bracket" for allocating a single resource
05:33 <rotaerk> ah
05:36 <rotaerk> one thing ResourceT is better at is
05:37 <rotaerk> I'm depending on MonadMask, and continuation-based monads are not valid instances of it
05:37 <rotaerk> but ResourceT was invented to help implement Conduits
05:37 <rotaerk> which are, as I understand it, continuation-based
05:38 JanBessai joined
05:41 darjeeling_ joined
05:42 cyberlard joined
05:44 fizbin joined
05:44 cybai joined
05:46 osa1 joined
05:47 scottschmidt1 joined
05:48 slaznick joined
05:50 Linter joined
05:53 pranz joined
05:53 scottschmidt1 joined
05:54 zariuq joined
05:54 znack joined
05:54 emilypi joined
05:54 language_agnosti joined
05:56 aarvar joined
05:58 scottschmidt joined
05:59 scottschmidt1 joined
06:00 phenoble joined
06:01 _vaibhavingale_ joined
06:02 errst joined
06:03 <johnw> rotaerk: as, indeed, they are
06:03 language_agnosti joined
06:03 oish joined
06:05 nitaigao joined
06:06 nowhereman_ joined
06:07 errst_ joined
06:09 dan_f joined
06:09 yoneda joined
06:10 slomo joined
06:12 fizbin1 joined
06:13 acidjnk joined
06:14 connrs joined
06:16 DTZUZO joined
06:17 andreabedini joined
06:18 dodong1 joined
06:21 dfeuer joined
06:21 ratschance joined
06:23 takuan joined
06:26 pranz1 joined
06:27 Durbley__ joined
06:27 connrs joined
06:28 RegEchse joined
06:29 ajmccluskey joined
06:29 Chadtech joined
06:29 JSharp joined
06:29 cdornan_ joined
06:29 gonz_ joined
06:29 dfeuer joined
06:30 chele joined
06:31 language_agnosti joined
06:34 <* hackage> winery 0.1.1 - Sustainable serialisation library http://hackage.haskell.org/package/winery-0.1.1 (FumiakiKinoshita)
06:37 connrs joined
06:38 scottschmidt1 joined
06:38 theorbtwo joined
06:39 jhrcek joined
06:40 slaznick joined
06:40 nitaigao joined
06:41 freeman42x]NixOS joined
06:42 logzet joined
06:45 pie__ joined
06:46 ThomasLocke joined
06:49 amar joined
06:50 caryoscelus joined
06:51 lortabac_ joined
06:52 scottschmidt joined
06:55 <* hackage> menoh 0.1.1 - Haskell binding for Menoh DNN inference library http://hackage.haskell.org/package/menoh-0.1.1 (MasahiroSakai)
06:55 zariuq joined
06:56 fujiy joined
06:58 encod3 joined
06:58 ian_andrich joined
07:01 scottschmidt1 joined
07:02 language_agnosti joined
07:05 <johnw> any Eta users here?
07:05 <johnw> I wondering how I can subclass a Java class, and then make that subclass available to a Scala program
07:08 language_agnosti joined
07:09 ogrady joined
07:09 louispan joined
07:09 raichoo joined
07:09 khilan joined
07:10 jackdk joined
07:13 tcsiwula joined
07:14 cdepillabout joined
07:14 trcc joined
07:14 philippD joined
07:15 sighingnow joined
07:18 <* hackage> geodetics 0.0.6 - Terrestrial coordinate systems and geodetic calculations. http://hackage.haskell.org/package/geodetics-0.0.6 (PaulJohnson)
07:19 fishythefish joined
07:21 kuribas joined
07:21 connrs joined
07:21 phenoble joined
07:23 reactormonk joined
07:24 bergle joined
07:25 phenoble joined
07:25 jegaxd26 joined
07:26 dcoutts joined
07:27 mreh joined
07:28 agander_ joined
07:28 phil_ joined
07:29 kuttifunk joined
07:29 louispan joined
07:30 agander__ joined
07:30 hamishmack joined
07:30 knupfer joined
07:33 Linter joined
07:35 fmixing joined
07:36 Kacia joined
07:36 osa1 joined
07:37 fmixing joined
07:41 vlatkoB joined
07:44 davr0s joined
07:45 mreh_ joined
07:45 carlomagno joined
07:46 amelliaa joined
07:46 yeevy joined
07:46 Yuras joined
07:46 scottschmidt joined
07:47 skeuomorf joined
07:48 fizbin joined
07:48 raingloom joined
07:48 GodotMisogi joined
07:50 cschneid joined
07:50 borkr joined
07:50 saurabhn_ joined
07:51 <bwe> How can I cache with bitbucket pipelines haskell dependencies (using stack)? https://bitbucket.org/site/master/issues/12818/caching-dependencies-in-pipelines#comment-46319659
07:52 dhil joined
07:54 <bwe> Contrary to travis (https://www.fpcomplete.com/blog/2016/02/updated-haskell-travis-config), bitbucket seems not to support `directory` key specifier: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html#Configurebitbucket-pipelines.yml-ci_cachescaches
07:55 connrs joined
07:56 GodotMisogi joined
07:57 oish joined
07:57 pipahask joined
07:57 seveg joined
07:58 osa1 joined
07:58 DasBrain joined
07:58 <mreh_> I'm trying to compile GHC from some instructions, can anyone decypher this? "For GHC we need opt and llc from the llvm 4, which can be obtained from their release download website. (http://releases.llvm.org/download.html)"
07:59 scottschmidt1 joined
08:01 keepLearning512 joined
08:02 <dminuoso> bwe: just like specified in that thread?
08:02 <dminuoso> bwe: you'll want to cache your ~/.stack/store
08:02 nitaigao joined
08:03 thc202 joined
08:03 pfurla_ joined
08:04 keepLearning512 joined
08:05 <cocreature> mreh: if you want to use GHC’s LLVM backend (which is not the default), you need (for the GHC release you are trying to install) the "opt" and "llc" binaries that you get from LLVM 4.x
08:05 natrys joined
08:05 <mreh> cocreature, I'm trying to cross compile to arm on android, so I guess LLVM is the backend for that
08:06 <cocreature> ah yeah, for arm you have to use LLVM
08:06 <mreh> someone was distributing prebuilt binaries but they're offline right now
08:06 <cocreature> if you are cross compiling you might also want to use the newest GHC release. afaik there have been quite a few improvements to cross-compilation recently
08:08 <mreh> cocreature, I read that zw3rk is adding "-target" to GHC too
08:08 <cocreature> yeah although I think that’s still a bit away
08:08 <alp> yeah, I think it's quite early in the making. angerman?
08:09 tomphp joined
08:09 <angerman> yea, nothing soon.
08:09 <angerman> and yea, zw3rk = angerman for all practical pruposes :-)
08:10 zariuq joined
08:10 <bwe> dminuoso: ~/.stack/store will suffice, then?
08:10 <mreh> angerman, are you zw3rk?
08:10 <angerman> yea, pretty much :-)
08:10 language_agnosti joined
08:11 <angerman> hackage.mobilehaskell.org should be back online soonish... stupid dns tricket me.
08:11 <mreh> angerman, thanks, I tweeted you
08:11 <mreh> I think... I'm still not sure it *is* you
08:12 <angerman> yea, thanks for letting me know.
08:12 <mreh> I thought it might be DNS, it was showing blanks in the A record
08:12 <angerman> yea, domains were moved due to some registrar issue. and apparently the NS copy didn't work out.
08:12 <mreh> angerman, can I use these to build GHC for mobile in the mean time? https://github.com/zw3rk/ghc-build-scripts/commits/master/build-mobile-ghcs
08:14 <angerman> mreh: you can use http://hackage.mobilehaskell.org.s3-website-ap-southeast-1.amazonaws.com/, and http://releases.mobilehaskell.org.s3-website-ap-southeast-1.amazonaws.com/ in the meantime
08:15 <angerman> mreh: I hope they are fully propagated by tonight again.
08:17 <mreh> angerman, okay, great
08:17 encod3 joined
08:17 <angerman> sorry for the inconvenience :/
08:18 agander joined
08:18 voooza joined
08:18 language_agnosti joined
08:18 amar joined
08:18 Boomerang joined
08:19 KeyJoo joined
08:20 louispan joined
08:20 language_agnosti joined
08:20 scottschmidt1 joined
08:21 python476 joined
08:22 <mreh> angerman, have I got this right? http://releases.mobilehaskell.org.s3-website-ap-southeast-1.amazonaws.com/x86_64-linux/9824f6e473/ghc-8.4.0.20180109-armv7-linux-androideabi.tar.xz
08:22 theorbtwo joined
08:22 <angerman> ohh sorry :-) just a sec
08:23 <angerman> mreh: this one: https://s3-ap-southeast-1.amazonaws.com/releases.mobilehaskell.org/x86_64-linux/9824f6e473/ghc-8.4.0.20180109-armv7-linux-androideabi.tar.xz
08:23 chris__bacon joined
08:24 <mreh> angerman, that's better :) lets see if I can run this on Ubuntu
08:24 progfun joined
08:25 amar joined
08:25 <angerman> you'll still need to setup the toolchain wrapper and your android toolchain, but apart from that, I think it should work :-)
08:25 <mreh> angerman, thanks, I'll follow the talk you gave, the slides and video
08:28 danvet joined
08:28 jfredett_ joined
08:28 Sonderblade joined
08:29 fragamus joined
08:30 oak joined
08:32 Ariakenom joined
08:33 scottschmidt joined
08:33 pranz1 joined
08:34 jeltsch joined
08:35 bahamas joined
08:35 encod3 joined
08:37 merijn joined
08:40 danso joined
08:40 fmixing joined
08:42 AfC joined
08:44 nowhereman_ joined
08:47 dddddd joined
08:47 freeman42]NixOS joined
08:49 Kacia joined
08:50 bahamas joined
08:50 youtmon joined
08:52 <* hackage> relational-query 0.11.3.0 - Typeful, Modular, Relational, algebraic query engine http://hackage.haskell.org/package/relational-query-0.11.3.0 (KeiHibino)
08:53 <bahamas> is there something equivalent for `npm install --save library` in haskell? that means both installing the library and adding it to dependencies in the cabal file
08:54 valentinbuza joined
08:55 chris__bacon joined
08:55 xtreak joined
08:55 <Rembane> bahamas: I usually do it the other way around. I add the library to my stack.yaml and then run stack install.
08:55 <Rembane> bahamas: And then set version constraints.
08:59 justanotheruser joined
09:03 <bahamas> Rembane: where do you add them? to extra-deps?
09:03 korans joined
09:06 <Rembane> bahamas: Sorry, typo, I add them to my cabal file.
09:07 oak joined
09:07 <* hackage> relational-record-examples 0.5.1.0 - Examples of Haskell Relationa Record http://hackage.haskell.org/package/relational-record-examples-0.5.1.0 (KeiHibino)
09:08 amar joined
09:08 rzp joined
09:08 language_agnosti joined
09:09 keepLearning512 joined
09:09 ijks joined
09:10 language_agnosti joined
09:12 perspectival joined
09:12 andyhuzhill joined
09:13 oish joined
09:16 languag__ joined
09:19 language_agnosti joined
09:19 raingloom joined
09:20 saurabhnanda joined
09:21 fragamus joined
09:22 louispan joined
09:23 reactormonk joined
09:23 GodotMisogi joined
09:25 theelous3_ joined
09:27 vonfry joined
09:27 nitaigao joined
09:27 <c50a326> (,) is a function :o
09:28 scottschmidt joined
09:28 quobo joined
09:28 <merijn> c50a326: It's a data constructor, but those function a lot like functions, yes
09:28 <merijn> :t Just
09:28 <lambdabot> a -> Maybe a
09:29 <merijn> Think about it, "Just" has a function type from 'a' to 'Maybe a'
09:29 <merijn> :t (,)
09:29 <lambdabot> a -> b -> (a, b)
09:29 <lavalike> @type (,,) -- c50a326
09:29 <lambdabot> a -> b -> c -> (a, b, c)
09:29 <quicksilver> all data constructors are functions, but not all functions are data constructors.
09:29 <merijn> So, obviously the , constructor for tuples takes an 'a' and 'b' and returns a tuple
09:29 rschm joined
09:30 <quicksilver> unless you think that is inexact and you might prefer "all data constructors give rise to a corresponding function". But in haskell we use the same name for both.
09:30 <quicksilver> [unlike ocaml, say]
09:31 cyphase joined
09:31 <gonz_> Which is infuriating behavior in OCaml, by the way
09:31 lortabac joined
09:31 <quicksilver> I find it so :)
09:31 <gonz_> at least coming from the Haskell side of things
09:31 <quicksilver> that and the value restriction
09:31 <gonz_> To have to add a ppx to derive constructor functions
09:32 <gonz_> With bucklescript it's built-in, but still annoying if you temporarily forget to add the deriving directive
09:33 <c50a326> why does min only take 2 arguments, why can't it take n arguments
09:33 jao joined
09:33 <merijn> :t minimum
09:33 <lambdabot> (Ord a, Foldable t) => t a -> a
09:33 catsup joined
09:34 <cocreature> :t minimum :: Ord a => [a] -> a
09:34 <lambdabot> Ord a => [a] -> a
09:34 <cocreature> in case you aren’t familiar with Foldable yet :)
09:34 <c50a326> I have seen the minimum function but still doesn't answer why min and max couldn't take more arguments
09:34 <merijn> c50a326: How would "variable number of arguments" work in Haskell's type system?
09:34 catsup joined
09:35 <c50a326> min 1 2 3 should return 1
09:35 <cocreature> c50a326: try finding a type for that version of "min"
09:35 vonfry joined
09:35 <gonz_> :t minimum [1, 2, 3]
09:35 <lambdabot> (Num a, Ord a) => a
09:36 jpcooper joined
09:37 language_agnosti joined
09:38 whaletechno joined
09:40 <jpcooper> Hello. Given `data X = forall a. X a` the function `id :: a -> a` and a value `X 666`, how can I apply `id` to the value `666` inside?
09:40 <c50a326> I don't understand any of these type definitions tbh, e.g.
09:40 <c50a326> :t [1..20]
09:40 <lambdabot> (Enum a, Num a) => [a]
09:40 <jpcooper> Is this possible?
09:40 <c50a326> well that's different, in ghci Enum a and Num a are the other way round for starters
09:41 <c50a326> and why aren't they just both the same type, like (Enum a, Enum a)
09:42 tomphp joined
09:42 <merijn> c50a326: Because numeric literals are polymorphic Num typed and [..] sugar is shorthand for the Enum class
09:43 keepLearning512 joined
09:43 <merijn> c50a326: [x..y] is just syntactic sugar for "enumFromTo"
09:43 AfC joined
09:43 <merijn> :t enumFromTo
09:43 <lambdabot> Enum a => a -> a -> [a]
09:43 <jpcooper> Actually that isn't my full issue. I am trying to build `Constraint`s from https://hackage.haskell.org/package/limp-0.3.2.2/docs/Numeric-Limp-Program-Constraint.html by using what I have defined as `data SomeLinear v = forall k. SomeLinear (Linear v v k)` and unwrapping them. This doesn't seem to be possible even though the `Constraint` constructors don't actually care about the instance of `k`.
09:43 <cocreature> jpcooper: pattern match on X and apply id? you won’t be able to do much with the result
09:43 <cocreature> but that in itself should work
09:43 <merijn> ok, so we know that we have two values of type 'a' returning a '[a]' (where 'a' is an instance of Num)
09:43 <merijn> :t 1
09:43 <lambdabot> Num p => p
09:44 <merijn> c50a326: And 1 is 'Num a => a' i.e. any numeric type, so if we put the two together we get a list of "anything that happens to be both an instance of Num and an isntance of Enum
09:44 <jpcooper> cocreature, id (case X 666 of X r -> r) results in type scope errors
09:44 Gurkenglas joined
09:44 <cocreature> jpcooper: you need to use "id" inside the case
09:44 <merijn> jpcooper: Because you can't return the contents from the pattern match
09:44 <cocreature> you can’t escape type variables from an existential pattern match
09:45 <jpcooper> cocreature, same error
09:45 <jpcooper> (case X 666 of X r -> id r)
09:46 <c50a326> so is there some kind of type hierarchy in haskell
09:46 <c50a326> is there a nice page on type polymorphism?
09:46 <c50a326> at the moment i'm just reading learn you a haskell
09:46 <merijn> jpcooper: because now you're still trying to return the content of X
09:46 scottschmidt1 joined
09:46 <merijn> jpcooper: You can *never* return the content from within X
09:47 <c50a326> ah there's a wiki page
09:48 <merijn> c50a326: There's no type hierarchy, but Haskell has builtin support for polymorphic literals
09:48 <quicksilver> c50a326: there is no type hierarchy, really
09:48 <quicksilver> c50a326: there is a hierarchy of *typeclasses*
09:48 <* hackage> odpic-raw 0.3.0 - Oracle Database Bindings http://hackage.haskell.org/package/odpic-raw-0.3.0 (leptonyu)
09:48 <quicksilver> and there is the rather fundamental notion of "more specific types" which does look a bit like a hierarchy if you squint, but it's certainly not a classic type hierarchy.
09:49 <jpcooper> merijn, What can I do with the content within X?
09:49 <merijn> jpcooper: In your example? Not a whole lot
09:49 tvN joined
09:50 nschoe joined
09:50 <merijn> Basically, you can apply "id" to it and wrap it back up into an X again
09:51 <jpcooper> Makes sense actually. I wouldn't be able to return a forall-typed value
09:52 <jpcooper> Thanks merijn and cocreature though. I've managed to solve the `Constraint` problem by a series of nested case matches
09:52 <cocreature> jpcooper: when you pattern match on an existential, you only get to know that it is of some type “a” (and if you add constraints, that these constraints hold for “a”)
09:52 tomphp joined
09:53 <jpcooper> Makes sense
09:53 saurabhnanda joined
09:54 Anthro joined
09:54 saurabhnanda joined
09:55 Anthro joined
10:00 simukis joined
10:01 <mreh> angerman, do you think we could build android projects with stack?
10:03 <angerman> mreh, i honestly don’t know if anyone who has done so. It might work... I have only used cabal.
10:03 <mreh> angerman, I was just reading that in your slides, seeing as stack uses cabal, I wouldn't see why not
10:03 Linter joined
10:04 <mreh> would have to switch out the GHC binary somehow of course
10:04 phenoble joined
10:04 progfun joined
10:05 amar joined
10:05 acidjnk joined
10:05 <angerman> mreh, Stack does use lib:Cabal, cabal-install (which provides the cabal binary) does use lib:Cabal as well, however it doesn’t use the Setup.hs Interface but uses the API directly.
10:06 DrAwesomeClaws joined
10:06 <angerman> Anyway, if you have a working stack setup, I’d certainly be interested to know.
10:07 tomphp joined
10:08 jakutis joined
10:11 amar joined
10:12 scottschmidt joined
10:12 <c50a326> why bother using 'let' here? http://learnyouahaskell.com/starting-out#an-intro-to-lists
10:13 <c50a326> it works the same without using let
10:14 scottschmidt1 joined
10:14 <Boomerang> c50a326: It didn't used to work without let
10:14 saurabhnanda joined
10:17 <* hackage> names-th 0.2.0.5 - Manipulate name strings for TH http://hackage.haskell.org/package/names-th-0.2.0.5 (KeiHibino)
10:18 altjsus joined
10:18 Targon joined
10:19 <c50a326> and what's up with this, why are they different https://lpaste.net/4676818570406002688
10:20 <c50a326> oh wtf I put b^c not b^2 sorr
10:20 <c50a326> y
10:20 <jle`> keep in mind that LYAH was written like, 7 years ago
10:20 <jle`> and basically has never been updated
10:21 <jle`> in the past few years it has grown a bit out of favor
10:22 <c50a326> why are these different https://lpaste.net/5126078544773906432
10:22 amar joined
10:22 <jle`> what makes you think they would be the same?
10:23 <c50a326> the a <-, b <- etc. are just ordered differently
10:23 amar joined
10:24 <c50a326> oh no the hypotenuse should be the [1..10] one
10:24 <c50a326> and the other sides are the smaller sides
10:24 keepLearning512 joined
10:24 <jle`> the easiest way to see what these would turn out to be is to just manually evaluate it
10:24 <jle`> that's the nice thing about haskell, it's easy to manually expand out expressions and values
10:24 <jle`> it's basiclaly straight substitution
10:24 Kacia joined
10:25 <jle`> you don't have to worry about any state to keep track of :)
10:25 amar joined
10:25 <jle`> in this case we can just look at all possible values of a, b, and c generated
10:25 <jle`> and see which ones match the predicate
10:26 <jle`> if you follow this, you will see why the first one returns two items and the second one returns none
10:27 <c50a326> this is invalid though: [ (a, b, c) | a <- [1..c], b <- [1..a], c <- [1..10], a^2 + b^2 == c^2 ]
10:27 <jle`> in particular if you try out all possible combinations of a, b, and c in the second one, you will see that none of them will fulfill a^2 + b^2 == c^2
10:27 ccomb joined
10:27 <c50a326> so the left to right thing seems to matter
10:27 <jle`> c50a326: ah yeah, list comprehensions have a quirk like that
10:27 <jle`> it's sort of necessary for order to matter
10:27 <jle`> since the order determines what is "nested"
10:28 <jle`> list comprehensions like that are basically the equivalent of nested for loops in other languages
10:28 <c50a326> has a lot changed since LYAH then? is there a better thing now?
10:28 <jle`> > [(a,b) | a <- [1,2,3], b <- "abc"]
10:28 <lambdabot> [(1,'a'),(1,'b'),(1,'c'),(2,'a'),(2,'b'),(2,'c'),(3,'a'),(3,'b'),(3,'c')]
10:28 <jle`> > [(a,b) | b <- "abc", a <- [1,2,3]]
10:28 <lambdabot> [(1,'a'),(2,'a'),(3,'a'),(1,'b'),(2,'b'),(3,'b'),(1,'c'),(2,'c'),(3,'c')]
10:29 <mreh> angerman, do I need clang5?
10:29 <jle`> the basic principles are the same, but a lot of the surface parts of the language and libraries have changed
10:29 <* hackage> names-th 0.3.0.0 - Manipulate name strings for TH http://hackage.haskell.org/package/names-th-0.3.0.0 (KeiHibino)
10:29 <mreh> unbuntu installs it as clang-5.0 helpfully
10:29 <quicksilver> there is nothing else as far as I know with LYAH's cheerful/informal style. Which some people find useful and some people hate.
10:29 <jle`> @where learnhaskell
10:29 <lambdabot> https://github.com/bitemyapp/learnhaskell
10:30 <angerman> mreh: you probably want to, but I would assume that llvm6 migth also work.
10:30 <jle`> there are some small things that are out of date that might confuse you if you aren't aware, but they aren't fundamental parts of the language really. but when you're learning, it's hard to tell
10:30 <* hackage> indents 0.5.0.0 - indentation sensitive parser-combinators for parsec http://hackage.haskell.org/package/indents-0.5.0.0 (JasperVanDerJeugt)
10:30 <jle`> the main complaint i've heard about LYAH is that it doesn't really have any exercises
10:30 <mreh> angerman, Ubuntu installs llvm3 by default
10:30 <jle`> so it's not really the best for "learning" haskell...just for showing off cool parts of it
10:31 wchresta joined
10:31 <angerman> mreh: well that's a bit old. But you can just grab the binary distributions from the llvm.org website, and put their `bin` into your `PATH`.
10:31 <jle`> but it doesn't really do anything directly to help you learn how to write haskell
10:31 <jle`> er, write actual haskell programs
10:32 <mreh> angerman, will do
10:32 orphean joined
10:33 mariatsji joined
10:34 xtreak joined
10:35 fishythefish joined
10:35 emilypi joined
10:37 dhil joined
10:39 davr0s joined
10:39 jakutis joined
10:39 <mreh> angerman, do you need the NDK to build the project in those slides?
10:40 <angerman> Yes.
10:40 <mreh> meetup2018-01
10:40 sdothum joined
10:40 <AWizzArd> I would like to have a `getField` method in a Lookup typeclass. The idea is that getField can return any field from a record. I thought about the type signature getField :: a -> String -> b. So I would pass in a value of my record of type `a` and a String and then just return something from that record.
10:41 <AWizzArd> However, when I try to implement getField myPerson "Person.age" = age myPerson I get the complaint that the Int doesn’t match with `b`.
10:41 <cocreature> AWizzArd: so you want to replace a nice typesafe record by a lookup function that gets the field name as a String?
10:42 <cocreature> that doesn’t sound like a win
10:42 <cocreature> "getField :: a -> String -> b" mean that the caller gets to choose "b"
10:42 <cocreature> that can’t possibly work since your field has a fixed type
10:42 <AWizzArd> cocreature: yes, is there a RankN type signature that would help?
10:42 <AWizzArd> cocreature: I want to be able to use this for any Record, as my code lives in my library and only the end user of this lib will have concrete types.
10:43 davr0s joined
10:43 <cocreature> not in a useful way, you need to return some kind of sumtype that represents the possible field types
10:43 <AWizzArd> Okay I see.
10:43 <cocreature> or I guess Dynamic but at that point you might as well write javascript :P
10:44 <* hackage> regex-tdfa 1.2.3.1 - Replaces/Enhances Text.Regex http://hackage.haskell.org/package/regex-tdfa-1.2.3.1 (Artyom)
10:44 HarveyPwca joined
10:44 osa1 joined
10:44 <AWizzArd> cocreature: it’s for an interpreter that should be extensible by a user. Anyway, I think I can work around this by lifting the return value into my Term type.
10:47 tzemanovic joined
10:48 <iron_houzi> If I want to split my code up into two files and using stack. Does this happen in the .cabal file with Exposed/Other-Modules, or in the stack.yaml file somehow?
10:49 <cocreature> iron_houzi: in the cabal file
10:49 <iron_houzi> ty
10:49 altjsus_ joined
10:49 keepLearning512 joined
10:50 scottschmidt1 joined
10:50 language_agnosti joined
10:51 danvet joined
10:52 saurabhnanda joined
10:53 justanotheruser joined
10:57 bahamas joined
10:58 <iron_houzi> When I do `stack build` I don't get an import error for my new module I've declared in cabal file, but when I do `stack ghc src/Main.hs`, I get the import error, which is bugging me since my editor is using ghc for linting..
10:58 amar joined
10:59 <iron_houzi> Any way to fix this?
10:59 <iron_houzi> ..sorry, my editor is using `stack ghc` for linting
11:00 <cocreature> I don’t think you can rely on "stack ghc" to behave the same way as a "stack build"
11:00 <merijn> iron_houzi: Because stack build setups up the package environment, etc. "stack ghc" would just call GHC I think
11:00 <cocreature> it’s missing all the options specified in the cabal file which includes things like include-dirs, …
11:01 <cocreature> in this case I would suspect that a missing -isrc flag (or something similar) is probably the difference
11:01 amar_ joined
11:01 language_agnosti joined