<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:00 <ertes> still trying to figure out how to pop up a bunch of colored windows… i'm abusing 'gm display' now =)
00:00 atomi joined
00:00 skeuomorf joined
00:01 lambda-11235 joined
00:02 infinity0 joined
00:03 darlan joined
00:05 infinity0 joined
00:05 <ertes> where can i upload the video without going through the youtube bullshit again?
00:05 <spoonm> I use 0x0.st, but you can use u.teknik.io, mixtape.moe, etc.
00:05 ryantrinkle joined
00:05 <spoonm> for 0x0.st, just `curl'
00:07 infinity0 joined
00:08 <ertes> cool
00:08 <spoonm> I like how none of those domains end with the default .com, .net, .org, tlds
00:09 <geekosaur> "that's so 1990s"
00:09 <spoonm> heh
00:09 echoreply joined
00:10 infinity0 joined
00:11 <ertes> spoonm: http://0x0.st/EGj.mp4
00:12 afarmer joined
00:13 <spoonm> looks pretty cool, but not exactly what I want
00:13 <ertes> i think it's the same thing, except that the "minimised" windows are actually visible
00:13 <spoonm> I don't really want the IM thing where there's a layout off to the side and another where the master pane would be, but yeah
00:13 <ertes> well, choose a different layout =)
00:14 <spoonm> ertes: can I keep the two other windows that are cyclable visible?
00:14 <ertes> you can program any logic you want
00:14 <spoonm> ertes: I was going to use sublayout, but I couldn't understand how it works or how to use it, even tried with some example configs and nay
00:14 halogenandtoast joined
00:15 ryantrinkle left
00:15 <ertes> yeah, xmonad really wants you to be a haskell programmer, if you want to do anything advanced… in fact my xmonad configuration is a fully cabalised package =)
00:15 <ertes> https://github.com/esoeylemez/config/tree/master/myxmonad
00:16 saussure joined
00:17 <Lokathor> EvanR, found the culprit
00:17 <spoonm> nice
00:17 <Lokathor> i was creating VAOs and then using them as VBOs without noticing
00:17 <spoonm> I'm trying to learn the language as I go, but I often tackle something way too far ahead of me
00:19 <ertes> spoonm: i never considered xmonad to be a good way to learn haskell, but a friend of mine started to learn it that way, too
00:19 <ertes> so perhaps it's legitimate after all
00:20 <spoonm> doesn't seem like a very good way, been told that in the past
00:21 <geekosaur> it's not the greatest way to learn haskell as such, but it does seem to make a good gateway drug >.>
00:21 <ertes> indeed
00:21 <spoonm> maybe general syntax while configuring it, but when you want to change the behavior of this and that you're presented with a bunch of functions you get 100+ lines of errors for modifying what you /thought/ was right
00:22 jeirosz joined
00:23 <ertes> spoonm: try not to be intimidated by the size of the error messages… GHC is really just trying to be helpful, and once you learn how to read the error messages, you will benefit from that
00:23 <spoonm> yeah, I learned quite soon to ignore most lines
00:24 im0nde joined
00:24 wroathe joined
00:24 <spoonm> they're really just saying the first error that popped up caused an error on this other expression, which caused an error here too, and there, and then...
00:24 <geekosaur> most of the error message spam happens with layouts... and much of it would go away if we didn't keep the stackset so heavily parameterized so it can be tested in agda
00:25 <ertes> geekosaur: seriously?
00:25 <ertes> are you doing proofs in agda, or why?
00:26 <geekosaur> yeh, the #1 problem is it can't infer Window in the type of a layout, because it's not expressed anywhere except the type in the config record. so if you have any "dangling" layouts they all throw errors
00:26 <geekosaur> sjanssen 'proved' XMonad.StackSet in agda
00:27 <ertes> you could just take stuff like Window as a module parameter in agda
00:27 <ertes> or even postulate it
00:27 <geekosaur> but things like Window come from the X11 package so he couldn't reference them, and switched it with Int or a word type for that
00:28 a3Dman joined
00:28 a3Dman joined
00:29 <geekosaur> also the type of workspace tags was left a parameter, but realistically you can only use String in xmonad
00:29 <geekosaur> (occasionally something else would be nice, but practically you would lose the ability to use just about every contrib because they all assume the tag is String)
00:30 <ertes> honestly i wish the StackSet type would go away in favour of a more abstract StackSet class… reason: i'd really like to have real workspace trees (currently i'm abusing names to represent trees), and i'd like to have window tags
00:31 <geekosaur> the StackSet _itself_ needs to go away, really. it's fine as a mathematical entity but the source of like 90% of our UX bugs
00:32 zv joined
00:33 ianandrich joined
00:34 <ertes> perhaps it's time for xmonad 1.0 =)
00:35 <ertes> changelog: "you can now use xmonad without learning about parametric polymorphism and zippers"
00:37 Volt_ joined
00:37 im0nde_ joined
00:38 a3Dman joined
00:38 FreeBirdLjj joined
00:39 <* hackage> async-extra 0.2.0.0, bluemix-sdk 0.1.1.0 (AlexanderThiemann): https://qbin.io/8zplal5
00:42 Welkin joined
00:43 erikd joined
00:43 acarrico joined
00:43 <ski> Philonous : they asked in swedish, so ..
00:45 Bardusbasium joined
00:46 mjs2600 joined
00:50 WhiskyRyan joined
00:50 louispan joined
00:50 <* hackage> loc 0.1.2.2 - Types representing line and column positions and ranges in text files. https://hackage.haskell.org/package/loc-0.1.2.2 (chris_martin)
00:53 saussure joined
00:55 sleffy joined
00:56 <* hackage> loc 0.1.2.3 - Types representing line and column positions and ranges in text files. https://hackage.haskell.org/package/loc-0.1.2.3 (chris_martin)
00:57 <EvanR> Lokathor: you only really need one VAO i imagine
00:57 <EvanR> and yeah mixing up the various objects...
00:58 <EvanR> checking for GL errors may help
01:01 justanotheruser joined
01:03 ziyourenxiang joined
01:03 Xanather joined
01:03 tomboy64 joined
01:04 juanpaucar joined
01:04 {emptyset} joined
01:05 zv joined
01:06 meba joined
01:09 spinus joined
01:09 katesmith joined
01:11 saussure joined
01:11 <spinus> hello, do you have regex matching example when using guards or patterm matching? Currently I'm trying https://stackoverflow.com/questions/31764967/using-regexp-in-haskell-function-guards but the last example with matches does not work for me
01:11 <Lokathor> EvanR, i've read many beginners guides, but i've still yet to understand the whole point of VAOs vs VBOs
01:11 <Lokathor> i'm sure it's there somewhere
01:12 <katesmith> i would like to learn
01:12 <EvanR> its two totally different things
01:12 <EvanR> but ultimately an adhoc way to basically do clever state caching
01:12 <EvanR> the VAO is
01:14 <srk> Lokathor: yes, you can have multiple vertex array objects and render them with the same set of shaders
01:15 joco42 joined
01:15 rblaze joined
01:15 <Lokathor> srk, yeah one of the later examples i did was drawing more than one cube, and some of them spinning, but it was all with the same VBO over and over
01:15 <Lokathor> i've yet to encounter more than one VAO
01:15 sword865 joined
01:16 simukis joined
01:16 <srk> Lokathor: here you go https://git.48.io/liveplot/blob/wip/f/src/Graphics/Liveplot/Line.hs#_56
01:16 <EvanR> the VAO holds some of your global state, so you can switch that some out quickly and easily by switching out VAOs
01:16 <Lokathor> er, more technically, i guess it was draw -> update uniform (which contains a location matrix) -> loop
01:16 <EvanR> the fact that it only holds some of it is....
01:17 meba joined
01:17 <saylu> http://lpaste.net/355888
01:17 <saylu> Hey folks -- have a quick question around csv-conduit and decoding to Haskell types
01:17 <saylu> Explained it in the file, but I'm missing an instance and I'm not sure what to do about it
01:17 <Lokathor> srk, i don't know the OpenGL package, just the gl package, so a lot of this is nonsensical unforutnately
01:18 <saylu> reading from csvs with headers is just fine -- its when I move from the 'NamedRecord' to just 'Record' that I run into trouble
01:18 <Lokathor> but i maybe kinda get what you're after
01:20 <srk> Lokathor: heh, I'm also using vinyl-gl and andromeda to generate shaders
01:20 <srk> much less boilerplate
01:20 <srk> inspired by this tutorial http://www.arcadianvisions.com/blog/2013/introducing-vinyl-gl.html
01:20 jgt joined
01:20 <srk> then I've tried to solve how to bundle shaders with my app and instead decided to try generating them and it worked :)
01:21 lambdamu_ joined
01:21 <EvanR> generate code from your code with more code!
01:22 jbiesnecker joined
01:23 <Lokathor> bundling shaders with your app seems easy, you can just stuff them into a string literal
01:23 <EvanR> yuck
01:23 <srk> indeed but why when you can use haskell :)
01:23 WhiskyRyan joined
01:24 <srk> my shaders were very simple though
01:24 <Lokathor> EvanR i'm not sure what's yuck about it
01:24 <Lokathor> well, i mean i use a raw string quasiquoter, but still
01:24 <EvanR> thats like, just put HTML templates in string literals in your javascript
01:25 <EvanR> ah ok better
01:25 <Lokathor> https://github.com/Lokathor/learnopengl/blob/master/app/Lesson07.hs#L81 like this
01:26 <srk> boring
01:26 <Lokathor> hmm
01:26 <Lokathor> it seems you can't use withArrayLen and gl together
01:26 <Lokathor> :(
01:26 <EvanR> eh, i distinctly remember doing that
01:26 <Lokathor> hmm
01:27 <clamchowder> I have some weird problem with ghci.
01:27 castlelore joined
01:28 jsgrant__ joined
01:28 <clamchowder> I used to be able to `ghci filename.hs` and then play with the functions in the file.
01:28 <Lokathor> well then i wonder why my triangle isn't showing up
01:28 AndChat502 joined
01:28 augur joined
01:29 <AndChat502> Test
01:29 <clamchowder> But after I changed some files and compiled the whole project using `cabal install`, and try to `ghci` the same file, and test some function I got this:
01:29 saussure joined
01:30 <clamchowder> can't load .so/.DLL for: ~/.cabal/lib/x86_64-linux-ghc-8.0.1/pandoc-2.0-IqHNcNxYMme2AImsjmcj7X/libHSpandoc-2.0-IqHNcNxYMme2AImsjmcj7X-ghc8.0.1.so (~/.cabal/lib/x86_64-linux-ghc-8.0.1/pandoc-2.0-IqHNcNxYMme2AImsjmcj7X/libHSpandoc-2.0-IqHNcNxYMme2AImsjmcj7X-ghc8.0.1.so: undefined symbol: pandoczm2zi0zmIqHNcNxYMme2AImsjmcj7X_TextziPandocziWritersziICML_writeICML_closure)
01:30 <clamchowder> The project is pandoc as you can tell
01:30 <AndChat502> Test
01:30 <Lokathor> thtat's sure a weird one
01:30 <clamchowder> Do you know what may have caused this?
01:30 <Lokathor> AndChat502, hey hey
01:30 AndChat502 left
01:31 AndChat502 joined
01:31 MrWoohoo joined
01:31 <geekosaur> wait, literal ~ ?
01:31 <geekosaur> that will not work
01:32 <geekosaur> dunno how it got in there but ~ is only meaningful in shells and ghci is not feeding that path through a shell
01:33 <clamchowder> Nice spot :) I replaced the $HOME with ~
01:33 AndChat502 left
01:33 <clamchowder> is there a way to revert to pre-`cabal install` state?
01:33 jedws joined
01:33 dejanr joined
01:34 <clamchowder> nuking the .cabal directory?
01:34 anks joined
01:35 <ertes> clamchowder: rm -rf ~/.cabal/{bin,lib,setup-exe-cache,share} ~/.ghc/*-linux-*
01:35 acarrico joined
01:35 <ertes> (change the last pattern, if you're not using linux)
01:35 <anks> Hello, do you have any hints for me on that: https://pastebin.com/4qfUWfyb
01:35 <ertes> clamchowder: you should probably start using sandboxes though
01:36 <clamchowder> ertes: how do I do that?
01:36 <ertes> anks: could you paste on lpaste.net? pastebin always fucks up the formatting
01:36 shangxiao joined
01:36 <ertes> clamchowder: go into a directory, type: cabal sandbox init
01:37 <ertes> clamchowder: now everything you install while that directory is your working directory will be local to it
01:37 <anks> ertes in a moment, i've found sthing but I dont think thats that
01:37 <Lokathor> EvanR, I've been hoisted again
01:38 <clamchowder> ertes: OK with sandbox how do I revert things when it gets messed up again?
01:38 <Lokathor> i passed the vertex list twice, so i used my vertexes as my index data in my EBO
01:38 <ertes> clamchowder: delete the sandbox
01:39 <ertes> clamchowder: (there is a way to "uninstall", but it's very messy)
01:39 <clamchowder> ertes: cabal sandbox delete?
01:39 <ertes> clamchowder: yeah
01:39 FreeBirdLjj joined
01:39 louispan joined
01:39 nilof joined
01:40 <clamchowder> ertes: then cabal sandbox init again? OK thanks a lot.
01:41 <ertes> clamchowder: is uninstalling something you do regularly?
01:41 <clamchowder> ertes: no
01:42 bigos joined
01:47 <clamchowder> ertes: I think I just need to sandbox Pandoc.
01:47 saussure joined
01:48 PotatoCommando joined
01:49 <anks> hey, any hints on this strange error: http://lpaste.net/355890 ??
01:49 <anks> well
01:49 <anks> dont bother
01:49 <anks> im should go to sleep already
01:49 <anks> ..
01:49 brynedwardz joined
01:50 anks left
01:51 zuck05 joined
01:51 <ertes> clamchowder: you want to install pandoc as a user?
01:54 maybefbi joined
01:54 zuck05 joined
01:55 <clamchowder> ertes: sorry my internet had some problem. back now.
01:56 <clamchowder> ertes: i used to install it as a user. But since I'm playing and changing the pandoc code I'm going to try the sandbox
01:56 flashmozzg joined
01:56 jbiesnecker joined
01:58 <clamchowder> ertes: the pandoc seems to use Tasty for testing. Is it better than HUnit? I'm new to haskell, and when I searched for ways of unit testing, the top results on google are HUnit
01:58 <ertes> clamchowder: tasty is a test framework, and HUnit is a test library that you can use with tasty
01:59 HallaSurvivor joined
01:59 Reshi joined
01:59 <ertes> clamchowder: HUnit is mostly for writing simple assertions
01:59 <flashmozzg> Hello, I have a quick newbie question: it looks like my program stack overflows while creating a simple linkedlist-like structure while reading from file (about 5e5 elements). But I see no way to make it strict/recursive.
01:59 saussure joined
01:59 <flashmozzg> Basically I want something like (imperative pseudocode):for 1..n do ans = No
01:59 zv joined
01:59 <exio4> flashmozzg: can you give some example code?
01:59 <HallaSurvivor> flashmozzg: can you give us a
01:59 <HallaSurvivor> ^
01:59 <clamchowder> ertes: when I cabal install my customised pandoc (which involves HUnit for testing), it complains about not pandoc.cabal not having HUnit as a dependency.
02:00 saussure joined
02:00 <flashmozzg> for 1..n do ans = Node { value = readfunc line, next = Nil}; and.next = recursive call.
02:00 <clamchowder> ertes: I wonder what testing library pandoc uses.
02:00 <ertes> clamchowder: cabal install --only-dependencies
02:00 <exio4> flashmozzg: example haskell code which leads to space-leaks/stack overflow
02:00 hucksy_ joined
02:00 <flashmozzg> the problem is that my parsing functions not only return the result but the remaining string to parse, so I can't simply use accumulators.
02:01 <clamchowder> ertes: I thought that installs the dependencies specified in pandoc.cabal..
02:01 <flashmozzg> Well, I'm pretty sure it's this code to blame:
02:01 <flashmozzg> getListNode :: ([String] -> (a, [String])) -> [String] -> (ListNode a, [String])
02:01 <flashmozzg> getListNode f (x:xs) = getListNode' (read x::Int) xs
02:01 <flashmozzg> where getListNode' 0 l = (Nil, l)
02:01 <flashmozzg> getListNode' n l = (ListNode {val = v, next = nxt}, rest)
02:01 <flashmozzg> where (v, ls) = f l
02:01 <flashmozzg> (nxt, rest) = getListNode' (n - 1) (ls)
02:01 <lyxia> @lpaste
02:01 <lambdabot> Haskell pastebin: http://lpaste.net/
02:01 jbiesnecker joined
02:01 <glguy> flashmozzg: It's not OK to paste that much into chat
02:01 <flashmozzg> ops, sorry.
02:02 <ertes> clamchowder: the current release version uses test-framework (tasty is a more modern replacement for that one) together with HUnit and QuickCheck
02:02 <HallaSurvivor> flashmozzg: use either pastebin, or git gists :)
02:02 <ertes> clamchowder: https://hackage.haskell.org/package/pandoc-1.19.2.1/pandoc.cabal
02:02 <clamchowder> Is there a function that takes a mixture of spaces and tabs, and output the length of the indentation?
02:02 <flashmozzg> Well, it's 6 lines, so it's not terribly big
02:02 <clamchowder> ertes: OK thanks, I'll have a look in that. Mine (pandoc 2.0) did not have HUnit, weird.
02:03 <glguy> flashmozzg: More than 2 can go to a pastebin
02:03 <ertes> clamchowder: none that i know of, but it's fairly easy to create
02:03 jbiesnecker_ joined
02:03 <flashmozzg> anyway, here it's on pastebin: http://lpaste.net/8980774266588889088
02:03 <HallaSurvivor> ty <3
02:03 <ertes> clamchowder: oh, you should do this first: cabal configure --enable-tests
02:03 <ertes> clamchowder: (after creating the sandbox)
02:04 <flashmozzg> The error itself obviously appears down the line, when I actually try to use parsed stracture (i.e. access it's last element).
02:04 <ertes> clamchowder: (you can just do it now… no need to start from scratch)
02:04 <lyxia> clamchowder: 1) set your tabwidth to 1. 2) you can now use length.
02:04 <Lokathor> EvanR, https://www.dropbox.com/s/us7d3banox3qesq/Screenshot%202017-05-27%2020.01.23.png?dl=0
02:04 juanpaucar joined
02:05 <EvanR> ah you drew on the sprite sheet
02:05 <athan> If I wanted a shared TChan across multiple processes, should I just be using a Unix domain socket?
02:05 <clamchowder> lyxia: that's a good solution, but what if someone else runs it..?
02:05 <Lokathor> that's not the sheet, that's a screenshot of the program window
02:05 Goplat joined
02:05 <ertes> athan: yeah, with your favourite serialisation package
02:05 <Lokathor> i made it scale down the point locations to the resolution within the shader
02:05 daniel___ joined
02:06 <athan> hrm. thanks ertes
02:06 <Lokathor> http://lpaste.net/355891
02:06 <EvanR> athan: if by shared you mean one side is in one process the other is in another (not more than 2 processes) and by transactional you mean not transactional, yeah
02:06 <ertes> athan: alternatively try one of the many message passing frameworks like ZeroMQ
02:06 <clamchowder> ertes: I'm already re-`cabal install` pandoc, because by rm -rf much of the .cabal directory most of the dependencies are gone..
02:06 <EvanR> athan: you may also be able to just use stdio
02:06 <exio4> flashmozzg: where do you use this function?
02:06 <athan> EvanR Is there hope for transactional?
02:06 <EvanR> if not already in use
02:06 <athan> ahh good idea thanks ertes
02:06 <exio4> flashmozzg: it's quite a weird function
02:07 <clamchowder> ertes: I'm just gonna rm rf the subdirs involving pandoc in $HOME/.cabal/, and then do the sandbox thing
02:07 <EvanR> athan: you could guard the socket in one of the processes with STM, but that STM will not cooperate with STM in the other process
02:08 <ertes> clamchowder: you need to delete the corresponding files from ~/.ghc, too
02:08 <flashmozzg> exio4: it's a parsing function. It takes list of strings (from the file) parses it into linkedlist and returns unparsed strings as a second pair argument
02:08 <clamchowder> ertes: OK thanks for reminding
02:08 <flashmozzg> exio4: (since there are other similar function which can be combined)
02:08 <ertes> clamchowder: (in fact deleteing anything from ~/.cabal is optional)
02:08 <clamchowder> ertes: do you know if there is a function in the pandoc code calculating the length of indentation?
02:09 <ertes> clamchowder: sorry, i'm not familiar with pandoc's source code
02:09 <clamchowder> ertes: no worries.
02:09 <exio4> flashmozzg: do you have the structure of some f's?
02:09 <exio4> flashmozzg: and how do you read the original [String]?
02:09 <clamchowder> ertes: I thought things ~/.cabal was the culprit because ghci complained about some weird files in that directory...
02:09 <exio4> flashmozzg: FWIW, String is quite an inefficient type for having *actual* strings on memory
02:09 <flashmozzg> exio4: just basic readFile
02:10 <exio4> you might want Text (or even ByteString if you don't need actual text but can work at a byte-level)
02:10 <exio4> ah
02:11 <exio4> flashmozzg: do f's read "forward" into the string, or just the head?
02:11 connrs joined
02:11 <clamchowder> ertes: strange, after re-installing everything without changing any pandoc code, the ghci problem vanished..
02:11 <clamchowder> ertes: thanks for the suggestions.
02:11 <exio4> flashmozzg: (unrelated, but it's also missing error handling, which should be a good practice as you're using `read`, which is likely to fail)
02:12 <flashmozzg> exio4: each f returns (result, unparsed chunk)
02:12 jbiesnecker joined
02:12 <exio4> flashmozzg: I am talking about f's strictness
02:12 <ertes> > (indentation "", indentation "\t", indentation "\t ", indentation "\t \t")
02:12 <lambdabot> (0,8,10,16)
02:12 <ertes> clamchowder: something like that?
02:13 <clamchowder> ertes: I guess it depends on the tabwidth..
02:13 jbiesnecker_ joined
02:14 <flashmozzg> exio4: well, not sure. f can be anything (see the signature), even the getListNode itself (that way I'll parse linkedlist of linkedlists).
02:14 <ertes> > (indentation 4 "", indentation 4 "\t", indentation 4 "\t ", indentation 4 "\t \t")
02:14 <lambdabot> (0,4,6,8)
02:14 <ertes> clamchowder: like that?
02:14 rblaze joined
02:14 <EvanR> :t indentation
02:14 <lambdabot> (Foldable t, Integral a) => a -> t Char -> a
02:14 <exio4> flashmozzg: yes, I am talking about the strictness of those functions
02:15 <clamchowder> Ah I see identation is a built-in thing!
02:15 <clamchowder> OK let me see what it's about
02:15 <ertes> clamchowder: no, it's not =)
02:15 systadmin joined
02:15 <ertes> clamchowder: i just defined it secretly, so you can take implementing it as an exercise =)
02:16 <flashmozzg> exio4: well I can't enforce it, so they are probably not strict. But why would that matter?
02:16 <clamchowder> ertes: I see... lambdabot can read lhs style code - sneaky
02:16 <ertes> clamchowder: you can /query it
02:16 <flashmozzg> exio4: i.e. example f: (\(x:xs) -> (read x :: Int, xs))
02:17 <exio4> flashmozzg: if they are too strict on the argument, then that'd lead to basically reading the whole file at once, and then doing other things
02:17 <clamchowder> ertes: ok
02:17 <exio4> flashmozzg: which, on strings, is really wasteful
02:18 WhiskyRyan joined
02:18 sellout- joined
02:18 <clamchowder> ertes: did you hardcode 4 as tabwidth in the indentation function?
02:19 montagy joined
02:19 <* hackage> makefile 1.0.0.3 - Simple Makefile parser and generator https://hackage.haskell.org/package/makefile-1.0.0.3 (nmattia)
02:20 <flashmozzg> exio4: well, I NEED to read the whole file. I.e. I don't so much care about the ultimate performance rather I just don't want my program to crash.
02:20 sellout- joined
02:20 jbiesnecker joined
02:20 <EvanR> flashmozzg: right ... when that happens a strict ByteString read of the whole file might work better
02:20 Scip joined
02:21 <exio4> flashmozzg: there's a big difference between reading the whole file at once and reading it by parts, if you want this to be performant, using String(s) naively isn't the best idea
02:21 <EvanR> then process that
02:21 <flashmozzg> exio4: if I don't do anything with my parsed linkedlist - no stack overflow happens. Btw, I can even convert it to regular list, take it's length, and it's ok. Bu trying to take the last element - stack overflow.
02:21 <flashmozzg> exio4: my files are 4mb at most. I want it to not crash.
02:22 <EvanR> yeah dont use String
02:22 <exio4> flashmozzg: do you have some example code?
02:22 <EvanR> as silly as that sounds
02:22 <exio4> like, complete code
02:23 <exio4> flashmozzg: also, I've worked with 4mb files with String(s) just fine, so I don't think this is the exact issue
02:23 wei2912 joined
02:24 <exio4> what's your definition of ListNode?
02:24 <flashmozzg> exio4: that is almost complete code, you just need to apply this func to the result of readfile with 5e5 lines) And while I can past the more final code, I'm not sure I'll manage with input file
02:25 halogenandtoast joined
02:27 wroathe joined
02:27 juanpaucar joined
02:28 kaeluka joined
02:28 medical joined
02:28 aglorei joined
02:29 WhiskyRyan joined
02:30 <exio4> flashmozzg: http://dpaste.com/2R6KW5A this code works just fine
02:30 <flashmozzg> exio4: well I put together some code, the only thing that is missing is input.txt http://lpaste.net/8712522381786087424
02:31 <exio4> that code doesn't compile
02:31 <exio4> but I'll fix the mistakes and try it
02:32 latro`a joined
02:32 <exio4> $ time ./test
02:32 <exio4> False
02:32 <exio4> real 0m1,547s
02:33 <flashmozzg> exio4: yeah, I hand typed it. The problem is when the linked list is very big (5 * 10^5).
02:33 mizu_no_oto joined
02:33 <flashmozzg> (well, comparatively big)
02:33 <exio4> tried it with 1M elements, took 15s
02:33 <exio4> with 100k elements, just 1.5s
02:34 <exio4> (this is a 64bit laptop, 2gb ram, intel atom, the crappiest software you'll ever find)
02:35 <flashmozzg> exio4, hm, verry strange.
02:35 <exio4> that function is just fine, I think the problem is on the `f` function you pass, being way too strict, or maybe some kind of infinite loop caused by returning a list that's bigger than the input or something weird
02:37 connrs joined
02:37 <flashmozzg> exio4: well, I haven't done anything to make my func stricter, so I doubt haskell made it stricter by himself.
02:37 dash joined
02:39 <exio4> flashmozzg: I don't think I can help further without looking at the exact code causing this issue, I don't think it's just strictness but probably some `f` returning some thunk which requires a pattern matching for the resulting list, which in turns end ups requiring more and more over time, thus leading to a stack overflow
02:39 xinming_ joined
02:39 tzh joined
02:40 <exio4> flashmozzg: which is mostly related to "pattern matching required a pattern match, which in turn required a pattern match, which required another one, ...."
02:40 <dash> I realize this isn't _strictly_ a haskell question, but: does anyone know of FRP-or-similar libraries for terminal UIs? Anyone done reactive-banana-ncurses or something like JavaScript's React for terminals? :)
02:40 FreeBirdLjj joined
02:40 cdg joined
02:42 WhiskyRyan joined
02:42 <exio4> flashmozzg: (I would do note that your program is really really unproductive GC-wise (compile it with -rtsopts and check with +RTS -s
02:43 <flashmozzg> exio4: hm, well, the only difference I see is that I do no pass f as lamda directly rather I use parseFun f (x:xs) = (f x, xs) and pass (parseFun (read::Int), and also, there are a couple of linked lists that are parsed from file, but it only overflwos on the biggest one
02:43 rblaze joined
02:44 exferenceBot joined
02:44 <exio4> flashmozzg: BTW, your toList algorithm isn't really.. nice, it'd be better if you didn't it make "tail-recursive"
02:44 <exio4> flashmozzg: as naive tail-recursion is actually bad if you are lazy
02:44 <exio4> flashmozzg: (it'll build more and more thunks in the 2nd parameter, until you call it later)
02:45 <exio4> flashmozzg: you either make the 2nd parameter strict, which has its own issues, or write it as:
02:45 <exio4> toList Nil = []
02:45 <exio4> toList (ListNode x xs) = x : toList xs
02:45 <flashmozzg> exio4: yeah, I tried to write it differently but realized that it was't the problem
02:46 juanpaucar joined
02:48 hexagoxel joined
02:49 <flashmozzg> exio4, btw it overflows on a GHC 7.6.3 under Ubuntu, could this be the problem?
02:49 <exio4> flashmozzg: I am using GHC 8.2.0, so, maybe :)
02:51 <exio4> flashmozzg: in general, too, lists shouldn't be used if you actually want everything to be in memory at the same time
02:51 <exio4> flashmozzg: there are better data structures for that (Vector, Set, Map, ByteString, Text, ...)
02:52 saussure joined
02:54 <exio4> flashmozzg: btw, can you try adding laziness annotations?
02:55 <exio4> flashmozzg: I think that's the issue, ~(v,ls) instead of (v,ls) and ~(nxt,rest) instead of (nxt,rest)
02:56 <exio4> flashmozzg: ignore everything I said, thought where was lazy :P
02:57 wroathe joined
02:57 <flashmozzg> exio4: well, it is good enough for now. Partly the problem is that types need to be "standard" at the end point anyway. I've copied the code from the ubuntu machine to my windows desktop (it uses ghc 8.01 or 7.12, don't remember) and ti work fine there. And I've jsut reduced the number of linked list read from file...
02:59 <exio4> flashmozzg: http://dpaste.com/33H9B9Y this works in constant memory on my laptop, with just two changes :P
02:59 <exio4> you don't need the bangpatterns, anyway
02:59 justanotheruser joined
03:00 jbiesnecker joined
03:01 <flashmozzg> exio4: I can't reproduce the issue on my windows desktop ;P But it is on the ubuntu with GHC 7.6.3
03:02 <exio4> flashmozzg: try the laziness annotations, anyway, that'll greatly improve the performance :P
03:02 <flashmozzg> exio4: (btw, on that machine the stacksize is set to unlimeted, but ghc iiuc bypasses it and uses it's own size)
03:03 ianandrich joined
03:03 felixsch1 joined
03:04 darlan joined
03:04 <exio4> flashmozzg: stack size on GHC is different to other programming languages, it's a pattern matching stack
03:05 <flashmozzg> exio4: with bang patters I get error: Parse error in pattern: getListNode'
03:05 WhiskyRyan joined
03:05 <* hackage> grammatical-parsers 0.1, rank2classes 0.1 (MarioBlazevic): https://qbin.io/yvqolhkg
03:05 <exio4> flashmozzg: remove the ! in the code
03:05 ubsan_ joined
03:06 latro`a joined
03:06 shangxiao joined
03:08 <flashmozzg> exio4: still the same thing on ubuntu "Stack space overflow: current size 8388608 bytes." =(
03:08 <exio4> flashmozzg: even with ~? :/
03:08 connrs joined
03:08 <flashmozzg> exio4: yup, really strange
03:08 <EvanR> its indicative of buggy code unfortunately
03:09 Sh4rPEYE joined
03:09 <EvanR> parsing a large file as a String the wrong way will just eat ram
03:09 <flashmozzg> exio4: I tryied to use `seq` before and it didn't help
03:09 <EvanR> seq might make it worse, same as !
03:10 <flashmozzg> Evan4: or buggy compiler, since on my win desktop and exio4' PCs the code works fine even without any optimizations
03:10 <EvanR> its because one some versions of ghc the default is no stack size limit
03:10 <flashmozzg> And the only difference I see is newer GHC
03:10 <EvanR> right, the limit was removed later
03:10 <exio4> EvanR: my code works in constant memory :)
03:11 <EvanR> i assume your code is totally different?
03:11 <exio4> with the laziness annotation
03:11 dash left
03:12 <EvanR> i suspect an incongruity in these stories
03:12 <EvanR> besides that
03:12 rblaze joined
03:12 ekinmur joined
03:12 systadmin joined
03:13 padre_angolano joined
03:14 <exio4> and indeed, I can't test the exact code flashmozzg runs because he's not giving the complete code
03:15 <flashmozzg> exio4: I tested the exact code my ubnutu pc runs, on my windows machine and I couldn't reproduce it either.
03:15 zacts joined
03:15 <exio4> flashmozzg: http://dpaste.com/33H9B9Y talking about this test case
03:15 <flashmozzg> So it's probably just like EvanR said - newer compilers removed the limit and it works just fine after that
03:16 joco42 joined
03:16 <EvanR> well, it works, not what id call just fine
03:16 <exio4> flashmozzg: the thing is, it shouldn't be even reaching the limit
03:16 <EvanR> imposing a stack limit is a good way to detect space leaks in your code
03:16 <flashmozzg> exio4: what's wrong with thsi test case? it work on my win pc too, but not on ubuntu.
03:16 <EvanR> C programs which leak space also run fine as long as they dont run too long
03:17 <exio4> flashmozzg: did you run the exact code I linked in ubuntu/GHC 7.6?
03:17 <flashmozzg> exio4, well I replaced the getListNode with your version and the result is the same.
03:18 ystael joined
03:18 drewbert joined
03:18 <exio4> flashmozzg: the thing is, I can't know what's exactly the issue unless I have the full code, because laziness is a tricky problem which requires more than the function which caused the blowup
03:19 <EvanR> which is funny because "laziness is great because you can write code without worrying about how someone else will use it"
03:19 <EvanR> "its more modular"
03:19 davr0s joined
03:19 <exio4> flashmozzg: for example, you gave me a test case, with a simple change I optimized it from a stack blowup to a constant memory algorthm
03:20 <flashmozzg> Evan4: well my initial question was to how to make my program better without sacrificing flexibility (i.e. ability to compose parsing function),
03:20 jmcarthur joined
03:20 <EvanR> yeah laziness would probably help with that
03:21 <exio4> flashmozzg: I think, again, the issue is with some other function not doing what it should be doing :p
03:21 jgt joined
03:21 sync__ joined
03:22 <flashmozzg> exio4: I swear, there are no other functions xD And I run exactly the same code on different pc but with newer ghc and "it jsut works". Btw, how do you properly check the memery usage? I know how to do that in ghci, but it's not the ebst place to test.
03:23 <exio4> flashmozzg: you can compile your code with -rtsopts and do +RTS -s to get basic stats, if you want more info, you have to compile wth profiling (https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/profiling.html)
03:23 augur joined
03:24 <EvanR> theres ekg
03:24 ertesx joined
03:24 rblaze joined
03:24 augur joined
03:24 doyougnu joined
03:28 augur joined
03:28 <flashmozzg> exio4: don't really see much difference between version with ~ and not
03:31 sssilver joined
03:32 anodium joined
03:32 conal joined
03:32 sanitypassing joined
03:35 <flashmozzg> exio: btw, does +RTS -Ksize -RTS work for you? I tired using it, but it looks liek it automatically sets lowest stack size possible (32KBs) and fails with that. I wanted to confirm, that If I set the stack to 8MB, when it will fail.
03:35 pavonia joined
03:35 WhiskyRyan joined
03:36 <spoonm> ... why do I get so many errors about Integral and Fractional types? all I wanted was to divide two numbers, is it so hard? :(
03:36 <ChaiTRex> spoonm: Use `div` for integers.
03:36 <ChaiTRex> spoonm: Or use fromIntegral a / fromIntegral b
03:36 <spoonm> ChaiTRex: I was doing fromIntegral, but for some reason I got a ton of errors still
03:37 <exio4> flashmozzg: how are you using -Ksize?
03:37 <ChaiTRex> spoonm: Oh, can you paste your code to lpaste?
03:37 <ChaiTRex> @lpaste
03:37 <lambdabot> Haskell pastebin: http://lpaste.net/
03:37 <exio4> flashmozzg: -K20MB or -K20?
03:37 <exio4> 20M *
03:37 <flashmozzg> exio4: +RTS -K10000 -RTS
03:38 <exio4> flashmozzg: that's not 10 megabytes though
03:38 <exio4> flashmozzg: just a bit less than 10 kilobytes, which is why it's picking the lowest stack size possible
03:38 rcschm joined
03:38 <flashmozzg> rxio4: I know. The problem is that it works weird
03:39 <spoonm> ChaiTRex: I can ix it, here: http://ix.io/viv
03:39 <flashmozzg> exio4: +RTS -K64 -RTS - Stack space overflow: current size 33624 bytes.
03:39 <flashmozzg> exio4: out.exe +RTS -K10000000 -RTS - Stack space overflow: current size 33624 bytes.
03:39 latro`a joined
03:39 <flashmozzg> exio4: out.exe +RTS -K100000000 -RTS - no error, so don't know the stack
03:39 cdg_ joined
03:40 Costar joined
03:40 <spoonm> ChaiTRex: I'm passing a [(Double, Integer)] to them, and at first I did `fromIntegral length pairs' on `medar'
03:40 <spoonm> but then it complained a lot about other things
03:40 Welkin joined
03:40 <ChaiTRex> spoonm: You need "medar pairs = totalSum / fromIntegral (length pairs) where"
03:41 <ChaiTRex> spoonm: length returns an Int, so it needs the fromIntegral treatment.
03:41 <ChaiTRex> spoonm: Oh, I see. You need to put parentheses around length pairs, too.
03:41 <spoonm> yeah, I found that out, but still dunno why it complains so much
03:41 <spoonm> lemme try again with your suggestion
03:42 <spoonm> whoa it actually worked
03:42 <spoonm> thanks a lot, ChaiTRex o.o
03:42 <ChaiTRex> spoonm: If you say "fromIntegral length pairs", it thinks that you want to convert the function length into another numeric type, which it doesn't know how to handle.
03:42 <ChaiTRex> spoonm: You're welcome.
03:43 <spoonm> is there a particular reason for Haskell to be so strict about types in arithmetic expressions?
03:43 <Welkin> yes, because a float is not an integer
03:44 <ChaiTRex> spoonm: Yeah, it's the general philosophy of Haskell, being strict about types.
03:44 <exio4> flashmozzg: no idea, to be honest
03:44 <ChaiTRex> spoonm: It helps avoid errors, though, so there's a silver lining.
03:44 <exio4> "being strict on types, non-strict on values"
03:44 <Welkin> there are always some tradeoffs, but this one is very minor
03:44 EvanR_ joined
03:44 <exio4> this doesn't sound well outside programming :P
03:44 <spoonm> even though you would normally cast integers to floating types?
03:44 <monochrom> Types keep me honest.
03:44 <exio4> spoonm: why not floating types to integers?
03:44 <Welkin> I don't find myself typing in long equations that mix floating point and integral values often (if ever)
03:45 <spoonm> exio4: involves loss of information, but also manageable, it has some applications
03:45 <monochrom> Also I doubt that it is casting. Conversion sounds more like it.
03:45 <exio4> spoonm: same goes if you convert an Integer to a floating type
03:45 <spoonm> exio4: fair enough
03:46 <exio4> spoonm: an Integer can hold a number as big as your memory allows it, Floats/Doubles can't
03:46 <flashmozzg> exio4: well, thanks anyway. WOuld be nice if you just tried to run your code with 8388608 bytes stack limit. But anyway, big thanks for helping me solve this weird error. I'll try to updite the ghc on my Ubuntu machine and see if it helps.
03:46 halogenandtoast joined
03:46 <exio4> flashmozzg: this code just sent my computer to hell, my laptop completely froze for 35~ seconds
03:47 sellout-1 joined
03:50 alexelcu joined
03:50 juanpaucar joined
03:51 <Lokathor> EvanR, https://www.dropbox.com/s/lgiwbn6un4k4fc4/Screenshot%202017-05-27%2021.51.22.png?dl=0
03:52 xiinotulp joined
03:55 tromp joined
03:56 <exio4> flashmozzg: oh, apparently the strict patterns did do something :p
03:56 mizu_no_oto joined
03:56 otto_s_ joined
03:56 <exio4> flashmozzg: enable {-# LANGUAGE BangPatterns #-}
03:56 <exio4> flashmozzg: and add ! on l in getListNode'
03:57 <exio4> flashmozzg: I just tested the code without bang patterns and it's as slow as the default version
03:59 <exio4> flashmozzg: and the perf improvements seem to be caused by the strictness on l than the laziness annotations, my bad, twice
03:59 <exio4> it's way too late :)
04:00 darjeeli1 joined
04:00 WhiskyRyan joined
04:01 mizu_no_oto joined
04:01 tromp joined
04:03 systadmin joined
04:04 <Lokathor> https://www.dropbox.com/s/6hreku5lkugcnix/Screenshot%202017-05-27%2022.03.19.png?dl=0 it worksssss
04:05 path[l] joined
04:06 whaletechno joined
04:10 coot____ joined
04:12 sleffy joined
04:13 infinity0 joined
04:16 tristanp joined
04:17 saussure joined
04:19 rcschm joined
04:20 whaletechno joined
04:24 shangxiao joined
04:26 flatmap13 joined
04:27 Jackoe joined
04:28 heurist` joined
04:29 radi joined
04:29 FreeBirdLjj joined
04:33 HallaSurvivor joined
04:33 mizu_no_oto joined
04:34 justanotheruser joined
04:40 afarmer joined
04:41 HallaSurvivor joined
04:46 <flashmozzg> exio4: tahnks again! But I I said, adding ! leads to Parse error in pattern: getListNode'
04:46 zacts joined
04:49 WhiskyRyan joined
04:49 juanpaucar joined
04:50 primal_ joined
04:52 tromp joined
04:54 rcschm joined
04:54 <flashmozzg> exio4: for some reason pragma didn't activate the bangpatterns properly
04:55 WhiskyRyan joined
04:56 cpup joined
04:57 benjic joined
04:58 <Sh4rPEYE> I have a bunch of signed permutations (:: [[Int]]) and I need to nicely print them one per line like this:
04:58 <Sh4rPEYE> [-1, -2, 1] --> -1 -2 1
04:59 <Sh4rPEYE> If they weren't signed, I'd use some combination of show and intersperse ' '... But what to do in this case?
05:00 primal joined
05:00 <c_wraith> Sh4rPEYE: what does being signed change?
05:00 <Sh4rPEYE> *To be exact, I have [-1, -2, 1] and I want to print it like "-1 -2 1"
05:00 <flashmozzg> exio4: tahnks, it really did help
05:01 <c_wraith> Sh4rPEYE: Oh, I think I understand. intersperse is the wrong function. you want intercalate
05:01 <dmwit> > unwords . map show $ [-1, -2, 1]
05:01 <lambdabot> "-1 -2 1"
05:02 <Sh4rPEYE> c_wraith: Never heard about that one. Will check, thanks
05:02 <c_wraith> Sh4rPEYE: you need that for inputs with multiple digits expressed in decimal anyway
05:02 <c_wraith> Sh4rPEYE: or unwords, as dmwit points out
05:02 <Sh4rPEYE> dmwit: Cool! Just like that. Could've guessed there's un-words for words
05:03 <Sh4rPEYE> I'm just learning Haskell and the library functions just go over my head a little bit
05:03 <Sh4rPEYE> Thank you both
05:03 path[l] joined
05:04 lamduh joined
05:09 dmiles joined
05:10 aarvar joined
05:10 flatmap13 joined
05:11 EvanR_ joined
05:12 meandi_2 joined
05:13 CacoS joined
05:16 joco42 joined
05:18 davr0s joined
05:20 meba joined
05:21 timbod7 joined
05:21 <timbod7> Hi. What's the idiomatic way of creating a singleton Data.List.NonEmpty value?
05:22 jgt joined
05:24 connrs joined
05:24 <Lokathor> timbod7, i'd probably define a singleton helper function
05:24 <Lokathor> if i were going to do it a lot
05:25 <timbod7> Lokathor It's a one off.
05:25 <Lokathor> > 2 :| []
05:25 <lambdabot> error:
05:25 <lambdabot> • Data constructor not in scope: (:|) :: Integer -> [t0] -> t
05:25 <lambdabot> • Perhaps you meant one of these:
05:25 <timbod7> (In a call to the amazonka library).
05:25 <Lokathor> > 2 Data.List.NonEmpty.:| []
05:25 <lambdabot> error:
05:25 <lambdabot> Not in scope: data constructor ‘Data.List.NonEmpty.:|’
05:25 <lambdabot> No module named ‘Data.List.NonEmpty’ is imported.
05:25 <Lokathor> poor lambdabot
05:25 <Lokathor> but yeah you can just write (val :| []) and it'll be fine
05:26 <timbod7> I'm surprised there's not a builtin to do it, given that you need to start non empty list with a single value.
05:26 <EvanR> it unsually doesnt seem to have `singleton`
05:27 renzhi joined
05:27 <Lokathor> (singleton a) is actually longer than (a :| []) though
05:27 <EvanR> though it might be in the latest version which hackage doesnt have docs for
05:27 <EvanR> length isnt everything, queue the joke
05:28 <timbod7> Lokathor But the docs suggest importing qualified, in which case you end up with something longer.
05:28 <timbod7> or an import especially for the ctor
05:28 <Lokathor> fair point
05:28 <EvanR> :| is ____ enough to import unqualified
05:29 hiratara joined
05:29 <timbod7> Yes - but then 2 lines of imports!
05:29 <EvanR> right... of course you can put both lines on one line ;)
05:29 <Lokathor> i've had modules with more imports than code before :P
05:29 <timbod7> Anyway - thanks. Just wondered if I was missing something obvious.
05:29 <EvanR> check the latest version of the package and see if singleton is defined
05:30 <cocreature> you can use "pure/return" to create singletons
05:30 <EvanR> doh ... yeah
05:30 <EvanR> "obviously"
05:31 <cocreature> you could also use OverloadedLists and [val] instead of a :| []
05:31 mbrock joined
05:31 <timbod7> yes - I guess pure is the right approach.
05:32 <timbod7> don't really like [val] as if you write [] instead it will fail at runtime won't it?
05:32 sync__ joined
05:32 <cocreature> yep
05:33 <mbrock> My state has a Data.Tree to which I want to keep adding nodes. I always add them at the "rightmost" index. Should I use a zipper? I tried to figure out ekmett's "zippers" package but got confused.
05:36 Destol joined
05:38 teggi joined
05:40 wroathe joined
05:40 <mbrock> Ah, I think the "zippers" package simply isn't made for dynamic levels, e.g. moving up and down an arbitrary rose tree. The "rosezipper" package seems more appropriate.
05:40 davr0s joined
05:45 <c_wraith> mbrock: it has the issue that a zipper changes types whenever it changes levels. That makes it very hard to change levels dynamically.
05:45 <c_wraith> mbrock: which is probably exactly what you discovered. :)
05:48 <mbrock> c_wraith: Yeah, I might have guessed sooner if the top example in the docs didn't involve Data.Tree...
05:49 diegoksp joined
05:49 <c_wraith> mbrock: yeah, it's a case where simple static examples make the library look more capable than it is, because you never have to deal with the hairy types
05:50 primal_ joined
05:51 takuan joined
05:52 Johan_L joined
05:53 jgertm joined
05:53 juanpaucar joined
05:54 <Sh4rPEYE> Is there any list-like data type with fixed length? Something like Queues in Python
05:56 <ChaiTRex> Sh4rPEYE: A tuple?
06:02 <EvanR> Sh4rPEYE: usually called a Vect
06:03 <EvanR> youll need type level numbers to talk about the length
06:04 <geekosaur> are we sure this isn't just Array or maybe Vector?
06:04 <geekosaur> as opposed to a fixed-length linked list?
06:06 filterfish joined
06:06 ziyourenxiang joined
06:07 <ChaiTRex> If we're talking concurrency, there is https://hackage.haskell.org/package/BoundedChan-1.0.3.0/docs/Control-Concurrent-BoundedChan.html
06:09 radi joined
06:11 Johan_L joined
06:12 takle joined
06:21 mzf joined
06:23 tristanp joined
06:24 <cocreature> Sh4rPEYE: if it’s fixed length something like a Vector is usually the best solution. you can use something like https://hackage.haskell.org/package/vector-sized-0.5.1.0/docs/Data-Vector-Sized.html to get a fixed size
06:25 <EvanR> did not know about this one
06:27 tomboy64 joined
06:30 leat joined
06:31 takle joined
06:31 qwertydvorak joined
06:31 Icarus joined
06:31 <Icarus> Hello
06:33 albertus1 joined
06:33 <c_wraith> hey Icarus
06:34 <Icarus> What's everyone up to?
06:34 sternmull joined
06:35 Scip joined
06:37 takle joined
06:37 louispan joined
06:37 <c_wraith> apparently no one is up to anything of interest... Or are so engrossed they didn't notice the question. :)
06:37 halogenandtoast joined
06:38 <EvanR> differential equations
06:41 Bardusbasium joined
06:44 osa1_ joined
06:45 castlelore joined
06:46 <fresheyeball> whats the type operator that makes tuples?
06:47 <pavonia> It's a function, not an operator, I think
06:47 connrs joined
06:47 govg joined
06:49 dni joined
06:53 juanpaucar joined
06:53 caumeslasal joined
06:54 vaibhavsagar joined
06:55 patbecich joined
06:56 shangxiao joined
06:57 <nshepperd> (,) :: * -> * -> *
06:57 <nshepperd> it's a mixfix operator, i guess
06:57 Reshi joined
06:57 <vaibhavsagar> Friends! When did do-notation come to Haskell?
06:58 jelleke joined
06:58 grizwako joined
07:03 <cocreature> nshepperd: now we only need a way to define our own mixfix operators :)
07:05 jbiesnecker joined
07:12 ninedotnine joined
07:15 <ReinH> cocreature: I wish.
07:16 henriksod joined
07:16 flatmap13 joined
07:17 connrs joined
07:17 joco42 joined
07:19 <cocreature> ReinH: tbh I’m not sure I do. but maybe that’s just because Coq has a particularly messy way to define custom notations.
07:19 <ReinH> I like Agda's
07:20 Xanather joined
07:20 primal joined
07:21 <EvanR> idris
07:21 path[l] joined
07:21 Bardusbasium joined
07:21 <cocreature> I thought idris didn’t let you define mixfix operators?
07:21 <cocreature> maybe I’m confusing things here
07:22 <EvanR> it lets you introduce syntax sugar
07:22 filterfish joined
07:22 <EvanR> which could expand to regular functions or operators
07:22 <EvanR> though agda seems to have that too
07:22 <ReinH> It's a bit annoying though
07:22 jgt joined
07:23 <ReinH> syntax in Agda allows for binders
07:23 <ReinH> otherwise you can just use mixfix
07:24 osa1 joined
07:26 augur joined
07:27 dni joined
07:28 Icewing joined
07:28 dni_ joined
07:32 Kreest__ joined
07:32 Johan_L joined
07:40 Argue joined
07:41 wroathe joined
07:41 echoreply joined
07:41 osa1 joined
07:41 osa1 joined
07:41 thunderrd__ joined
07:42 luis30 joined
07:43 eHammarstrom joined
07:44 c137 joined
07:44 <LiaoTao> Hmm
07:45 <LiaoTao> GHC is eating all my memory when compiling store-0.3.1
07:45 <LiaoTao> Had a nice episode of swap thrashing just now
07:47 c137 joined
07:47 Elish joined
07:49 <ongy> how much memory do you have?
07:49 <ongy> and which GHC version?
07:50 <LiaoTao> 3G available with 1G of swap
07:51 <LiaoTao> I tried it again with everything else closed and it worked
07:51 <LiaoTao> Maybe there's a kernel bug in the swap management
07:51 <LiaoTao> Anyway!
07:51 <LiaoTao> Also, GHC 8.0.2
07:52 slomo joined
07:52 slomo joined
07:54 dni joined
07:54 wonko7 joined
07:55 falcon10 joined
07:55 dni joined
07:55 falcon10 left
07:56 jgertm joined
07:56 osa1 joined
07:56 osa1 joined
07:56 <ongy> shouldn't eat that much memory either way, I can compile it on my laptop with 4G total (usually ~3 Available) and no swap
07:56 <ongy> will runhaskell get a cabal new-build version where it can use the store for package lookup?
07:57 <LiaoTao> I wasn't able to check how much memory it was using at the time since the system became nigh unusable
07:57 <LiaoTao> Load shot up to ~18 though
07:57 juanpaucar joined
07:57 codesoup joined
07:58 <pacak> LiaoTao: compiling with -j1 might help
07:58 <LiaoTao> pacak: Noted :)
07:59 osa1 joined
07:59 osa1 joined
07:59 <* hackage> aeson-pretty 0.8.3 - JSON pretty-printing library and command-line tool. https://hackage.haskell.org/package/aeson-pretty-0.8.3 (FalkoPeters)
07:59 <pacak> used 1.6Gb on my machine
07:59 <pacak> LiaoTao: OS?
08:00 <LiaoTao> Linux 4.11.3
08:00 <LiaoTao> Gentoo
08:01 <pacak> 32bit, 64bit?
08:01 _main_ joined
08:01 <LiaoTao> 64 :)
08:01 <LiaoTao> Linux ### 4.11.3-gentoo #2 SMP Sat May 27 21:51:48 CST 2017 x86_64 Intel(R) Core(TM) i3-4030U CPU @ 1.90GHz GenuineIntel GNU/Linux
08:01 <pacak> $(reifyManyWithoutInstances ''Store [''Info] (const True) >>= mapM (\name -> return (deriveGenericInstance [] (ConT name))))
08:01 <pacak> ^ that's probably why.
08:02 _main_ joined
08:02 <LiaoTao> Templates eating memory?
08:02 <pacak> Generics
08:02 ilyaigpetrov joined
08:02 <LiaoTao> Right
08:03 <* hackage> aeson-pretty 0.8.4 - JSON pretty-printing library and command-line tool. https://hackage.haskell.org/package/aeson-pretty-0.8.4 (FalkoPeters)
08:05 __main__ joined
08:05 dni joined
08:06 robotroll joined
08:06 <pacak> So they basically look for ALL THE THINGS without store instances and derive instances using generics.
08:06 ericdwhite joined
08:07 <LiaoTao> pacak: That's one way to do it :D
08:07 <pacak> That seems like all 63 variants of tuple for example.
08:08 <pacak> LiaoTao: So no, it's not ghc or linux kernel fault. Store is written by idiots.
08:08 Croniamental joined
08:08 tomboy64 joined
08:10 <LiaoTao> pacak: The kernel swap bug was only mentioned tangentially
08:11 <LiaoTao> Feels like the system shouldn't explode just because it used slightly more memory than was available outside of swap
08:11 <LiaoTao> But yeah, their approach seems a bit heavy-handed
08:12 <pacak> There's not much kernel can do - ghc does GC and thus touching all the things
08:12 acidjnk22 joined
08:13 <LiaoTao> It probably qualifies as a complex interaction between memory management systems then :)
08:13 louispan joined
08:15 Cerontir joined
08:17 zzbo joined
08:17 zzbo left
08:22 Itkovian joined
08:24 Bin4ry joined
08:26 primal_ joined
08:29 Sose joined
08:30 mmn80 joined
08:30 solex joined
08:31 fendor joined
08:33 FreeBirdLjj joined
08:36 primal joined
08:37 <Lokathor> is it good or bad, would you say, that haddock doesn't point out when a type is a data or when a type is a newtype?
08:39 rcschm joined
08:41 <pacak> Probably bad - they are a bit different.
08:42 lep-delete joined
08:43 kamog joined
08:44 toby1851 joined
08:45 thc202 joined
08:46 dennisvennink joined
08:47 <Lokathor> hmm
08:47 <Lokathor> on an unrelated subject, does anyone know if openGL does vsync automatically?
08:48 <Lokathor> and/or if GLFW-b does vsync automatically?
08:48 <cocreature> haddock only does that if you don’t export the constructor iirc
08:48 <cocreature> and that is pretty reasonable imho
08:48 tsahyt joined
08:48 <cocreature> for an abstract type, the user shouldn’t have to care if it’s data or newtype
08:48 <Lokathor> cocreature, good detail to know
08:49 <cocreature> e.g. https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-Monoid.html#t:Sum shows that it’s a newtype
08:50 tsahyt joined
08:51 <Lokathor> i only ask about vsync because a quick use of the timer seems to show my frames taking almost exactly 16ms per frame
08:51 <Lokathor> which is suspiciously close to 60fps and such
08:54 ziocroc joined
08:56 <LiaoTao> Lokathor: vsync is highly dependent on your environment
08:57 <Lokathor> LiaoTao, well I'm guessing that somehow I'm having it applied to my program, because it goes from <1ms per frame when not rendering to almost exactly 16ms per frame when rendering.
08:57 <LiaoTao> i.e. compositors/drivers/aliens can force it
08:57 <LiaoTao> compositors/drivers/aliens can also break it
08:58 <Lokathor> yeah it doesn't work for a lot of video play stuff on this computer/GPU/monitor somehow
08:58 <Lokathor> tearing all the time
09:01 juanpaucar joined
09:03 <Lokathor> neato
09:03 halogenandtoast joined
09:03 <Lokathor> pull request just went though
09:03 <Lokathor> you folks will all know a little more about what's going on with GLFW-b in the next release
09:03 erikd joined
09:04 heurist` joined
09:06 ErinvanderVeen joined
09:06 zariuq joined
09:07 RayNbow` joined
09:10 Yuras joined
09:11 augur joined
09:13 merijn joined
09:13 kaeru1 joined
09:15 louispan joined
09:16 primal_ joined
09:18 joco42 joined
09:21 meba joined
09:23 whaletechno joined
09:23 jgt joined
09:24 halogenandtoast joined
09:24 <halogenandtoast> If I'm using stack with docker enable: true, what the best way to get a postgres instance for it
09:25 <halogenandtoast> I was trying with docker-compose but I don't see how to specify the "image" stack creates
09:26 primal joined
09:26 filterfish joined
09:27 dennisvennink joined
09:32 bvad joined
09:33 gawen joined
09:34 catsup joined
09:36 catsup joined
09:38 Realmkeeper joined
09:40 dejanr joined
09:40 <Philonous> halogenandtoast, you want stack image container, it creates a container from the built executable
09:41 <Philonous> docker enable just means it builds in a container, it doesn't create one from the result
09:41 MJ joined
09:41 wroathe joined
09:42 <halogenandtoast> Philonous: do you happen to have an example of the commands I should run?
09:42 <Philonous> Probably you want both, though, because if you build on your own system the library paths might not match
09:42 aplund_ joined
09:43 <cocreature> halogenandtoast: "stack image container" will give you a docker container that contains the executables in your project
09:43 <Philonous> halogenandtoast, Sure, first you want to add this to your stack.yaml: https://gist.github.com/Philonous/5209e2670cbca35d454ba29fe770b218
09:43 <Philonous> Then you can run stack image container to build the container
09:45 robotroll joined
09:45 <halogenandtoast> Alright I'll give it a try thanks Philonous / cocreature
09:46 danvet joined
09:49 govg joined
09:52 halogena1dtoast joined
09:53 <halogenandtoast> it may or may not have worked, still waiting on building I guess
09:53 kritzcreek joined
09:54 Dookie12 joined
09:55 bendo joined
09:55 zariuq joined
10:00 Bassetts joined
10:02 Realmkeeper joined
10:03 IchorRealmkeeper joined
10:03 <ph88^> i'm trying to suppress an exception with this code dataPart <- EXR.catch (f newSrc) (\_ -> return []) however the exception need a type signature where can i put that ?
10:04 FreeBirdLjj joined
10:04 cretiq joined
10:05 juanpaucar joined
10:06 Johan_L joined
10:08 xnyhps joined
10:09 <* hackage> nonce 1.0.4 - Generate cryptographic nonces. https://hackage.haskell.org/package/nonce-1.0.4 (ErikDeCastroLopo)
10:09 netheranthem joined
10:10 <* hackage> superbuffer 0.3.1.1 - Efficiently build a bytestring from smaller chunks https://hackage.haskell.org/package/superbuffer-0.3.1.1 (AlexanderThiemann)
10:14 silver joined
10:15 mfukar joined
10:16 Bardusbasium joined
10:16 mfukar joined
10:18 t7 joined
10:21 govg joined
10:21 grayjoc joined
10:22 tsmish joined
10:23 <cocreature> ph88^: enable ScopedTypeVariables and use \(e :: ExceptionType) -> return []
10:23 zuck05 joined
10:26 fredmorcos joined
10:26 vydd joined
10:26 Bardusbasium_ joined
10:27 dcoutts_ joined
10:28 Koterpillar joined
10:28 augur_ joined
10:30 systadmin joined
10:32 Bardusbasium joined
10:33 dcoutts joined
10:33 dcoutts joined
10:33 <ph88^> thx
10:34 louispan joined
10:35 <ph88^> first <- A.takeWhile $ \c -> c /= '=' && c /= '\NUL' this gives me an error of Char not matching Word8 (parsing bytestrings), why does overloadedstrings not handle this? which function do i use best here?
10:37 bennofs1 joined
10:38 ErinvanderVeen joined
10:38 twomix joined
10:38 marr joined
10:38 <pacak> ph88^: There are two modules - Data.Attoparsec and Data.Attoparsec.Char8
10:39 <ph88^> i use Data.Attoparsec.ByteString.Lazy
10:39 <pacak> ph88^: Try picking Char8 version
10:40 <ph88^> i use that one too
10:40 <ph88^> ok i will try
10:40 <ph88^> ah ye that type check ... but i loose lazyness :(
10:41 <pacak> You don't need lazyness
10:41 <ph88^> oki ^^
10:42 fotonzade joined
10:43 thedoomguy joined
10:44 hvr joined
10:44 hvr joined
10:46 epsilonhalbe joined
10:46 yellowj joined
10:47 ctag_ joined
10:53 ErinvanderVeen joined
10:55 simukis joined
10:57 halogenandtoast joined
10:58 echoreply joined
11:00 cpennington joined
11:00 halogenandtoast joined
11:00 <halogenandtoast> Are there any haskell video series?
11:00 <ph88^> hi halogenandtoast
11:01 <halogenandtoast> hey ph88^
11:02 Snircle joined
11:02 <ph88^> https://www.youtube.com/results?search_query=haskell+tutorial ??
11:03 <ph88^> anyone know how i could parse this file? https://bpaste.net/show/3eeee12d6927 the problem is that i don't have a boundary between header and data
11:03 Sampuka joined
11:04 augur joined
11:04 felixsch_ joined
11:04 <halogenandtoast> ph88^: I was looking for something a little less rudimentary. Like actually building a series or real applications.
11:05 <halogenandtoast> If one doesn't exist, perhaps I'll try to make something myself.
11:05 <ph88^> there are some tutorials about some libraries
11:05 <ph88^> maybe yesod
11:05 juanpaucar joined
11:07 jix joined
11:07 <halogenandtoast> ph88^: Can you use something like parsec and on failure to parse, parse it as data?
11:07 <pacak> ph88^: What exactly is it? What is header and what is data?
11:08 <pacak> halogenandtoast: Nobody makes real applications in Haskell :)
11:08 <ph88^> pacak, data starts at second \00 on line 22
11:08 louispan joined
11:08 <ph88^> halogenandtoast, the header parser will happily parse the data as well :(
11:09 <ph88^> maybe i should just check if the last header starts with "REMARKS" ?
11:09 <pacak> ph88^: What format is that? Is the header fixed width?
11:10 <halogenandtoast> pacak: I tend to make web apps, would love more examples of web apps in haskell (twitter clone, todo list, reddit clone, etc.)
11:10 <halogenandtoast> Things I'd normally write in rails.
11:10 felixsch1 joined
11:10 <ph88^> don't know the official format .. just have this file, headers are not fixed width ... the format is similar to http i think
11:10 <halogenandtoast> I wonder if a web series making those types of apps would be well received.
11:10 <ph88^> halogenandtoast, https://github.com/shapr/sporkle
11:11 <halogenandtoast> ph88^: in http \n\n seperates headers and the body
11:11 <ph88^> yeah well i don't have such a separator :P
11:11 mstruebing joined
11:11 teggi joined
11:11 <halogenandtoast> ph88^: The file has to have some defined format, or it's not a format :p
11:12 <ph88^> :D
11:12 <halogenandtoast> Otherwise, garbage in, garbage out
11:13 <pacak> ph88^: Щ O_o
11:13 <pacak>
11:13 myme joined
11:13 <halogenandtoast> I did not realize ☭ was in UTF8
11:14 <pacak> > let (☭) = (+) in 1 ☭ 2
11:14 <lambdabot> 3
11:15 <halogenandtoast> I don't understand that line either
11:15 <pacak> > let (━☆.*・。) = (+) in 2 ━☆.*・。 1
11:15 <lambdabot> 3
11:15 <halogenandtoast> How does it get 3?
11:15 <pacak> halogenandtoast: That's what you get when you apply ☭ to 1 and 2.
11:15 <halogenandtoast> oh
11:15 <halogenandtoast> herp derp
11:16 <pacak> And (☭) is (+) case
11:16 <halogenandtoast> right
11:16 <pacak> Ghc is really flexible to what operator names you can use.
11:16 <pacak> Just don't use them.
11:16 <halogenandtoast> right
11:17 <halogenandtoast> let ((╯°□°)╯︵ ┻━┻) = (+) in 1 (╯°□°)╯︵ ┻━┻ 2
11:17 <halogenandtoast> > let ((╯°□°)╯︵ ┻━┻) = (+) in 1 (╯°□°)╯︵ ┻━┻ 2
11:17 <lambdabot> <hint>:1:11: error: lexical error at character '\65289'
11:17 <halogenandtoast> (╯°□°)╯︵ ┻━┻
11:18 <halogenandtoast> guess the name can't have ) in it
11:18 <halogenandtoast> > let (ಥ,_」ಥ) = (+) in 1 ಥ,_」ಥ 2
11:18 <lambdabot> <hint>:1:9: error: lexical error at character '\65379'
11:18 <halogenandtoast> alright enough of that.
11:19 joco42 joined
11:19 renzhi joined
11:21 primal_ joined
11:22 spinus joined
11:22 Gurkenglas joined
11:22 meba joined
11:22 PotatoCommando joined
11:23 grayjoc joined
11:23 <pacak> There are limitations. You can't use letters in operators.
11:23 wonko7 joined
11:24 <michi7x7> > let (¬‿¬) = (flip const) in 1 ¬‿¬ 2
11:24 <lambdabot> 2
11:24 jgt joined
11:25 felixsch_ joined
11:25 <ph88^> halogenandtoast, http://www.haskellcast.com/
11:26 primal joined
11:26 <halogenandtoast> ph88^: That's just a podcast though
11:26 <halogenandtoast> neat though
11:27 <ph88^> halogenandtoast, https://www.youtube.com/channel/UCQMkHY8U6B9tefTQdPkpY7A
11:29 <halogenandtoast> ph88^: yeah I came across that one, seems like it's the closest to what I've wanted.
11:29 <ph88^> so how could i check if i'm parsing that "REMARKS" part ?
11:30 Cerise joined
11:30 Cerise joined
11:30 <ph88^> this is how my parsing function looks like now https://bpaste.net/show/46d04e9ed944
11:30 Johan_L joined
11:32 cyborg-one joined
11:34 Denthir joined
11:35 <halogenandtoast> ph88^: is the | significant at all
11:35 <ph88^> which | ?
11:36 <halogenandtoast> towards the end of remarks
11:36 <halogenandtoast> In your example data.
11:37 <ph88^> it's just part of the data
11:37 <ph88^> it's binary
11:38 <Gurkenglas> ph88^, http://hackage.haskell.org/package/attoparsec-0.13.1.0/docs/Data-Attoparsec-ByteString-Char8.html#v:try says try is superfluous
11:38 <halogenandtoast> ph88^: is the start of data and # of data points significant
11:39 <ph88^> halogenandtoast, don't think so
11:39 <Gurkenglas> ph88^, hackage.haskell.org/package/attoparsec-0.13.1.0/docs/Data-Attoparsec-ByteString-Char8.html#v:manyTill looks like it can condense lines 8-10
11:39 <ph88^> Gurkenglas, my header parser will succeed on parsing the data too :(
11:39 <halogenandtoast> I wonder if the remarks is actually empty and that strea is just data.
11:40 <halogenandtoast> *stream
11:40 <Gurkenglas> ph88^, try can be removed anyway, it just says "try p = p"
11:40 <ph88^> remarks are a few empty lines
11:41 govg joined
11:41 <ph88^> remarks ends with a null byte, after the first null byte the data starts immediately
11:42 wroathe joined
11:43 <Gurkenglas> ph88^, wouldn't sepBy in line 3 remove the \NULs?
11:43 dihuteno joined
11:44 <ph88^> yes the NULs that are used for separating the headers
11:44 <ph88^> don't think it consumes a final NUL
11:44 biglama joined
11:45 <Gurkenglas> Then perhaps consider using many on manyTill in order to consume all the \NULs in line 3
11:46 Bassetts joined
11:46 et09 joined
11:46 <et09> what's a practical example of why someone would use list monad
11:47 <c_wraith> et09: https://blog.jle.im/entry/unique-sample-drawing-searches-with-list-and-statet
11:48 <c_wraith> et09: that's an example of stateful backtracking search
11:48 <c_wraith> et09: obviously it uses more pieces than just [], but it does require it.
11:49 <et09> oof i gotta study StateT
11:49 PotatoCommando joined
11:51 RegEchse joined
11:51 <et09> State/StateT that is
11:53 <* hackage> universum 0.4.3 - Custom prelude used in Serokell https://hackage.haskell.org/package/universum-0.4.3 (shersh)
11:54 cinimod joined
11:55 noraesae38 joined
11:57 <et09> oh wow. so you could probably use this for something like DFS or A* right
11:57 gillesmajor joined
11:58 <c_wraith> It will always be a DFS ordering.
11:59 <Gurkenglas> See SearchT.
11:59 <et09> woow. this language
12:02 dennisvennink joined
12:03 <vaibhavsagar> et09: list comprehensions
12:04 <et09> ah.. i didn't realize those were monadic
12:07 oisdk joined
12:08 Velizar joined
12:08 Velizar joined
12:09 Cerise joined
12:09 Cerise joined
12:09 juanpaucar joined
12:09 jbiesnecker joined
12:13 Zoddo joined
12:14 cgfbee joined
12:15 <* hackage> fltkhs 0.5.2.0 - FLTK bindings https://hackage.haskell.org/package/fltkhs-0.5.2.0 (deech)
12:17 leat joined
12:17 yellowj joined
12:22 Bassetts joined
12:22 <Eduard_Munteanu> et09, actually you can use comprehension syntax for all monads now
12:23 zariuq joined
12:28 ErinvanderVeen joined
12:29 jbiesnecker joined
12:33 fotonzade joined
12:33 bennofs1 joined
12:35 <osfameron> do you have to enable that?
12:35 halogena1dtoast joined
12:36 <osfameron> and does the syntax look good for monads other than list?
12:36 <lyxia> yes MonadComprehensions https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#monad-comprehensions
12:36 oisdk joined
12:36 tennix joined
12:37 <osfameron> the example in that for Maybe monad isn't especially compelling, but presumably it's nice in other cases?
12:38 tennix_ joined
12:38 <lyxia> ah, I don't know. I find do notation just fine.
12:39 <c_wraith> osfameron: it makes stringing together several functions that all return Maybe values a lot more pleasant.
12:40 Ultifest2 joined
12:42 augur joined
12:46 FreeBirdLjj joined
12:46 dominik_ joined
12:47 gillesmajor joined
12:48 <dominik_> hi, after a while I've been trying to compile a haskell snippet again (rather than interpreting it interactively in ghci). However, when running `ghc Foo.hs`, all that is created is an .o file, but no executable
12:48 <dominik_> anyone knows why this is?
12:48 <dominik_> am I maybe missing the linker?
12:50 govg joined
12:51 <liste> dominik_: does your program have a main function?
12:51 <dominik_> liste: yes
12:51 mnoonan joined
12:51 <dominik_> basically it is organized like this: I have a Foo.hs and a Foo/ folder that includes a couple more haskell modules
12:51 tsmish joined
12:51 <dominik_> and Foo.hs contains the main :: IO () function
12:51 <ongy> do you have any compile errors?
12:51 <dominik_> nope
12:52 <liste> is there a .hi file?
12:52 <dominik_> I just don't get any executable, all I get is a Foo.o and a Foo.hi
12:52 <dominik_> liste: yes
12:52 dejanr joined
12:53 <dominik_> maybe I'm indeed missing the system linker...
12:53 <liste> "If your program contains multiple modules, then you only need to tell GHC the name of the source file containing the Main module, and GHC will examine the import declarations to find the other modules that make up the program and find their source files." -- https://downloads.haskell.org/~ghc/7.6.3/docs/html/users_guide/using-ghc.html#idp34450864
12:53 <liste> --https://downloads.haskell.org/~ghc/8.0.1/docs/html/users_guide/using.html#getting-started-compiling-programs
12:55 <liste> so Foo.hs has `main`, and imports other files in Foo/ ?
12:55 <dominik_> liste: yes, exactly
12:55 Bardusbasium joined
12:55 krok_ joined
12:55 gillesmajor joined
12:55 darlan joined
12:56 <dominik_> and the compilation then tells me: [2 of 2] Compiling Foo ( Foo.hs, Foo.o )
12:56 <dominik_> without any errors
12:56 <dominik_> but it is not linking anything
12:56 <dominik_> does anyone know the package for the system linker/loader on Debian GNU/Linux, since I might be missing that one...
12:57 Foritus joined
12:58 <ongy> dominik_: usually gcc but I'd bet the ghc package depends on it
12:58 <ongy> just check if 'ld' exists
12:58 bvad joined
12:59 <hexagoxel> dominik_: do you say "module Foo where .." in your Foo.hs?
12:59 <dominik_> hmm, no, binutils is installed.
12:59 chidy joined
12:59 krok__ joined
12:59 <hanna> I'm still struggling to interface between Haskell and C++, and once again the issue is figuring out how to marshal a std::string into a haskell string. Is there any solution that doesn't involve making assumptions about the string's length?
13:00 <glguy> dominik_: You need a "Main" module
13:00 <dominik_> hexagoxel: yes
13:00 <dominik_> glguy: ohh, I don't have that one
13:00 <hexagoxel> dominik_: then what glguy says.
13:00 <glguy> dominik_: If Foo.hs has main defined, then change the top to "module Main where"
13:00 <dominik_> ohh, ok.
13:00 <dominik_> thanks!
13:02 richi238 joined
13:02 <cocreature> hanna: I think I already told you my approach but I forgot why it doesn’t work for you so here it is again: 1. pass a char** to the c++ code. 2. make the c++ code strdup the string and write it to that pointer. 3. marshal the string on the Haskell side. 4. free the string from the Haskell code
13:03 <hanna> cocreature: it's in my question: “Is there any solution that doesn't involve making assumptions about the string's length?”
13:03 <cocreature> hanna: where do you see any assumption about the length of the string here?
13:03 blym joined
13:03 <hanna> wait; you want me to allocate bytes in haskell and have the C++ code copy bytes to it, right?
13:03 <hanna> copy the string to it*
13:03 <cocreature> no
13:03 <hanna> huh
13:04 <cocreature> strdup does the allocation
13:04 <hanna> I don't understand
13:04 <hanna> strdup just copies from one char* to another char*?
13:04 <hexagoxel> cocreature: 3. does seem to involve a length, somehow.
13:05 <dominik_> ok, interesting, after renaming Foo.hs to Main.hs and changing it to "module Main where", ghc links the program
13:05 <cocreature> hanna: no it calls malloc to allocate space and then copies the string there
13:05 <dominik_> however, I'm wondering, is there no way to keep my main Module named Foo.hs?
13:05 <cocreature> hexagoxel: right, but you don’t need to assume some maximum length which I think is what hanna is asking for
13:06 <hanna> Oh, okay. So `free` must be called from Haskell afterwards?
13:06 <hanna> Makes sense, and seems like it solves my problem
13:06 <c_wraith> dominik_: not according to the haskell standard, but ghc provides flags to change it.
13:06 <cocreature> hanna: that’s step 4 :)
13:06 <glguy> dominik_: Yes, you can name your main module Foo.hs
13:06 <hexagoxel> cocreature: ah, true, i read the question differently.
13:06 <glguy> The filename can be Foo.hs, the module name needs to be Main
13:06 nilof joined
13:08 <osfameron> c_wraith: ah ok. I guess it's nice to have the choice
13:09 augur joined
13:09 <dominik_> glguy, c_wraith: ok, thanks! Let me try this.
13:11 <* hackage> fltkhs 0.5.2.1 - FLTK bindings https://hackage.haskell.org/package/fltkhs-0.5.2.1 (deech)
13:12 <hanna> cocreature: thanks, this works :)
13:12 <hanna> I must have misunderstood your approach the last time
13:13 <dominik_> hmm, interestingly compiling my main module Foo.hs with "module Main where" with `ghc Foo.hs` gives me the following linking error:
13:13 <cocreature> hanna: note that if you strdup .data() instead of .c_str() the string might not be null terminated so you need to return the length to your Haskell code and use that for marshalling
13:13 juanpaucar joined
13:14 <dominik_> /usr/bin/ld: cannot open output file Foo: Is a directory
13:14 <dominik_> collect2: error: ld returned 1 exit status
13:14 <glguy> If the string isn't null-terminated, strdup would be illadvised
13:14 <dominik_> `gcc' failed in phase `Linker'. (Exit code: 1)
13:14 <cocreature> glguy: oh good point :)
13:14 <glguy> dominik_: GHC is trying to write the executable Foo
13:14 <cocreature> I guess you can always manually malloc + memcpy in that case
13:14 <glguy> dominik_: So you shouldn't have a directory named Foo
13:14 <dominik_> hehe :D
13:15 <dominik_> ok, good point, thanks :->
13:15 <* hackage> jose 0.6.0.2 - Javascript Object Signing and Encryption and JSON Web Token library https://hackage.haskell.org/package/jose-0.6.0.2 (frasertweedale)
13:17 <* hackage> jose 0.5.0.4 - Javascript Object Signing and Encryption and JSON Web Token library https://hackage.haskell.org/package/jose-0.5.0.4 (frasertweedale)
13:18 alx741_ joined
13:19 <hanna> cocreature: https://github.com/haasn/hsbooru/commit/16cbf19b2a6fbbe87b9b16d815cdb43c266bf071 did it like this, I suppose that's fair?
13:19 <hanna> seems to work
13:19 <* hackage> jose 0.4.0.4 - Javascript Object Signing and Encryption and JSON Web Token library https://hackage.haskell.org/package/jose-0.4.0.4 (frasertweedale)
13:19 <cocreature> hackage: yeah looks fine
13:20 joco42 joined
13:20 vaibhavsagar joined
13:21 gillesmajor joined
13:23 meba joined
13:24 Denthir joined
13:25 jgt joined
13:25 thunderrd joined
13:25 Bardusbasium joined
13:29 Bassetts joined
13:29 jiegec joined
13:29 zuck05 joined
13:30 Johan_L joined
13:32 JuanDaugherty joined
13:33 im0nde joined
13:34 <Gurkenglas> A guy on stackoverflow is asking for how Ord (a, b) is implemented. Good question. I find a deriving clause at best. Is there a way to look up further desugared source online?
13:34 <c_wraith> you can just pass -ddump-deriv to ghc
13:35 <c_wraith> but the short answer is "lexicographic"
13:35 <c_wraith> whenever you derive Ord on a product, it uses lexicographic order in the order the fields are written in the constructor.
13:35 <Gurkenglas> The question isn't good because the behavior is complicated, but because one has to ask the question.
13:37 <Gurkenglas> I'd have trouble going from "pass -ddump-deriv to ghc" to seeing the implementation of that source. It also seems dependent on system/installation.
13:38 <cocreature> so is your point that using deriving makes it harder to find the source? I don’t think anybody is going to argue with that
13:39 <Gurkenglas> The ideal solution would be to add to that newfangled haddock links thing the feature that clicking on a deriving clause shows you the resulting code
13:40 <c_wraith> the thing is, the code never really exists
13:40 cpennington joined
13:41 sdothum joined
13:42 <Gurkenglas> You mean, -ddump-deriv's output isn't uniquely determined by the haddock page that shows the deriving clause?
13:43 <[exa]> Is there any simple example of StateM usage for doing some CPU-intensive computation?
13:43 <[exa]> (kindof looking for ideas)
13:44 wroathe joined
13:44 <Gurkenglas> You mean StateT? something like "execState (replicateM_ (10^9) $ modify (+1)) 0"?
13:44 <Velizar> Is there a shorter way to write `map fst $ filter (f . snd) myTupleList`
13:45 <Gurkenglas> Depends on where the tuples come from
13:46 <Velizar> I could also shape myTupleList in a different way, e.g. [fst', snd'] instead of (fst', snd')
13:46 <Velizar> It comes from this expression, notice the part before | `[((i, j), cell) | (i, row) <- zip [1..] worldList, (j, cell) <- zip [1..] row]`
13:47 <[exa]> Gurkenglas: not exactly, I'm more like searching for some useful/simple/standard-ish algorithm that would be a good case for being implemented using StateM
13:47 <Velizar> (by 'before', I mean 'to the left of')
13:48 <Gurkenglas> [(i, j) | (i, row) <- zip [1..] worldList, (j, cell) <- zip [1..] row, f cell]
13:48 tsmish joined
13:48 bendo joined
13:49 <Velizar> Ahh. I forgot about that :P thanks
13:49 epsilonhalbe joined
13:49 mizu_no_oto joined
13:50 <Velizar> Ahh. I forgot about that :P thanks
13:50 <Velizar> oops
13:50 gmhafiz joined
13:51 dejanr joined
13:57 target_i joined
13:59 daniel-s joined
14:01 cinimod joined
14:04 thedoomguy joined
14:04 leat joined
14:05 MJ joined
14:06 mohsen_ joined
14:08 mjs2600 joined
14:08 grizwako_ joined
14:10 coltfred joined
14:11 vektorweg1 joined
14:12 ErinvanderVeen joined
14:12 codesoup joined
14:15 zolamusic joined
14:16 ericdwhite joined
14:16 sepp2k joined
14:16 simendsjo joined
14:17 juanpaucar joined
14:18 tromp joined
14:18 halogenandtoast joined
14:20 Welkin joined
14:26 Zoddo joined
14:27 Gurkenglas joined
14:27 ErinvanderVeen joined
14:29 mohsen_ joined
14:29 JoshS joined
14:33 Xanather joined
14:34 <* hackage> fltkhs 0.5.2.2 - FLTK bindings https://hackage.haskell.org/package/fltkhs-0.5.2.2 (deech)
14:40 mizu_no_oto joined
14:40 dejanr joined
14:42 Khisanth joined
14:42 descender joined
14:43 bendo joined
14:43 yellowj joined
14:43 <hanna> oops: changing ghc-options and re-running `cabal build` does not implicitly `cabal clean`
14:44 anemecek joined
14:44 dddddd joined
14:45 hnrk joined
14:45 oisdk joined
14:46 dni joined
14:47 wildlander joined
14:48 felixsch1 joined
14:51 osa1 joined
14:51 osa1 joined
14:52 coot____ joined
14:52 ziyourenxiang joined
14:53 felixsch_ joined
14:54 Bin4ry joined
14:56 Rakkattakka joined
14:57 Big_G joined
15:01 saussure joined
15:01 grayjoc joined
15:01 ragepandemic joined
15:02 felixsch1 joined
15:02 toby1851 joined
15:03 dejanr joined
15:05 felixsch_ joined
15:07 kirillow joined
15:10 felixsch1 joined
15:13 HallaSurvivor joined
15:13 prkc joined
15:17 wroathe joined
15:17 Dookie12 joined
15:19 tzh joined
15:19 ericsagnes joined
15:21 jbiesnecker joined
15:21 joco42 joined
15:22 juanpaucar joined
15:22 <* hackage> jenkinsPlugins2nix 0.2.0.0 - Generate nix for Jenkins plugins. https://hackage.haskell.org/package/jenkinsPlugins2nix-0.2.0.0 (MateuszKowalczyk)
15:24 meba joined
15:25 jgt joined
15:26 <* hackage> jenkinsPlugins2nix 0.2.0.1 - Generate nix for Jenkins plugins. https://hackage.haskell.org/package/jenkinsPlugins2nix-0.2.0.1 (MateuszKowalczyk)
15:28 FreeBirdLjj joined
15:30 SpinTensor joined
15:32 doyougnu joined
15:32 oisdk joined
15:33 jmcarthur joined
15:34 portnov joined
15:35 <portnov> hi all
15:36 <anemecek> when i run stack install i get a message that says " No module named "Main". The 'main-is' source file should usually have a header indicating that it's a 'Main' module."
15:36 <anemecek> however everything is setup correctly
15:36 <portnov> I have a type LogFormat = [LogItem]
15:36 <portnov> and an instance IsString LogFormat where...
15:36 <portnov> GHC 8 complains about overlapping instances: https://paste.in.ua/2763/
15:36 <portnov> any ideas why it thinks the first instance matches?
15:37 <* hackage> spake2 0.1.0 - Implementation of the SPAKE2 Password-Authenticated Key Exchange algorithm https://hackage.haskell.org/package/spake2-0.1.0 (jml)
15:38 <cocreature> portnov: how is LogFormat defined?
15:38 <Gurkenglas> portnov, the part before the => is ignored when deciding whether to apply an instance
15:38 <portnov> cocreature: type LogFormat = [LogItem]
15:38 <portnov> Gurkenglas: it is sad :(
15:38 <cocreature> right, then Gurkenglas already told you the problem
15:39 irco joined
15:39 <lyxia> anemecek: what is your main-is file
15:39 <anemecek> Main.hs
15:39 <Gurkenglas> cocreature, is there ever another problem?
15:39 <portnov> cocreature: is it considered as a bug or as a feature?
15:40 <cocreature> Gurkenglas: I guess not but if LogFormat was not just a type synonym for a list you wouldn’t run into this problem in the first place
15:40 <anemecek> so actually maybe i'm approaching it wrong. i'm using "haskell for mac" (the ide) and i'm trying to install this https://hackage.haskell.org/package/music-suite
15:40 <cocreature> portnov: I wouldn’t call it a feature but “it’s working as intended”
15:40 <Gurkenglas> portnov, afaik it gurantees that type inference terminates
15:41 <portnov> aha
15:41 <portnov> ok
15:41 <portnov> then what i need is probably a newtype LogFormat = LogFormat [LogItem]
15:41 <anemecek> but it's been a pain, i've spent maybe 3-4 hours dealing with the dependencies
15:41 sz0 joined
15:41 <Gurkenglas> anemecek, have you tried stack?
15:41 <anemecek> i'm using stack
15:42 <anemecek> if i understand it correctly stack uses only "stable" packages
15:42 <ph88^> Gurkenglas, i made this parser now but it looks ugly, what you think ? https://bpaste.net/show/d9936925198b
15:43 <anemecek> or like it seems like it's supposed to be a breeze with stable packages but it seems like adding externals is still a pain
15:44 <anemecek> this is the current project before i added the dependencies
15:44 <Gurkenglas> ph88^, why not lpaste? (no need to repaste now.) 3-5 look like they can be replaced by many $ flip manyTill (A.char '\NUL') headerParser, allowing you to inline headerParser's definition
15:44 <lyxia> anemecek: the error you get doesn't seem to be about dependencies though
15:44 <anemecek> https://github.com/adamnemecek/Haskell
15:44 xtreak joined
15:45 <Gurkenglas> many1, I mean
15:45 <anemecek> lyxia: it's a smaller problem in the context of a bigger problem
15:45 <anemecek> the bigger problem being me being unable to figure out how to install packages
15:45 <anemecek> so like
15:46 <anemecek> i brought it up because i don't know if this is even the problem i'm supposed to be solving
15:46 <ph88^> Gurkenglas, lpaste doesn't have timeout on my paste
15:46 inkbottle joined
15:48 WhiskyRyan joined
15:48 <Gurkenglas> Why is that bad? This channel is publically logged anyway.
15:48 <lyxia> anemecek: to add external dependencies: add them in .cabal, add them in stack.yaml
15:48 xtreak joined
15:48 <lyxia> anemecek: under extra-deps
15:48 <anemecek> i've previously done that and got stuck with the main.hs message
15:49 <anemecek> why do i need to add them both to cabal and stack
15:49 <ph88^> Gurkenglas, i don't paste for publication, just as an aid in chat
15:50 <hvr> anemecek: because stack doesn't use the solver
15:50 dan_f joined
15:50 <hvr> anemecek: so it expects you to pin down every single dependency to a specific version compatible with the inter-package version constraints
15:51 <anemecek> ok. that helps. so what should i do about the main.hs message?
15:53 latro`a joined
15:53 <hvr> anemecek: I don't use Stack, but I just tried w/ cabal, and it just worked
15:53 <hvr> (i.e. I cloned https://github.com/adamnemecek/Haskell and ran 'cabal new-build' in it)
15:54 <* hackage> hops 0.7.1 - Handy Operations on Power Series https://hackage.haskell.org/package/hops-0.7.1 (AndersClaesson)
15:54 primal_ joined
15:55 FreeBirdLjj joined
15:55 urodna joined
15:56 miklcct joined
15:56 JagaJaga joined
15:56 sherub joined
15:58 <anemecek> hvr: ok it builds with cabal
15:58 <anemecek> so what's the best way of installing that package i need now?
15:58 <anemecek> add it to the cabal file?
15:59 <anemecek> when i do cabal install music-suite
15:59 <anemecek> it can't find the package
15:59 <anemecek> its using the package list lts-6.29
15:59 <hvr> the build-deps in the .cabal file is like an "import" statement for packages
16:00 <hvr> it brings them into scope, so you can access them
16:00 <anemecek> so i specify the location using the github url?
16:00 <hvr> is the hackage version good enough?
16:01 <hvr> if so, no need to refer to github repos
16:01 <anemecek> sure
16:01 <anemecek> oh i specify the hackage url?
16:01 <hvr> nope, just 'music-site == 1.9.*' or something like that
16:02 <hvr> which ghc version do you use?
16:02 <anemecek> 7.10
16:02 <anemecek> it's the one that comes with "haskell for mac"
16:04 govg joined
16:05 <Welkin> upgrade to 8.0.2
16:05 <hvr> Welkin: if he does,he won't be able to use music-site
16:05 prkc joined
16:07 <hvr> sorry, music-suite
16:07 <anemecek> hvr: cabal: At least the following dependencies are missing:
16:07 <anemecek> music-suite ==1.9.*
16:07 <hvr> anemecek: I'm trying locally if I can get it to even build; music-suite has a rather big install-plan
16:07 <anemecek> it does
16:08 <anemecek> i was able to install other things before and they somewhat worked out but ive been banging my head against this
16:09 <anemecek> thanks so much for helping me btw
16:12 juanpaucar joined
16:13 <sherub> 21:11:03 sherub | hi there I was trying to use parsec, to parse strings like "name:curry", "curry", "name:\"Haskell curry\"" to some ADT and was wondering about a good way to do this. Can ??? averell
16:13 <sherub> ??? | anyone help me out? ??? Axman6
16:13 <sherub> ???21:13:18 sherub | I wan to use these with `and` `or` keywords ??? Bane^
16:13 <sherub> ???21:14:18 sherub | but unsure how not to make `string` parser combinator that will parse any string but will not pick up `and` `or`. ??? banseljaj
16:13 <sherub> ???21:14:40 sherub | I thought making them reserved would do the trick but that is not happening.
16:14 <anemecek> hvr: does "build-type: Simple" matter?
16:14 <sherub> hmm...Copy/paste in IRC clients is not straight forwared. apologies
16:14 <hvr> anemecek: yeah, you should set it
16:14 <hvr> anemecek: and 'simple' is usually the one you want most of the time
16:14 <anemecek> to what
16:15 <anemecek> it doesn't work with it or without it. still "at least one of the following dependencies are missing"
16:15 <anemecek> i dont understand why it's not seeing the package
16:15 <hvr> well, the problem now is trying to get 'music-suite' built
16:15 kadoban joined
16:16 dejanr joined
16:16 <hvr> and I haven't yet been able to do that locally, as I run into compile failures
16:16 rach joined
16:16 <anemecek> so the thing that makes music-suite different is the complex build plan?
16:17 oisdk joined
16:17 <hvr> mostly, yeah; 'music-suite' is actually a big framework of packages
16:17 <rach> dc
16:18 rach left
16:18 <anemecek> hvr: yeah it is. would it make a difference to include them one by one?
16:18 bennofs joined
16:19 yrdz joined
16:19 <hvr> anemecek: if you know you need only a few of those, it would increase the chance to get a working subset; right now I'm looking at why lilypond fails
16:19 <anemecek> thanks so much. maybe i should contact the author
16:20 <hvr> the last release dates back to 2015; which somewhat predates GHC 7.10.3
16:21 MJ joined
16:21 <anemecek> has much changed?
16:21 wroathe joined
16:21 <hvr> the problem is that each new major GHC version breaks a couple of packages
16:22 <hvr> and especially from GHC 7.8 -> GHC 7.10 there were big changes
16:23 yrdz joined
16:24 <anemecek> are these like source level changes?
16:24 <hvr> API level changes
16:24 <anemecek> the compiler should point these out no?
16:25 <hvr> yeah, it does so... by giving you a compile error :)
16:25 <anemecek> right so it that was the problem it should give me a compiler error no?
16:26 romank joined
16:29 sternmull joined
16:29 iqubic joined
16:29 alx741 joined
16:29 <iqubic> Hello folks.
16:29 <ongy> Hi
16:30 Bassetts joined
16:34 oisdk joined
16:36 mohsen_ joined
16:37 romank joined
16:37 <anemecek> hvr: any success?
16:39 ews joined
16:40 romank joined
16:41 <ews> Hello everyone, is there any way to configure GHCI so that it would execute `main` from the loaded file automatically? So that it would work same as runhaskell but stay in the interpreter.
16:42 <Gurkenglas> ews, https://downloads.haskell.org/~ghc/7.2.2/docs/html/users_guide/ghci-dot-files.html
16:43 Johan_L joined
16:45 tristanp joined
16:45 <Gurkenglas> Why doesn't "stack install" failing outside of a project because of missing extra-deps not recommend "stack unpack" first so "stack solver" will work?
16:46 jeirosz joined
16:47 <iqubic> Gurkenglas: I wish I knew.
16:47 <Gurkenglas> Or, stepping back: How should I get into a position to run http://hackage.haskell.org/package/SourceGraph on arbitrary projects? (found on the wiki under static analysis tools)
16:48 jeirosz joined
16:48 <* hackage> fltkhs 0.5.2.3 - FLTK bindings https://hackage.haskell.org/package/fltkhs-0.5.2.3 (deech)
16:50 WhiskyRyan joined
16:52 Bin4ry joined
16:53 dual joined
16:54 afarmer joined
16:56 toby1851 joined
16:56 Randy joined
17:00 octarin joined
17:00 flatmap13 joined
17:02 Qfwfq joined
17:02 {emptyset} joined
17:02 chalkmonster joined
17:03 et09 joined
17:04 dual joined
17:04 bollu joined
17:05 perrier-jouet joined
17:05 Qfwfq joined
17:07 prkc joined
17:07 oisdk joined
17:08 shangxiao joined
17:09 saussure joined
17:09 biglama joined
17:10 aarvar joined
17:10 <* hackage> jenkinsPlugins2nix 0.2.0.2 - Generate nix for Jenkins plugins. https://hackage.haskell.org/package/jenkinsPlugins2nix-0.2.0.2 (MateuszKowalczyk)
17:11 darlan joined
17:14 <* hackage> crjdt-haskell 0.3.0 - A Conflict-Free Replicated JSON Datatype for Haskell https://hackage.haskell.org/package/crjdt-haskell-0.3.0 (amarpotghan)
17:14 <orion> http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/ <-- "Streams are Monads, thus playing a big part in bringing functional programming to Java"
17:14 <orion> Is this an accurate statement?
17:15 conal joined
17:15 sleffy joined
17:16 <Welkin> java can never be functional
17:16 <Welkin> it doesn't have first class functions
17:16 xtreak joined
17:16 <* hackage> streaming-binary 0.1.0.0 - Streaming interface to binary. https://hackage.haskell.org/package/streaming-binary-0.1.0.0 (MathieuBoespflug)
17:16 Gurkenglas joined
17:17 <liste> Welkin: it does. they're objects, but they really do the same thing
17:17 juanpaucar joined
17:17 <liste> and it has anonymous functions now too
17:17 <liste> orion: well, there's Stream.of (unit), Stream.flatMap (bind), and they seem to satisfy the jobs
17:18 <liste> laws*
17:18 <liste> not jobs
17:18 Velizar joined
17:18 <Welkin> by unit you mean pure?
17:19 <liste> Welkin: yes
17:19 jshjsh joined
17:20 dual joined
17:20 <orion> flatMap seems to be equivalent to concatMap.
17:20 <liste> yes
17:20 <liste> which is >>= for lists
17:20 <Welkin> concatMAp is bind lol
17:20 kefin joined
17:20 <Welkin> not as general bind
17:20 thedoomguy joined
17:20 <Welkin> :t (=<<)
17:20 <lambdabot> Monad m => (a -> m b) -> m a -> m b
17:20 <Welkin> :t concatMap
17:20 <lambdabot> Foldable t => (a -> [b]) -> t a -> [b]
17:21 tromp joined
17:22 <liste> Java lacks type classes and higher kinded types, so it's impossible to generalize a Monad type class in Java, but there can be specific types that are monads
17:22 <liste> it's way less useful without the generalization though
17:22 joco42 joined
17:23 armyriad joined
17:23 <Welkin> so the closest you can get is something like Elm (which sucks)
17:25 jgt joined
17:25 <liste> you can kinda make a Monoid type class though
17:25 <liste> but it's wieldy to use, you need to pass the dictionary around
17:26 <Welkin> which you can do with any language though
17:26 <Welkin> pass around arbitrary data
17:26 <Welkin> it's just a lot of boilerplate
17:27 <liste> yes
17:31 romank joined
17:33 raynold joined
17:34 flatmap13 joined
17:35 <* hackage> concrete-haskell 0.1.0.5 - Library for the Concrete data format. https://hackage.haskell.org/package/concrete-haskell-0.1.0.5 (TomLippincott)
17:38 twomix joined
17:39 ubsan_ joined
17:40 brunooo joined
17:40 <EvanR> Welkin: monoid in C...
17:40 <EvanR> which doesnt support closures
17:40 <EvanR> dictionary of functions is like a hairshirt
17:41 <liste> just add an extra void* parameter to each function :o)
17:41 <Welkin> that's a function pointer though
17:43 <* hackage> concrete-haskell 0.1.0.6 - Library for the Concrete data format. https://hackage.haskell.org/package/concrete-haskell-0.1.0.6 (TomLippincott)
17:45 dejanr joined
17:45 Jesin joined
17:46 <ews> Hello everyone, is there any way to configure GHCI so that it would execute `main` from the loaded file automatically? So that it would work same as runhaskell but stay in the interpreter.
17:46 latro`a joined
17:46 jbiesnecker joined
17:46 <ews> I have the following code in the file IO of my program: https://pastebin.com/PxU98M1n . Is there any way I can simplify it (note that last 2 lines are read into a list of ints, whereas first line is read into an int).
17:47 <Gurkenglas> "sourcegraph: user error (The program 'ghc' version >=6.4 is required but it could not be found.)" <- How do I make stack give it access to the ghc version it wants?
17:49 <hexagoxel> ews: I would guess that the ghci thing is not directly possible. however, you can define a macro that reloads and runs main, in one command.
17:49 <hodapp> at a certain point, "can do in any language" really just means "you can use (almost) any language to implement a different language"
17:49 <Gurkenglas> ews, see the .ghci manual page I sent you above. You can define hReadLine :: Read a => Handle -> IO a as hReadLine handle = fmap read (hGetLine handle).
17:50 romank joined
17:50 takle_ joined
17:51 <Gurkenglas> hReadLn, I mean, to keep the naming Prelude establishes with readLn
17:51 <hexagoxel> Gurkenglas: when i put "main" into the dotfile, it does not work in the desired way though. am i missing something?
17:51 zero_byte joined
17:51 <Gurkenglas> Huh. I never tried it, I was just pointed at .ghci myself when I asked a similar question.
17:52 dual joined
17:52 <geekosaur> what is "the desired thing" here?
17:52 sherub joined
17:52 <hexagoxel> Gurkenglas: ah, ok.
17:52 <ews> I tried putting main into .ghci but I believe .ghci is loaded before the file we're loading
17:52 Goplat joined
17:53 <geekosaur> likely yes,
17:53 <hexagoxel> geekosaur: a behaviour resembling entering ":main\n" manually
17:53 <ews> As for my 2nd question: is there any way I could simplify this: startingStates <- (hReadList handle) acceptingStates <- (hReadList handle) ?
17:53 <hexagoxel> ews: the macro could look like :def relmain \_ -> return $ ":r\n:main"
17:54 <geekosaur> you could put that into .ghci ... but if the source file isnt loaded yet then it won't help
17:54 <hexagoxel> then you can enter ":relmain" in .ghci
17:54 <hexagoxel> s/in .ghci/in the running ghci session/
17:54 <hexagoxel> sorry
17:55 <MarcelineVQ> ews: yes, but it'd be better if your provided more context, like where handle is coming from or other relevant things
17:55 <ews> Yes but it will have the same effect as running :main
17:55 benjic joined
17:56 <ews> MarcelineVQ, handle is just a handle to a file with integer the first line, then 2 lines with integer lists and remaining lines in some given format
17:56 tomboy64 joined
17:57 gienah_ joined
17:58 govg joined
17:58 <MarcelineVQ> Ah I was too vague, what I meant was it would be better to post more complete code so that people can see what can be simplified. One or two lines can only get so pretty, but someone might know a way to not need to write the lines at all when seeing the whole picture
17:58 <Gurkenglas> ews, it's hReadLine or hReadLn, not hReadList - one definition works for both a and [a], just like read
17:58 prophile joined
17:59 <fresheyeball> is there a type level operator for tuple and either?
17:59 <fresheyeball> I feel like this code would be more clean if there was
17:59 <fresheyeball> they don't visually look related with default notation
18:00 <doyougnu> fresheyeball: like this? :k (,)
18:00 takle joined
18:00 <Welkin> can't you create your own?
18:01 <doyougnu> :k (,)
18:01 <lambdabot> * -> * -> *
18:01 <EvanR> type level tuple of types
18:01 <iqubic> :k Either
18:01 <lambdabot> * -> * -> *
18:02 <EvanR> :k 'Either
18:02 <lambdabot> error:
18:02 <lambdabot> Not in scope: data constructor ‘Either’
18:02 <lambdabot> Perhaps you meant variable ‘either’ (imported from Data.Either)
18:02 <iqubic> fresheyeball: What do you want?
18:02 <fresheyeball> I want my code to look slightly cleaner
18:02 <fresheyeball> so that its clear that (x,y) is a product
18:02 <fresheyeball> and Either x y is a sum
18:03 <fresheyeball> and they have this relation
18:03 romank joined
18:03 <fresheyeball> I know I could make my own
18:03 <iqubic> Oh, yeah.
18:03 <fresheyeball> but surely this is out there already
18:03 <doyougnu> Why is it not clear that (a,b) is a product? Are you looking for something like: a X b?
18:04 <EvanR> x :×: x
18:04 <EvanR> clean!
18:04 <doyougnu> ^^
18:04 <EvanR> and kind of confusing
18:04 <EvanR> x :+: x
18:05 <EvanR> fresheyeball: maybe you want agda, it has nice unicode everything everywhere
18:06 <fresheyeball> Yeah!
18:06 <fresheyeball> EvanR: where are those?
18:06 <fresheyeball> :x: looks like it would make this code more clear
18:06 <fresheyeball> (ironically I know)
18:07 <EvanR> i wrote ×
18:07 <EvanR> agda is a different programming language
18:07 TheFuzzball joined
18:08 <EvanR> but you can define the above in haskell
18:10 anodium joined
18:10 takle joined
18:11 HallaSurvivor joined
18:11 jbiesnecker joined
18:11 <athan> If I had a Record of data in a TVar, and a large lens to mutate it, would a `modifyTVar` transaction take a longer time than an equivalent read-only record of TVars to lens into?
18:12 <doyougnu> fresheyeball: you'll need to use the TypeOperators extension, here's a good primer: https://ocharles.org.uk/blog/posts/2014-12-08-type-operators.html
18:13 <athan> `TVar (LargeRecord SomeData) & modifyTVar fooLens` vs. `LargeRecord (TVar SomeData) & modifyTVar =<< get fooLens`
18:13 <EvanR> athan: seems like splitting hairs... but could be measured
18:13 <athan> EvanR: I feel like it would help blocking
18:13 <athan> to use the latter
18:14 <athan> like a bunch of concurrent threads that access different parts of the record at the same time
18:15 <Cale> athan: That may be the case, if that's the situation you're in.
18:16 jeirosz joined
18:16 anemecek joined
18:16 juanpaucar joined
18:17 takle joined
18:17 <Cale> This is the sort of question where you kind of just need to try it both ways if you really want to know. There's overhead associated with TVars as well, and the garbage collector performs a lot better with less mutable data around, usually these factors don't play a large role, but when balanced against something similarly small, it's hard to know off-hand.
18:18 anemecek joined
18:23 cyborg-one joined
18:24 romank joined
18:25 sedeki joined
18:25 cpup joined
18:25 jgt joined
18:26 zacts joined
18:27 mada joined
18:27 saussure joined
18:28 ph88^ joined
18:28 <Gurkenglas> "sourcegraph: user error (The program 'ghc' version >=6.4 is required but it could not be found.)" <- How do I make stack give it access to the ghc version it wants?
18:28 fragamus joined
18:29 Qfwfq joined
18:29 <ph88^> hello
18:29 <kadoban> Gurkenglas: Probably add the directory in stack's guts to your path
18:29 <kadoban> Or maybe stack exec, I dunno if that gives you a ghc on path
18:29 scinawa joined
18:30 thblt joined
18:30 coltfred joined
18:31 <geekosaur> it should
18:32 torgdor joined
18:33 ubsan_ joined
18:33 tomboy64 joined
18:33 CoderPuppy joined
18:36 romank joined
18:36 <* hackage> streaming-binary 0.2.0.0 - Streaming interface to binary. https://hackage.haskell.org/package/streaming-binary-0.2.0.0 (MathieuBoespflug)
18:37 padre_angolano joined
18:37 <ews> I would like to aply 'any isNothing' to a list of Maybies with varying underlying types (Int, [Int]). Is there any way to do it?
18:39 <Velizar> Is it possible to assign the whole thing while pattern matching? Like this: f (x, y)@xyTuple = ()
18:39 <Tuplanolla> Just swap around the `@`, Velizar.
18:39 <cocreature> Velizar: yes, use "f xyTuple@(x,y) = ()"
18:40 <Velizar> neat
18:40 <Tuplanolla> It works anywhere in a pattern.
18:40 <cocreature> ews: you can’t make a list of think with different types so no that’s not possible. you can however construct a list of booleans by calling isNothing when you add things to the list and then use "or" instead of "any"
18:41 <cocreature> ews: also note that since haskell is lazy, you are still not doing unnecessary work that way
18:42 Claudius1aximus joined
18:43 dni joined
18:43 calloc joined
18:44 crypt0 joined
18:45 <Gurkenglas> ews, if that's in order to handle malformed input, you could work in the Maybe monad instead (or even Either)
18:46 halogenandtoast joined
18:47 toby1851 joined
18:47 <Gurkenglas> foo :: (Maybe Int, Maybe [Int]) -> Maybe (Int, [Int]); foo (mx, my) = do x <- mx; y <- my; return (x, y)
18:47 romank joined
18:47 marr joined
18:47 silver joined
18:47 <Gurkenglas> If you're acquiring the values through IO, you can even use MaybeT to short-circuit once something fails
18:48 <Gurkenglas> foo :: (IO (Maybe Int), IO (Maybe [Int])) -> IO (Maybe (Int, [Int])); foo (mx, my) = runMaybeT $ do x <- MaybeT mx; y <- MaybeT my; return (x, y)
18:48 <Gurkenglas> (Either would here become ExceptT)
18:48 Scip joined
18:49 Qfwfq joined
18:50 takle_ joined
18:51 tromp joined
18:51 dfeuer joined
18:52 Itkovian joined
18:53 geniucos joined
18:53 safe joined
18:53 <Gurkenglas> (If your do block ends up looking as trivial as my example, consider applicative style: foo (mx, my) = runMaybeT $ (,) <$> MaybeT mx <*> MaybeT my)
18:54 AndoBando joined
18:54 vydd joined
18:55 zzz joined
18:55 vydd joined
18:56 <iqubic> :t Print
18:56 <lambdabot> error:
18:56 <lambdabot> • Data constructor not in scope: Print
18:56 <lambdabot> • Perhaps you meant variable ‘print’ (imported from Prelude)
18:56 <iqubic> :t print
18:56 <lambdabot> Show a => a -> IO ()
18:56 <iqubic> Do Strings derive Show?
18:56 <Gurkenglas> :t show "asd"
18:56 <lambdabot> String
18:56 <Gurkenglas> > show "asd"
18:56 <lambdabot> "\"asd\""
18:57 <Gurkenglas> @instances Show
18:57 <lambdabot> (), (Data.Fixed.Fixed a), (Seq.Seq a), (Seq.ViewL a), (Seq.ViewR a), (Shrink2 a), (a, b), (a, b, c), All, AllocationLimitExceeded, Any, ArithException, Array a b, ArrayException, AssertionFailed,
18:57 <lambdabot> AsyncException, BlockedIndefinitelyOnMVar, BlockedIndefinitelyOnSTM, Bool, Char, Complex a, Const a b, Constr, ConstrRep, DataRep, DataType, Deadlock, DefName, Double, Down a, Dual a, Dynamic,
18:57 <lambdabot> Either a b, ErrorCall, First a, Fixity, Float, GeneralCategory, IO a, IOException, Identity a, Int, Int16, Int32, Int64, Int8, Integer, Interval a, Large a, Last a, Level i a, MaskingState, Maybe a,
18:57 <lambdabot> NestedAtomically, NoMethodError, NonEmptyList a, NonNegative a, NonTermination, NonZero a, OrderedList a, Ordering, PatternMatchFail, Positive a, Product a, Ratio a, RecConError, RecSelError,
18:57 <lambdabot> RecUpdError, Shrinking s a, Small a, Smart a, SomeAsyncException, SomeException, StdGen, Sum a, Sym a, Tree a, TyCon, TypeError, TypeRep, Word, Word16, Word32, Word64, Word8, ZipList a, [a]
18:57 fendor joined
18:57 <Tuplanolla> That's a handful.
18:57 <MarcelineVQ> doh ho ho, more lines than she allows for errors
18:57 <kadoban> Heh. Easier to list the things that aren't Show at some point xD
18:58 yellowj joined
18:58 <iqubic> What are the requirements for implementing a Show instance.
18:58 <iqubic> :t Show
18:58 <lambdabot> error:
18:58 <lambdabot> • Data constructor not in scope: Show
18:58 <lambdabot> • Perhaps you meant one of these:
18:58 <Tuplanolla> Preferably `shows`, iqubic.
18:58 <MarcelineVQ> Gurkenglas: goodness, this package is a bit silly to compile isn't it
18:59 <hpc> https://hackage.haskell.org/package/base-4.9.1.0/docs/Prelude.html#t:Show
18:59 <iqubic> Tuplanolla: What do you meen by shows?
18:59 <MarcelineVQ> Gurkenglas: Did you get it working? I can tell you how I did if not
18:59 zzz joined
18:59 <Tuplanolla> :t shows -- This.
18:59 <lambdabot> Show a => a -> ShowS
19:00 <Gurkenglas> I got SourceGraph to compile using stack unpack into stack init --solver
19:00 <Gurkenglas> And then to run using stack exec to supply a ghc
19:00 rap99 joined
19:00 <Gurkenglas> (Though it appears it can't read some code files.)
19:00 <Gurkenglas> *parse
19:00 <MarcelineVQ> oh interesting, was that enough? That didn't work for me, had to bump down the Cabal version in the solver's extra-deps
19:01 <iqubic> Is there something equivelant to Java's toString for Haskell's Show type class.
19:01 <Gurkenglas> (stack init --solver into stack install, of course)
19:01 <hpc> iqubic: look at the docs for Show that i linked
19:01 takle joined
19:01 <rap99> Hello. Anyone here familiar with Esqueleto? I'm trying to do a "SELECT ... IN (SELECT ...);" and I'm struggling with it
19:01 SpinTensor joined
19:02 <iqubic> rap99: I think this is the wrong channel.
19:02 <rap99> oh... what is the appropriate one?
19:02 <iqubic> :t showsPrec
19:02 <lambdabot> Show a => Int -> a -> ShowS
19:02 <Tuplanolla> This is, rap99. Ignore iqubic.
19:03 sssilver joined
19:03 <koala_man> I have two Maps and I want to find keys that only exists in the first and keys that only exists in the second. Is there anything more efficient than two calls to 'difference'?
19:03 <Gurkenglas> iqubic, what type signature should this toString have?
19:03 <rap99> ok, thanks Tuplanolla :)
19:03 dual joined
19:04 <* hackage> streaming-binary 0.2.1.0 - Streaming interface to binary. https://hackage.haskell.org/package/streaming-binary-0.2.1.0 (MathieuBoespflug)
19:05 kmicu joined
19:05 <iqubic> Gurkenglas: Show a => a -> String
19:05 <Gurkenglas> @hoogle Show a => a -> String
19:05 <lambdabot> Prelude show :: Show a => a -> String
19:05 <lambdabot> Text.Show show :: Show a => a -> String
19:05 <lambdabot> Test.QuickCheck.Text showErr :: Show a => a -> String
19:06 sherub1 joined
19:06 <Gurkenglas> koala_man, mergeWithKey perhaps?
19:06 biglama joined
19:06 sigmundv joined
19:07 gawen joined
19:07 <iqubic> Gurkenglas: What's the minimal complete definition of Show?
19:08 <hpc> iqubic: all of your questions are answered by the documentation
19:08 <fresheyeball> how can I get around this error?
19:08 <fresheyeball> Cannot use record selector ‘_area’ as a function due to escaped type
19:08 <fresheyeball> variables
19:08 <Gurkenglas> iqubic, go to https://hackage.haskell.org/package/base-4.9.1.0/docs/Text-Show.html and Ctrl-F for "Minimal complete definition"
19:08 <fresheyeball> Probable fix: use pattern-matching syntax instead
19:08 <fresheyeball> its a selector that pulls an existentialized type off a record
19:09 <iqubic> WHat's the difference between show and showsPrec?
19:09 <iqubic> :t showsPrec
19:09 <lambdabot> Show a => Int -> a -> ShowS
19:09 <iqubic> What the heck is the Int doing there?
19:09 <xa0> precedence
19:09 <hpc> iqubic: Gurkenglas's link spells it out quite explicitly
19:10 raichoo joined
19:10 <koala_man> Gurkenglas: ah nice, thanks
19:10 <ph88^> i get this exception with conduitDecode from serialization, i don't understand why https://bpaste.net/show/9636d36b40b3
19:11 <jle`> iqubic: the documentation is pretty clear too
19:11 sigmundv joined
19:11 <hpc> fresheyeball: the error message suggests that you try pattern-matching on the record instead
19:11 takle joined
19:12 <jle`> oh actually it doesn't say it in the actual documentation for showsPrec, hm
19:12 <jle`> interesting
19:12 <fresheyeball> hpc: weird
19:12 <Gurkenglas> iqubic, go to "https://hackage.haskell.org/package/base-4.9.1.0/docs/src/GHC.Show.html" and Ctrl-F for "showsPrec ::"
19:12 <jle`> i thought it did
19:12 sepp2k joined
19:12 primal joined
19:12 <hpc> jle`: the surrounding documentation spells it out
19:12 <cocreature> jle`: heh yeah I was about to say “look at the docs” but it’s actually really not that obvious
19:12 <jle`> mhm
19:12 <jle`> well it's actually not explicit
19:13 Costar joined
19:14 <hpc> If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
19:14 <hpc> the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
19:14 <c_wraith> deriving show fails to generate infix application of infix GADT constructors.
19:14 <cocreature> hpc: but it doesn’t say that the integer parsed to showPrec is the precedence
19:16 pylbrecht joined
19:16 juanpaucar joined
19:16 <jle`> yeah, all it says is the behavior from 0 or 11. and the documentation for "shows" is the only place where 'precendence context' is explicitly used
19:16 krok__ joined
19:17 <jle`> referring to an argument
19:17 jgt joined
19:17 <jle`> but that's soemthing you have to infer as well
19:17 <c_wraith> I only ever copy the example anyway
19:17 <c_wraith> It demonstrates how to use it without thinking
19:20 anemecek joined
19:20 bennofs joined
19:20 <ph88^> anyone experience with ? https://hackage.haskell.org/package/binary-conduit/docs/Data-Conduit-Serialization-Binary.html
19:20 takle joined
19:20 benjic joined
19:21 dual joined
19:23 joco42 joined
19:23 ErinvanderVeen joined
19:23 <jle`> ph88^: did you have a question?
19:24 <Gurkenglas> I have a set of things, and a way to tell whether two things can be combined into a third. Is there an established way to explore thingspace?
19:24 <ph88^> jle`, yes how can i get this to work ? https://bpaste.net/show/9636d36b40b3
19:25 <ph88^> i also tried the same input file + 1 byte, same file + 2 byte .. till +7 bytes ... all files get exceptions
19:25 meba joined
19:25 lionelcurry joined
19:26 <mniip> is it possible to tell ghci to execute a command after every line input by user
19:27 simukis joined
19:28 tiny_test joined
19:28 dejanr joined
19:28 jbiesnecker joined
19:28 Cerise joined
19:28 Cerise joined
19:29 slomo joined
19:29 Velizar joined
19:30 ph88^ joined
19:30 <ph88^> mniip, you can put haskell code in your ghci file
19:31 saussure joined
19:31 <mniip> кшпре
19:31 <mniip> right*
19:31 dejanr joined
19:31 <mniip> but that alone doesn't do what I want
19:33 <ph88^> mniip, i think you can make hooks
19:33 <mniip> how so
19:34 <ph88^> i vaguely remember reading something about it
19:34 <Gurkenglas> (Hah! I noticed a connection to the Alchemy game, googled Alchemy AI, and found https://alchemy.cs.washington.edu/)
19:34 cpup joined
19:35 ChaiTRex joined
19:35 <ph88^> mniip, ah yes i remember now
19:35 <ph88^> i had a ghci file that formats output
19:35 dejanr joined
19:36 <ph88^> mniip, read this page http://haskell.org/haskellwiki/GHC/GHCi
19:36 bs joined
19:38 <mniip> ph88^, haven't found anything relevant
19:38 Qommand0r joined
19:39 SCHAPiE joined
19:39 inad922 joined
19:40 takle joined
19:41 <geekosaur> you'd need something like bash's $PROMPT_COMMAND but there isn't one
19:42 dni joined
19:43 <ph88^> there is :set -interactive-print so you can hook into printing
19:43 ragepandemic joined
19:43 <ph88^> maybe there are more hooks
19:44 ianandrich joined
19:45 <mniip> hmm
19:47 araujo joined
19:48 jbiesnecker joined
19:48 <ph88^> i looked .. doesn't seem so :(
19:48 Deide joined
19:48 <mniip> I suppose I could mod ghci
19:48 <ph88^> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/ghci.html
19:48 <Gurkenglas> Writing a .hs outside a project using intero using emacs. How do I bring a package into scope?
19:48 <mniip> the usecase is fairly specific
19:49 <Tuplanolla> When I needed that, I used `tmux` to do it for me, mniip.
19:49 <Gurkenglas> https://i.gyazo.com/45c233ba6bdafd8ef88f8a418c9ce7f7.png
19:49 <mniip> Tuplanolla, how?
19:49 <ph88^> mniip, maybe you can let ghci work in another monad that does what you want
19:49 <mniip> nah, unlikely
19:50 <Tuplanolla> Just remapped Enter in the GHCi panel, mniip.
19:50 <mniip> nope
19:50 <mniip> definitely not going to work
19:50 <mniip> I'm running ghci in a script
19:51 jgt joined
19:51 CoderPuppy joined
19:51 <cocreature> Gurkenglas: you can just run "stack buld package" outside of any project and then restart intero
19:51 dni joined
19:52 Qfwfq joined
19:53 themagician joined
19:53 TheFuzzb_ joined
19:54 <et09> staring at articles about monads for like 4 years and finally it clicks, lol
19:55 <MarcelineVQ> Gurkenglas: what package is Control.Monad.Search, something you're making?
19:55 mac10688 joined
19:55 <et09> hey what's a good example of a practical use of applicative
19:56 <cocreature> et09: the trick is to stop staring at articles and just use them :)
19:56 <et09> yeah isnt that always the case
19:56 <Tuplanolla> Context-free parsing is great, et09.
19:56 <Welkin> et09: yesod-form
19:57 <Welkin> pretty much parsing
19:57 <Gurkenglas> MarcelineVQ, monad-dijkstra, not me, seeing whether I can write an exference on ~an A4 page
19:57 <glguy> et09: https://glguy.net/config-demo is an example of something interesting that you can do with applicative (and not Monad)
19:57 tiny_test joined
19:57 Cerise joined
19:57 Cerise joined
19:58 <Gurkenglas> cocreature, https://i.gyazo.com/9512f51d4c431070ac40d990f7990d0d.mp4
19:59 <et09> this is for app configurations glguy ?
19:59 benjic joined
20:00 <et09> or a yaml like thing sort of ?
20:00 <iqubic> Can I use Haskell to write web apps?
20:00 <et09> iqubic: yeah, check out Yesod and/or Snap/hAppStack
20:00 tiny_test joined
20:01 <iqubic> Isn't there a framework that compiles to JavaScript? I thought there was.
20:01 <et09> Elm? ghcjs?
20:01 <kadoban> GHCJS and reflex-dom
20:02 <cocreature> Gurkenglas: are you sure that the file is really outside of a project (in the sense that there is no "stack.yaml" in a parent directory) and that the directory you ran this command in is also outside of a project?
20:02 <iqubic> What do people recomend for web applications in Haskell?
20:02 <et09> iqubic: in my limited experience, Yesod
20:03 <iqubic> How hard is Yesod to learn?
20:03 <et09> depends how much haskell you know really
20:03 <Gurkenglas> cocreature, it turns out "intero-restart" wasn't enough, restarting emacs worked.
20:03 <et09> https://www.yesodweb.com/book/json-web-service
20:04 <cocreature> if you want something a bit more minimal, Spock and scotty are also fairly popular
20:04 joco42 joined
20:04 systemfault joined
20:04 <cocreature> the new kid on the block which is mostly targeted at writing REST APIs is servant
20:04 <dmj`> iqubic: Using yesod is probably easier than understanding how it was implemented
20:04 yellowj joined
20:04 joco42_ joined
20:05 <dmj`> iqubic: yesod uses quasi quotation heavily, which isn’t really programming in haskell
20:05 <dmj`> using a QQ that is
20:05 systemfault joined
20:06 <et09> personal preference, having found out about them 2 minute ago, i'd probably stick with scotty or spock unless developing something heavy that needs a lot of support fast
20:06 <et09> i tend to like microframeworks
20:07 mjs2600 joined
20:07 <Tuplanolla> You shouldn't use `background-color: #fff9c4 !important` without a matching `color` that's also `!important`, glguy. I can't read white on yellow.
20:08 <et09> best practice to never use !important unless you're really stuck overriding a library you're stuck with
20:08 <Gurkenglas> Could intero acquire the capacity to generate import statements from out-of-scope identifiers?
20:09 toby_ joined
20:10 takle joined
20:11 <et09> :t return 5 :: Num a1 => [a1]
20:11 <lambdabot> Num a1 => [a1]
20:11 <et09> wondering if it's every appropriate to try to force the monad used in 'return'
20:13 <geekosaur> rarely; usually it's inferred by context
20:16 <glguy> Tuplanolla: patches welcome it's on github
20:16 <glguy> et09: I use it for configuring lots of things
20:16 <Tuplanolla> It's easier to not read it.
20:17 <portnov> :t return 5
20:17 <lambdabot> (Num a, Monad m) => m a
20:17 <glguy> web design definitely isn't my thing
20:17 romank joined
20:17 <Tuplanolla> It's not a thing to enjoy, for sure.
20:18 <dmj`> css is the real problem
20:18 <et09> well you got a good start using material design i guess
20:21 obadz- joined
20:21 augur joined
20:22 <et09> i see what's going on here glguy, very cool
20:22 takle joined
20:22 Kreest_ joined
20:24 jbiesnecker joined
20:25 <Gurkenglas> http://lpaste.net/7430854593916960768 how should I go about acquiring a getType?
20:26 juanpaucar joined
20:26 jgt joined
20:26 <Gurkenglas> (whoops, added "modify (f:)")
20:26 twomix joined
20:28 tiny_test joined
20:28 kmels joined
20:29 <Gurkenglas> (actually, I think I can delay it until after the cost :) )
20:29 mivael joined
20:30 <Cale> Hey, I learned something new about Haskell today: it's possible to foreign import from GHCi.
20:30 dfranke_ joined
20:30 dfranke joined
20:31 <Cale> (I learned this by just trying it, lol)
20:31 <* et09> thought Cale invented haskell
20:31 <dmj`> Cale: cool, care to share :]
20:31 <Cale> I wasn't quite around for that. I started in 2001, which is a little over a decade late on the initial language.
20:32 <Gurkenglas> (Oh hey I did something like this years ago. Neat http://lpaste.net/143790 *salvages*)
20:32 <Cale> dmj`: I just did foreign import ccall "OpenSSL_add_all_digests" addAllDigests :: IO ()
20:32 <Cale> dmj`: At the ghci prompt, and it worked :)
20:33 <et09> is ghci repl like the clojure repl in that it compiles down the same path as normal ghc?
20:33 <Cale> (The other thing I learned is that nobody ever tried using HsOpenSSL for message digests, because if they had, they'd have noticed that this C call wasn't happening on startup, and so you can't look up any digest algorithms.
20:34 <kadoban> Cale: A good sign for a crypto library :-/
20:34 <[exa]> :]
20:34 <Cale> et09: For the most part it does, but there are lots of idiosyncratic things in the way of that.
20:36 <kadoban> Is http://www.staff.city.ac.uk/~ross/papers/FingerTree.pdf decent for understanding finger trees, or is there a better/additional resource I should look at?
20:36 <Cale> kadoban: I'm sort of surprised we don't have that stuff together a bit better. The pure Haskell implementations of crypto are a bit nicer to use by now, but I have no confidence that they're not vulnerable to all sorts of side-channel attacks and stuff -- it's not even clear how you'd go about implementing a side-channel-silent algorithm in pure Haskell.
20:37 Dookie12 joined
20:37 <Cale> kadoban: That's the thing I would link. :)
20:37 <et09> hs-tls ?
20:38 <et09> is that the one to use?
20:38 <[exa]> kadoban: it's pretty good
20:38 <Cale> et09: That's another native Haskell implementation...
20:38 <kadoban> Yeah, I'm pretty wary of crypto in haskell in general unfortunately, partly for that reason and partly just because it doesn't seem like any of them have seriously been looked at by enough people that know what they're doing.
20:38 <[exa]> kadoban: but anyway, there's a generalized approach to make finger-tree-like stuff automatically from anything, term-derivation based
20:38 anuxivm joined
20:39 <kadoban> Cale, [exa]: Thanks
20:39 <Cale> et09: I'm not saying don't use it, but if you care about stuff like side channel attacks, maybe don't use it, because I don't think anyone's taken the trouble to check.
20:39 jgertm joined
20:40 <kadoban> When I was last looking at libraries, none of them seemed to go out of their way to be honest about how unexamined they were either. Like ... one person writing a crypto library and nobody looking at it isn't a healthy place to be for production crypto uses.
20:40 <Cale> Honestly, if you care, probably just use HsOpenSSL and fix any problems you come across.
20:40 <Cale> There's also a Haskell binding to Nettle.
20:40 <Cale> I don't know how well trusted Nettle is, but based on its documentation, it at least looks like it's trying.
20:41 romank joined
20:41 <kadoban> [exa]: Heh, I'll try to understand the basic thing first I guess, and then look at generalized approaches :)
20:42 <et09> oh, i misread your comment
20:42 <Cale> The sad thing about FingerTree is that in order to get really good performance, you have to specialise it to a fixed monoid and measure.
20:42 <et09> so use an ffi to gnutls i guess
20:42 <[exa]> kadoban: this contains some links that might be good https://stackoverflow.com/questions/27282120/are-all-differentiable-types-monads
20:43 <et09> or just jam your server behind nginx hah
20:43 <Cale> It would be nice if GHC had some way to do template instantiation of entire modules, where some type variable gets replaced by a specified constant throughout and then various things get simplified in terms of that.
20:43 <[exa]> kadoban: a colleague once write a complete term-level-derivation-only derivation of fingertree structure from "normal" tree, in Agda iirc, for bachelor thesis. The connection with comonads is well interesting at least
20:44 <kadoban> Looks like a pretty fun rabbithole to go down
20:44 <Cale> So that, for instance, we could get Data.Sequence as a specialisation of Data.FingerTree
20:44 <Cale> as it ought to always have been
20:45 sssilver joined
20:46 dejanr_ joined
20:47 <hanna> if only we had some kind of library where all the common data type manipulation functions get generated based on a single universal traversal-like function
20:48 fotonzade joined
20:48 <[exa]> hanna: that sounds like "if only we had inliner without loopbreakers"
20:48 juanpaucar joined
20:51 ubsan_ joined
20:53 ego joined
20:54 takle joined
20:55 Bassetts joined
20:55 romank joined
20:57 meoblast001 joined
20:58 cpup joined
20:58 <dmj`> et09: nixos makes terminating ssl behind nginx a breeze
20:58 <et09> terminating?
20:59 <dmj`> https://www.nginx.com/resources/admin-guide/nginx-ssl-termination/
20:59 <et09> ah, right
21:00 <et09> how does nixos facilitate it
21:01 <et09> oh whoa, does nixos have its own network stack?
21:01 meoblast001 joined
21:04 fnurglewitz joined
21:06 <dmj`> et09: it uses the linux kernel, so yes I guess.
21:06 <et09> i meant a custom one
21:06 <et09> i guess you're talking about this configuration.nix thing though
21:06 Achylles joined
21:07 <clever> nixos allows you to just set enableACME=true; and it will automaticaly enable ssl in nginx, and run #letsencrypt to auto-generate a cert
21:07 darjeeli1 joined
21:07 <* hackage> hamtsolo 1.0.0 - Intel AMT serial-over-lan (SOL) client https://hackage.haskell.org/package/hamtsolo-1.0.0 (jgalowicz)
21:07 <et09> oh, that's handy
21:08 CoderPuppy joined
21:08 <dmj`> et09: something like this, https://gist.github.com/dmjio/a641f223603fa5eca51e58fdfdc77188
21:08 <* hackage> superconstraints 0.0.2 - Access an instance's constraints https://hackage.haskell.org/package/superconstraints-0.0.2 (RyanTrinkle)
21:08 anemecek joined
21:08 <clever> https://gist.github.com/cleverca22/43d0576b427fa85ce0efab81e99a84a8 this example i made a month ago will enable hydra and auto-configure nginx as a reverse proxy that adds ssl
21:09 romank joined
21:09 HallaSurvivor joined
21:11 baldrick joined
21:12 TheFuzzb_ joined
21:12 JoshS joined
21:15 dan_f_ joined
21:16 augur joined
21:16 darjeeling_ joined
21:18 hololeap joined
21:20 juanpaucar joined
21:20 ccomb joined
21:21 armyriad joined
21:21 joco42 joined
21:22 <hololeap> is there a good library or language extension (like TupleSections) that eases working with tuples, for instance, mapping a function to both tuples, combining all parts of multiple like a monoid, etc.
21:23 armyriad joined
21:26 francky joined
21:27 romank joined
21:28 joco42_ joined
21:30 peterbecich joined
21:31 bendo joined
21:32 Volt_ joined
21:34 gillesmajor left
21:34 zacts joined
21:35 sssilver joined
21:36 sssilver joined
21:37 mr_sm1th joined
21:37 sssilver joined
21:38 {emptyset} joined
21:38 mizu_no_oto joined
21:39 sigmundv joined
21:40 ^bschafer1 joined
21:43 conal joined
21:44 zacts joined
21:46 epsilonhalbe joined
21:46 cur8or joined
21:47 takle joined
21:48 Volt_ joined
21:53 hiratara joined
21:53 tromp joined
21:55 romank joined
21:58 romank joined
22:01 ertes joined
22:02 twanvl joined
22:02 jmcarthur joined
22:04 <Tuplanolla> Yeah, `lens`, TheFuzzball.
22:04 argent0 joined
22:05 <Tuplanolla> :t Field1 -- If that's too much, you can build your own around this class.
22:05 <lambdabot> error: Data constructor not in scope: Field1
22:05 <* hackage> fltkhs 0.5.2.4 - FLTK bindings https://hackage.haskell.org/package/fltkhs-0.5.2.4 (deech)
22:06 <Rembane> I think Haskell is awesome, but since I run ArchLinux on the dev machine and some random LTS version of Ubuntu on the VPS where I want to run my program nothing works when I just copy the compiled program. I wanted to compile on the VPS but I haven't got enough memory. How do you do deployment?
22:07 <Tuplanolla> :k Field1
22:07 <lambdabot> * -> * -> * -> * -> Constraint
22:08 im0nde joined
22:08 takle joined
22:09 coot____ joined
22:11 francky left
22:12 coltfred joined
22:12 ertes joined
22:13 gauthier joined
22:13 <ertes> Rembane: i use nix locally, and when i deploy to a machine that doesn't have nix, normally i just deploy a docker image (which nix helps me build), or i deploy a nix closure, which is the program together with *all* its dependencies down to glibc
22:15 <Rembane> ertes: Cool, is cabal2nix involved in this endeavour?
22:15 <ertes> Rembane: yeah
22:15 <ertes> Rembane: you generate one nix file for the haskell package, and then a separate one for the docker image
22:16 JoshS joined
22:16 <ertes> or, if you go for the closure approach, you only need the package file, and you use `nix-store -qR` to extract the closure
22:16 <Rembane> ertes: Okay. I'll read up on this. Just using Docker for building stuff hasn't really worked out for me. Linking is hard.
22:17 gugah joined
22:18 <ertes> Rembane: the nix+docker approach surprisingly (or perhaps not that surprisingly) doesn't involve actual building or a Dockerfile… by the time nix starts to generate the image the haskell package itself will have already been built
22:18 fooflare joined
22:18 saussure joined
22:18 ziocroc joined
22:19 <Rembane> ertes: Ah. Good stuff.
22:22 umib0zu joined
22:22 kmels joined
22:24 juanpaucar joined
22:26 romank joined
22:27 Koterpillar joined
22:27 dual joined
22:30 louispan joined
22:31 hiratara joined
22:31 jgertm joined
22:31 nilof joined
22:32 sssilver joined
22:32 sleffy joined
22:34 Reshi joined
22:35 tripped joined
22:36 <* hackage> shikensu 0.3.3 - A small toolset for building static websites https://hackage.haskell.org/package/shikensu-0.3.3 (icidasset)
22:36 timbod7 joined
22:40 tromp joined
22:41 revprez joined
22:43 irrequietus joined
22:45 systemfault joined
22:45 cyborg-one joined
22:46 RFburns joined
22:46 halogenandtoast joined
22:47 ddere joined
22:49 <* hackage> hdaemonize 0.5.4 - Library to handle the details of writing daemons for UNIX https://hackage.haskell.org/package/hdaemonize-0.5.4 (sickmind)
22:50 romank joined
22:50 RFburns joined
22:52 <* hackage> sitepipe 0.1.1 - A simple to understand static site generator https://hackage.haskell.org/package/sitepipe-0.1.1 (ChrisPenner)
22:53 romank joined
22:55 cvpcs|work joined
22:55 timbod7 joined
22:57 augur joined
22:58 indi_ joined
23:01 <Gurkenglas> How do I stop a diverging computation in ghci in intero in emacs?
23:02 spacecadetbrown joined
23:03 Sindriava joined
23:03 JagaJaga joined
23:04 coot____ joined
23:04 augur joined
23:05 zzz joined
23:06 ertes joined
23:07 <Lokathor> so it's safeish to use unsafeCoerce to go between a base type and a newtype?
23:08 Guest40 joined
23:08 Sindriava joined
23:08 <Guest40> why does haskell use tuple syntax for list destructuring?
23:08 romank joined
23:08 <Guest40> i.e. (x:xs) vs [x:xs]
23:08 <glguy> Lokathor: you can use Data.Coerce for that
23:09 <Lokathor> Guest40, you mean (a:xs) ?
23:09 <Guest40> yes
23:09 <Lokathor> ( ) is just parens
23:09 <Lokathor> like (3+4) * 5
23:09 <Lokathor> the , is what makes it the tuple
23:09 <Guest40> I see
23:09 <glguy> Guest40: [x] matches a single element list naming that element x
23:09 <Guest40> I see
23:10 <Guest40> but since the type sig uses []
23:10 <Guest40> why not use that for destructuring?
23:10 <pacak> [x:xs] - not haskell
23:10 <Lokathor> glguy, does that work if the newtype's constructor is private? is the thing i was really wondering about
23:10 <Guest40> it would seem to be consistent
23:10 <Guest40> there must be some historical reason
23:10 <pacak> Lokathor: unsafeCoerce :)
23:10 <Rotaerk> [x:xs] would be a list containing a single element, which is a list containing at least one element, and that element is called x, while the rest is xs
23:10 <Lokathor> Guest40, because it's not () because it's list, it's () for any pattern, eg case foo of (Just (x,y)) ->
23:11 <glguy> Guest40: the types of things rarely look just like the values
23:11 <Lokathor> pacak, but that's what i asked about at first :P
23:11 <Guest40> that makes sense
23:11 <monochrom> List does not mean using square brackets. So-called [1,2,3] is syntax sugar for 1:(2:(3:[])).
23:11 <Guest40> thank you Lokathor and glguy
23:11 kritzcreek joined
23:12 <Guest40> it just tripped me up b/c I had just read about tuples
23:12 <Guest40> and it looked similar
23:12 theelous3 joined
23:13 <Guest40> most helpful, thanks again
23:13 <pacak> Lokathor: use coerce if you can. In this case if anything changes typechecker will prevent your code from exploding. unsafeCoerce on the other hand is unsafe.
23:13 <Lokathor> yeah, the , part is the real magic with tuples
23:13 <Guest40> yeah , for tuples and : for cons (i.e. lists)
23:13 <Guest40> the new haskell book is good
23:14 texasmynsted joined
23:15 MP2E joined
23:15 <Lokathor> pacak, so it looks like newtypes automatically have the correct coercable instances?
23:15 <Lokathor> it's pretty good
23:15 <Lokathor> wish it was sans serif :3
23:16 spinus joined
23:17 lambda-11235 joined
23:18 patbecich joined
23:20 ianandrich joined
23:20 iqubic joined
23:22 theDon_ joined
23:22 romank joined
23:24 Costar joined
23:25 markus1209 joined
23:25 markus1219 joined
23:26 anuxivm joined
23:27 meba joined
23:28 juanpaucar joined
23:28 <Koterpillar> > let [x:xs] = [[1,2]] in "x is " ++ show x " and xs is " ++ show xs
23:28 <lambdabot> error:
23:28 <lambdabot> • Couldn't match expected type ‘[Char] -> [Char]’
23:28 <lambdabot> with actual type ‘[Char]’
23:29 <mniip> missing ++
23:29 <Koterpillar> > let [x:xs] = [[1,2]] in "x is " ++ show x ++ " and xs is " ++ show xs
23:29 <lambdabot> "x is 1 and xs is [2]"
23:30 Guest40 joined
23:32 primal__ joined
23:34 ofdm joined
23:36 darjeeling_ joined
23:37 YongJoon joined
23:37 zzz joined
23:40 Achylles joined
23:43 louispan joined
23:46 uniclown joined
23:47 Flechette joined
23:47 zzz joined
23:47 tromp joined
23:48 Reshi joined
23:48 romank joined
23:48 tnks joined
23:48 srcerer_ joined
23:49 joco42 joined
23:49 Welkin joined
23:51 anemecek joined
23:51 sssilver joined
23:52 alveric1 joined
23:52 zaltekk joined
23:54 jedws joined
23:58 alveric2 joined
23:58 Achylles joined
23:59 WhiskyRyan joined
23:59 infinity0_ joined
23:59 infinity0_ joined