<     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 rcschm joined
00:01 infinity0 joined
00:01 <ph88^> how can i use this with conduit? https://hackage.haskell.org/package/binary-
00:01 <* hackage> write-buffer-core, write-buffer-stm (parsonsmatt): https://qbin.io/ys10z0h8w
00:02 wroathe joined
00:03 kg joined
00:04 infinity0 joined
00:04 <dmwit> ph88^: https://hackage.haskell.org/package/binary-conduit- perhaps?
00:04 mjs2600 joined
00:04 <ph88^> wow cool
00:05 <ph88^> i was also looking at take from https://hackage.haskell.org/package/conduit-0.2.2/docs/Data-Conduit-Binary.html
00:05 <Myrl-saki> Is `init` O(n)?
00:05 <dmwit> yes
00:06 barcabuona joined
00:06 <Myrl-saki> Oh welp.
00:07 infinity0 joined
00:07 <dmwit> If you need to repeatedly push/pop from the end of a list, consider reversing it once for O(n), then repeatedly using head/tail instead of last/init for O(1) each instead of O(n) each.
00:07 <dmwit> If you need access to both ends, consider using Seq (which is based on finger trees).
00:07 <dmwit> Seq has amortized O(1) access to both ends.
00:08 <Myrl-saki> createInput k = reverse . drop k . reverse . map (take k) . tails
00:08 <Myrl-saki> I just realized that that's O(n^2)
00:09 <Myrl-saki> I'm thinking of using Seq to fix that by changing the loop by using the Seq version of tail and append.
00:09 <dmwit> `reverse . drop k . reverse = ap (zipWith (flip const)) (drop k)`
00:09 <dmwit> ...ish?
00:09 infinity0 joined
00:09 <dmwit> :t \k -> ap (zipWith (flip const)) (drop k)
00:09 <lambdabot> Int -> [b] -> [b]
00:09 <Myrl-saki> dmwit: The problem is `map (take k)`
00:10 <dmwit> Are you sure that's a problem?
00:10 <Myrl-saki> dmwit: Yes, that's O(n^2).
00:10 <dmwit> It's only going to do as much work as you touch elements anyway.
00:11 <dmwit> It's not O(n^2), it's O(k*n). And it's lazy, so you only pay O(k*n) if you're going to touch (k*n) elements, which is certainly O(k*n) anyway.
00:11 <Myrl-saki> Mmmm... true.
00:11 <Myrl-saki> The problem is large values of k then.
00:11 <dmwit> However, the `reverse . drop k . reverse` part *is* a problem, because it forces the whole spine into memory.
00:12 NewNick_ joined
00:12 <dmwit> The fancy zip-y version is productive.
00:12 <dmwit> > ap (zipWith (flip const)) (drop 3) [1..5]
00:12 infinity0 joined
00:12 <lambdabot> [4,5]
00:12 <dmwit> > ap (zipWith const) (drop 3) [1..]
00:12 NewNick_ joined
00:12 <lambdabot> [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,...
00:12 systadmin joined
00:12 wroathe joined
00:13 <dmwit> Yikes! I've got it very wrong somehow.
00:13 <dmwit> > ap (zipWith const) (drop 3) [1..5] -- oh, lol
00:13 <lambdabot> [1,2]
00:13 rcschm joined
00:13 NewNick_ joined
00:13 <dmwit> I wanted to do `[1..]` next anyway, to show that it is indeed productive, so... yay, that's already out of the way!
00:14 rcschm joined
00:14 <Welkin> what was with the flip const
00:14 <dmwit> A mistake.
00:15 <dmwit> I make those sometimes. Sorry.
00:15 infinity0 joined
00:16 lambda-11235 joined
00:17 jbiesnecker joined
00:18 infinity0 joined
00:18 j5drop joined
00:22 oisdk joined
00:23 <ph88^> how can i say that b should be of type Double in this type signature? :: (DB.Binary b, MonadThrow m) => Conduit BSC.ByteString m b
00:23 wroathe joined
00:24 connrs joined
00:24 <geekosaur> that depends on the context: if that is a signature given to you, just add a type ascription in the right place
00:24 <ph88^> what's a type ascription ?
00:24 <geekosaur> if it is something you actually control, why are you starting from a more polymorphic form than you need?
00:25 <geekosaur> > (1 :: Int)
00:25 <lambdabot> 1
00:25 <geekosaur> that is, specify the type when/where you use it, don't try to change the signature
00:25 <ph88^> https://hackage.haskell.org/package/binary-conduit-
00:25 <geekosaur> ok?
00:26 <geekosaur> so just make sure when you use it that you specify the type you want out of it as Double
00:26 Hanslo joined
00:27 patbecich joined
00:27 jadrian joined
00:27 <geekosaur> since this is monadic, one way to do it is turn on ScopedTypeVariables (because it ate the extension you really want some years ago...) and say something like:
00:27 <geekosaur> (v :: Double) <- conduitDecode
00:28 safe joined
00:28 systadmin joined
00:29 <ph88^> looks delicious
00:30 andyhuzhill joined
00:30 P1RATEZ joined
00:31 n_blownapart joined
00:31 felixphew joined
00:32 NewNick_ joined
00:32 patbecic` joined
00:33 <james999> why can't i see haskell in ubuntu software center?
00:33 <n_blownapart> hi if I execute from the cli stack works fine, but I get errors when I run stack ghci or ghci , please look here: http://lpaste.net/355872
00:33 PotatoCommando joined
00:33 wroathe joined
00:34 <n_blownapart> james999: go here : https://docs.haskellstack.org/en/stable/install_and_upgrade/#ubuntu
00:35 <n_blownapart> there's no apt-get packages
00:35 andyhuzhill joined
00:35 dmiles joined
00:35 <ph88^> james999, https://docs.haskellstack.org/en/stable/install_and_upgrade/#ubuntu
00:36 tromp joined
00:37 <james999> i'm really trying not to go straight to the command line
00:37 <james999> but if this doesn't work i'm just gonna try apt get
00:39 <n_blownapart> no there's no package for the compiler. the easiest way is from the command line
00:39 <james999> the link you gave me says there is
00:39 NewNick_ joined
00:39 <james999> for my exact version and arch. -_-
00:40 <n_blownapart> good luck I couldn't find any
00:40 <n_blownapart> I have debian which is apt-get
00:40 drewbert joined
00:40 juanpaucar joined
00:40 <james999> that's what i'ma bout to try next. :D
00:40 <james999> debian that is
00:42 sync__ joined
00:42 ninedotnine joined
00:42 sssilver joined
00:43 jbiesnecker joined
00:43 louispan joined
00:43 <n_blownapart> james999 just follow the directions on the page. the hardest part is setting the PATH in .bashrc
00:43 wroathe joined
00:44 <james999> sigh. this is why linux will never go anywhere
00:44 <james999> thanks n_blownapart I'll do that
00:44 primal__ joined
00:44 filterfish_ joined
00:44 <n_blownapart> james999: I'm having troubles too. It's fun and pretty interesting.
00:46 perrier-jouet joined
00:46 oisdk joined
00:47 NewNick_ joined
00:47 montagy joined
00:47 NewNick_ joined
00:47 <james999> lol oh?
00:48 <james999> i'm just trying to get these VMs updated before I leave for food. not looking good so far
00:48 louispan joined
00:49 <james999> no luck in debian either
00:49 <james999> can i even install emacs? let's see
00:51 <dmwit> I find it very hard to believe that Ubuntu doesn't have a GHC package.
00:51 systadmin joined
00:51 <ph88^> how can i run attoparsec on a conduit first and then later run another conduit ?
00:52 <dmwit> james999: At least on my machine (16.04) there definitely is a GHC package. Named ghc.
00:52 <ph88^> so first part of stream handled by a function, second part of stream handled by another function
00:52 raichoo joined
00:52 primal_ joined
00:52 <james999> dmwit: i'm also running 16.04
00:52 <james999> i think
00:53 <james999> uname didn't say
00:53 davr0s joined
00:53 <dmwit> n_blownapart: Why do you have a `Lib` module in multiple packages? Don't do that. Or use package-imports to disambiguate, but it's usually much simpler to "don't do that".
00:53 wroathe joined
00:53 eschnett joined
00:54 <dmwit> james999: So... is your problem solved now?
00:54 <james999> can you tell me if the ubuntu software thing
00:55 <james999> does it have 3 tabs saying All Installed Updates on top?
00:55 dmiles joined
00:55 drewbert joined
00:56 <dmwit> I suggest using synaptic, if you really need a GUI for your package management.
00:56 <dmwit> I've never liked the Ubuntu Software Center.
00:56 <james999> I already searched for it
00:56 <james999> didn't come up
00:56 <exio4> james999: sudo apt-get install ghc
00:56 <exio4> what does it say?
00:57 <dmwit> james999: Dunno, then. When I search for synaptic in Ubuntu Software Center the only hit is the right one. I agree that searching for ghc doesn't turn up the right stuff, though (synaptic does better here).
00:57 castlelore joined
00:57 primal joined
00:58 <james999> exio4: it wants to install 40MB of stuff including ghc, libbsd-dev, and libncurses5-dev
00:58 <dmwit> Sounds right to me.
00:58 kKzs joined
00:59 <james999> alright well i gave the GUI a try
00:59 <james999> thanks for the help guys
01:00 im0nde joined
01:00 <aijony> I could be wrong, (and I am a Haskell newb) but I think Ubuntu has stack. However it lags behind.
01:02 louispan joined
01:03 <james999> ok aijony you're right haskell-stack is available
01:03 <james999> it is less than 40 MB though. lol
01:03 <james999> is it not ghc?
01:03 <aijony> It will install it's own sandboxed GHC. I really like it.
01:04 <aijony> *its
01:04 dfeuer joined
01:04 patbecich joined
01:04 primal_ joined
01:04 <james999> er ok...
01:04 <james999> i think the book uses ghc though
01:05 patbecich joined
01:05 <aijony> You do you :)
01:05 <aijony> But it handles GHC and everything else for you.
01:06 <n_blownapart> still having errors like this: http://lpaste.net/355872
01:06 <n_blownapart> any help please?
01:07 NewNick_ joined
01:07 <srk> what's the problem if stack ghci works?
01:08 <srk> looks like you don't have system ghci installed
01:08 djapo joined
01:08 wroathe joined
01:09 <ph88^> if i do runConduit on a sourceFile can i then afterwards run another conduit where the previous one left off ?
01:09 louispan joined
01:09 texasmynsted joined
01:11 andyhuzhill joined
01:12 halogenandtoast joined
01:12 <james999> what on earth is 'cabal'?
01:12 <srk> package management/build tool
01:13 <sm> n_blownapart: what's the file like in that directory ?
01:13 <sm> the cabal file
01:13 <n_blownapart> srk sorry could you elaborate on ghci? this is a 32bit debian system. haskell-stack with Atom haskell-ide work fine on a 64bit debian machine
01:13 <n_blownapart> sm one moment thanks
01:13 patbecic` joined
01:14 <sm> I think "stack ghci PACKAGE" will work
01:14 primal__ joined
01:14 <sm> or it it EXECUTABLE. Eg "stack ghci primality"
01:14 pookleblinky joined
01:16 louispan joined
01:16 mnoonan joined
01:16 argent0 joined
01:16 pookleblinky left
01:17 <n_blownapart> sm one sec having trouble with chat client on one machine and haskell on another
01:17 <n_blownapart> sm please look at this - http://lpaste.net/6673003817786671104
01:18 <sm> success
01:18 meba joined
01:19 <n_blownapart> sm but $ stack exec primality-exe causes errors
01:20 anuxivm left
01:20 <sm> oh ? show us
01:21 kKzs joined
01:22 lambdamu joined
01:22 <n_blownapart> weird, that runs the program. but if I enter $ ghci I get command not found. If I enter $ stack ghci I get that initial error: http://lpaste.net/355872
01:23 <n_blownapart> on the 64bit machine $ stack ghci gives me a repl prompt
01:24 rcschm joined
01:24 primal joined
01:24 <sm> your package probably has multiple executables defined in the cabal file; for "stack ghci", stack doesn't know which one you want, so warns you
01:24 <n_blownapart> sm the cabal file for which app?
01:24 <suzu> :t (>=>)
01:24 <lambdabot> Monad m => (a -> m b) -> (b -> m c) -> a -> m c
01:25 <sm> I assume you have one cabal file in your current directoy
01:25 <suzu> :t (>>=)
01:25 <lambdabot> Monad m => m a -> (a -> m b) -> m b
01:27 <sm> n_blownapart: is that right ?
01:28 <n_blownapart> sm sorry one moment please I am emailing myself to get the pastes
01:28 kKzs joined
01:28 torgdor joined
01:28 wroathe joined
01:29 <n_blownapart> here's the cabal file for primality app sm
01:29 <n_blownapart> http://lpaste.net/8249268218556841984
01:29 <sm> is there a cabal file in ~/haskell ?
01:29 <n_blownapart> checking
01:29 <sm> or a stack.yaml file ?
01:30 <n_blownapart> no neither, but a primality.hs file outside the project dir sm
01:31 <n_blownapart> outside the primality project dir
01:31 jleon joined
01:31 <suzu> :i (>=>)
01:32 <n_blownapart> is that causing a problem ?
01:32 <n_blownapart> sm
01:32 <sm> shouldn't be. I'm not sure why "stack ghci" gives you that warning.
01:33 <sm> if you want to try something fun, there's http://hackage.haskell.org/package/debug-me
01:33 <sm> but the workaround is simple - give it a package name, right
01:33 jbiesnecker joined
01:34 primal__ joined
01:35 <clamchowder> I'm tried the following code which didn't work:
01:36 <clamchowder> do {s1; if s2 then return v1 else return v2}
01:36 juanpaucar joined
01:36 <clamchowder> ghci complains "possibly missing a "do"?"
01:36 <n_blownapart> thanks sm I'll work on both 64 and 32bit machines side by side tonight. appreciate it.
01:36 <sm> good luck
01:36 <n_blownapart> pax
01:37 <clamchowder> But I have a do at the beginning so why?
01:38 <n_blownapart> strange still: $ ghci or $ stack ghci does not give me the repl, but "command not found"
01:39 <sm> n_blownapart: "ghci" is not found because you haven't installed a ghci outside of stack - you can get that eg from your package manager or http://haskell.org/ghc
01:39 <clamchowder> Ah actually I just tried on ghci and it works for list... I was trying to simplify my problem but I guess the simplification is wrong, sorry.
01:39 felixphew joined
01:39 wroathe joined
01:39 <sm> "stack ghci" runs a ghci that stack manages itself
01:39 jsgrant__ joined
01:40 <n_blownapart> sm checking that thank you kindly
01:43 jbiesnecker joined
01:44 primal_ joined
01:45 NewNick_ joined
01:46 bjz joined
01:47 renzhi joined
01:47 felixphew joined
01:48 <n_blownapart> sm thanks so much YEAH I'm off to learn how to do math proofs on haskell !
01:49 cpennington joined
01:50 <sm> see you
01:50 kKzs joined
01:50 ContessaTP joined
01:50 kKzs joined
01:52 andyhuzhill joined
01:53 takle joined
01:54 juanpaucar joined
01:56 tromp joined
01:56 c4r50nz joined
01:57 mac10688 joined
01:58 brandonv joined
02:00 hucksy joined
02:03 plutonix_ joined
02:03 primal joined
02:04 louispan joined
02:04 path[l] joined
02:07 tristanp joined
02:07 alveric1 joined
02:09 systadmin joined
02:09 halogenandtoast joined
02:10 Johan_L joined
02:11 rblaze joined
02:12 andyhuzhill1 joined
02:13 HoierM joined
02:14 primal__ joined
02:14 HoierM joined
02:15 HoierM joined
02:16 drewbert joined
02:16 NewNick_ joined
02:18 <halogenandtoast> So this seems odd, I have two copies of the same website, one on Keter and one without and the Keter website seems noticeably slower.
02:18 ryantrinkle joined
02:18 <halogenandtoast> Anyone have that experience
02:24 connrs joined
02:25 carlomagno joined
02:25 kadoban joined
02:28 <halogenandtoast> Both servers are in the same region.
02:29 spacecadetbrown joined
02:31 darjeeli1 joined
02:32 NewNick_ joined
02:34 primal___ joined
02:35 Scip joined
02:35 ubsan_ joined
02:36 louispan joined
02:38 orion joined
02:39 tromp joined
02:41 reser554 joined
02:41 reser554 left
02:41 coltfred_ joined
02:41 toresbe1 joined
02:44 primal joined
02:44 CoderPuppy joined
02:45 exferenceBot joined
02:47 felixphew joined
02:49 hexagoxel joined
02:50 mjora7 joined
02:50 felixphew joined
02:52 doyougnu joined
02:52 Rotaerk joined
02:57 shangxiao joined
02:59 rcschm joined
03:01 geppettodivacin joined
03:01 darlan joined
03:03 mac10688 joined
03:03 montagy joined
03:04 primal___ joined
03:07 texasmynsted joined
03:08 kaychaks joined
03:09 orhan89 joined
03:09 Costar joined
03:09 felixsch_ joined
03:14 primal__1 joined
03:14 jbiesnecker joined
03:14 <suzu> :t (>=>)
03:14 <lambdabot> Monad m => (a -> m b) -> (b -> m c) -> a -> m c
03:14 <suzu> :t liftM3 (>=>)
03:14 <lambdabot> (Monad m, Monad m1) => m1 (a -> m b) -> m1 (b -> m c) -> m1 a -> m1 (m c)
03:14 <suzu> :t liftM2 (>=>)
03:14 <lambdabot> (Monad m, Monad m1) => m1 (a -> m b) -> m1 (b -> m c) -> m1 (a -> m c)
03:15 james999 joined
03:16 coot____ joined
03:16 <c_wraith> If you ever need that, you're writing some convoluted code. :)
03:16 <suzu> i certainly am, lol
03:16 <suzu> i'm currently somewhere in the weeds of digestive-functor
03:17 <c_wraith> ah, that explains it
03:17 <suzu> have you used it before?
03:17 NewNick_ joined
03:18 <c_wraith> no, but I remember the author going through the process of writing it - he had a bunch of design changes several times as he tried to figure out how to make things make sense
03:18 <suzu> lol, makes sense
03:18 <suzu> i'm trying to chain two validating functions together
03:18 <suzu> this wouldn't be so hard if those validations didn't need to run in a monad
03:18 <suzu> so i'm trying to figure out the right lift and right glue to stick in here to get everything to typecheck so i can move onto more fun things
03:18 <suzu> lol
03:19 jleon joined
03:23 <EvanR> "validations have to run in a monad" :(
03:23 primal_ joined
03:24 louispan joined
03:24 <EvanR> are you sure you cant pass in the function or context for that one piece you think you need a monad for
03:24 patbecic` joined
03:25 <suzu> i.. maybe can
03:25 <suzu> but i think this is the right method
03:26 <suzu> there's a few functions provided for doing your validations in an arbitrary monad, so i think this is the right approach
03:26 plutoniix joined
03:26 codygman___ joined
03:28 isidore joined
03:28 louispan joined
03:28 <codygman___> I'm curious what #Haskeller's think of Jonathan Blow's Jai language: https://inductive.no/jai/
03:29 systadmin joined
03:31 <Cale> codygman___: It's not something that I can really ever see myself using, but there are some interesting aspects about it.
03:32 WhiskyRyan joined
03:33 primal___ joined
03:34 NewNick_ joined
03:36 NewNick_ joined
03:37 DonaldTrumpFool joined
03:38 alx741 joined
03:38 DonaldTrumpFool left
03:38 _sras_ joined
03:41 NewNick_ joined
03:42 louispan joined
03:43 flatmap13 joined
03:43 NewNick_ joined
03:43 felixphew joined
03:43 primal__ joined
03:44 sync__ joined
03:45 NewNick_ joined
03:45 <* hackage> fltkhs - FLTK bindings https://hackage.haskell.org/package/fltkhs- (deech)
03:46 joco42 joined
03:46 begriffs joined
03:47 kritzcreek joined
03:49 louispan joined
03:50 fragamus joined
03:50 NewNick_ joined
03:51 NewNick_ joined
03:52 NewNick_ joined
03:53 andyhuzhill joined
03:53 primal___ joined
03:54 louispan joined
03:54 NewNick_ joined
03:57 otto_s joined
03:58 wroathe joined
03:58 marcoescondolez joined
04:00 laudiacay joined
04:02 flatmap13 joined
04:04 primal__ joined
04:07 <* hackage> sbv 6.1 - SMT Based Verification: Symbolic Haskell theorem prover using SMT solving. https://hackage.haskell.org/package/sbv-6.1 (LeventErkok)
04:08 <codygman___> Cale: cool, thanks
04:09 Xanather joined
04:09 Johan_L joined
04:12 path[l] joined
04:13 primal___ joined
04:14 jleon joined
04:19 meba joined
04:20 path[l]_ joined
04:20 Batzy joined
04:20 <Batzy> is there an escape character in Haskell? Usually you see like \ in programming languages
04:20 <cocreature> Batzy: yes \ :)
04:21 <Batzy> i guess my problem is something else thaen
04:21 <Batzy> then*
04:21 <cocreature> what are you trying to do?
04:21 <Batzy> cocreature, remove a directory
04:21 <glguy> Batzy: Character and string literals: https://www.haskell.org/onlinereport/haskell2010/haskellch2.html#dx7-20001
04:21 ertes joined
04:22 <Batzy> so i have like removeDirectory "C:\\path\\ay\\lmao"
04:22 <suzu> lol nice path
04:22 <Batzy> haskell doesnt think so
04:23 <Batzy> anyways it's saying variable not in scope
04:23 <geekosaur> that sounds like something else is wrong
04:23 <Batzy> yes it does.
04:23 <geekosaur> we don't have variable interpolation into strings like some languages do, so that error has to come from something other than the string
04:23 <geekosaur> unless you also have a mis-escaped double quote somewhere
04:23 <geekosaur> @paste actual code and full error?
04:23 <lambdabot> Haskell pastebin: http://lpaste.net/
04:23 Welkin joined
04:24 primal__1 joined
04:24 jbiesnecker joined
04:24 <Batzy> https://i.gyazo.com/3a9ee4e89b14386185ee042bc69fb0a8.png
04:24 <Batzy> and that was the actual code
04:25 <Batzy> oh wait
04:25 <Batzy> there's a capital U in the path
04:25 <Batzy> oh wait it didn't have the escape characters i just added them and now the error has changed!
04:26 wei2912 joined
04:29 patbecic` joined
04:31 <Batzy> here's the error: https://i.gyazo.com/abbaeee92790222cb43c82437a270fbf.png
04:31 <cocreature> import System.Directory
04:31 halogenandtoast joined
04:31 brynedwardz joined
04:32 juanpaucar joined
04:33 <Batzy> :(
04:33 <Batzy> u were right
04:34 primal___ joined
04:34 jbiesnecker joined
04:34 ploop joined
04:38 <halogenandtoast> Any ideas for a Haskell project to learn free monads?
04:38 <halogenandtoast> Maybe something I could complete in 3 hours or so?
04:39 path[l] joined
04:41 <Welkin> halogenandtoast: write an interpreter?
04:42 <Welkin> http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html
04:43 path[l]_ joined
04:43 <dmwit> halogenandtoast: How about a parser monad that you can interpret one way to parse a string, and another to generate a string that would successfully parse?
04:44 primal__1 joined
04:44 sleffy joined
04:44 <halogenandtoast> Alright, I'll look into that.
04:45 ploop joined
04:45 <halogenandtoast> Maybe I'll write an interpreter for my crappy language.
04:45 <lpaste> glguy pasted “more haskell.vim fixes” at http://lpaste.net/355873
04:45 <glguy> So I've got hierarchical modules added, fixed \^A escapes, fixed string gaps (\ \) allowed _ as the first character of an identifier
04:46 <glguy> What else do we need to fix in the Haskell syntax highlighting file?
04:47 ianandrich joined
04:48 anodium joined
04:48 <halogenandtoast> Welkin: I managed to finally deploy an app with Keter. Seems nice, but I assume I want to precompile my keter file and then just scp it up
04:48 <halogenandtoast> Maybe with Docker?
04:48 <* halogenandtoast> thinks we talked about Keter before
04:49 <Welkin> yes
04:49 <Welkin> all keter does it zip up your files in a tar
04:49 <Welkin> you could do it yourself if you want
04:50 <Welkin> that's how I do it
04:50 <Welkin> I just wrote a bash script to tar up everything, copy the correct files in, and then scp it to the server
04:50 <halogenandtoast> right but if I compile on my mac, it won't work on Ubuntu is my assumption
04:50 <Welkin> yes, that's true
04:50 plutoniix joined
04:50 <Rotaerk> hmm I see mention from Gabriel back in 2013 of "Edge" wrappers around Pipes that allow for an Arrow instance for push-based pipes, which allow you to make a directed acyclic graph
04:50 <Welkin> you need to compile on linux
04:50 <halogenandtoast> so use Docker to compile then scp it
04:50 <Rotaerk> there was also mention of him making a pipes-arrow library
04:50 <Rotaerk> but I don't see anything like that ... any idea why it never happened?
04:51 <halogenandtoast> Cool, I'll see if I can set that up
04:51 <halogenandtoast> I like the format Keter provides (aside from having to compile in Docker, but I'd pay that price with any compiled language I assume).
04:51 plutoniix joined
04:53 P1RATEZ joined
04:53 P1RATEZ joined
04:54 primal__ joined
04:57 Costar joined
05:00 SkyPatrol joined
05:04 primal___ joined
05:08 justanotheruser joined
05:08 mclaren joined
05:08 cschneid_ joined
05:09 mclaren joined
05:11 <mclaren> hey, i wanted to ask about the vastness of the Haskell wiki. Is it really well documented like the Arch Linux wiki or?
05:11 codygman_ joined
05:12 connrs joined
05:12 perrier-jouet joined
05:12 uglyfigurine joined
05:13 <james999> i don't think anything compares to the arch wiki
05:13 <james999> and i don't even use arch but i use their wiki
05:13 <codygman_> Anyone remember the name of that Excel like software posted in r/haskell that let you use haskell expressions for each cell?
05:13 <mclaren> yeah, its very expansive
05:13 meandi_2 joined
05:14 <mclaren> but i meant, is the haskell wiki similar to it
05:14 <kadoban> Similar in what way?
05:14 <kadoban> In terms of quality you mean?
05:14 <mclaren> yeah
05:14 Wizek_ joined
05:15 <kadoban> I've heard generally good things about it. I don't recall anyone expressing strong negative opinions of it. But I haven't spent a ton of time there myself. The few parts I have seemed good.
05:17 <mclaren> oh alright, thanks
05:17 eHammarstrom joined
05:18 erikd joined
05:18 felixphew joined
05:19 shesek joined
05:19 james999 left
05:21 Philonous joined
05:22 <mnoonan> codygman_: I think this is the one: http://www.alphasheets.com
05:23 primal_ joined
05:24 brynedwards joined
05:31 lamduh joined
05:33 primal___ joined
05:37 erikd joined
05:39 castlelore joined
05:40 juanpaucar joined
05:41 PotatoCommando joined
05:43 exferenceBot joined
05:44 primal joined
05:45 <halogenandtoast> I just used ghci and accidentally typed ":q" thanks to my vim habits
05:45 <halogenandtoast> found out that works...
05:47 joco42 joined
05:47 <MarcelineVQ> what did you used to do? :>
05:47 erikd joined
05:49 <halogenandtoast> MarcelineVQ: Ctrl+D
05:50 <wz1000> Ok, so I have two types(say A and B) i want to decode from json. Both share a common field, say f :: String, and the type of the incoming json is dependent on the contents of f. How do I achieve this?
05:51 benjic joined
05:52 <halogenandtoast> wz1000: Name them differently in A and B and then specify how to decode manually
05:52 <halogenandtoast> Unless someone has a better answer
05:53 <halogenandtoast> wz1000: Here's an example where I manually decode: https://github.com/halogenandtoast/mirin/blob/master/app/Main.hs#L41
05:53 primal_ joined
05:53 <wz1000> halogenandtoast: Name what differently?
05:53 <pacak> wz1000: You can decode things manually
05:54 takle joined
05:54 <wz1000> But I still need to decide whether I want to decode to type A or type B
05:54 <halogenandtoast> wz1000: If A and B are different records in Haskell
05:54 <halogenandtoast> they can't share the same field name
05:54 <halogenandtoast> see: s
05:54 <pacak> takeF >>= \f -> if blah f then decodeBlah f else decodeNotBlah f
05:54 sullyj3 joined
05:54 <halogenandtoast> https://wiki.haskell.org/Name_clashes_in_record_fields
05:55 <wz1000> halogenandtoast: They can because of OverloadedFields, but thats irrelevant because the JSON field has the same name
05:55 ubsan_ joined
05:55 <halogenandtoast> you probably mean DuplicateRecordFields
05:55 <halogenandtoast> but sure
05:55 <wz1000> Yeah
05:55 <pacak> wz1000: Parser in aeson is a monad.
05:56 <pacak> Since A and B are two differnet types - put them in a sum type
05:56 <pacak> Either A GB
05:56 <pacak> Either A B
05:56 <pacak> And later decide what do you want to do with them.
05:56 jgertm joined
05:56 <halogenandtoast> wz1000: You could also make a type that just decodes that one field and decide what to do.
05:57 <halogenandtoast> But I'd probably listen to pacak as he probably knows more than I do.
05:57 <wz1000> halogenandtoast: But then I would essentially have to decode the JSON twice, once to get the field, and once for the actual decoding
05:59 <halogenandtoast> Do what pacak is saying with a sum type.
06:00 <halogenandtoast> then your fromJSON can parse the one field
06:00 <halogenandtoast> err
06:00 <halogenandtoast> your parseJSON can parse the one field
06:00 <halogenandtoast> then decode the rest as needed
06:00 <halogenandtoast> only one call to parseJSON
06:00 <pacak> Or you can use Alternative / MonadPlus
06:00 <pacak> But again - with a sum type
06:01 <pacak> parseA = takeF >>= \f -> guard (f == "foo") >> Left <$> parseRestA
06:01 <pacak> parseB ...
06:01 <pacak> parseAOrB = choice [parseA, parseB, ... ]
06:02 <systemfault> Is there going to be a new standard? The last one is about 7 years old, right?
06:03 dni joined
06:03 <pacak> systemfault: What would you like to see in a new standard?
06:03 primal joined
06:04 <angerman> joeyh: Cross Compiling Yesod to Raspberry Pi - https://medium.com/@zw3rk/cross-compiling-yesod-to-raspberry-pi-f14de6fdbf06 -- Happy Birthday! (assuming Reddit is correct) :D
06:04 hurkan joined
06:05 daniel-s joined
06:05 plutoniix joined
06:05 <systemfault> pacak: I'm not sure, it just seems to me that how people uses GHC today is so disconnected from the current state of Haskell... So it would make sense to me if the standard would be updated with whatever GHC extensions the community feels should become standard.
06:06 <systemfault> Perhaps I'm just not getting it, I'm still learning.
06:07 erikd joined
06:07 <pacak> I just pretend that Haskell == ghc.
06:07 <pacak> And it kind of works.
06:07 plutoniix joined
06:08 <systemfault> Doesn't that replicate the classic C++ problem where everyone has its own subset of the language?
06:08 <LiaoTao> systemfault: What do you mean by "how people uses GHC today"?
06:09 esph joined
06:09 plutoniix joined
06:09 <pacak> systemfault: Are there any other implementations that's not ghc and alive?
06:09 <* angerman> is using GHC "today".
06:10 <systemfault> LiaoTao: The multiple language extensions, a few newer proposals that were "fairly recently" included (like AMP/FTP)
06:10 <angerman> pacak: mu?
06:10 <angerman> pacak: eta? Well, somewhat ghc but deviating...
06:11 <pacak> angerman: Hmm... Mu - is it publically available? I don't know.
06:11 <angerman> pacak: publically, no. I don't think so.
06:11 <cocreature> systemfault: people are working on a new Haskell standard
06:11 <angerman> but it's pretty much alive I guess.
06:12 <cocreature> but tbh I don’t think it will change a lot
06:12 <pacak> Eta - yes, but it's version 0.0.6.
06:12 <systemfault> Usually, when you learn a language... you learn the syntax and then you can read any code written in it, you just learn the ecosystem and libraries. Haskell is different to me in that aspect, because the syntax/language itself changes depending on pragmas.
06:12 <angerman> bah, getting yesod to work wasn't *that* hard... writing the post took *a lot* longer.
06:12 osa1 joined
06:13 <angerman> systemfault: you've gone into lens already? ;p
06:13 <LiaoTao> systemfault: This is also sort of bothering me
06:13 <pacak> systemfault: Syntax in haskell is simple. Libraries and ideas are hard.
06:13 <systemfault> angerman: It's on my list :p
06:13 <pacak> :t confusing
06:13 <lambdabot> Applicative f => LensLike (Data.Functor.Day.Curried.Curried (Data.Functor.Yoneda.Yoneda f) (Data.Functor.Yoneda.Yoneda f)) s t a b -> LensLike f s t a b
06:13 <LiaoTao> Seems like many of these extensions should be included in the next standard
06:13 <pacak> ^ nothing to do with extensions :)
06:13 <angerman> pacak: that's some pretty spicy yoneda rigth there.
06:13 primal__ joined
06:14 <cocreature> the more extensions you include in the standard the harder it becomes to write a compiler that actually implements all of the standard. and that makes the standard kind of useless
06:14 <angerman> LiaoTao: well, there was some informal voting on extension during last years icfp.
06:14 holla joined
06:14 <* angerman> likes LambdaCase, but that didn't feel like there was a majority for it during ifcp, at least to my subjective understanding.
06:15 jbiesnecker joined
06:15 <cocreature> LambdaCase is at least easy to implement
06:15 <* pacak> likes LambdaCase as well
06:16 <EvanR> according to SPJ implementing anything like ghc is just too hard period
06:16 <EvanR> its too late
06:16 <systemfault> One compiler to rule them all
06:16 <EvanR> its too big
06:17 <systemfault> Anyway, Haskell is hardly the only language with a "single" compiler
06:17 <LiaoTao> cocreature: I don't see how it's a lot different right now
06:17 <angerman> I guess it's the siliar to someone trying to write the JVM from scratch.
06:17 <LiaoTao> We've basically got GHC that's the end-all solution
06:17 <cocreature> LiaoTao: right but if you want it to stay that way you don’t need a standard
06:18 <cocreature> which is a valid point of view and I would largely agree with that
06:18 <cocreature> but if you put work into a standard, the goal should be that there can be other compilers
06:18 <LiaoTao> Naturally
06:18 <EvanR> there were others... long ago
06:18 <* angerman> 'd rather see time devoted to tooling around haskell, rather than spent on standardizing though... I know... I'm selfish.
06:18 <LiaoTao> But a standard shouldn't necessarily be the bare minimum if anyone still just ends up using extensions to fill the gaps
06:18 <sullyj3> in the 2020 standard github, someone suggested `case of { P1 -> e1; P2 -> e2 }` which I prefer
06:19 <LiaoTao> It's not like they are mutually exclusive tasks, angerman
06:19 <angerman> LiaoTao: if you have a tiny group of folks who work on things. Yes it is.
06:19 <LiaoTao> Fair point
06:20 meba joined
06:20 FreeBirdLjj joined
06:22 <angerman> e.g. cabal can probably use any hand it could get.
06:22 osa1_ joined
06:23 bollu joined
06:23 primal___ joined
06:26 <jle`> :w
06:26 <angerman> jle`: wrote.
06:27 <pacak> jle`: command not found: :w
06:27 <jle`> kkkjkk
06:27 <EvanR> local leader s
06:27 <EvanR> pls
06:27 <jle`> ah, sorry
06:27 Sh4rPEYE joined
06:27 felixphew joined
06:28 <angerman> so who is interested in android cc? ;-)
06:28 <EvanR> rpi plz
06:28 <angerman> EvanR: you did see: https://medium.com/@zw3rk/cross-compiling-yesod-to-raspberry-pi-f14de6fdbf06 ?
06:29 zuck05^ joined
06:29 <EvanR> no, reading
06:30 <* pacak> wants to run haskell in browser. Natively.
06:30 seventh-chord joined
06:30 <angerman> If somethings unclear, or missing, or additional wishes, it's probably best to discuss that on the accompanying reddit thread: https://www.reddit.com/r/haskell/comments/6dm6j8/cross_compiling_yesod_to_raspberry_pi/
06:30 <systemfault> I'm also think of using a web framework... Yesod seems to have the most feature but has that template haskell stuff I'm not even close to learning. So I was thinking about Snap. Does anyone have an opinion on that?
06:30 <pacak> systemfault: snap = haskell. yesod = not haskell.
06:31 albertus1 joined
06:31 <systemfault> I also look at other alternatives but they seemed too simple
06:32 <systemfault> Snap has modules and that made it interesting to me.
06:32 <angerman> EvanR: that way (reddit) there is some public log of Q/A
06:33 <angerman> The choice for Yesod, was mostly due to TH, and because I knew it had some largish dependency graph.
06:33 <cocreature> systemfault: there is also servant which is pretty popular these days especially for APIs but it requires some fairly advanced type-level extensions
06:33 primal joined
06:33 erikd joined
06:33 <systemfault> Will take a look at it
06:34 <angerman> there's also spock.ly
06:34 <Sh4rPEYE> Hey. I'm writing a simple parser for negative integers. I know how to parse integers, but I don't see a way how to check if there is a '-' before them. Something along the lines of
06:34 <Sh4rPEYE> num <- ((-1 * ) <$> try char '-' >> base10Integer) <|> base10Integer
06:34 <angerman> err https://www.spock.li
06:35 <pacak> Sh4rPEYE: sign = negate <$ char '-' <|> pure id
06:35 <pacak> Sh4rPEYE: sign <*> base10Integer
06:35 <Sh4rPEYE> pacak: Thanks. Never head about "<$", will look it up
06:35 <pacak> :t (<$)
06:35 <lambdabot> Functor f => a -> f b -> f a
06:36 <EvanR> fmap (const negate) (char '-')
06:36 <EvanR> is another way to say it
06:36 <pacak> Yep.
06:37 <pacak> @src (<$)
06:37 <lambdabot> (<$) = (<$>) . const
06:37 <pacak> Sh4rPEYE: <*>, <*, *>, <$>, <$, $>
06:38 sword865 joined
06:38 <pacak> Also there's such heresy as <&>
06:38 dni joined
06:39 <EvanR> good old fashioned light side and dark side
06:39 <Sh4rPEYE> pacak: Pardon my ignorance, but what does it mean to fmap const over parser? It'd seem to me that it would completely discard the "thing inside the Praser structure" and replace it with negate.
06:39 <EvanR> it doesnt discard the parsing effect though
06:40 <pacak> Sh4rPEYE: Only if it matches
06:40 <pacak> That is it's char '-'
06:40 vtomole joined
06:40 <EvanR> you dont care about '-' but you do care if it began with a '-'
06:40 <Sh4rPEYE> Oh yeah, so it discard just the Success result
06:41 <EvanR> negate if it succeeds, id if it didnt
06:41 <angerman> pacak: regarding native browser stuff, there is some HSOC student who wants to do a WASM LLVM backend... so we might get there...
06:42 <pacak> angerman: I've seen that. Just curious how long it will take to make and how big compiled project will be.
06:42 <cocreature> the hsoc projects look very cool this year
06:43 <angerman> pacak: it pretty much depends how well wasm maps to cmm (for the ghc-llvm) part.
06:43 primal_ joined
06:44 Bashmetim joined
06:44 <angerman> pacak: code-size wise, I would hope there could be some synergy between the mobile stuff and the native wasm stuff.
06:44 <pacak> I'm kind of upset by current state of javascript depelopment. Minimal sized react project is ~500Mb - that seems kind of wrong.
06:44 <cocreature> angerman: I’m not sure if that’s the critical part. I think porting the GHC RTS to wasm is probably more challenging
06:45 juanpaucar joined
06:45 <angerman> pacak: yea, in general we should be able to do much better with file size I would hope. Even the yesod on rpi sample is ~56mb
06:45 <pacak> Especially I like the fact that it contains about 10 mostly identical copies of rifraf project, the only purpose of which is to get around the fact that rm -rf on windows is crap.
06:46 <EvanR> pacak: 500M of ... what?
06:46 <EvanR> text?
06:46 <Sh4rPEYE> Pacak: Thanks much for the help! Beautiful indeed
06:46 <angerman> cocreature: hmm that will be interesting. But at least it's "just" c :-)
06:46 <pacak> EvanR: javascript.
06:46 <EvanR> how is that even possible
06:46 <pacak> 500 megabytes of javascript.
06:46 <angerman> cocreature: and a few stupid cmm snippets, which you'd probably want to use ghc on any way :)
06:46 tromp joined
06:48 <pacak> EvanR: https://www.theregister.co.uk/2016/03/23/npm_left_pad_chaos/
06:48 <pacak> That's how they do things.
06:48 <* angerman> is still unhappy about the prospect that ghcs llvm mangler is likely going to be extended ...
06:49 <EvanR> "unpublished source code"
06:49 inad922 joined
06:49 <angerman> pacak: I try to stay away from js for a good reason :)
06:49 <EvanR> i guess its fitting that hackage cant do that
06:49 <EvanR> immutable hah
06:49 <angerman> hackage and immutablility... Well...
06:50 <EvanR> the blog post takes it for granted you can simple delete your code from the internet
06:50 <EvanR> simply
06:50 <systemfault> You cannot do that anymore
06:50 <pacak> EvanR: Problem is that most people decided that it's easier to depend on 10 lines of code (plus a standard size license text) than to implement it themselves.
06:51 <systemfault> The JS world loves dependencies.
06:51 <EvanR> ive rewritten left pad about 40 times
06:51 <EvanR> i feel stupid each time
06:52 <EvanR> maybe were talking about different kinds of reusable code
06:52 <EvanR> code for a specific very specific thing, and generally applicable code to many things
06:52 erikd joined
06:53 <EvanR> the second bit arguably doesnt come up much in js
06:53 <pacak> https://www.npmjs.com/package/sum.js - 16 downloads in the last month
06:53 primal__ joined
06:53 <systemfault> pacak: https://www.npmjs.com/package/node-noop
06:54 <cocreature> "sum(strings, 'length');" …
06:54 <cocreature> you clearly need a package for that
06:54 <EvanR> systemfault: ... wait this is not a joke
06:54 <systemfault> Nope.
06:55 <systemfault> That one is though: https://www.npmjs.com/package/meta-noop
06:55 <pacak> systemfault: 21888 downloads in the last month
06:55 <cocreature> now I’m tempted to make a acme-noop package
06:56 jleon joined
06:56 <halogenandtoast> Any suggestions for determining if a list contains unsorted consecutive values?
06:57 andyhuzhill joined
06:57 <EvanR> cocreature: an automatic node to acme converter?
06:57 <angerman> ok. this is getting over my head...
06:58 <angerman> I'll still be around if there are questions re TH, CC and RPi.
06:58 <pacak> > and (\xs -> zipWith (>) xs (drop 1 xs)) [1,2,3,2]
06:58 <lambdabot> error:
06:58 <lambdabot> • Couldn't match expected type ‘[Integer] -> t’
06:58 <lambdabot> with actual type ‘Bool’
06:58 <EvanR> angerman: i just read the whole post, pretty awesome
06:58 <pacak> > and $ (\xs -> zipWith (>) xs (drop 1 xs)) [1,2,3,2]
06:58 <lambdabot> False
06:58 <EvanR> manual intervention or not
06:58 <pacak> > and $ (\xs -> zipWith (<) xs (drop 1 xs)) [1,2,3,4]
06:58 <lambdabot> True
06:58 <pacak> > and $ (\xs -> zipWith (<) xs (drop 1 xs)) [1,2,3,1]
06:58 <lambdabot> False
06:59 <angerman> EvanR: well, that will hopefully only be needed for so long :-)
06:59 <angerman> The build-type: custom is the most annoying thing. And building setup on the build machine, and running it there, while compiling for a different host, while working feels just wrong.
07:00 raichoo joined
07:00 <EvanR> i never understood the role of Setup
07:00 <angerman> (e.g. it will work for anything arch independent, but also work for arch dependent stuff. It will just simply (and silently) be wrong)
07:00 <angerman> EvanR: it's an escape hatch, similar to unsafePerformIO :-)
07:01 <pacak> EvanR: packages can require strange stuff to compile. You don't need it for pure haskell packages, but there are things like gtk for example. They do strange things in Setup.
07:01 <angerman> stuff that cabal can not (yet) express, can be handled via build-type: custom. However I beleive it's being abused for haddock and doctest far too often. There are legit use cases that simply can't subsumed by cabal. cocreature has at least one :)
07:02 <EvanR> i see
07:02 montagy joined
07:02 <cocreature> angerman: I don’t quite understand the shakespeare errors. why is this only a problem when crosscompiling? it seems like it should be ambiguous regardless of that
07:03 teggi joined
07:03 <angerman> cocreature: because **I** have added those function to the Quasi class like two days ago :)
07:03 <cocreature> angerman: ah ok
07:03 <cocreature> I didn’t realize that :)
07:03 primal joined
07:04 <cocreature> EvanR: specifically, I’m calling "llvm-config" in Setup.hs to figure out linker options and options that I need to pass to the C++ compiler
07:04 <angerman> cocreature: https://phabricator.haskell.org/D3608
07:04 connrs joined
07:05 <EvanR> so Setup is always there but may usually be doing nothing
07:05 jedws joined
07:05 <EvanR> unless doctest
07:05 <cocreature> EvanR: it doesn’t do nothing. there is a default that just builds your package without doing anything extra
07:05 <angerman> yes. unless doctest, or haddock, or some setup magic
07:05 <EvanR> oh
07:05 louispan joined
07:07 <cocreature> main = defaultMain is the standard
07:07 <cocreature> Setup.hs
07:08 cinimod joined
07:09 path[l] joined
07:09 <halogenandtoast> pacak: was your code a solution to my problem?
07:10 <cocreature> halogenandtoast: yes
07:10 <cinimod> Anyone know anything about BlogLiterately?
07:10 <halogenandtoast> I assume that means I need to call sort on the list.
07:10 <pacak> halogenandtoast: It was a solution to my understanding of your problem.
07:10 <cocreature> halogenandtoast: huh? why do you think that
07:11 <halogenandtoast> > and $ (\xs -> zipWith (<) xs (drop 1 xs)) [1,4,2,3]
07:11 <lambdabot> False
07:11 <halogenandtoast> cocreature: that's why
07:11 <pacak> there are - "unsorted consecutive values"
07:11 <pacak> > and $ (\xs -> zipWith (<) xs (drop 1 xs)) [1,2,3,4]
07:11 <lambdabot> True
07:11 <angerman> cocreature: but do we actually compile Setup.hs if build-type: simple?
07:11 <pacak> there's no "unsorted consecutive values"
07:11 <cocreature> > (\l -> or (zipWith (>) xs (drop 1 xs)) [1,4,2,3]
07:11 <lambdabot> <hint>:1:49: error:
07:11 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
07:11 <halogenandtoast> pacak: I'm dealing with a card game, where the cards can be played in any order
07:12 <cocreature> > (\l -> or (zipWith (>) xs (drop 1 xs))) [1,4,2,3]
07:12 <lambdabot> error:
07:12 <lambdabot> • Variable not in scope: xs :: [()]
07:12 <lambdabot> • Perhaps you meant one of these:
07:12 <halogenandtoast> but I need to know if they could be consecutive
07:12 <cocreature> > (\l -> or (zipWith (>) l (drop 1 l))) [1,4,2,3]
07:12 <lambdabot> True
07:12 <pacak> halogenandtoast: o_O
07:12 <cocreature> > (\l -> or (zipWith (>) l (drop 1 l))) [1,2,3]
07:12 <pacak> halogenandtoast: use set then
07:12 juanpaucar joined
07:12 <lambdabot> False
07:12 takuan joined
07:12 <pacak> consecutive - as in "there's no holes"?
07:13 erikd joined
07:13 <halogenandtoast> pacak: yes
07:13 <cocreature> angerman: It is an error if the Setup.hs is not just "main = defaultMain" in that case so even if you would compile it you would know what it does
07:13 <cinimod> Apparently not :(
07:13 <cocreature> cinimod: asking questions directly always works better than “does someone know something about X”
07:14 <pacak> halogenandtoast: use Set, toList, zipWith (\a b -> pred a == b)
07:14 primal_ joined
07:14 <pacak> (assuming there's Enum instance)
07:14 <halogenandtoast> There is, I have control over the data type.
07:14 <cinimod> Ok my python code does not get syntax hightlighting in my blog post when I render it using Blogliterately: https://gist.github.com/idontgetoutmuch/c638fd0dd2a6af8b3503a8f05c89c326
07:15 <halogenandtoast> pacak: I assume Set is Data.Set
07:15 <pacak> halogenandtoast: yep
07:15 jingbird joined
07:15 <halogenandtoast> Alright, I'll check it out. Thanks for your help
07:15 <pacak> Enum instance needs to deal with different suits in some intelligent way.
07:15 Kreest__ joined
07:16 <cinimod> cocreature: did I see you are *not* going to Zurihac?
07:16 Bassetts joined
07:16 <cocreature> cinimod: yeah I sadly can’t make it
07:16 <cinimod> :(
07:16 <cocreature> I’m really annoyed by that
07:16 andreabedini joined
07:17 <cinimod> I will be there :) - I may also go to the Leipzig hackathon
07:17 <cocreature> leizig? I didn’t see anything about that
07:18 <cocreature> *leipzig
07:18 <cocreature> oh hal
07:18 <cinimod> https://hal2017.softbase.org
07:18 <cocreature> I’m kind of hoping that quchen will do another munihac this year and was planning to go there
07:19 <cinimod> So many hacs
07:19 <cocreature> I owe quchen at least one beer so it’s important that I’ll go to a hac where he’s going too :)
07:19 <cinimod> Munich is nice
07:20 <cinimod> Leipzig is also nice
07:20 <cinimod> I want my blog post to be even more beautiful
07:20 <cinimod> I will wait for Brent to wake up
07:20 <cocreature> sry not sure what’s wrong with your blog post
07:20 <cinimod> np
07:21 <cinimod> But you never know if someone knows the answer
07:22 <EvanR> you dont known if you know what you dont know yet
07:22 <EvanR> until you ask
07:23 cschneid_ joined
07:23 primal joined
07:28 darjeeli1 joined
07:29 <jingbird> Hi all. I have a question about using hothasktags. There is convenient command to build tags file with this tool: "find . -name '*.hs' | xargs hothasktags > tags". Unfortunately it makes errors if haskell program use some extensions and not declare it with language pragmas but declare in default-extensions of cabal-file. Is there a methof to use it in such scenario?
07:29 pavonia joined
07:29 <Lokathor> EvanR, I spent most of work musing over GLSL possibilities, I think I might be able to have both a tile engine and a curses engine work in a single drawing pipeline
07:30 slomo joined
07:31 <EvanR> you could send the configuration of the grid as a uniform
07:31 justanotheruser joined
07:31 <EvanR> instead of texture data
07:32 <* hackage> gi-gsttag 1.0.12 - GStreamer Tag bindings https://hackage.haskell.org/package/gi-gsttag-1.0.12 (inaki)
07:32 <Lokathor> well my current intent is that every cell has an opaque background color, alpha'd texture location, and alpha'd foreground color
07:32 danvet_ joined
07:32 <* hackage> freer-converse - Handle effects conversely using monadic conversation https://hackage.haskell.org/package/freer-converse- (RobertHensing)
07:32 <EvanR> and each color is 24-bit o_O?
07:33 <Lokathor> and then the fragment shader will be able to combine those carefully so that your forground color might or might not recolor the texture's color, and then that might or might not overwrite the background color (which is the default result)
07:33 <EvanR> what happened to 3-bit palette heh
07:33 <* hackage> gi-gstpbutils 1.0.12 - GStreamer Plugins Base Utils bindings https://hackage.haskell.org/package/gi-gstpbutils-1.0.12 (inaki)
07:33 tristanp joined
07:33 erikd joined
07:33 primal_ joined
07:33 <Lokathor> background is RGB with A always as 1, texture is s,t coordinates which perform a lookup into an RGBA texture, and the foreground is RGBA
07:34 <EvanR> instead of st coords... just index
07:34 <EvanR> insead of RGB... palette index..
07:34 <Lokathor> can you do that in a fragment shader?
07:34 <Lokathor> i mean i could do a palettte index i guess
07:34 <EvanR> you can convert numbers to s,t inside of the shader sure
07:35 <cocreature> cinimod: hm that reminds me, henning asked me if I want to give a talk at hal this year so if I can come up with a nice topic, I might go there too :)
07:35 <Lokathor> but this lets you have all the possible colors!
07:35 mjora7 joined
07:35 <EvanR> something about 24-bit color terminal doesnt make sense to me
07:36 <cinimod> cocreature: henning was the person who told me about hal
07:36 <EvanR> but anyway thats yet another uniform
07:37 <cinimod> I will try to go - I look forward to your talk :)
07:37 <Lokathor> EvanR, you're free to only select 8 or 16 different colors :3
07:37 <Lokathor> but this way the exact same framework can also just be a tile engine framework
07:37 fnurglewitz joined
07:37 <EvanR> but im paying for 16777216
07:38 <Lokathor> it's open source :P
07:39 <Lokathor> EvanR, background color isn't a uniform, it's per cell.
07:39 ericdwhite joined
07:39 <Lokathor> my current thoughts are that I'll have 1 texture uniform and a slightly bulky vertex data entry and that's it
07:39 <EvanR> the grid of configurations is a uniform
07:40 <EvanR> you dont need any texture
07:40 dni joined
07:40 <EvanR> except for the texture you already loaded into a unit prior
07:40 <Lokathor> the texture data is the tilemap, yeah
07:40 <EvanR> for each frame you just need this array of config, which is one array uniform or one for each "field"
07:41 <EvanR> bgcolor, tileindex, etc
07:41 <Lokathor> ...do you mean "vertex buffer object"?
07:41 <EvanR> no way
07:41 jadrian joined
07:41 <EvanR> youre not using more than one triangle are you ;)
07:42 <Lokathor> i'm totally not familiar with how a single uniform can store all the data for all the cells of the screen
07:42 thunderrd_ joined
07:42 <EvanR> its an array
07:42 <Lokathor> I'm using 2 triangles per cell?
07:42 sphinxo joined
07:43 <Lokathor> side note: http://imgur.com/a/GV8Wg hey cool font stuff!
07:43 primal joined
07:43 <EvanR> classic
07:45 bablisok joined
07:46 jadrian_ joined
07:46 <Lokathor> EvanR, I don't think that I'm gonna change my short term design at this point, because i'm sticking to what I know how to do
07:46 <Lokathor> but, that said
07:46 <Lokathor> what's this about drawing it all in just 2 triangles?
07:47 <EvanR> really you only need 1
07:47 <EvanR> 2x as efficient!
07:47 <Lokathor> assuming, say, 80x24 cells for a standard display
07:47 <EvanR> right, youre not really getting any benefit from having 2 triangles per cell
07:47 <EvanR> its not buying you anything
07:47 augur joined
07:48 <EvanR> the shader runs the same for all of them
07:48 joco42 joined
07:48 <Lokathor> at the moment it's buying me "i can think about the problem easier"
07:48 <Lokathor> but there's no technical advantage, no
07:48 <EvanR> i cant see any difference
07:48 <Lokathor> remember that i've only known anything at all about ogl for 3 weeks
07:49 <EvanR> thats pretty good, then you dont know anything about "the old ways"
07:49 <EvanR> RIP
07:50 <Lokathor> https://learnopengl.com/#!Getting-started/Hello-Window I have completed the "Getting Started" section (using gl and GLFW-b), and browsed the other sections and some other GLSL advice stuff
07:50 <Lokathor> and that's about it
07:51 <EvanR> also pretty cool https://open.gl/
07:51 <EvanR> and if you go to ##opengl tell them all about haskell
07:51 <Lokathor> i think they'll laugh at my silly garbage collected language :/
07:52 erikd joined
07:52 Beetny joined
07:53 primal_ joined
07:53 m_ joined
07:54 <Lokathor> Once I have Hexes in a usable state, I plan to learn much more OpenGL stuff
07:54 thebardian joined
07:55 <Lokathor> however, I think that right now I gotta focus on finishing a project as much as possible, or i will not finish the project :P
07:55 jadrian_ joined
07:56 NewNick_ joined
07:57 grizwako joined
07:58 NewNick_ joined
08:00 wroathe joined
08:01 NewNick_ joined
08:01 felixphew joined
08:02 connrs joined
08:04 mjora7 joined
08:04 mbrock joined
08:05 seanparsons joined
08:07 acidjnk22 joined
08:07 primal joined
08:07 NewNick_ joined
08:09 Fairy joined
08:10 NewNick_ joined
08:12 dni joined
08:12 NewNick_ joined
08:12 juanpaucar joined
08:13 dni joined
08:13 andyhuzhill joined
08:14 primal_ joined
08:14 NewNick_ joined
08:15 esph joined
08:16 <suppi> anyone knows why this happens? kinda looks like a compiler/library bug http://lpaste.net/9117597983175606272
08:16 Icewing joined
08:16 <mauke> suppi: looks OK to me
08:16 NewNick_ joined
08:17 <mauke> what did you expect to happen?
08:17 <suppi> i expected no warning since the literal is within range
08:17 <mauke> no, it's not
08:17 <Lokathor> suppi, (i think) what's happening is that it's reading the literal 2147483648 (which is outside the upper bound) and then applying the negation function to it
08:17 <mauke> it even tells you why
08:18 <mauke> "Literal 2147483648 is out of the Int32 range -2147483648..2147483647"
08:18 <c_wraith> suppi: there's an extension that enables negative literals. Try that out.
08:18 <mauke> "If you are trying to write a large negative literal, use NegativeLiterals"
08:18 primal joined
08:18 Yuras joined
08:18 <suppi> oh, i see. thanks.
08:19 <suppi> why isn't that the default behaviour though?
08:19 <EvanR> > -0 :: Double
08:19 <lambdabot> -0.0
08:19 NewNick_ joined
08:19 <Lokathor> historical stuff, probably
08:19 <EvanR> behold the only real reason
08:19 <Maxdamantus> let n = 4 in -n
08:19 <Maxdamantus> > let n = 4 in -n
08:20 <lambdabot> -4
08:20 <Maxdamantus> maybe there are no negative literals.
08:20 <suppi> -n ???
08:20 <EvanR> not without the extension
08:20 filterfish joined
08:20 <suppi> thanks everyone
08:21 meba joined
08:21 <Lokathor> Maxdamantus, does -4^2 equal 16 or -16? The internet will never know :P
08:21 <mauke> personally I'd like it better if there were negative literals, unary - didn't exist, and 'negate' were shortened to 'neg'
08:21 leat joined
08:21 <suppi> ^
08:22 <EvanR> if negate 0 gives something different than -0 for Doubles, and thats the surprising consequence of just having negative integer literals....
08:22 mstruebing joined
08:22 <EvanR> seems like a no brainer, Double is the "surprising" dumpster
08:22 <suppi> though i rather not short negate to neg :P
08:22 <Lokathor> EvanR, you never said how to draw the entire grid in a single triangle
08:22 <EvanR> exercise for the reader
08:22 <Lokathor> oh no!
08:22 <Lokathor> :3
08:22 <EvanR> two stars
08:23 <Lokathor> doThing((**void)0);
08:23 <Maxdamantus> > read "-0" :: Double
08:23 <lambdabot> -0.0
08:23 <EvanR> kind of surprising
08:23 <Maxdamantus> Don't see why that has to do with not having negative literals.
08:23 NewNick_ joined
08:24 <EvanR> no idea how that read instance works
08:24 <mauke> > fromRational (-0) :: Double
08:24 <lambdabot> 0.0
08:24 <Maxdamantus> Doesn't seem surprising to me .. whatever handles the negation will just calculate the thing after it then negate that.
08:24 <Maxdamantus> It might have to do something special there for Int
08:25 <EvanR> with negative literals, -0 :: Double would be +0
08:25 <mauke> depends on how you spec it
08:25 <Maxdamantus> > read "-9223372036854775808" :: Int
08:25 <lambdabot> -9223372036854775808
08:25 <Maxdamantus> > let n = read "9223372036854775808" :: Int in -n
08:25 primal_ joined
08:25 <lambdabot> -9223372036854775808
08:26 <Maxdamantus> O_o
08:26 <EvanR> lol
08:26 <Maxdamantus> Ah, right, that still works.
08:26 <EvanR> > negate 9223372036854775808
08:26 <lambdabot> -9223372036854775808
08:26 <mauke> > minBound `div` (-1) :: Int
08:26 <EvanR> > negate (negate 9223372036854775808)
08:26 <lambdabot> *Exception: arithmetic overflow
08:26 <lambdabot> 9223372036854775808
08:26 <EvanR> > negate (negate 9223372036854775808) :: Int
08:26 <lambdabot> -9223372036854775808
08:26 <Maxdamantus> > let n = read "9223372036854775808" :: Int in (n, -n)
08:26 <lambdabot> (-9223372036854775808,-9223372036854775808)
08:26 <EvanR> > negate (negate (negate 9223372036854775808)) :: Int
08:27 <lambdabot> -9223372036854775808
08:27 <EvanR> fun
08:27 <Maxdamantus> Hm ..
08:27 <suppi> :(
08:27 <mauke> > negate minBound == minBound
08:27 <lambdabot> error:
08:27 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘negate’
08:27 <lambdabot> prevents the constraint ‘(Num a0)’ from being solved.
08:27 <EvanR> this version of negate takes its negating seriously
08:27 <Maxdamantus> > let n = read "9223372036854775808" :: Int in n == -n
08:27 <lambdabot> True
08:27 <mauke> > negate minBound == (minBound :: Int)
08:27 <lambdabot> True
08:27 robotroll joined
08:27 <Maxdamantus> wtf
08:27 merijn joined
08:27 <suppi> this is a haskell wat talk material right there
08:28 <Lokathor> welcome to the magic of uneven bounds in the integral types
08:28 <mauke> you used to be able to crash ghci with minBound `div` (-1) :: Int
08:28 erikd joined
08:28 dni joined
08:28 <mauke> suppi: no
08:28 <mauke> this is how two's complement works
08:28 NewNick_ joined
08:28 <Lokathor> suppi, this is true in any language that has sized integral types
08:28 <Lokathor> Python, Erlang, and a few others can escape such a problem though
08:28 andreabedini joined
08:29 <EvanR> this is a case of haskell teaching stuff that doesnt get learned outside C
08:29 jmcarthur joined
08:29 <EvanR> and its easier here because we dont have to constantly be lawyering over undefined behavior
08:30 medicijnman joined
08:31 <Lokathor> does haskell have much UB in the core language / base package itself?
08:31 <EvanR> unsafeFoo will do it
08:31 thc202 joined
08:31 Elish joined
08:31 <* Maxdamantus> has to think more about two's complement to convince himself that `n == -n` for a non-zero `n`
08:32 <Lokathor> I know that System.Random declares at least one UB situation, but packages declaring UB seems somehow "fineish"
08:32 comerijn joined
08:33 <mauke> Maxdamantus: take a bit patttern of 100000...0000, flip all bits, then add 1
08:33 Atrumx joined
08:33 <Maxdamantus> Okay, that works.
08:34 <EvanR> 100000000 is arbitrarily one or the other minBound or maxBound
08:34 <EvanR> like the other side of a loop
08:34 <EvanR> and negate sends you to the opposite hemisphere of the loop, and theres two poles
08:35 NewNick_ joined
08:35 ErinvanderVeen joined
08:35 <suppi> Maxdamantus: maybe this can help? https://soupi.github.io/insect/
08:35 primal joined
08:36 <Maxdamantus> Doesn't work on my phone.
08:36 <Maxdamantus> Will try in a few minutes.
08:37 <halogenandtoast> If I have some ADT (Foo Rank Value) and I want to write a spec that says if Rank is the same, compare Value, can I use QuickCheck to write that constraint?
08:37 NewNick_ joined
08:38 <halogenandtoast> QuickCheck is always black magic to me, but I want to try it out if I can.
08:38 justanotheruser joined
08:39 juanpaucar joined
08:39 NewNick_ joined
08:40 Hithroc joined
08:41 jleon joined
08:42 NewNick_ joined
08:42 lep-delete joined
08:42 LHoT10820 joined
08:43 Itkovian joined
08:44 NewNick_ joined
08:45 ali_bush joined
08:45 ali_bush joined
08:45 twomix joined
08:45 esph joined
08:46 primal_ joined
08:47 tromp joined
08:48 NewNick_ joined
08:49 <halogenandtoast> Maybe that's too much work...
08:51 NewNick_ joined
08:52 <Maxdamantus> halogenandtoast: well, you just have to express implication in your property.
08:53 <Maxdamantus> `rankIsSame v` implies `somethingElse v`
08:53 <Maxdamantus> ie, `not (rankIsSame v) || somethingElse v`
08:54 takle joined
08:55 <halogenandtoast> hmm
08:55 <halogenandtoast> I think I'd need to see an example to understand, I'm attempting to write it now.
08:55 NewNick_ joined
08:55 <halogenandtoast> Creating Arbitrary instances for my types currently.
08:55 primal joined
08:56 <Maxdamantus> Apparently quickcheck has an actual combinator for implication.
08:56 biglama joined
08:57 <Maxdamantus> so you can avoid having tests that just end up in that `not (rankIsSame v)` branch
08:57 <Maxdamantus> https://hackage.haskell.org/package/QuickCheck-2.9.2/docs/Test-QuickCheck.html#v:-61--61--62-
08:57 NewNick_ joined
08:58 <halogenandtoast> Yeah I'm reading through the manual, I've just written 0 quick check checks
08:58 <halogenandtoast> So here goes nothing
09:00 NewNick_ joined
09:00 erikd joined
09:01 <halogenandtoast> Think I've managed to create my arbitary instances
09:01 <halogenandtoast> (compiled)
09:02 takle joined
09:02 marr joined
09:06 primal_ joined
09:06 NewNick_ joined
09:07 barcabuona joined
09:07 jhenligne joined
09:07 Qfwfq joined
09:09 <Lokathor> EvanR, I *think* something like this is what I'm gonna use for my fragment shader http://lpaste.net/355875
09:10 <Lokathor> but like, with real inputs and outputs and stuff. but the mixing bit in the middle is i think how i wanna mix it
09:10 yellowj joined
09:11 NewNick_ joined
09:12 <halogenandtoast> I feel like I'm close, but far off. If anyone knows QuickCheck and Hspec: https://gist.github.com/halogenandtoast/2510b3384bbb130dcc8f567466e789b3
09:13 davr0s joined
09:13 NewNick_ joined
09:13 <halogenandtoast> Oh I probably can't use property like that for one.
09:15 <halogenandtoast> Update gist with attempt #2
09:15 mmn80 joined
09:15 alveric1 joined
09:16 NewNick_ joined
09:16 primal joined
09:16 <halogenandtoast> Next mistake is I should be use `===` and not `==`
09:16 <halogenandtoast> s/use/using/
09:17 <halogenandtoast> Updated with that fix now.
09:18 andyhuzhill joined
09:18 NewNick_ joined
09:19 CacoS joined
09:20 <halogenandtoast> Nailed it!
09:21 <halogenandtoast> for anyone interested: https://gist.github.com/halogenandtoast/2510b3384bbb130dcc8f567466e789b3
09:23 <* hackage> wryte - Pretty output for source generators https://hackage.haskell.org/package/wryte- (TobiasDammers)
09:24 bjz joined
09:25 NewNick_ joined
09:26 primal_ joined
09:27 NewNick_ joined
09:28 Gurkenglas joined
09:28 andyhuzhill joined
09:28 <halogenandtoast> confirmed, QuickCheck is amazng.
09:28 <halogenandtoast> *amazing
09:29 bjz joined
09:29 NewNick_ joined
09:29 CacoS joined
09:30 Itkovian joined
09:30 CacoS joined
09:31 CacoS joined
09:31 NewNick_ joined
09:32 primal joined
09:32 CacoS joined
09:33 rockfordal joined
09:33 erikd joined
09:34 NewNick_ joined
09:34 tristanp joined
09:36 NewNick_ joined
09:36 bablisok joined
09:38 NewNick_ joined
09:39 cschneid_ joined
09:40 <* hackage> list-tries 0.6.4 - Tries and Patricia tries: finite sets and maps for list keys https://hackage.haskell.org/package/list-tries-0.6.4 (MattiNiemenmaa)
09:42 spacecadetbrown joined
09:42 primal joined
09:43 target_i joined
09:47 primal_ joined
09:48 PotatoCommando joined
09:48 cretiq joined
09:48 silver joined
09:48 juanpaucar joined
09:48 joco42 joined
09:49 fendor joined
09:51 filterfish joined
09:52 filterfish joined
09:53 Itkovian joined
09:53 <* hackage> Glob 0.8.0 - Globbing library https://hackage.haskell.org/package/Glob-0.8.0 (MattiNiemenmaa)
09:54 oisdk joined
09:54 xinming joined
09:57 theelous3 joined
09:58 louispan joined
09:58 erikd joined
09:58 ianandrich joined
09:59 netheranthem joined
10:04 jgt joined
10:04 louispan joined
10:04 <jgt> hey folks
10:05 <jgt> what's a reasonable strategy for performing a one-time data migration for a Yesod/Postgres app?
10:05 <jgt> hand-write some SQL, SCP it to the machine, and just run it?
10:06 primal joined
10:08 cretiq joined
10:09 <srhb> jgt: As in moving the data from one database to another?
10:09 <srhb> jgt: Or one postgres instance to another, rather.
10:09 <jgt> srhb: simpler than that (I think?). Moving data from one table to another.
10:09 <srhb> Or are we talking schema migrations?
10:10 <srhb> jgt: Oh. Yeah, that sounds reasonable.
10:10 <jgt> Ok. Thanks :)
10:10 DisruptiveNL joined
10:10 <srhb> jgt: As long as you can get persistent (if that's what you're using) to recognize the new tables :)
10:11 <jgt> yeah, the new table was created automatically with persistent, but the data I have exists in the old table still
10:12 bablisok joined
10:12 jhenligne joined
10:14 primal_ joined
10:15 oisdk joined
10:15 shangxiao joined
10:15 SkyPatrol joined
10:15 tomphp joined
10:16 Bassetts_ joined
10:16 <ph88^> if i do runConduit on a sourceFile can i then afterwards run another conduit where the previous one left off ?
10:17 fotonzade joined
10:17 ErinvanderVeen joined
10:19 tsmish joined
10:19 gawen joined
10:20 _ashbreeze_ joined
10:20 fendor joined
10:21 Velizar joined
10:21 Velizar joined
10:23 bennofs joined
10:23 primal joined
10:24 erikd joined
10:25 Bassetts joined
10:25 osa1 joined
10:32 dequbed joined
10:32 ErinvanderVeen joined
10:33 oisdk joined
10:35 connrs joined
10:36 cinimod joined
10:39 filterfish_ joined
10:40 felixphew joined
10:40 jeirosz joined
10:41 ziocroc joined
10:42 RegEchse joined
10:42 jeirosz joined
10:43 Bassetts_ joined
10:46 joco42 joined
10:46 cyborg-one joined
10:47 Bassetts joined
10:51 Bassetts_ joined
10:52 juanpaucar joined
10:53 sdothum joined
10:54 primal_ joined
10:54 cretiq joined
10:54 Bassetts_ joined
10:57 t7 joined
11:01 zacts joined
11:02 Snircle joined
11:04 Bassetts joined
11:04 Johan_L joined
11:05 kevinburke1 joined
11:07 sedeki joined
11:07 bjz joined
11:08 Bassetts_ joined
11:09 Dookie12 joined
11:09 connrs joined
11:11 armyriad joined
11:11 jbiesnecker joined
11:13 <ph88^> this is probably the quietest moment in this channel ^^
11:14 <sbrg> channel is quiet all the time on my end, since I don't see all the joins/parts
11:15 HappyEnte joined
11:15 <ph88^> let's start making some noise sbrg
11:16 <cocreature> ph88^: that doesn’t make sense. you can’t call runConduit on a sourceFile. runConduit requires that your inputs are () and your outputs are Void which boils down to having consumed all inputs and outputs
11:16 <ph88^> pardon my wording :P
11:17 <NextHendrix> hi guys, can anyone reccomend any haskell books that aren't just "learn haskell from the beginning"
11:17 <ph88^> i use runResourceT $ runConduit src and friends
11:17 <ph88^> NextHendrix, real world haskell maybe ?
11:17 <cocreature> my point is that "runConduit src" doesn’t typecheck. you need to connect the source to a sink
11:17 <ph88^> cocreature, when i have a file as source .. can only consume some of the file as input and keep the rest of the file to run with another conduit ?
11:17 <ph88^> i have a sink
11:18 Bardusbasium_ joined
11:18 <ph88^> sourceToList is my sink
11:18 kirillow joined
11:18 <cocreature> sourceToList mostly destroys the purpose of using a streaming library in the first place
11:19 <cocreature> also sourceToList will consume all of your file so I’m not sure what “the rest of the file” is supposed to be
11:19 <ph88^> how can i make it so that it doesn't consume all of my file
11:19 <cocreature> well where do you want it to stop?
11:20 jeirosz joined
11:20 <ph88^> i have a parser , if that's finished i want it to stop
11:20 <ph88^> the file is like "HEADER\0DATA" i have a parser for Header ... if it succeed i know i arrived at the DATA part
11:21 <cocreature> I think you are going to need to make some minimal example that illustrates what you have and what you are trying to achieve. I’m having a hard time understanding your problem
11:22 <cocreature> maybe you are looking for the things described here https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#g:10
11:23 <ph88^> cocreature, this is my input file https://bpaste.net/show/c93feb7758fd
11:23 ericdwhite joined
11:24 <ph88^> oh connect and resume sounds good
11:24 prkc joined
11:25 <ph88^> cocreature, this is my function to parse the header https://bpaste.net/show/7eca9436ed3b
11:26 renzhi joined
11:26 <ph88^> i found a function conduitParserEither to run attoparsec parsers with conduit (this i already have working for another parser)
11:26 <ph88^> the rest of the file i want to use conduitDecode from https://hackage.haskell.org/package/binary-conduit-
11:28 <cocreature> note that ConduitM is a Monad so assuming your sinks are compatible, you can just combine them using do notation
11:28 <ph88^> can you give an example of that ?
11:28 <ph88^> all i know is that i can use .| to connect stuff
11:31 dni joined
11:32 <cocreature> actually I think conduitParser is not what you want. it will give you a stream of parsed tokens but you want to parse only one token
11:32 dni joined
11:32 <ph88^> eh ok
11:32 <ph88^> yeah you're right
11:33 Sh4rPEYE joined
11:33 <cocreature> sinkParser is the right thing
11:33 primal joined
11:34 <Sh4rPEYE> How can I read three digits with Trifecta to get an Int? I can save three digits separately na dthen join them somehow, but is there a better way?
11:34 asmyers joined
11:34 <cocreature> Sh4rPEYE: I don’t think there is a better way
11:34 <Sh4rPEYE> Ok.
11:34 <ph88^> cocreature, ok i think i can make that work with sinkParser .. but then i still don't know how to handle the data part of my file. How can i do that thing with the do notation you were talking about ?
11:35 Itkovian joined
11:36 <ph88^> google isn't helpful here if i type like "haskell combine sinks using do notation"
11:37 <cocreature> ph88^: http://lpaste.net/355880 should work I think but I’ve never used conduit so take this with a grain of salt
11:38 <ph88^> ok thanks cocreature i will take a look
11:39 <ph88^> that's it ? o_O
11:39 <cocreature> the magical power of do notation
11:39 <ph88^> how do i get the parseResult out though ?
11:39 <cocreature> well how do you want to get it out
11:40 epsilonhalbe joined
11:40 <ph88^> well ideally i still want that information but i don't want to pass it along the entire conduit
11:40 <ph88^> there are more conduits along the way for the actual data part
11:40 ilyaigpetrov joined
11:41 <ph88^> i mean the type that you gave ConduitM ByteString Int m () looks to me that this conduit should be generating Int ?
11:41 <cocreature> right
11:41 <cocreature> you can change that to anything supported via binary
11:42 <cocreature> you can either make that some sumtype and use yield to output parseResult or you can put it in the result type of your conduit
11:43 Gurkenglas joined
11:44 <ph88^> i don't understand the 3 options you are giving me sorry ... sumtype -- a tuple? where does it go? yield? i can only yield 1 type i think the result type of my conduit i think i will have to carry that type around to the other conduits functions which i don't want
11:45 <cocreature> a tuple is a product type. Either is a sumtype
11:45 <cocreature> why do you not want that?
11:45 <cocreature> I mean I guess you could write it to some IORef and escape it that way but I wouldn’t consider that to be a better solution
11:46 sedeki joined
11:46 <ph88^> if you write that conduit with Either .. do you have to run it twice ?
11:47 <ongy> when I have an Enum (well, Sumtype used as enum) is there an easy way to create another type that has all the same elements + some more? (I'm ok with TH, but don't want to write it myself)
11:47 <cocreature> sorry I’m not following. I really think you should show us the complete example of what you are trying to do with comments where you are having problems
11:47 <ph88^> i just mean when i have src .| parseEntireFile (this could be of type (Header, Double) .| handleDouble1 .| handleDouble2 ... snk
11:47 locallycompact joined
11:47 <ph88^> am i passing the entire header here for each double i want to process in the data ?
11:48 scottj joined
11:48 <ph88^> or i have a Either Header Double ?
11:48 tromp joined
11:49 <Sh4rPEYE> How can I simplify this:
11:49 <Sh4rPEYE> parseAreaCode' =
11:49 <Sh4rPEYE> ( try (char '+') >> anyChar >>= \c1 ->
11:49 felixphew joined
11:49 <Sh4rPEYE> anyChar >>= \c2 -> anyChar >>= \c3 -> return $ readDigits [c1, c2, c3]
11:49 <Sh4rPEYE> )
11:49 <Sh4rPEYE> <|> return 420
11:49 <Sh4rPEYE> Sorry, messed up formatting:
11:49 <Sh4rPEYE> (try (char '+') >> anyChar >>= \c1 -> anyChar >>= \c2 -> anyChar >>= \c3 -> return $ readDigits [c1, c2, c3]) <|> return 420
11:51 <ph88^> cocreature, ok i will just try to do it with the do notation and the tuple and get back later when it works, can worry about refactoring later
11:51 <ph88^> Sh4rPEYE, one thing that would help me is the do notation .. can you rewrite it using do ?
11:51 DeepSpawn joined
11:52 <Sh4rPEYE> ph88^: I'm not sure how can I specify that I want to get the three chars only when the char '+' succeeds
11:52 <* mniip> prods glguy
11:53 Dookie12 joined
11:53 Dookie14 joined
11:53 <ph88^> Sh4rPEYE, the problem is that your try is only on the (char '+') ... why don't you try do-notation then you can write this down less confusing
11:57 fendor joined
11:57 <Sh4rPEYE> ph88^: Oh, well, I had no idea I can try the whole do-notation block :-D
11:57 <ph88^> Sh4rPEYE, https://bpaste.net/show/282ff3046e10
11:58 <Sh4rPEYE> Yep, just like that. Thanks
11:58 <ph88^> the return type is not compatible
11:58 <ph88^> you return [c1, c2, c3] :: [a] or otherwise 420 :: Int
12:01 wroathe joined
12:02 ErinvanderVeen joined
12:04 FooBar` joined
12:05 Denthir joined
12:05 juanpaucar joined
12:06 mnoonan joined
12:06 <ph88^> cocreature, sorry i still don't understand, how can i get parseResult out ? https://bpaste.net/show/709a1c47ef91 this type checks but i just don't know where it goes
12:07 <cocreature> ph88^: it’s like any other value in do notation. if you don’t use it, it gets discarded
12:07 <ph88^> yeah, but i still like to use it
12:07 <cocreature> but where do you want to use it?
12:08 <cocreature> an easy solution is to change the type signature to ConduitM ByteString Double m ParseResult and add "pure parseResult" at the end of your do block
12:08 <ph88^> after the whole conduit thing is done
12:08 <cocreature> then use that
12:08 <ph88^> like at the end of the program i want to show some kind of summary
12:09 <ph88^> wow ok ..
12:09 <ph88^> i can see how this can work, it's pretty obvious now that i see it o_O
12:09 <ph88^> didn't think of it this way
12:10 <ph88^> but that also means that you can write a conduit with a sink inside it, eh ok
12:10 <ph88^> interesting stuff :D
12:10 <sullyj3> Hey all, so I want to get a line of input and read it as an int using readLn, then feed that into replicateM_ using a combinator. I want to minimize flipping and lambda-izing, so, I think (>>=) and (>=>) are out. What's the most elegant way?
12:10 <cocreature> ph88^: Sink is just a type synonym
12:10 <ph88^> i mean even conceptually ..
12:11 <ph88^> sullyj3, can you show the code in the not so elegant way ?
12:12 <cocreature> ph88^: you might want to take a look at the source for some of the standard sinks like "consume" and figure out how they are implemented in terms of "await".
12:12 bendo joined
12:12 MJ joined
12:12 CoderPuppy joined
12:12 <ph88^> ok
12:12 <sullyj3> ph88^: (readLn >>= replicateM_) interactLine (stringify roundGrade))
12:12 <sullyj3> oops
12:12 <sullyj3> wrong one
12:12 <sullyj3> readLn >>= (\n -> replicateM_ n (putStrLn "Hello, world!"))
12:12 <ph88^> cocreature, this reminds me somewhat of railroad programming
12:13 <cocreature> I don’t know what that is although I vaguely recall having heard the term at some point
12:13 primal_ joined
12:14 <ph88^> sullyj3, i think your code already looks good
12:15 <sullyj3> I guess I can get rid of a pair of brackets
12:15 <cocreature> sullyj3: do n <- readLn; replicateM_ n (putStrLn "Hello, world!") no lambdas and flips! :)
12:15 PotatoCommando joined
12:16 <sullyj3> cocreature haha, I just rewrote this from exactly that
12:16 <cocreature> sullyj3: why? using do notation is completely fine
12:16 <cocreature> so is using lambdas
12:16 <sullyj3> I know, I'm just fond of pipelines
12:16 zariuq joined
12:17 <sullyj3> and naming functions, not data
12:17 halogenandtoast joined
12:19 <cocreature> how does "readLn >>= \n -> …" name more functions and less data than using do notation
12:19 <cocreature> apart from the fact that I’m not sure why you would want to avoid naming things if you have good names for them
12:20 <sullyj3> It names more data by introducing an n parameter
12:20 <cocreature> but that’s exactly the same n you have in your lambda
12:20 <sullyj3> I'm saying I don't like the lambda either
12:21 <cocreature> *shrug*
12:21 <sullyj3> haha. I have delicate aesthetic sensibilities
12:21 <sullyj3> disliking code style is the ultimate first world problem
12:22 oisdk joined
12:22 meba joined
12:22 xeno7 joined
12:22 TCZ joined
12:25 jeirosz joined
12:26 yellowj joined
12:26 <sullyj3> here's the code that was for, for the record:
12:27 <lpaste> sully pasted “Grading” at http://lpaste.net/355882
12:28 filterfish__ joined
12:29 jbiesnecker joined
12:29 Bardusbasium__ joined
12:29 <srhb>
12:30 PotatoCommando joined
12:30 kKzs joined
12:30 Tesseraction joined
12:32 oisdk_ joined
12:32 <* hackage> gi-gstbase 1.0.13 - GStreamerBase bindings https://hackage.haskell.org/package/gi-gstbase-1.0.13 (inaki)
12:32 <ongy> when I have an Enum (well, Sumtype used as enum) is there an easy way to create another type that has all the same elements + some more? (I'm ok with TH, but don't want to write it myself) (asking again, since I didn't see any answer and it's slower now)
12:32 hexagoxel joined
12:32 riatre joined
12:33 kantokom1 joined
12:34 primal joined
12:34 thierry_ joined
12:35 AntiSpamMeta joined
12:35 tromp joined
12:36 vydd joined
12:37 thierry joined
12:39 Boomerang joined
12:43 bjz joined
12:44 ryantrinkle joined
12:45 jbiesnecker joined
12:45 <lyxia> data Enum2 = Enum1 MyEnum | More ...?
12:46 locallycompact joined
12:47 <ongy> lyxia: I'm using it in an xmonad-esque user writes haskell config style, and I would like to avoid that
12:47 safe joined
12:47 <lyxia> mess with TH then
12:47 <ongy> hmhm, I think a typeclass could actually do the trick here...
12:49 <ongy> so we can have (Num a => a; 5), can I recreate something like that?
12:50 ErinvanderVeen joined
12:50 wei2912 joined
12:50 mjs2600 joined
12:51 beerdrop joined
12:53 dejanr joined
12:54 <Sh4rPEYE> Why does this throw "expected '.'"?
12:54 <Sh4rPEYE> parseOctet = try (char '.' ) >> integer
12:54 <Sh4rPEYE> parseString parseOctet mempty "123"
12:54 <Sh4rPEYE> Shouldn't it just skip over the dot if it's not there?
12:54 systadmin joined
12:55 fotonzade joined
12:57 SkyPatrol_ joined
12:57 bjz joined
12:58 <cocreature> Sh4rPEYE: try does not affect whether a parser fails or not. it only affects how much input it consumes if it fails
12:58 <cocreature> Sh4rPEYE: and try around a "char" parser is a noop since that won’t consume input if it fails anyway
12:58 <Sh4rPEYE> Oh, so I have to use <|>
12:58 <cocreature> or "optional"
12:59 kKzs joined
13:00 simukis joined
13:02 louispan joined
13:03 <xa0> i have an issue with ghc -c -XForeignFunctionInterface, it generates errors like the following http://i.imgur.com/M6ZpAhT.png
13:03 <sullyj3> I'm not understanding the error message this line gives me:
13:03 <sullyj3> > 1 <$> (\x -> const x "Irrelevant") <*> show
13:04 <lambdabot> error:
13:04 <lambdabot> • No instance for (Typeable a0)
13:04 <lambdabot> arising from a use of ‘show_M416000496442651177910270’
13:04 <xa0> clearly it's not linking dependencies
13:04 <xa0> but i have no idea why
13:04 <sullyj3> whoa that's a different error again to the one from ghci
13:04 <sullyj3> wait, i get it
13:05 <sullyj3> > (const 1 0) <$> (\x -> const x "Irrelevant") <*> show
13:05 <lambdabot> error:
13:05 <lambdabot> • No instance for (Typeable a0)
13:05 <lambdabot> arising from a use of ‘show_M772623535083786463710319’
13:05 <sullyj3> oh
13:05 montagy joined
13:06 <sullyj3> > (const 1) <$> (\x -> const x "Irrelevant") <*> show
13:06 <lambdabot> error:
13:06 <lambdabot> • No instance for (Typeable b0)
13:06 <lambdabot> arising from a use of ‘show_M449860553341821052510396’
13:10 juanpaucar joined
13:10 <sullyj3> > (const 1) <$> (const 100) $ 6
13:10 <lambdabot> 1
13:11 <sullyj3> > (const 1) <$> (const 100) <*> (const 1000000000) $ 6
13:11 <lambdabot> error:
13:11 <lambdabot> • Could not deduce (Num a0)
13:11 <lambdabot> from the context: (Num (a -> t), Num a)
13:11 acidjnk22 joined
13:12 coot____ joined
13:14 slomo joined
13:14 slomo joined
13:15 <lyxia> sullyj3: give some types to the literals
13:17 <lyxia> xa0: do you have the code somewhere
13:18 <ph88^> how can i get the result of the conduit (as [Double]) and also get the other result :: a ?
13:18 <ph88^> https://bpaste.net/show/07754278a3cb
13:18 <sullyj3> lyxia, nah I don't think it's that
13:18 <xa0> lyxia: sure, http://github.com/bqv/hebi - the three relevant objects are plugin/haskell, plugin/haskell/Plugin and plugin/haskell/Message
13:18 <sullyj3> (flip const) 100 <$> pure <*> const 1000 $ 40
13:18 <sullyj3> > (flip const) 100 <$> pure <*> const 1000 $ 40
13:19 <lambdabot> 40
13:20 <lyxia> sullyj3: annotations would make the error messages more descriptive
13:21 NeonSynth joined
13:22 <lyxia> ph88^: https://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#v:fuseBoth
13:23 <sullyj3> > const (1::Int) <$> (const (100::Int)) <*> (const (1000000000::Int)) $ (6::Int)
13:23 <lambdabot> error:
13:23 <lambdabot> • Couldn't match type ‘Int’ with ‘Int -> t’
13:23 <lambdabot> Expected type: Int -> Int -> t
13:23 Big_G joined
13:23 Bardusbasium joined
13:23 <ph88^> lyxia, how can i use that ? i have now a single conduit, looks like this function is for two conduits
13:24 primal_ joined
13:24 <lyxia> ph88^: you use that instead of .|
13:25 <sullyj3> > pure (flip const) <*> pure "meh" <*> pure "woohoo!"
13:25 <lambdabot> error:
13:25 <lambdabot> • Ambiguous type variable ‘f0’ arising from a use of ‘show_M707573522813...
13:25 <lambdabot> prevents the constraint ‘(Show (f0 [Char]))’ from being solved.
13:25 <sullyj3> > pure (flip const) <*> pure "meh" <*> pure "woohoo!" :: Maybe String
13:25 <lambdabot> Just "woohoo!"
13:25 cretiq joined
13:25 <lyxia> xa0: and what did you do to get the error
13:26 <xa0> lyxia: tried to link using make
13:26 <xa0> it only happens when i try and import a dependency in the FFI haskell
13:26 <xa0> if i don't, it works fine
13:26 tromp joined
13:26 roylee joined
13:26 <roylee> '
13:26 <hexagoxel> debugging parsers 'unexpected end of input, expecting "foo", "bar", white space or end of input'
13:26 <hexagoxel> parsec seems to be confused :/
13:28 tsmish joined
13:29 ziyourenxiang joined
13:30 im0nde joined
13:30 <hexagoxel> on a related note, are there any counterarguments to moving to megaparsec?
13:30 cretiq_ joined
13:32 ericsagnes joined
13:32 anuxivm joined
13:32 <ertes> hexagoxel: not really… perhaps historical momentum, which manifests as better library support for parsec
13:33 jeirosz joined
13:35 cretiq joined
13:36 sanitypassing joined
13:36 kritzcreek joined
13:37 acarrico joined
13:39 mac10688 joined
13:40 louispan joined
13:40 cretiq joined
13:41 FreeBirdLjj joined
13:42 louispan joined
13:44 tromp joined
13:46 bjz joined
13:47 <lyxia> xa0: I'm not sure what's going wrong but I can compile it if I don't compile the haskell modules separately and just specify the hs files in the final command
13:47 yellowj joined
13:47 dejanr joined
13:47 <xa0> lyxia: ah okay, maybe I'll compile it like that then. Thanks!
13:48 <lyxia> xa0: it was also not failing with the ghc -c command but the last one that link everything together
13:48 <xa0> Yeah
13:48 <Sh4rPEYE> How can I "strip" the data I get from parser off the Result datatype?
13:48 <lyxia> xa0: by the way there are some .hi files in that repo that can be removed
13:49 <xa0> I saw, I've removed them locally
13:49 bjz_ joined
13:49 <xa0> Thanks though
13:50 sedeki joined
13:50 <* hackage> http-pony - A type unsafe http library https://hackage.haskell.org/package/http-pony- (JinjingWang)
13:50 tsmish joined
13:51 <lyxia> xa0: AH. actually another fix is -package text
13:51 <xa0> Oh fantastic, do I put that in the link command?
13:52 <lyxia> xa0: I think that by passing .hs it guessed from the import statements that text is a dependency, whereas with just the object files you have to make it explicit.
13:52 <lyxia> xa0: you can pass it in GHCOPTS
13:52 <* angerman> is going to be a round, if someone has questions regarding the yesod cross compilation
13:52 <halogenandtoast> angerman: I just solved yesod cross compilation
13:53 <lyxia> xa0: oh wait you're not using that in the link command...
13:53 <halogenandtoast> with Docker at least :p
13:53 <xa0> Yeah
13:53 <xa0> I didn't want the -XFFI in there for linking
13:53 <lyxia> xa0: well I just added it line 24 of the makefile
13:53 <angerman> halogenandtoast: well, with that I can't help you :p, but if there are questions regarding https://medium.com/@zw3rk/cross-compiling-yesod-to-raspberry-pi-f14de6fdbf06, I might be able to ;-)
13:53 sullyj3 joined
13:54 <xa0> Ok, gotcha
13:54 <lyxia> maybe LIBRARIES is a good place for that optioon
13:54 <xa0> Yeah
13:54 ThreeFx joined
13:54 <angerman> halogenandtoast: the benefit is, it doesn't restrict you to docker targets ;-) That however might not be of concern to you.
13:55 <sullyj3> @let readNRun f = liftM f readLn >>= print
13:55 <lambdabot> Defined.
13:55 <sullyj3> > readNRun (++ [3,4])
13:55 <lambdabot> <IO ()>
13:56 <sullyj3> @pl f
13:56 <lambdabot> f
13:56 <sullyj3> @pl readNRun f = liftM f readLn >>= print
13:56 <lambdabot> readNRun = (print =<<) . flip fmap readLn
13:57 <halogenandtoast> angerman: Yeah I just wanted to easily deploy my Yesod app.
13:57 bennofs joined
13:57 <lyxia> readLn >>= print . f
13:57 <halogenandtoast> While cool, I've never even seen a raspberry po
13:57 <sullyj3> lyxia ta
13:57 <hexagoxel> my current guess is that the error is connected to me using `fail` in Parsec. (I do some semantic checking/conversion as a separate step, but still in the Parsec monad.) Any hints regarding using `fail` in such a manner?
13:58 <angerman> halogenandtoast: yea, I've been doing the same targetting a linux system.
13:58 osa1 joined
13:58 <angerman> halogenandtoast: the Raspberry Pi, isn't really a restriction, it's just one target where cross compiling to make sense. I've the same setup for android and ios, I just only can write so many articles at once :-)
14:01 <ph88^> is it required to use ! together with UNPACK ? https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#unpack-pragma
14:01 <ertes> Sh4rPEYE: which library?
14:01 <lyxia> hexagoxel: for the kind of checking you mention it might be better to raise the error at another level
14:01 <Sh4rPEYE> ertes: Sorry, solved already
14:01 <ertes> ah
14:02 <Sh4rPEYE> ertes: But it was Trifecta and I wrote a little maybeResult myself.
14:03 <sullyj3> :t print . (id::(Int->Int)) =<< readLn
14:03 <lambdabot> IO ()
14:03 wroathe joined
14:03 <* hackage> weeder 0.1.4 - Detect dead code https://hackage.haskell.org/package/weeder-0.1.4 (NeilMitchell)
14:04 primal joined
14:04 <ph88^> what's a HOF ?
14:05 kamog joined
14:05 <lyxia> a higher-order function is a function which takes a function as an argument
14:06 pookleblinky joined
14:07 <hexagoxel> lyxia: but my semantic errors still have SourcePos connected to them. I'd have to replicate the parser's error-print, more or less.
14:08 grizwako_ joined
14:08 <hexagoxel> (nonetheless what you recommend will be my next step, just to make sure this is the problem.)
14:10 robotroll joined
14:10 wildlander joined
14:10 juanpaucar joined
14:10 coltfred_ joined
14:11 afarmer joined
14:11 pookleblinky left
14:11 oisdk joined
14:13 primal_ joined
14:14 tsmish joined
14:17 mjs2600 joined
14:17 twomix joined
14:17 jgertm joined
14:19 bennofs joined
14:19 latro`a joined
14:19 cinimod joined
14:20 eatsfoobars joined
14:21 tzh joined
14:21 radi joined
14:22 bjz joined
14:22 dredozubov_ joined
14:22 ErinvanderVeen joined
14:23 primal joined
14:23 ericdwhite joined
14:24 <radi> Hello folks, I'd like to ask about Pipes. How do I "flatten" pipe? I hope this type signature is helpful enough: `flatten :: Pipe (Producer a m r) a m r`
14:25 <Sh4rPEYE> Hey. I have a Map of values; I want to find the highest value and return its key. How can I do that?
14:27 <* hackage> case-insensitive - Case insensitive string comparison https://hackage.haskell.org/package/case-insensitive- (BasVanDijk)
14:28 akr`_ joined
14:28 <bennofs> radi: not familar with pipes at all, but perhaps something like 'forever $ do act <- await; act ' would work
14:28 oisdk joined
14:28 Sh4rPEYE joined
14:28 <bennofs> (or 'forever (join await))')
14:28 <Sh4rPEYE> Hey. I have a Map of values; I want to find the highest value and return its key. How can I do that?
14:29 <Sh4rPEYE> (sorry I timed out)
14:29 <Rembane> Sh4rPEYE: A Data.Map Map?
14:29 <Sh4rPEYE> Yep
14:29 <lyxia> Sh4rPEYE: use toList and maximumBy
14:30 <halogenandtoast> ^^
14:30 <bennofs> Sh4rPEYE: https://hackage.haskell.org/package/containers-
14:30 <Sh4rPEYE> Oh, sure... toList
14:30 <bennofs> there's a findMax function
14:30 <pavonia> That's for the max key only
14:30 <bennofs> oh sorry, you want hightest value
14:30 <* bennofs> needs to learn to read
14:31 <akr`_> Hello, I have recentrly come into maintaining a fairly large Haskell server. For the most part, the codebase is pretty solid and easy to navigate etc., however sometimes, randomly, a random request freezes or fails for no apparent reason. How could I investigate this further? I should perhaps mention that the server uses fastCGI and runs on GHC 6.12…
14:31 <radi> @Sh4rPEYE : try foldWithKey ?
14:31 <lambdabot> Unknown command, try @list
14:32 <* hackage> lifted-base - lifted IO operations from the base library https://hackage.haskell.org/package/lifted-base- (BasVanDijk)
14:32 <radi> bennofs: compile error ... `flatten = forever (join await)`
14:32 <halogenandtoast> radi: you would need some starting value right?
14:32 <halogenandtoast> for foldWithKey
14:33 <Rembane> If the values are Bound you can use the smallest value.
14:33 primal_ joined
14:33 juanpaucar joined
14:34 <radi> halogendandtoast : Yes, but as Rembane said you can use the smallest value ...
14:34 Eduard_Munteanu joined
14:34 sedeki joined
14:35 <halogenandtoast> but that would mean an empty map could return the smallest value
14:35 Johan_L joined
14:35 <halogenandtoast> which is a problem anyways I guess
14:35 <halogenandtoast> how to handle an empty Map I mean
14:35 Durbley joined
14:35 oisdk joined
14:36 Gurkenglas joined
14:36 <Rembane> I think an if-expression could handle that. If the map is empty, do something otherwise return the greatest value.
14:36 <* hackage> scientific - Numbers represented using scientific notation https://hackage.haskell.org/package/scientific- (BasVanDijk)
14:37 <radi> `if null map then Nothing else Just ( ... do the foldWithKey here ...)` ?
14:37 <lyxia> radi: you have to modify the producer before joining it. await >>= \p -> for p absurd
14:37 <lyxia> oh not "for"...
14:37 ErinvanderVeen joined
14:38 jeirosz joined
14:39 <radi> lyxia: compile error `flatten = await >>= \p -> Pipes.for p _`
14:40 Sampuka joined
14:41 WhiskyRyan joined
14:43 PotatoCommando joined
14:46 fendor joined
14:48 <lyxia> radi: forever (await >>= \(p :: Producer a m r) -> every (Select (void p)))
14:48 <lyxia> radi: forever (await >>= every . Select . void)
14:49 akr`_ joined
14:49 <akr`_> sorry my connection died, let me repeat my question:
14:49 <akr`_> Hello, I have recentrly come into maintaining a fairly large Haskell server. For the most part, the codebase is pretty solid and easy to navigate etc., however sometimes, randomly, a random request freezes or fails for no apparent reason. How could I investigate this further? I should perhaps mention that the server uses fastCGI and runs on GHC 6.12…
14:49 <radi> lyxia: it compiles. thanks!
14:49 Icewing joined
14:50 <bennofs> akr`_: is there any way you can reproduce the bug?
14:50 akr`__ joined
14:52 <bennofs> akr`_: i think you're best bet is to have fine-grained logging and hope to find the wrong part this way
14:53 <akr`__> bennofs: thanks, that was my initial thought as well
14:53 safe joined
14:53 oisdk joined
14:55 xplat joined
14:55 <akr`__> bennofs: I was wondering whether it could be connected to lazyness & memory usage somehow, but since the whole site never goes down, I guess not
14:55 <bennofs> akr`__: you may also look at GHC's eventlog system in combination with threadscope
14:55 <bennofs> akr`__: not sure if those work with GHC 6.12 though
14:56 joco42_ joined
14:56 <bennofs> (i didn't even know haskell existed when that version was up to date :D)
14:56 <akr`__> bennofs: didn't know about those, thanks
14:57 <akr`__> looks promising at least
14:57 <akr`__> (apparently eventlog is available since 6.10, heh)
14:57 radi joined
14:59 <cocreature> upgrade to a modern ghc and hope the bug goes away :)
15:00 <* hackage> paths 0.1 - Library for representing and manipulating type-safe file paths https://hackage.haskell.org/package/paths-0.1 (HerbertValerioRiedel)
15:00 {emptyset} joined
15:01 <cocreature> hvr: yet another filepath library? :)
15:01 <cocreature> hvr: the linked git repo is empty
15:02 <akr`__> cocreature: yeah, I'd like to, but the whole thing is using some patched libraries
15:02 <bennofs> hvr: so we now have 'path' and 'paths'? that feels like it might created quite some confusion
15:03 <akr`__> cocreature: plus things that might be hard to upgrade because, like template haskell
15:03 primal joined
15:03 <cocreature> akr`__: those are all good points but I would be really worried that if you stick to ghc 6.12 you are going to run into some showstopper at so me point
15:04 <akr`__> yeah, I agree
15:04 <akr`__> not really enough time atm, I already spent like ~5 hours trying to move to stack the other day
15:04 <akr`__> didn't really make any progress
15:04 <cocreature> does stack even work with ghc 6.12?
15:04 juanpaucar joined
15:05 <akr`__> well I was trying to move to 7.something as well iirc
15:05 ccomb joined
15:09 <* hackage> config-value 0.6.3, config-schema (EricMertens): https://qbin.io/n0didkny
15:10 wroathe joined
15:12 asmyers joined
15:15 calloc joined
15:17 urodna joined
15:18 PotatoCommando joined
15:23 primal_ joined
15:23 meba joined
15:24 oisdk joined
15:26 zzz joined
15:27 acarrico joined
15:29 doyougnu joined
15:31 coltfred_ joined
15:31 anuxivm left
15:32 tefter joined
15:32 <hvr> coltfred_: Stack doesn't even support GHC 7.6
15:32 <hvr> sorry,
15:32 <hvr> cocreature: Stack doesn't even support GHC 7.6
15:32 <cocreature> hvr: not even via system-ghc?
15:33 Bardusbasium joined
15:33 Cerontir joined
15:34 <* hackage> th-abstraction - Nicer interface for reified information about data types https://hackage.haskell.org/package/th-abstraction- (EricMertens)
15:35 jmcarthur joined
15:36 <ongy> hm, I have a weird error with cabal, new-haddock fails with http://lpaste.net/355883
15:36 zx joined
15:36 <hvr> cocreature: I can't find the email/issue, but afaik Stack prints a frightening warning when you use versions prior to GHC 7.8 that you're in unsupported territory and to expect problems
15:36 tristanp joined
15:37 <cocreature> ongy: I think that’s a known error. I’ve seen similar errors several times
15:37 <hvr> ongy: what happens if you say 'cabal new-haddock all'?
15:37 <ongy> hvr: up to date
15:38 <hvr> ongy: good, now remove the dist-newstyle folder, and try again w/ new-haddock all
15:38 <hvr> you've hit two bugs in a row :)
15:38 <ongy> now it runs. Good to know
15:38 <* hvr> tries to fix the first one
15:38 <ongy> so I guess this is just a missing defaulting?
15:39 <ongy> The project I did this in is https://github.com/Ongy/monky-newbuild which I made after looking at the xmonad-testing repo for local builds with new-build
15:41 felixsch1 joined
15:42 sepp2k joined
15:43 jeirosz joined
15:45 <ph88^> how can i use resumable source with conduit ? https://bpaste.net/show/3d12321ca937
15:45 <ongy> does new-haddock have a --for-hackage equivalent?
15:46 <ph88^> oh i think i see a mistake here, i have to pattern match on that tuple !!
15:46 aarvar joined
15:46 felixsch_ joined
15:48 Johan_L joined
15:49 <ph88^> hey cocreature i got it i think ! wanna see ?
15:49 Sh4rPEYE joined
15:49 eminhi joined
15:49 <* hackage> mailchimp 0.2.1 - Bindings for the MailChimp API https://hackage.haskell.org/package/mailchimp-0.2.1 (jpvillaisaza)
15:50 Sh4rPEYE joined
15:50 <cocreature> ph88^: sure
15:50 sanitypassing joined
15:51 Sh4rPEYE joined
15:51 <cocreature> ongy: --for-hackage was added very recently iirc but it doesn’t yet produce a tarball (there is an issue for it)
15:51 <ph88^> https://bpaste.net/show/f3a3c7706f1b
15:51 <ph88^> when i run it i get this though: hGetBufSome: illegal operation (handle is closed)
15:51 <ph88^> o_O
15:51 xplat joined
15:52 <ongy> cocreature: hm, I'm pretty sure I'm on a git version from yesterday and it told me --for-hackage doesn't exist. But if there's no tarball yet, I'll probably do it the old way in an container
15:52 <cocreature> ongy: huh maybe I only saw the PR and it isn’t merged yet, let me check
15:53 toby1851 joined
15:54 <cocreature> ongy: https://github.com/haskell/cabal/pull/4490 hm, seems to be merged
15:54 sssilver joined
15:55 <ongy> cocreature: it got renamed
15:55 <cocreature> oh right
15:55 <ongy> yea, works with the --haddock-for-hackage
15:55 <ongy> thx
15:56 nighty-- joined
15:56 barcabuona joined
15:58 <hvr> ongy: --haddock-for-hackage ... don't ask why
15:58 <hvr> nevermind
15:58 <ongy> thx anyways
15:58 <hvr> however, it doesn't tar itup
15:58 <ongy> but it seems to have a bug or 2. I don't get the tar AND I don't get the index.html (though cabal claims to have created it)
15:59 mstruebing joined
15:59 <hvr> yeah, as for the index.html, the bug here is only the message
15:59 <hvr> it turns out that it's correct not to generate it
15:59 <cocreature> hvr: any idea how hard it is to implement the tar’ing for someone not familiar with the cabal codebase? (e.g. me) that would remove 95% of the reasons that force me to still mess with sandboxes
15:59 Sose_ joined
16:00 <hvr> cocreature: I'd expect it to be doable :)
16:00 <ongy> oh why? Does hackage display the Description in the module header somewhere?
16:00 <* hvr> doesn't want to jinx it by saying "easy"
16:00 <hvr> ongy: hackage doens't use the index.html file
16:00 <cocreature> alright, I’ll take a look :)
16:00 <hvr> ongy: as it renders its own index
16:01 <ongy> also, why does it fail to link to e.g. Text? shouldn't it link to the haddock version of the documentation?
16:02 <hvr> ongy: that's maybe a 3rd issue/bug; in order to link to other packages, it'd need a haddock index for those; and afaik new-build doesn't yet support building that
16:02 SkyPatrol joined
16:02 <hvr> haddock meta-data is yet another artifact we need to build and store in the nix-store
16:02 fragamus joined
16:02 <ongy> how would I get the local documentation built and linked up for *everything*?
16:03 <ph88^> how can i find out why an exception has been thrown ?
16:03 <hvr> ongy: I'm afraid I don't know *yet* -- i.e. I need to investigate
16:04 <hvr> (and possibly file a few tickets about it)
16:04 <ongy> :) I just noticed that I didn't look at my code in almost 9 months and well, it's split over packages and I need my documentation :D
16:05 <hvr> too bad our last-mile hsoc students can only start in mid-june... there's lots of stuff to do =)
16:06 <cocreature> ph88^: with profiling info you can use +RTs -xc
16:06 felixsch1 joined
16:06 <ongy> oh right hsoc, when's 8.2 with cabal 2 scheduled? Like october?
16:07 <cocreature> ongy: huh? we already have rc2 of 8.2
16:07 <cocreature> if it would take until october to get the final release that would be pretty bad
16:07 <ongy> oh, I should keep track
16:07 oisdk joined
16:07 <ph88^> cocreature, i don't see anything with those flags ... maybe i didn't build it in the right way ? stack build --profile --fast --ghc-options="-j -auto-all +RTS -A128m -n2m -RTS"
16:08 <ph88^> i mean i see the usual output but that's it
16:08 <ongy> not sure if I will update before the arch repos either way... Have to see how the aur looks for ghc-git
16:08 <cocreature> arch hasn’t even updated to 8.0.2
16:08 <hvr> ongy: heh... I know ghc 8.2 running rather late... but it's supposed to get released in june latest
16:08 <ongy> yea, it's 8.0.1
16:09 juanpaucar joined
16:09 <ongy> though ghc is currently the only thing I got from the repos
16:09 <cocreature> I even emailed the maintainer this week because it’s taken him so long to update to 8.0.2
16:10 <cocreature> ph88^: are you sure an exception is actually thrown?
16:12 <ph88^> in ghci an exception is thrown
16:13 <ph88^> brb
16:13 <cocreature> ftr the error was that ph88^ had used +RTs instead of +RTS
16:13 <ph88^> i copy paste your line :P
16:13 <cocreature> oh
16:14 <cocreature> *hides in shame*
16:16 Bardusbasium joined
16:16 sellout-1 joined
16:16 oisdk joined
16:17 peterbecich joined
16:17 WhiskyRyan joined
16:19 sighingnow joined
16:21 bigos joined
16:21 systadmin joined
16:22 cpup- joined
16:24 cpup| joined
16:24 Johan_L joined
16:25 Bardusbasium joined
16:26 cpup^ joined
16:26 yqt joined
16:28 oisdk joined
16:29 WhiskyRyan joined
16:31 alx741 joined
16:31 alx741 joined
16:32 alx741 joined
16:33 Bardusbasium joined
16:34 fendor joined
16:39 kefin joined
16:39 bigos joined
16:43 Bardusbasium joined
16:43 PotatoCommando joined
16:45 Jean__ joined
16:46 jgt joined
16:47 Bassetts joined
16:48 jeirosz joined
16:48 vydd left
16:48 jbiesnecker joined
16:51 WhiskyRyan joined
16:54 cinimod joined
16:54 WhiskyRyan joined
16:56 yamad joined
16:56 zolamusic joined
16:56 joco42 joined
16:57 cables joined
16:58 cdg joined
17:01 cdg joined
17:02 <* hackage> monky - A system state collecting library and application https://hackage.haskell.org/package/monky- (ongyerth)
17:02 saussure joined
17:03 <* hackage> xmobar 0.24.5 - A Minimalistic Text Based Status Bar https://hackage.haskell.org/package/xmobar-0.24.5 (JoseAntonioOrtegaRuiz)
17:05 fotonzade joined
17:06 sedeki joined
17:07 systadmin joined
17:09 maybefbi joined
17:09 juanpaucar joined
17:09 p0a joined
17:09 <p0a> Hello I'm trying to setup haskell-mode
17:09 <p0a> on emacs. Is anyone familiar with it?
17:10 CacoS joined
17:11 mada joined
17:11 <p0a> I'm just trying to run a file, say, main = print "Hi."
17:11 <p0a> I have two buffers one with the file and one with the ghci session. not sure what to do
17:13 jship joined
17:13 <p0a> Hm... I guess I get it now. I use C-c C-l and then type main in the ghci
17:13 torgdor joined
17:13 <p0a> I had forgotten that
17:16 osa1 joined
17:16 sleffy joined
17:18 jimmyrcom joined
17:18 ryantrinkle joined
17:18 tromp joined
17:20 grayjoc joined
17:21 <ph88^> cocreature, i have a nice trace of the exception now, https://bpaste.net/show/d47856cd5fd5 but i don't know what to do about it
17:25 LKoen joined
17:25 meba joined
17:26 <Gurkenglas> Is there some remaining webpage that provides hlint output now that lpaste doesn't?
17:27 Puggy joined
17:28 <Lokathor> can't you just run hlint yourself?
17:30 Sose_ joined
17:31 epsilonhalbe joined
17:35 PotatoCommando joined
17:36 HoloIRCUser joined
17:36 juanpaucar joined
17:37 Johan_L joined
17:38 toby1851 joined
17:40 <tsahyt> is there a lensy way to filter a list for all elements that do not match a prism?
17:40 <* hpc> has never been impressed with the quality of hlint's output
17:41 <tsahyt> e.g. [Foo, Bar, Quux] -> something something _Bar -> [Foo, Quux]
17:41 grayjoc joined
17:41 <kadoban> For those that don't know, hlint is configurable the "rules" it uses. Some don't seem to know that. If you find it too opinionated, or differently opinionated than you, you can fix that.
17:41 toby_ joined
17:41 <hpc> oh, TIL
17:41 <pikajude> filter (not . has _Bar)?
17:41 <tsahyt> :t has
17:41 <lambdabot> Getting Any s a -> s -> Bool
17:41 <pikajude> does hasn't exist?
17:41 <pikajude> :t hasn't
17:41 <lambdabot> Getting All s a -> s -> Bool
17:41 <pikajude> it does
17:41 <tsahyt> works perfectly too! thanks :)
17:41 grayjoc joined
17:42 <pikajude> now, if this were scala, we could name this operator "does not have"
17:42 <tsahyt> hasn't is a weird function name. I'm not used to seeing ' inside of a name
17:42 <tsahyt> only at the end
17:42 <pikajude> yeah
17:42 <pikajude> that ed kmett is a tricky bastard
17:43 <EvanR> unusal for programming language to be grammatically correct
17:45 <tsahyt> after many years I've finally found something where lens is really worth its weight in gold. doing non-trivial rewrites and other transformations on ASTs is a breeze with lens
17:45 <tsahyt> Plated in particular
17:45 <jle`> "jquery for haskell"
17:46 <pikajude> jquery needs profunctors, imo
17:46 <Lokathor> importing Vector, Vector.Storable, and Vector.Storable.Mutable, oh boy
17:46 cyborg-one joined
17:47 <dmj`> profunctors.js
17:47 prkc joined
17:47 <EvanR> Lokathor: C in any language!
17:47 <tsahyt> Lokathor: is that so unusual?
17:47 rcschm joined
17:47 <tsahyt> in performance sensitive parts of the code I find myself doing this more than I care to admit
17:48 <Lokathor> tsahyt, all in the same module?
17:48 average joined
17:48 <Lokathor> hmm, i thought it was a little unusual, but perhaps not
17:48 <tsahyt> sometimes yeah, although I'd import them qualified
17:48 <Lokathor> yes, qualified indeed
17:48 <average> hi, how much money are you making with Haskell?
17:48 <average> straight up
17:48 <ph88^> why does this code make the handle closed ? https://bpaste.net/show/0a8495d13144
17:48 <Lokathor> average, none I'm a janitor
17:48 <average> don't deviate from the question if you choose to answer it
17:49 <average> anyone else?
17:49 <EvanR> average
17:49 <monochrom> You don't own this channel. You don't tell me what I answer.
17:49 coltfred_ joined
17:50 <average> monochrom: it's my question and I define what I feel an useful answer is for me.
17:50 <monochrom> But it is not your channel.
17:50 <tsahyt> the question has side effects, can't answer it
17:50 <average> never have I said this was my channel
17:50 <monochrom> heh
17:51 <EvanR> ill tell you when you need the answer
17:51 <monochrom> And yet you are ordering people around.
17:51 <average> monochrom: I'm not sure what your point is. are you trying to be a troll?
17:51 <lyxia> You're always asking the same question
17:51 <ongy> Lokathor: 4chan janitor? :)
17:51 <monochrom> My point is you're being bossy.
17:51 <Philonous> What's the best/easiest way to stay up to date wrt. papers on Haskell and Type Theory (particularly dependent types)? Is there an RSS feed for something like that?
17:52 <Lokathor> ongy, nope, just a normal place
17:52 cdg_ joined
17:52 <average> monochrom: and my point is I'm only interested if Haskell can generate income, how much, on what, and with what exact effort
17:52 <kadoban> Philonous: http://lambda-the-ultimate.org/ has some interesting stuff occasionally, though it's fairly low volume.
17:52 <kadoban> I'm sure there's better.
17:52 jeirosz joined
17:53 <Philonous> kadoban, Ah, nice, I forgot about that, I should subscribe to it. thanks.
17:53 <average> EvanR: you can tell me now for example :)
17:53 <ongy> haskell caffee has call for papers, which may be interesting to follow up on to see what got submitted
17:53 <average> yes, and how much money is made from submitting to a CfP
17:53 <average> about zero I suppose
17:53 <average> :)
17:53 <Lokathor> average, knowing Haskell will make you a better programmer in any language
17:53 <Gurkenglas> Trying to have intero have ghci write a type signature for me. intero's type shower gives http://lpaste.net/1225487184685957120 . My document doesn't have that many lines. Is there a better option here than to enable FlexibleContexts?
17:53 <Lokathor> the only cost is that you might hate programming in any other langauge at the same time
17:54 <average> Lokathor: I'm only interested in the financial/monetary aspect of Haskell
17:54 <bennofs> Philonous: i just found https://planet.haskell.org/, not idea how good it is
17:54 <average> nothing else
17:54 <EvanR> if you ask now then you get this ⟂ (a semantic middle finger)
17:54 <average> for me, if it doesn't make money, it doesn't matter
17:54 <Gurkenglas> Ideally, it would show the most specialized type signature that permits all its current uses.
17:54 <Philonous> ongy, bennofs, both look interesting, thanks
17:54 <Lokathor> average, if being a better programmer doesn't make you more money i'm not sure what's going on with your situation
17:54 uniclown joined
17:54 <average> from my pov, being a better programmer is making more money
17:55 <EvanR> Lokathor: what a golden age we live in
17:55 <kadoban> Lokathor: The world isn't that rational or simple.
17:55 <monochrom> Being a manager makes you more money than being a programmer, better or worse.
17:55 <average> I personally don't care about monads, unless I can make tons of money with that
17:55 <bennofs> average: wouldn't coding in some ancient language be the best then?
17:55 <tsahyt> average: with that mindset it's unlikely you'll ever make much money
17:55 <tsahyt> just my 2c
17:55 <average> I genuinely and like.. from the heart don't care about the langauge itself, unless there's a lot of money to be made
17:55 <ongy> I hear cobol programmers make stacks of money in banks :)
17:55 <Lokathor> average, then you're best served by becoming a top shelf C programmer
17:55 <glguy> average: If your primary concern is amount of money you're going to make the you shouldfind another language
17:56 <tsahyt> yeah, cobol would be a good choice there tbh. you sacrifice your sanity for it though
17:56 <kadoban> average: I doubt haskell is worth your time if your sole desire is maximum money with minimum effort.
17:56 <monochrom> ongy, but are there a lot of openings?
17:56 <average> maximum money please, yes
17:56 <glguy> average: If you have a question about Haskell programs you're welcome to come back
17:56 <average> that's my desire
17:56 <kadoban> But then I kind of doubt programming is worth the time in that case either.
17:56 <Rotaerk> programmers make pretty good money
17:56 <Rotaerk> managers make more
17:56 <coltfred_> My searching is failing me... is there a haskell package for `Field`, as in the Field from math?
17:57 <ongy> monochrom: I never checked, but I would asume they open up every other month when someone burns out :)
17:57 <kadoban> Yeah, programmers make decent money, but you always have to be learning stuff, you can't stand still.
17:57 <monochrom> ha
17:57 <coltfred_> Part of the hierarcy, Group -> Ring -> Field, etc.
17:57 <tsahyt> coltfred_: there are several packages providing algebraic hierarchies
17:57 <ongy> especially when ekmett was bored and something new exists
17:58 <tsahyt> coltfred_: algebra comes to mind
17:58 <tsahyt> @hackage algebra
17:58 <lambdabot> http://hackage.haskell.org/package/algebra
17:58 <tsahyt> but that might also be slightly overkill
17:58 <Rotaerk> kadoban, I feel like there's a lot less to learn in order to suffice than people seems to think
17:58 <Philonous> coltfred_, https://hackage.haskell.org/package/numeric-prelude has it
17:58 <coltfred_> tsahyt, Thanks!
17:58 <monochrom> If you are great at documentation (including all of: reading, writing, using), you should become a lawyer, so much better income than programmer. And yes this is why our docs such.
17:58 <monochrom> s/such/suck/
17:58 Realmkeeper joined
17:58 <coltfred_> Philonous, I wasn't sure if I wanted to replace my whole prelude...
17:58 <Lokathor> EvanR, less "C in any language!", more "Ptr backed values at any cost!"
17:59 <Rotaerk> as in, it only feels like a highly volatile industry because of the bandwagons obsessed with some particular technology
17:59 <EvanR> yeesh
17:59 <Rotaerk> the technologies tend to just be re-hashes of older tech though
17:59 scottj left
17:59 gienah joined
17:59 <Rotaerk> the fundamental knowledge doesn't change all that much
17:59 <Lokathor> EvanR, that's what gl takes, so that's what I gotta have
17:59 <EvanR> right
17:59 <ongy> that also depends on management and langauge ecosystem
17:59 <EvanR> at the very edge of the program
18:00 <ongy> I feel like js is moving pretty fast, and others (C/C++) not so much
18:00 <Lokathor> in this case, i'm lucky that JuicyPixels triially converts any picture to a RGBA Vector.Storable
18:00 <monochrom> Haskell is not going to give you money because explaining lens to people is the equivalent of doing pro-bono for your whole life.
18:00 <Lokathor> trivially*
18:00 <average> robust and long-term tech, so ways of making decent money in the long-term. if Haskell can bring that, I'm all in
18:01 <monochrom> Haskell cann't bring that. You're all out.
18:01 <average> if not, I'm definitely not looking at it as a serious skill. not for me at least. others can think what they may
18:01 <average> monochrom: then why bother..
18:01 rcschm joined
18:01 <bennofs> average: why not
18:01 <ongy> average: ever learned something because you were interested in it?
18:01 SkyPatrol_ joined
18:02 <ongy> monochrom: which of robust and long term do you think haskell doesn't fit?
18:02 <monochrom> Yes, I do want to ask you why you bother.
18:02 <Rotaerk> average, thing is, learning a new programming language is kind of a minor investment; go learn whatever it is that you can get hired for
18:02 <monochrom> As for me, I am one of those you call "think what they may".
18:02 PotatoCommando joined
18:02 <average> Rotaerk: I don't need to learn anything right now
18:02 Realmkeeper joined
18:02 <Rotaerk> C#, Java, C++, C, Javascript/web-stuff
18:02 <hexagoxel> tsahyt: is it the lens parts that make it useful, or the plated parts? have you tried just using uniplate?
18:03 acidjnk22 joined
18:03 <Rotaerk> but if you want to improve your competence, learning *concepts* is important
18:03 <Rotaerk> and using quality tools, which haskell is
18:03 primal joined
18:03 <Rotaerk> if you only care about money, and not ... actually being professional and doing a good job
18:03 <average> I only care about money
18:03 <tsahyt> hexagoxel: both actually. as a part of this AST I have a full first order logic encoding, on which I use Plated a lot for rewrites (e.g. to negation normal form etc), but accessing those FOL bits in the input and changing them is where the standard lensy bits come in
18:03 <ertes> average: you seem to be a very economical person from what you say… but that doesn't quite fit with what you're doing right now… if you want to see what haskell can buy you, invest one weekend in learning instead of rambling on IRC
18:03 <average> I honestly, like..genuinely only care about that
18:04 <monochrom> ongy: I was referring to the money part. You know what, it is a tautology that nothing guarantees money. :)
18:04 <bennofs> average: yes, and? have your questions not be answered? there are people that don't care only about money
18:04 <Lokathor> average, go found a megacorp
18:04 <average> ertes: I'd only really do that if there was a pre-planned way of making money at the end of said weekend by using what I learned in that weekend
18:04 saussure joined
18:04 <average> there's no point for me to ever use that weekend for learning Haskell if there's no money in it
18:05 <Rotaerk> there are economical reasons to use haskell, if you have the freedom to choose haskell
18:05 <average> does it make money or not
18:05 <average> that's the point
18:05 <pikajude> not really
18:05 <average> for me it is
18:05 <pikajude> would avoid it then
18:05 <Rotaerk> but if you're gonna make money by being employed by a company, you are gonna have a harder time getting hired for haskell than other languages
18:05 <ertes> average: sure: make an application/service you can sell… you can do that with haskell, and it has been done before (even the most superficial search on your favourite search engine would have revealed that)
18:05 <monochrom> average is not economically minded. average is merely your average miser. An economically minded person would offer you cash for answering their question.
18:06 <tsahyt> Rotaerk: I'd say *knowing* haskell is making developers more employable. they might just not end up actually writing much haskell
18:06 <average> hah monochrom !
18:06 <Rotaerk> hur hur, "average miser"
18:06 <ongy> and if a weekend sounds like to much time wasted, look at this
18:06 <Rotaerk> tsahyt, I'd say I agree, but I don't think HR would consider it all that impressive
18:06 prkc joined
18:06 <tsahyt> and I'd say actually much more employable. it's not unheard of that companies advertise for haskell programmers and then have them maintain java or something
18:06 <Rotaerk> and the average programmer wouldn't either, since a lot of programmers seem to look down on haskellers as being snobs or something
18:07 egis joined
18:07 <average> yeah Rotaerk , that's what I've noticed too
18:07 Johan_L joined
18:07 <average> and you know what, it's fine with me if you're a snob making tons of money
18:07 Wuzzy joined
18:07 <average> at least then you have some bragging rights
18:07 <hexagoxel> tsahyt: ah, makes sense, i can imagine such use-cases.
18:07 <average> so is Haskell a monetizable skill or not?
18:08 <grizwako_> well, bragging rights suchs as "others do not have problems because of code I have written" seems fine with me
18:08 <bennofs> average: hasn't this been answered many times already?
18:08 <monochrom> I say no. As far as I know.
18:08 <kadoban> average: Which answer would you like? You seem to keep asking the same thing, are you waiting until you get a specific answer?
18:08 <Rotaerk> average, it really depends on your strategy...
18:08 <monochrom> But I also have a hunch that you will keep asking that for the next 365 days.
18:08 <average> monochrom: you seem to be very stressed by my question. why is that?
18:08 <monochrom> As though you're desperate for someone to say yes.
18:08 <Rotaerk> if your strategy is to get hired and paid a huge salary, you can do that with haskell, if you're lucky enough to find a job that will hire you
18:09 <grizwako_> if you are thinking about working directly with haskell, it is, but you need a lot of time invested
18:09 <Rotaerk> but there are better languages for that strategy
18:09 <grizwako_> like 1 year+
18:09 PotatoCommando joined
18:09 <ertes> average: you're not getting the point: haskell is just a language – a tool… it doesn't matter
18:09 <monochrom> I don't know. I need to read your mind to find out why things seems whatever to you.
18:09 <average> ertes: it matters a lot to me
18:09 <Rotaerk> if your strategy is to write some software and sell it, then haskell would be good there, because you're not constrained by what the company accepts
18:10 <Rotaerk> and it has technical advantages over other languages
18:11 <ertes> average: do you have a business strategy that is calculated to the penny?
18:11 <Rotaerk> I'd love to use haskell at work, but that's just not gonna happen, because they dictate the languages we're allowed to use
18:11 <tsahyt> that's a good point. if you're free to pick your tech, haskell is a choice that can make money down the line by saving on maintenance costs among other things. at least in my experience, haskell makes maintenance comparatively easy
18:11 <tsahyt> and iirc about 3/4 of costs eventually go into maintenance, so that's a good place to optimize the process
18:11 <average> if someone were to make a statement like "The Haskell language and all its community and eco-system is generating a lot of poverty in IT professions and specifically among programmers"
18:11 <average> how would you counter that statement?
18:11 <tsahyt> average: I would say that statement doesn't even make sense
18:11 <average> tsahyt: well.. how so?
18:11 <monochrom> I would agree with it.
18:12 <average> monochrom: surprise! why?
18:12 <Rotaerk> monochrom just sounds like a grumpy old guy :P
18:12 <grizwako_> heh
18:12 <grizwako_> my day job is magento/php...
18:13 <pikajude> i'm not sure exactly what generating a lot of poverty means
18:13 <ertes> average: i would say that haskell is not a commodity, so the statement is non-sense… people cause poverty by fixating on technology when their focus should be on a real business strategy
18:13 <Tuplanolla> How do you generate poverty? Is it like conducting cold?
18:13 <ongy> monochrom is a grumpy old guy :D
18:13 <average> grizwako_: and that's a sane decision. that's an e-commerce platform. money revolves around e-commerce platforms so you get paid, and you get paid well i assume.
18:13 <grizwako_> haskel / functional style overall, helps me a lot in writing code with less bugs
18:13 <monochrom> Automation has always driven up poverty.
18:13 bennofs1 joined
18:13 <ongy> monochrom++
18:13 <grizwako_> not really well, but it pays bills..
18:13 <pikajude> oh, i see
18:13 <Rotaerk> lol, oh
18:13 oisdk joined
18:13 <EvanR> by all means drive up the poverty then
18:14 <pikajude> by reducing the amount of effort needed to write code, presumably
18:14 <ertes> average: but honestly i don't think you're the kind of person you're claiming to be, because your attitude and behaviour doesn't line up with "i only care about money"
18:14 <ongy> EvanR: I think we first have to fix a few things about economy and capitalism, but that's going OT :)
18:14 <grizwako_> thing is, that I have experience with large system, that could be said to be opposite of haskell "mindset"
18:14 <monochrom> Not to say that it's automation's own fault. But the manager type do exploit automation to rip off human labour.
18:14 <average> ertes: I'm down to have a detalied debate about Haskell and money
18:14 <average> *detailed
18:15 <EvanR> do it in -offtopic ;)
18:15 <grizwako_> you get mutable state all around, things depend on other things, code that you do not control, breaks other code that you do not control
18:15 <average> ertes: I'm not a superficial debater, if that's what you were trying to say. and yes, mine was not a simple question
18:15 <average> it's a hard question, even the answer may be hard(to formulate and to accept)
18:15 <Rotaerk> I don't think that's remotely what he was saying
18:15 <average> Rotaerk: I know what he was saying
18:15 doyougnu` joined
18:15 <ertes> average: now to bring it back on what is actually on topic here, do you have a technical question about haskell?
18:16 <grizwako_> being exposed to haskell helps me survive in that mess
18:16 <ph88^> how can i find out why this code makes the handle closed? https://bpaste.net/show/0a8495d13144
18:16 <average> ertes: well, I believe the topic I brought up is actually a technical question
18:16 <average> that's how I view it
18:17 <grizwako_> it is not
18:17 darjeeli1 joined
18:17 ryantrinkle joined
18:17 <ertes> average: if your question is how haskell can make/save money through its technical features, here is an answer: code tends to be shorter, safer and better maintainable in haskell compared to most other languages
18:18 <ertes> in particular haskell makes refactoring exceptionally easy, so it's very good at adapting to new market conditions
18:18 hc joined
18:18 <Rotaerk> average, programming is marketable because it results in software that saves time and money, not to mention makes some things feasible that are otherwise not. all the details of programming, such as the tools involved, are all focused on optimizing the cost of developing and/or supporting that software
18:18 <average> ertes: listen here Monad-boy, you can write oneliners in Bash too, that doesn't make the code more maintainable because it's shorter..
18:19 <pikajude> that's true, and also not what ertes said
18:19 <Rotaerk> he didn't say it was more maintainable *because* it was shorter
18:19 <Rotaerk> although brevity can help, to a point
18:19 <pikajude> i don't think you can write haskell in one line though, sadly
18:19 <pikajude> anything non-trivial
18:19 tromp joined
18:19 <grizwako_> python code is of similar size usually, but I would be more confident in changing haskell code than in changing python code
18:19 <ertes> average: shorter and more maintainable = more maintainble, because shorter
18:19 <ertes>
18:19 <monochrom> I am going to crown ertes as Monad Boy Of The Day
18:19 CacoS joined
18:20 sellout- joined
18:20 <pikajude> unless substituting ; for \n also applies to top level bindings
18:20 <ertes> =)
18:20 <average> a bunch of monadists..
18:20 <tsahyt> pikajude: couldn't you inline everything into main?
18:20 PotatoCommando joined
18:20 <average> much <3
18:20 <pikajude> tsahyt: kind of
18:20 <ertes> … and that reveals average as the average troll
18:20 <ongy> with a bunch of let .... in :)
18:20 <grizwako_> about technical stuff, any resources for haskell + vulkan?
18:20 <pikajude> i guess you really could
18:20 <average> ertes: not at all actually
18:20 mjs2600 joined
18:21 <average> ertes: but, I can make a joke from time to time..
18:21 <monochrom> Ah don't be too literal about "line"
18:21 <EvanR> classic
18:21 <Rotaerk> I'm not sure average is actually a person who "only cares about money", so much as someone playing a *role* for the sake of trying to force haskell to defend itself on practical terms or something
18:21 benjic joined
18:21 <tsahyt> grizwako_: afaik the bindings we have are pretty much 1:1 equivalent to the C bindings, so any of the vulkan C tutorial should work when you squint enough
18:21 <ongy> feels like the averade day on 4chan :)
18:21 <ongy> I wonder if average knows Protontorpedo
18:22 <grizwako_> tsahyt, yeah, I get that, I know basics of functional programming, have rough idea about applicative and monads, did not write any serious amount of code yet
18:22 <ertes> average: oh, we have bad jokes in spades: "it's just a monoid in the category of endofunctors, what's the problem?" took me 7 years to get the joke just to find that it wasn't that funny
18:22 <Rotaerk> i.e. "let's say I only care about money, what argument could you provide to convince me to use haskell?"
18:23 <grizwako_> and I have almost no xp at all with graphics programming
18:23 <Tuplanolla> If you only care about money, I recommend a life of crime.
18:23 <average> Rotaerk: but that's not what I said, please to reproduce faithfully when quoting..
18:23 <monochrom> Oh, actually I know the answer.
18:23 <tsahyt> grizwako_: then I'd rather start with opengl tbh. vulkan is very very low level
18:23 <average> monochrom: reveal it then
18:23 <Rotaerk> average, that wasn't a quote of you
18:23 <average> Rotaerk: but who
18:23 <grizwako_> yeah, that is why I want it
18:23 ExcelTronic joined
18:23 <grizwako_> I think vulkan fits really nice with multithreading
18:23 <Rotaerk> it was a fictional quote
18:24 <grizwako_> but I am not sure if it is too large of a bite :)
18:24 <tsahyt> grizwako_: I don't think the FP nature of haskell is going to matter much with vulkan, pretty much anything you do will be in IO and it'd be some very imperative code anyhow. you can of course abstract to something nicer from there
18:24 <average> 21:23 ( Tuplanolla) If you only care about money, I recommend a life of crime.
18:24 <tsahyt> I mean yeah, general monad patterns still apply of course
18:24 <ertes> grizwako_: have you done OpenGL?
18:24 <average> Tuplanolla: best answer ever
18:24 <* average> claps
18:24 <ertes> grizwako_: if not, i *strongly* suggest doing OpenGL first
18:24 <grizwako_> only a very little, I understand basic concepts
18:25 ericdwhite joined
18:25 <ertes> grizwako_: do you have a specific application in mind?
18:25 <grizwako_> bullet hell top down 3d shooter
18:26 <ongy> top down 3d?
18:26 <grizwako_> yeah
18:26 <ertes> grizwako_: can you get a scene with lighting and shading on the screen with OpenGL?
18:26 <grizwako_> it is mostly for learning purposes, with my very limited knowledge it seems like good project to start with
18:26 <grizwako_> not on my own without looking online
18:27 <ertes> grizwako_: i'd also ask for visiblity stuff, but that won't matter too much in a top-down game
18:27 cpennington joined
18:27 <ertes> grizwako_: then do that first… vulkan will build on your knowledge, and so will most tutorials about vulkan
18:27 xplat joined
18:27 CaptainLex joined
18:27 <grizwako_> ok, thanks
18:27 <Tuplanolla> Why is that the case? Isn't Vulkan supposed to deprecate OpenGL?
18:28 <grizwako_> well, generally people consider vulkan hard
18:28 coltfred_ joined
18:28 <EvanR> GL is already pretty hard
18:28 <grizwako_> and you need to learn 2 things, graphics and gpu
18:28 <ertes> Tuplanolla: yes, but you still need all the knowledge you had with OpenGL
18:28 <ertes> consider vulkan to be level 2 in the graphics programming game =)
18:29 <grizwako_> with OpenGL you need only graphics, and little GPU for performance
18:29 <ertes> beat level 1 first
18:29 cdg joined
18:29 <ertes> what?
18:29 <Tuplanolla> There's a difference between mastering PHP hard and Haskell hard.
18:29 <grizwako_> haskell hard is easier than PHP hard imo :)
18:29 <Tuplanolla> The former is largely a waste of time.
18:30 darlan joined
18:30 <ertes> this is also a statement on the current vulkan ecosystem… pretty much everything will assume that you already know how to do OpenGL
18:30 <grizwako_> anyway, about graphics, with opengl you need to learn about how graphics work, how to manage scene, lights
18:30 <ertes> in the best cases conceptually, in the worst cases in high technical detail
18:31 <ertes> grizwako_: no
18:31 <ertes> that's OpenGL < 3.0
18:31 <grizwako_> with vulkan, you need to get into how cpu and gpu communicate and how to do it in safe way
18:31 Sose_ joined
18:31 <grizwako_> ok :)
18:31 <ertes> starting with OpenGL 3, your focus will be on communicating with and programming the GPU
18:31 <ertes> most of the work is done in shaders
18:31 dddddd joined
18:32 <grizwako_> sorry for talking bullshit, but if I just throw out my assumption somebody helpfull could set me straight :)
18:32 uniclown joined
18:32 <tsahyt> grizwako_: this strategy is proven to be the most effective one to get an answer on the internet, according to xkcd iirc
18:32 <grizwako_> is it worth it to learn OpenGL via haskell, or I should just go with c++?
18:33 xplat joined
18:33 <ertes> grizwako_: haskell is fine… use the 'gl' library, which is a direct mapping of the API
18:33 <EvanR> if youre going to learn low level C code, i would rather do it with haskell than C++ ;)
18:33 <grizwako_> my goal is only to learn, not to make something usable, maintanable
18:33 <EvanR> but best would be C
18:33 systemfault joined
18:33 <tsahyt> EvanR: being able to C in Haskell is a surprisingly useful skill sometimes
18:33 <ertes> personally i'd suggest haskell anyway
18:34 SkyPatrol joined
18:34 <* osfameron> is shocked, shocked that #haskell is suggesting using Haskell for something
18:34 <ertes> if only for the pleasure of working with storable vectors instead of C arrays =)
18:34 <grizwako_> well, since my plan is to use vulkan from haskell later on
18:34 <grizwako_> that skill shoud translate from gl lib to vulkan?
18:35 <tsahyt> I've actually been meaning to look into vulkan with haskell too, maybe write a tiny toy engine utilizing FRP
18:35 <tsahyt> but I never got around to it
18:35 <grizwako_> so I will have one less mountain to climb over
18:35 <ertes> grizwako_: yeah, pretty much… the vulkan library is using the same kind of automatic API generator
18:35 <ertes> grizwako_: in fact i think it's literally the same one, rewritten to work on the vulkan spec
18:36 mstruebi1 joined
18:37 <grizwako_> ertes, thanks for advice (others too!)
18:37 mjora7 joined
18:38 gugah joined
18:39 raichoo joined
18:40 juanpaucar joined
18:42 sternmull joined
18:45 <Cale> ertes: Yeah, the "monoid in a category of endofunctors" thing... isn't necessarily even a joke.
18:45 <ertes> the "what's the problem?" part is the joke
18:46 <Cale> Yeah, or the fact that if you knew what it meant, you probably wouldn't need an explanation of what a monad is.
18:46 <EvanR> what other theorem statements can we make into a joke
18:47 <Cale> A category is just a monad in the 2-category of spans of sets.
18:48 quobo joined
18:48 <ertes> categories are monoids on steroids
18:48 <Cale> You could probably just pick a random page on ncatlab and find such a ridiculous characterization
18:49 kefin joined
18:52 <Tuplanolla> Can I formulate any theorem in the form "x in the category of y"?
18:53 <ertes> that's… just an expression
18:53 cdg_ joined
18:56 <Taneb> Tuplanolla, a surprising amount of algebra definitions are like "A Lie Group is a group object in the category of differentiable manifold"
18:57 joco42 joined
18:58 jeirosz joined
18:59 oisdk joined
19:01 osa1_ joined
19:02 Scip joined
19:03 <Gurkenglas> Ah, replacing about 40 lines with "iterationGroup is = partsOf (traversed . indices (`elem` is)) %= reducePotentials" x)
19:03 <average> how is that intuitive tho
19:03 <average> if I looked at that I'd have no idea what it did
19:04 <Gurkenglas> Yea, I added a comment. That's worth the line savings.
19:04 <bennofs1> makes sense to me
19:05 <ertes> Gurkenglas: the "x)" part is a smiley, isn't it?
19:05 <Taneb> The brackets don't match
19:05 <ertes> ah, yes, it is =)
19:05 <Taneb> Ah, same confusion as ertes
19:05 <average> Gurkenglas: so you swapped code for comments
19:05 <ongy> what's %=? something like map?
19:05 <ertes> ongy: over
19:05 <ertes> :t over
19:05 <lambdabot> ASetter s t a b -> (a -> b) -> s -> t
19:05 <ertes> but for StateT
19:05 <Taneb> ongy, very loosely, yeah
19:05 <average> Gurkenglas: that must be an improvement for some definition of it..
19:06 <average> I guess I now see why everyone loves Haskell
19:06 <bennofs1> average: if you're familar with lens, that code is pretty readable
19:06 <average> you write more english and less code?
19:06 cdg joined
19:06 <ongy> I'm not really familiar with lense and I still see why it's pretty :)
19:06 <ertes> ongy: there is a state variant for pretty much every lens operator
19:07 <ertes> like (%=) for (%~), (.=) for (.~), etc.
19:07 <ertes> so in StateT you would write: blah . blubb %= f
19:07 Dookie12 joined
19:07 <ertes> or even (like in C): blah . blubb += 5
19:07 <ongy> yea, makes sense. I have a basic grasp of lens, just not indepth
19:08 saussure joined
19:08 Dookie12 joined
19:08 nshepperd joined
19:09 Swizec joined
19:09 mstruebing joined
19:09 conal joined
19:10 <Gurkenglas> Though if I'm going to keep reusing the same is's, is there a way to build the traversal only once so it doesn't have to keep looking up using elem?
19:10 afarmer joined
19:10 <ph88^> how can i find out why this code makes the handle closed? https://bpaste.net/show/0a8495d13144
19:10 <ertes> Gurkenglas: not sure if it applies to your use case, but you can use 'zoom' with traversals
19:11 yellowj joined
19:11 mstruebing joined
19:11 <ertes> > execState (zoom traverse $ do _1 += 5; _2 += 7) [(10,10), (20,20), (30,30)]
19:11 <Gurkenglas> Nah, doesn't, it's 27 alternately used values of is. (Guess the use case!)
19:11 <lambdabot> [(15,17),(25,27),(35,37)]
19:12 chlong joined
19:12 <bennofs1> Gurkenglas: you can probably build an efficient traversal by hand, but I don't think you will be able to reuse many combinators. Does the order of the elements matter, or can you sort is?
19:14 <Gurkenglas> That's still going to carry around the indices when the traversal is applied, I'm hoping for something that precomputes the traversal without the function to apply over it
19:16 ianandrich joined
19:17 toby1851 joined
19:18 ryantrinkle joined
19:18 tromp joined
19:18 <bennofs1> Gurkenglas: not sure how to precompute it. at the end, you still have to store the info of what indicies you take out of the list somewhere
19:19 cpup joined
19:20 <Lokathor> does a "#ccall" in a bindings make a normal foreign call?
19:20 <Lokathor> that is, is the default to make uninterruptable or interruptable?
19:21 prophile joined
19:22 Rotaerk joined
19:24 jerbome joined
19:26 <Rotaerk> c_wraith, you said machines is experimental still; is it sufficiently mature for pet projects, if not for production systems in a business?
19:27 besenwesen joined
19:27 CoderPuppy joined
19:27 <ertes> Rotaerk: the 'machines' library?
19:27 <Rotaerk> yea
19:27 <ertes> Rotaerk: i'm using it heavily… it has pretty much replaced pipes for me
19:28 <Rotaerk> ah; I was actually thinking of doing the same, because pipes is kind of limiting for branching inputs/outputs
19:28 telser joined
19:28 <geekosaur> ph88^, which sourceFile is that using?
19:28 <Rotaerk> can kinda get by, but it's a bit ugly
19:28 <* hackage> here 1.2.10 - Here docs & interpolated strings via quasiquotation https://hackage.haskell.org/package/here-1.2.10 (TaylorHedberg)
19:29 <Philonous> If it replaces pipes it presumably also replaces conduits?
19:29 <Philonous> Is there a comparison of machines/pipes/conduits?
19:29 tristanp joined
19:30 <uniclown> newtype All = All { getAll :: Bool }
19:30 <Rotaerk> ertes, thanks; I'll try it, now that I know it's viable
19:30 <uniclown> why is this a common idiom in haskell
19:30 <c_wraith> Rotaerk: and yeah, it's fine for pet projects.
19:31 <c_wraith> uniclown: because it's a one-liner that declares the getter and the data type together
19:32 <geekosaur> uniclown, because it gives you both a type and a 'runner'/accessor for it
19:32 <geekosaur> usually it's used to make a runnable monad or an alternative monoid instance (in this case it's the latter)
19:32 rullie joined
19:32 <c_wraith> uniclown: that said, no one should care if you don't use it. You just need to be able to understand what's going on if you encounter it
19:33 <tsahyt> geekosaur: is it an alternative monoid instance when the underlying type doesn't have one?
19:33 <geekosaur> when there's multiple possible instances and none stands out as the default, yes
19:33 <c_wraith> tsahyt: in the case of All, yes
19:33 <uniclown> so what's the alternative to that idiom? Is it just an algebraic variant with one constructor?
19:33 <geekosaur> it just means possibly several alternatives, but no default
19:33 <tsahyt> uniclown: newtype All = All Bool, and then some function getAll :: All -> Bool, with getAll (All x) = x
19:33 <c_wraith> tsahyt: but there are also things like Reverse which is a monoid that reverses application order of an underlying monoid
19:34 <tsahyt> uniclown: using record syntax just reduces boilerplate code
19:34 <geekosaur> likewise we have Sum and Product newtypes with their own Monoid instances, but no default
19:34 <uniclown> ok makes sense. Thank you
19:36 Icewing joined
19:36 fendor joined
19:38 <ph88^> geekosaur, "sj300e_bin.dat"
19:38 oisdk joined
19:39 <geekosaur> ... I am not sure how you got that answer from my question
19:39 ryantrinkle joined
19:40 <geekosaur> but it looks like both conduit-extras and conduit-combinators close the file automatically
19:40 <ph88^> geekosaur, import qualified Data.Conduit.Binary as CB
19:40 <ph88^> eh that's not good .. how can i work with ReusableSource this way ?
19:41 <ph88^> ResumableSource *
19:42 mizu_no_oto joined
19:42 PotatoCommando joined
19:44 simukis joined
19:46 cdg joined
19:47 echoreply joined
19:47 PotatoCommando joined
19:48 cdg joined
19:48 <ertes> Rotaerk: the reason i use it is not because of branching, but because of the separation between PlanT and MachineT
19:49 <ertes> Rotaerk: i can use efficient CPS for the individual stream processors and only expand to an algebraic encoding for connecting the plans
19:49 <ertes> pipes relies heavily on rewrite rules to make that efficient
19:52 <Rotaerk> ah
19:54 <Rotaerk> my use case is something like... having a producer of E where data E = A X | B Y | Z C
19:54 <average> what if you used Bash and GNU parallel for that? :)
19:54 <Rotaerk> and then pumping the contained values through Pipe X o, Pipe Y o, and Pipe Z o
19:54 <average> and the regular pipes you have in Bash :)
19:54 <Rotaerk> average, you wouldn't understand
19:55 <average> Rotaerk: I think I meant _would_
19:55 <average> *you meant _would_
19:55 <Rotaerk> nope
19:55 <average> Rotaerk: what are you building?
19:55 seantparsons joined
19:56 <Rotaerk> ertes, so something like: ePipe :: Pipe X o m r -> Pipe Y o m r -> Pipe Z o m r -> Pipe E o m r
19:56 <Rotaerk> I can get by with doing that in pipes, but it's kind of ugly
19:58 <Rotaerk> ended up doing it by making a: branch :: Monad m => (i -> Maybe i') -> Pipe i' o m r -> Pipe i o m r -> Pipe i o m r
19:59 anodium joined
19:59 <Rotaerk> average, by the way, working in bash is painful
19:59 mizu_no_oto joined
20:00 <average> Rotaerk: why? I use Bash for a lot of things. How is it painful?
20:01 <average> Rotaerk: the syntax is not worse than Haskell's ..
20:01 <average> both are Turing-complete..
20:01 sellout- joined
20:01 <average> Bash has no types.. less headaches..
20:01 <Rotaerk> bash doesn't have a type system; that's a pain-poinnt
20:01 lamduh joined
20:01 <average> it's actually not a pain-point at all..
20:02 <Rotaerk> well, actually, we should take this to -blah or -offtopic
20:03 jeirosz joined
20:05 <ertes> Rotaerk: maybe i haven't hit the use case yet, but i don't really see a lot of value in branching… perhaps because whenever branching comes up, i tend to gravitate towards real concurrency =)
20:05 lamduh joined
20:06 <Rotaerk> ertes, simple example: I have a TCP connection object which produces TCP.Event values, which include: Received ByteString | Closed | Disconnected
20:06 rcschm joined
20:06 <Rotaerk> there are already plenty of Pipe ByteString o m r things, but you can't trivially use them in a Pipe Event o m r
20:07 <Rotaerk> need a way to pump a subset of the inputs through that one pipe, and the other inputs through a different one
20:07 <ertes> Rotaerk: yeah, to me it would be a producer that just stops
20:07 wroathe joined
20:08 <ertes> Producer ByteString m 2 -- something along those lines
20:08 <ertes> where 2 is any binary type
20:08 rullie joined
20:08 mnoonan joined
20:08 Sh4rPEYE joined
20:08 <Rotaerk> maybe a better example is: data IRC.Event = Received IrcMsg | InvalidMessage Text | Closed | Disconnected
20:09 <Rotaerk> and if I have a Pipe IrcMsg that I want to use, but only for the Received events...
20:09 <Rotaerk> (better example because "just ending" only eliminates the need for Closed and Disconnected)
20:10 <ph88^> anyone know how to use ResourceT ?
20:10 oisdk joined
20:10 JagaJaga joined
20:12 <ertes> Rotaerk: yeah, something like that tends to be the final producer for me… and i tend to just feed it into an MVar or TQueue
20:12 <Rotaerk> ah
20:12 <ertes> i've never really needed branching as part of the stream pipeline
20:12 <Lokathor> it seems cruel that Vector.Storable has the very nice generateM and Vector.Storable.Mutable does not :(
20:12 joco42 joined
20:12 mizu_no_oto joined
20:13 <Rotaerk> maybe I *should* eliminate the Closed/Disconnect though...
20:14 average left
20:14 dni joined
20:15 BlueRavenGT joined
20:16 toby1851 joined
20:17 <EvanR> something doesnt appeal to me about a Closed / Disconnect event in a pipe
20:18 <EvanR> because you dont expect to get anything after that point, its logically different than "the next event"
20:18 <Rotaerk> yea that's why I'm reconsidering, in this case
20:18 <ertes> Rotaerk: BTW, another useful abstraction for that kind of thing is FRP
20:18 <EvanR> if you treat it wrong, youll get stuck
20:18 <Rotaerk> although a Disconnect event IS useful for an "IRC session" object I'm gonna build
20:18 <Rotaerk> where disconnection just means it'll try to auto-reconnect
20:18 <EvanR> well the session is logically over at that point
20:19 <EvanR> and you need a new one
20:19 <ertes> the connection is over
20:19 <Rotaerk> no, the "Session" object abstracts the connection, and persists across disconnects
20:19 <EvanR> oh
20:19 <ertes> a "session" can be really anything
20:19 <Rotaerk> maybe a better word than session is warranted
20:19 <ertes> "session" is fine
20:20 <ertes> Rotaerk: but i would reconsider if there needs to be a "session object"
20:20 <EvanR> still, i imagine an on going connection to be a thread, and when its over, the thread dies (and you know it because youre waiting on it somewhere)
20:20 <Rotaerk> I think it would be valuable to have here
20:20 <ertes> as i said: FRP is almost a perfect fit for IRC
20:20 saussure joined
20:20 <Rotaerk> I was planning on using FRP for the GUI aspect
20:20 <EvanR> or if it crashes. you will get a result, and you definitely wont be getting anything more from it
20:21 <ertes> i'd use it for IRC itself
20:21 osa1_ joined
20:21 <ertes> GUIs are a surprisingly boring use case for IRC
20:21 <Rotaerk> for FRP * ?
20:21 <ertes> *for FRP
20:21 <EvanR> i would use async
20:22 <EvanR> hardcore
20:22 <EvanR> more flexible
20:22 <Rotaerk> what I'm currently building is strictly a daemon... it will ultimately manage the state of the IRC connection and communication with the IRC server, and then it will send user-events and receive user-commands via inter-process communication of some sort
20:22 <Rotaerk> you still recommend FRP in that case?
20:22 <Rotaerk> seems really pipe-y to me
20:22 Kreest_ joined
20:22 conal joined
20:22 <EvanR> it seems asynchronous to me ;)
20:22 <Rotaerk> (I haven't got a remotely intuitive understanding of FRP yet, so I can't really judge that)
20:23 <EvanR> because the demon is both managing inputs from the server and from the user
20:23 <Rotaerk> well I've definitely got some asyncs going on; that's why I'm building "objects"
20:23 <ertes> Rotaerk: of course… FRP has nothing to do with graphics or UIs… it's an abstraction to model interactions
20:23 primal_ joined
20:23 <Rotaerk> when I say object, I mean an agent running asyncronously, with which you can communicate only through message passing
20:23 <Rotaerk> (via mailboxes and pipes)
20:23 <EvanR> a thread!
20:24 <ertes> UIs are just an obvious (and boring) use case, much like servers are an obvious and boring use case for concurrency
20:24 <EvanR> agent is so vague :(
20:24 <Rotaerk> objects tend to be in their own "thread", but there's more to them than *just* a thread
20:24 <Rotaerk> i.e. the message-passing part
20:24 Welkin joined
20:24 <EvanR> anything beyond the IO action the thread is, and whatever you gave it for communication, seems like overengineering
20:24 <ertes> Rotaerk: if your interactions are really basic, then FRP probably won't buy you much
20:25 <ertes> but if you start filtering and switching, you will quickly benefit from it
20:25 <Rotaerk> hmm I'm open to using FRP, but as of now, I don't have the faintest idea how it would help exactly
20:25 <Rotaerk> I mean, different from how pipes
20:26 <EvanR> this problem has nothing to do with FRP
20:26 <Rotaerk> since this is really just a stream of incoming data and a stream of outgoing data, with logic in the middle to decide what goes in/out
20:26 <EvanR> like you said, "concurrency for servers"
20:26 <EvanR> which this is
20:27 <EvanR> Rotaerk: isnt it 2 streams going in opposite directions?
20:27 <EvanR> 2 inputs, 2 outputs
20:28 <Rotaerk> EvanR, yea, IRC network -> internal processes, and internal processes -> IRC network
20:28 <EvanR> (which pipes seems to support in one data type)
20:28 <Rotaerk> though really there will be many networks and many processes simultaneously
20:28 <EvanR> it sounds super async
20:29 <Rotaerk> I'm not using bidirectional pipes, because with IRC, the in and out streams are pretty independent
20:29 <Rotaerk> so I'm using two unidirectional pipelines
20:29 <Rotaerk> the bidirectional pipes are more for like... requesting something from upstream and getting it back
20:29 <Rotaerk> but there's nothing like that with IRC
20:30 <EvanR> yes, getting nothing at all back is normal
20:31 conal joined
20:31 Cassiopaya joined
20:32 thebardian joined
20:34 <Rotaerk> anyway, ertes, thanks for the suggestion; I'll ponder how FRP would help
20:34 <Rotaerk> hadn't considered using it for the internals
20:36 <EvanR> this falls more into dataflow programming
20:36 <EvanR> rather than continuous time behaviors
20:36 <EvanR> but because of the many async processes going on that need monitoring... i wouldnt want either
20:37 <Rotaerk> EvanR, I am using both async and pipes for this
20:37 yellowj joined
20:37 <Rotaerk> communication between the async tasks is done via mailboxes... pipes-concurrency
20:37 <EvanR> how does that handle threads finishing and crashing
20:38 saussure joined
20:38 <Rotaerk> e.g. my TCP connection object is represented as: { connectionTask :: Async (), fromConnection :: Producer Event (), toConnection :: Consumer Command m () }
20:39 <Rotaerk> though per the above suggestion, I may change that to something like...
20:39 Costar joined
20:39 crave joined
20:39 <Rotaerk> { connectionTask :: Async (), fromConnection :: Producer ByteString m EndEvent, toConnection :: Consumer Command m () }
20:40 <Rotaerk> where EndEvent distinguishes between closing and disconnecting
20:40 <EvanR> ah
20:40 <crave> How do I express that the return type of a function is uniquely identified by its inputs?
20:40 plutoniix joined
20:40 <EvanR> by its input types?
20:41 <Rotaerk> crave, can you be more specific?
20:41 <EvanR> you could use an injective type family
20:41 bendo joined
20:41 <EvanR> or a type class with functional dependency
20:41 <crave> functional dependency! thanks
20:42 <EvanR> the injective type family seems more targeted
20:42 plutoniix joined
20:42 <EvanR> but type classes let you add more cases later
20:44 Johan_L joined
20:45 ChaiTRex joined
20:45 mjora7 joined
20:46 bollu joined
20:47 cdg joined
20:48 <ertes> Rotaerk: FRP helps with event handling… it's very useful to have events as first class objects
20:49 <EvanR> if you just want to filter events, then you could use E a = a -> Bool, which compose as contrafunctors
20:50 <EvanR> to select events according to composable conditions
20:50 Johan_L joined
20:51 Dookie12 joined
20:53 fotonzade joined
20:54 Big_G joined
20:55 ccomb joined
20:56 Jesin joined
20:56 saussure joined
20:57 <jle`> jjjk
20:58 Shatnerz joined
20:58 <EvanR> :q!
20:58 <jle`> huh i wonder why this keeps happening
20:58 <EvanR> is your IRC inside of vim? ;)
20:59 <jle`> i'm in vim and i try to move and i find out my ssh tunnel has died, so i force kill it with <CR>~. and log back in. and then it sends them after
20:59 <jle`> my ssh opens right into weechat so maybe it queues up the commands i couldn't send before?
20:59 <* hackage> turtle 1.3.4 - Shell programming, Haskell-style https://hackage.haskell.org/package/turtle-1.3.4 (GabrielGonzalez)
21:00 <cocreature> jle`: the solution is to use mosh to avoid dying ssh tunnels :)
21:01 <jle`> hmm thanks, this looks promising :)
21:03 <srk> or screen :)
21:03 mjora7 joined
21:04 <jle`> i use tmux on my server
21:04 Batzy joined
21:04 <jle`> i just lose the connection from my computer, heh
21:04 <cocreature> I use mosh and tmux and it works great :)
21:05 <jle`> when i logon to my server, it automatically hooks onto a running tmux session and it just happens to open into the window with my irc client
21:05 <jle`> probably not the best thing to open into though
21:05 <srk> jle`: there's also KeepAlive for ssh
21:05 <srk> option
21:06 blah9876 joined
21:06 <geekosaur> KeepAlive is kinda useless actually, {Server,Client}Alive{Interval,Count} more useful
21:06 <Sh4rPEYE> Is there any good article (or a nice way you can describe it here) about replicateM? It seems to be widely used in various context and it is pure magic to me every time I see it. Last example: I use kmers n xs = [ x : y | x <- xs, y <- kmers (n - 1) xs ], while they simply write kmers' = replicateM
21:06 <geekosaur> (TCP keepalives tend to not fire often)
21:08 jeirosz joined
21:08 ianleeclark joined
21:08 <cocreature> Sh4rPEYE: I recommend to just take a look at the source of replicateM and figure out what the Applicative operations mean for various instances
21:09 juanpaucar joined
21:11 ErinvanderVeen joined
21:11 mac10688 joined
21:11 ExcelTronic joined
21:13 joco42 joined
21:14 felixsch_ joined
21:15 saussure joined
21:16 <Cale> Sh4rPEYE: I can explain it if you like. I would guess that you're relatively unfamiliar with Monad?
21:16 takle joined
21:17 erisco joined
21:17 <Sh4rPEYE> Cale: I understand the basics, did few exercises... But yes, relatively unfamiliar
21:17 <Cale> Sh4rPEYE: The Monad instance for lists basically behaves a lot like list comprehensions -- "running" a list means picking an element from it, in all possible ways:
21:17 jgt joined
21:17 <Cale> > do x <- [1,2,3]; y <- [4,5]; z <- [6,7,8]; return (x,y,z)
21:17 <lambdabot> [(1,4,6),(1,4,7),(1,4,8),(1,5,6),(1,5,7),(1,5,8),(2,4,6),(2,4,7),(2,4,8),(2,...
21:18 <Cale> So in this example, x is bound to each of [1,2,3] in turn, and so on
21:18 <Lokathor> Segmentation fault/access violation in generated code
21:18 <Lokathor> ouch
21:18 takle joined
21:18 <Cale> Sh4rPEYE: Let's have a look at sequence, and I'll explain replicateM in terms of that
21:18 bollu joined
21:18 <Cale> sequence :: (Monad m) => [m a] -> m [a]
21:18 <Sh4rPEYE> Sequence somehow flips the structure, right?
21:18 <Cale> It's a function which takes a list of actions in some monad
21:19 <Cale> and combines them into a single action which will run each in turn
21:19 <Cale> and collect a list of the results
21:19 <Cale> For the list monad, this will take a list of lists, and pick an element from each one, in all possible ways
21:19 <Cale> > sequence [[1,2,3],[4,5],[6,7,8]]
21:19 <lambdabot> [[1,4,6],[1,4,7],[1,4,8],[1,5,6],[1,5,7],[1,5,8],[2,4,6],[2,4,7],[2,4,8],[2,...
21:20 <Cale> It's written as follows:
21:20 <Cale> sequence [] = return []
21:20 <Cale> In the case that we have an empty list of actions, we produce the action which does nothing except to give an empty list as its result
21:20 tromp joined
21:20 <Cale> sequence (x:xs) = do ...
21:20 <Cale> In the case that we have a nonempty list of actions, whose first element is x
21:21 <Cale> sequence (x:xs) = do v <- x; ...
21:21 cdg_ joined
21:21 <Cale> we first run x, getting some result v
21:21 <Cale> sequence (x:xs) = do v <- x; vs <- sequence xs; ...
21:21 <Cale> we then run the rest of the actions in the list, getting some list of results vs
21:21 <Cale> sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs)
21:21 <Cale> and we produce a complete list (v:vs) as the result of our action
21:22 <Cale> So, in terms of this, we can write many other useful things
21:22 <Cale> If we can decide what each iteration of a loop should be up-front, and construct a list of the actions, sequence will stitch them together for us
21:22 omnom joined
21:23 <Cale> mapM f xs = sequence (map f xs)
21:23 <Cale> behaves like a sort of for-each loop, with the function taking the place of the "loop body"
21:23 anodium joined
21:23 <Cale> replicateM n x = sequence (replicate n x)
21:23 Bardusbasium joined
21:23 <Cale> takes an action, makes a list of n copies of it, and then sequences them together
21:24 <Cale> For the list monad, that will have the effect of picking an element of a list, n times
21:24 <Cale> > replicateM 3 [0,1]
21:24 <lambdabot> [[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]
21:24 bollu joined
21:24 zennist joined
21:24 rullie joined
21:25 pita joined
21:25 <Cale> Sh4rPEYE: make sense?
21:25 <Cale> (Feel free to ask questions, this was kind of a deep dive without getting into the details of how the Monad abstraction works)
21:25 <tobiasBora> Hello,
21:26 meba joined
21:28 <Sh4rPEYE> Cale: Yes it does make perfect sense. Now I also understand why it is different for each monad... Thanks, it helped a lot! :-)
21:28 <tobiasBora> Just a question, I cannot find how to find several occurences of a regex in regex-tdfa. I tried to look at the options in https://hackage.haskell.org/package/regex-tdfa-1.2.2/docs/Text-Regex-TDFA-Common.html, but I can't find how to do that
21:29 <Cale> Sh4rPEYE: No problem!
21:30 <Cale> tobiasBora: See AllSubmatches etc. in regex-base
21:30 kritzcreek joined
21:30 <Cale> https://hackage.haskell.org/package/regex-base-0.93.2/docs/Text-Regex-Base-RegexLike.html#t:RegexContext
21:31 <Cale> This regex library is needlessly confusing...
21:31 <geekosaur> tobiasBora, the standard regex harness is kinda yuck. iirc it uses return type polymorphism, if you request a list result then it does multiple match
21:31 <geekosaur> ...just a bit late
21:31 <Cale> But the idea is that you just attempt to get a result of type AllTextSubmatches, etc. and depending on what you pick, you get different things.
21:32 <geekosaur> anyway yeah, this is more or less designed to make you reconsider using regexes >.>
21:32 <geekosaur> that, or it's being 'clever' in the bad sense
21:33 <Cale> It's trying to out-perl perl
21:33 saussure joined
21:33 <tobiasBora> Cale: geekosaur : it's compatible with tdfa ? Because I need utf8 support
21:34 Sonderblade joined
21:34 <Cale> tobiasBora: Yeah, that regex-tdfa thing is built on top of it
21:34 x2f80hxyx joined
21:34 <geekosaur> regex-tdfa, regex-posix, etc. are all built on top of the standard regex framework, yes
21:35 zacts joined
21:36 <geekosaur> ...sometmes it's easier to use pcre-light and make sure your system pcre lib is built with utf8 support (beware debian and opensuse, and I have no idea how it works out on windows)
21:37 bollu joined
21:37 <tobiasBora> geekosaur: Cale : great thank you
21:39 {emptyset} joined
21:41 <tobiasBora> Hum wait
21:41 <tobiasBora> I tried:
21:41 <tobiasBora> let Right reg = REG.compile (COM.CompOption False False True True False) (COM.ExecOption True) "[a-zA-Z0-9][-a-zA-Z0-9!.#%&é*+/=?^_`{|}~]*@[-.a-zA-Z0-9]*\\.[-a-zA-Z0-9.]*[a-zA-Z]"
21:41 <tobiasBora> matchAllText reg "hello coucou@gmail and rig@tedy.com :D"
21:41 <tobiasBora> and in the result I've just one email:
21:41 <tobiasBora> [array (0,0) [(0,("rig@tedy.com",(23,12)))]]
21:42 bjz joined
21:42 replay joined
21:43 echoreply joined
21:43 moth joined
21:43 mr45ez45 joined
21:44 mjs2600 joined
21:45 jgertm joined
21:45 <geekosaur> yes?
21:45 <geekosaur> that's not a library problem
21:45 <geekosaur> it's an example of why you shouldn't try to do that with regex
21:46 <geekosaur> (your chosen regex demands a . on the right of the @ so the coucou@gmail will not match)
21:46 <erisco> pretty sure I have an email regexp around somewhere... just a minute
21:46 twomix joined
21:47 <erisco> here you go https://gist.github.com/erisco/29082201244b053285cfd48814f3859c
21:48 <erisco> the argument from here is that you can't expect all addresses to be compliant with RFC822, but that isn't my problem :P
21:48 <geekosaur> that looks needlessly obtuse (no ranges). also ... you want rfc2822 and amendments for e.g. locale specific parts
21:48 <geekosaur> the resulting regex is larger than the rest of your program.
21:48 PotatoCommando joined
21:48 rcschm joined
21:49 <Eduard_Munteanu> Arguably, ranges are locale-dependent.
21:49 <erisco> ranges are a trivial reduction... it was just easy to list all the characters
21:49 <geekosaur> well, if parsing email, you want to force the locale to C anyway
21:49 <geekosaur> at least in the headers, you don;t even get iso8859
21:50 <erisco> I just wanted to demonstrate that email addresses are in fact regular as per spec
21:50 <erisco> which was one point I had to make clear in face of all the misconceptions
21:50 <geekosaur> (because headers were specced with a restricted charset that worked with ebcdic, sixbit, etc. on mainframes)
21:51 echoreply joined
21:51 saussure joined
21:52 <erisco> parsing them out of a header is different than just showing they're regular
21:52 <tobiasBora> geekosaur: good point, I forgot the .com, thanks !
21:52 <erisco> well, no, it is just wrong to require a dot after the at
21:52 jbiesnecker joined
21:52 hiratara joined
21:53 <tobiasBora> geekosaur: I'm not sure to understand why the header are interesting here. And how can you set up the headers?
21:53 biglama joined
21:53 <erisco> you can also take my solution to demonstrate that it is silly to try and parse emails with regular expressions
21:53 <erisco> I mean, look at it
21:53 <geekosaur> tobiasBora, mostly that was in response to the stuff about rfc822 which specifies the format of addresses in email headers, not generally
21:54 <geekosaur> ...but if the address is to be actually usable, it will end up in a header and be forced to comply with the spec
21:54 <geekosaur> s/actually usable/actually used/
21:56 average joined
21:56 average left
21:56 <ski> shapr : jag har inte använt 0mq (jag fick slå upp vad det var)
21:57 average joined
21:57 <geekosaur> of course then you run into real world complications like many mail systems outright reject the extension to encode characters outside the RFC2822 valid charset because spammers use it to obscure hostnames on block lists, etc.
21:59 ChaiTRex joined
21:59 <geekosaur> also this is reminding me how much I don't miss running mail servers >.>
22:00 kareeeeem joined
22:01 dni joined
22:02 wroathe joined
22:03 jacklo left
22:05 bollu joined
22:05 average left
22:07 lispy joined
22:08 juanpaucar joined
22:08 ^bschafer1 joined
22:08 filterfish__ joined
22:09 saussure joined
22:11 govg joined
22:13 <Philonous> Why Swedish though
22:13 patbecich joined
22:13 jeirosz joined
22:15 mizu_no_oto joined
22:15 umqtsct joined
22:17 laxyrm joined
22:17 Winterfearrr joined
22:17 <Winterfearrr> trying to get this script https://expirebox.com/download/15223f19c6d73638b738fb6cbd75ce53.html to work with this https://expirebox.com/download/69007df36b86a4493cc9ca9ac1cfb1d0.html sorry this is the right one'
22:19 xxzvdvxfo joined
22:19 jbiesnecker joined
22:21 LHoT10820 joined
22:21 <lyxia> Winterfearrr: http://lpaste.net/
22:21 cdg joined
22:22 juanpaucar joined
22:23 <Winterfearrr> lpaste is too complicated
22:24 HarveyPwca joined
22:25 <lyxia> how do you get on IRC if lpaste is too complicated
22:25 <hpc> my typewriter has irc built in
22:26 mizu_no_oto joined
22:26 qxxwhywzi joined
22:27 saussure joined
22:28 zacts joined
22:30 robotroll joined
22:31 hiratara joined
22:34 FreeBirdLjj joined
22:36 felixphew joined
22:36 wroathe joined
22:37 Velizar joined
22:37 <* monochrom> considers pressing the button for "report this file to delete it". Now there is something not complicated. :)
22:39 <EvanR> is there a word for choose randomly from a list, but its always the same choice for a given list
22:40 <ertes> EvanR: collapse of the wave function?
22:41 <ertes> EvanR: i'd communicate it through the name and the type
22:42 dgtqqsch joined
22:42 <monochrom> Is it really random, or do you just mean an implementation-dependent choice?
22:42 <ertes> indexRandom :: (Hashable a) => [a] -> a
22:42 wroathe joined
22:43 <monochrom> Because programmers generally over-abuse the word "random" for all sorts of non-random nondeterminism and implementation-defined behaviour and undefined behaviour.
22:43 <monochrom> (Hint: It is not random unless and until you write down the probability distribution.)
22:43 <EvanR> in a repeatable experiment, if you give me list xs, you always get the same result.
22:44 <monochrom> See, that's implementation-defined behaviour.
22:44 <ertes> monochrom: the english word "random" highly overloaded
22:44 <EvanR> perhaps i just do head
22:44 <ski> EvanR : i'd say "arbitrary", except that's taken :/
22:44 <ertes> is
22:44 <EvanR> yeah, random is probably a bad word here
22:44 leat joined
22:44 <EvanR> deterministic choice?
22:45 <ski> perhaps "unspecified" ?
22:45 <monochrom> And Haskell is great at exposing the conflation and challenging your conventional wisdom. If you have neither IO nor RandomGen, it is not random.
22:45 <EvanR> what if i do use a random gen
22:45 path[l] joined
22:45 <ski> (me hasn't seen an answer to "do you just mean an implementation-dependent choice?" yet)
22:45 ebsen joined
22:46 <ski> EvanR : what if you seed the pseudo-random gen only from the list itself ?
22:46 saussure joined
22:46 <EvanR> sure, that satisfies the "determinism" doesnt it
22:47 <monochrom> I am like Delphi. I make the right-on point or ask the right-on question. And nobody sees it.
22:47 <EvanR> i would say its obviously implementation dependent, but then that sounds bad
22:47 <monochrom> No, it sounds good.
22:47 zpuvq joined
22:47 <EvanR> since i didnt gave much more useful info about what it will choose
22:47 <ski> (it might be good to specify whether a user can expect to get the same choice of element for any particular list, regardless of platform the code is compiled ior running on, and regardless of internal changes to implementation that do not change specified behaviour)
22:48 <EvanR> yes it shouldnt depend on the computer
22:48 coltfred joined
22:49 <EvanR> what is the problem with "arbitrary"
22:49 <ski> e.g. if they store a result that depends on this choice in a file, and later loads that into a program using the same library, but possibly a later version, or compiled ior run on another machine/platform, can they expect consistency ?
22:49 <ski> @type arbitrary
22:49 <lambdabot> Arbitrary a => Gen a
22:50 <ertes> :t indexRandom
22:50 <lambdabot> Hashable a => [a] -> a
22:50 <ertes> > indexRandom "Hello world"
22:50 <lambdabot> 'H'
22:50 <ertes> > indexRandom "Hello world!"
22:50 <lambdabot> 'w'
22:50 <EvanR> hahahaa
22:50 <ski> if you don't mind using the same term as QuickCheck, then if you want to, go ahead
22:50 <EvanR> nice
22:50 <EvanR> ertes: so what do you call that behavior? random?
22:51 <EvanR> arbitrary?
22:51 <ertes> EvanR: that one i'd call random, yes… it's using a PRNG under the hood
22:51 <EvanR> how?
22:51 <ertes> @undef
22:51 <lambdabot> Undefined.
22:51 <ertes> @import Data.Hashable (Hashable, hash)
22:51 <lambdabot> Unknown command, try @list
22:51 <ertes> @let import Data.Hashable (Hashable, hash)
22:51 <lambdabot> Defined.
22:51 <ski> it presumably doesn't use an externally specified PRNG or seed thereof
22:51 <ertes> @let indexRandom xs = let (h, l) = foldl' (\(h, l) x -> (h + hash x, l + 1)) (0, 0) xs; (i, _) = randomR (0, l - 1) (snd (next (mkStdGen h))) in xs !! i
22:51 <lambdabot> Defined.
22:52 <ertes> EvanR: ^
22:52 <EvanR> by seeding an RNG and using it once, i cant see that working out
22:52 dejanr joined
22:52 <EvanR> the hash itself should be good enough
22:52 opmebcxcc joined
22:52 <ertes> (the reason i'm using 'next' is that StdGen is terrible)
22:52 Flechette joined
22:52 <EvanR> make sure you use "next" a random number of times?
22:52 <ertes> EvanR: i still need a uniformly distributed index =)
22:53 <ski> ok, `mkStdGen', no external randomness
22:53 <EvanR> yeah not sure im on board with this implementation
22:53 <ski> @type next
22:53 <lambdabot> RandomGen g => g -> (Int, g)
22:53 <ertes> just seed a PRNG from the list contents… that's what i'm using Hashable for
22:53 <EvanR> seeding something and using it once cant be right
22:53 <ertes> actually i'm stupid… i could have just hashed the list =)
22:54 <geekosaur> it's just a weird hash function
22:54 <ertes> EvanR: that's what a hash function is
22:54 <EvanR> thats different from a RNG
22:54 <geekosaur> not really
22:55 <geekosaur> well. suppose it depends on what level you;re thinking at. I'd actually claim we're abusing a PRNG as a hash function (hence "weird")
22:55 filterfish joined
22:55 <EvanR> RNGs dont usually guarantee you that the first output given all possible seeds follows the same distribution as the iterated output with one seed
22:55 <ertes> EvanR: it's still called random: https://en.wikipedia.org/wiki/Pseudorandom_function_family
22:55 ErinvanderVeen joined
22:55 filterfish joined
22:56 <EvanR> i recall stdgen giving False as the first output for... a lot of seeds
22:56 jbiesnecker joined
22:56 staffehn_ joined
22:56 <ertes> yes, that's why i used 'next'
22:56 <EvanR> taking the second output seems like.... what
22:56 <ertes> StdGen is the worst
22:56 <EvanR> how are you helping
22:56 nbouscal joined
22:56 rann joined
22:56 cmdv joined
22:56 poga joined
22:56 Rumia_ joined
22:56 <EvanR> "clearly the second output is random"
22:56 strmpnk joined
22:57 <monochrom> I have recently switched to tf-random. You may like to try it.
22:57 Tritlo joined
22:57 <ertes> EvanR: no, but it doesn't have the obvious bias that the first output has
22:57 integral joined
22:57 integral joined
22:57 bweston92 joined
22:57 thoughtpolice joined
22:57 Forkk joined
22:57 <EvanR> heh.
22:57 Laney joined
22:57 <EvanR> no obvious bias, obviously no bias
22:58 StianL joined
22:58 stoopkid joined
22:58 nyuszika7h joined
22:58 <ertes> > map (fst . random . mkStdGen) [0..] :: [Bool]
22:58 <lambdabot> [True,True,True,True,True,True,True,True,True,True,True,True,True,True,True,...
22:58 <EvanR> i guess ill give up on words, but i am still interested in precise descriptions of different "random" behaviors
22:58 <ertes> > map (fst . random . snd . next . mkStdGen) [0..] :: [Bool]
22:58 <lambdabot> [True,False,True,True,False,True,False,False,True,False,True,True,False,True...
22:58 <ertes> EvanR: ^
22:58 <EvanR> so random
22:58 <ertes> first output vs. second output =)
22:58 skydrome joined
22:59 <* ski> idly wonders how to render "obviously" as a modal operator
22:59 <monochrom> Use a circle.
22:59 plutoniix joined
22:59 <monochrom> You already have square and diamond. So just add a circle. It looks like the letter O. :)
22:59 banjiewen joined
22:59 mikedlr joined
22:59 takle joined
23:00 hydraz joined
23:00 chelfi joined
23:00 defanor joined
23:00 oldsk00l joined
23:00 max-m joined
23:00 mgttlinger joined
23:00 Shatnerz joined
23:01 LeaChim joined
23:01 coup_de_shitlord joined
23:01 mearnsh joined
23:01 mearnsh joined
23:01 Majiir joined
23:01 <EvanR> so if repeatedly choose from a list of ties what action to take next, i would not normally expect to be able to repeat the process and get the same result without special case
23:01 <monochrom> ◇◯p "p may be obvious" :)
23:01 <EvanR> special care
23:01 stig joined
23:01 <EvanR> so im wondering what the special care would be
23:01 c_wraith joined
23:01 Xorlev joined
23:02 oberstein joined
23:02 <EvanR> like priority tie, time tie
23:02 demonic_dissonan joined
23:03 <EvanR> or maybe purely functional programming has this built in
23:03 <ski> monochrom : but what is its dual, and what is its properties ?
23:03 <EvanR> just use head
23:04 saussure joined
23:06 jacqueline[m] joined
23:06 M-krsiehl joined
23:06 <ski> (hm, and i thought that a circle had been used for something else. apparently "next" in temporal logic, as i suspected)
23:06 bennofs_matrix joined
23:06 goodboy[m] joined
23:06 curry[m] joined
23:07 <ski> EvanR : "list of ties" ?
23:07 sleffy joined
23:07 <EvanR> list, i am ghc with a list of runnable threads
23:07 unlmtd joined
23:07 <EvanR> and i only have one cpu
23:07 <EvanR> er
23:07 <EvanR> like*
23:08 u-ou joined
23:08 <EvanR> and which one i choose may result in one of the others becoming unrunnable so i cant just run them all
23:10 ErinvanderVeen joined
23:11 Sailor4772 joined
23:12 PotatoCommando joined
23:12 tomboy64 joined
23:13 conal joined
23:14 joco42 joined
23:14 awkl joined
23:15 <Lokathor> using trace for warning messages in pure functions
23:15 <Lokathor> delicious
23:16 <EvanR> arent you mostly using IO ?
23:16 <Lokathor> it's in the state maker helper, mkState :: Int -> Int -> Image PixelRGBA8 -> HexesState
23:17 <Lokathor> if an image doesn't divide evenly, it'll warn with a trace message
23:17 <Lokathor> all the fields in question are Strict, so the trace prints out right away anyway
23:17 tjayanth_ joined
23:17 connrs joined
23:18 <Lokathor> I tried to turn it on the first time
23:18 <Lokathor> and it drew nothing at all :O
23:18 yqvs joined
23:18 jeirosz joined
23:18 <Lokathor> so now I'm carefully going over it again
23:18 systemfault joined
23:19 systemfault joined
23:19 <EvanR> classic black screen effect
23:19 jgt joined
23:20 mizu_no_oto joined
23:20 <Lokathor> well it drew the glClearColor :S
23:20 <Lokathor> but not even one triangle
23:20 drewbert joined
23:21 zv joined
23:21 Deide joined
23:22 <ertes> (that moment when you see your first triangle on the screen)
23:22 saussure joined
23:22 <Lokathor> well there were triangles for a while
23:22 <Lokathor> and then i rewrote it
23:22 <Lokathor> and then there weren't
23:23 theDon_ joined
23:23 connrs joined
23:23 sanitypassing joined
23:24 <ertes> well, the problem is obvious: it's OpenGL
23:25 <ertes> rage against the state machine
23:25 <Lokathor> yes i'm sure i forgot a state change somewhere
23:25 <Rotaerk> is it plugged in?
23:25 <Rotaerk> did you turn it on?
23:25 <Lokathor> Rotaerk, I even tried turning it off and on again
23:26 markus1189 joined
23:26 markus1199 joined
23:29 sleffy joined
23:29 atomi joined
23:29 <ertes> incoming quarterly library check:
23:30 <ertes> *now* is there a library for relational database migrations that supports sqlite (or is sqlite-specific)?
23:30 <Rotaerk> "are we there yet?"
23:31 <ertes> i think i'm just gonna write it myself this time
23:31 tzh joined
23:31 {emptyset} joined
23:33 louispan joined
23:33 Velizar joined
23:33 Velizar joined
23:33 nakal joined
23:34 hc_ joined
23:34 <spoonm> I'm trying to change a module from xmonad contrib that stores minimized windows in a stack, but I want it to do it in a queue
23:34 Meemaw1 joined
23:35 <spoonm> thing is I don't really know how this works, so what I came up with was reversing the window list(if I understand this correctly it's converting a StackSet into a windows list)
23:35 <ertes> spoonm: lists aren't really suitable as queues… you should use Data.Sequence
23:36 <spoonm> so uh, my question is I have something that is `X [Window]', and can't just `reverse' it
23:36 <ertes> spoonm: X is a functor: fmap :: (a -> b) -> X a -> X b
23:36 Gurkenglas joined
23:36 <ertes> fmap reverse :: X [a] -> X [a]
23:38 FreeBirdLjj joined
23:38 <spoonm> ertes: thanks
23:38 <ertes> spoonm: you should still switch to Data.Sequence, if you want a queue, because that one you can query/manipulate at both ends
23:39 <spoonm> is it possible to use Data.Sequence or something with XMonad.Util.ExtensibleState(https://github.com/xmonad/xmonad-contrib/blob/master/XMonad/Util/ExtensibleState.hs)? (I know this isn't the right place to ask about this)
23:39 <EvanR> waahat, functional queue ftw
23:39 <EvanR> how many windows will you have
23:39 hc joined
23:39 <ertes> spoonm: it's fine, it's a haskell question =)
23:40 <spoonm> EvanR: right now minimized windows are stored in a stack and I can restore the last minimized window
23:40 <spoonm> I want to be able to store them in a queue and cycle through them
23:40 saussure joined
23:40 <EvanR> right so Sequence is probably overkill
23:41 <spoonm> `fmap reverse (XS.gets minimizedStack)' in `withMinimized' solved it
23:41 <spoonm> I want to know what's a better way of doing it, though
23:41 <ertes> i wish people would stop using the word "overkill
23:41 <ertes> Data.Sequence is a perfect fit for queues… you should use it
23:41 <spoonm> I already made another function in the X.A.Minimize module so I could swap the current window with the last minimized one lol
23:42 <spoonm> note: I'm a haskell noob, don't really understand how most of this works, I just try to make sense of what I'm reading and changing
23:42 ChaiTRex joined
23:43 fred-fri joined
23:43 <ertes> spoonm: of course the fact that you're using minimisation is an indicator that you should probably just learn to utilise workspaces properly =)
23:43 <ertes> spoonm: moving windows between workspaces is a very powerful tool
23:43 <spoonm> oh, no, I do use workspaces
23:44 <spoonm> and I have keybinds for creating copies of windows on other workspaces, but that gets a little messy now and then
23:44 <spoonm> so I was using the minimize layout to minimize a window and toggle between a different window and the last minimized one
23:44 <ertes> keep in mind that you can have as many workspaces as you want, and that you can create and destroy them dynamically
23:45 <ertes> there is no reason to have an exact workspace/key-binding correspondence
23:46 <spoonm> ertes: how would you go about doing this, given you already have multiple workspaces? (hang on, converting and uploading video ;-;)
23:47 <spoonm> http://0x0.st/EGM.webm
23:47 <spoonm> imagine the workspace I switched to had other windows, like gimp and whatnot
23:48 justanotheruser joined
23:50 jsgrant_ joined
23:52 <ertes> spoonm: not sure i understand the video… you're switching out the main window?
23:52 Velizar joined
23:52 Velizar joined
23:52 <spoonm> yup, I'm cycling through minimized windows
23:52 <ertes> ah, i do that with regular windows, so they appear to the side
23:53 <ertes> let me make a video
23:53 alveric2 joined
23:54 emmanuel_erc joined
23:55 im0nde joined
23:58 <spoonm> this is how I was doing it before, and when I needed more than two windows(now that I can cycle, that's not necessary), using my available workspaces and CopyWindow: http://0x0.st/EGQ.webm
23:58 saussure joined
23:58 primal joined
23:59 infinity0_ joined
23:59 infinity0_ joined