<     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 _2_7  
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