<    April 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
00:00 <kernelj_arch> is there a better way to calculate e.g. head . dropWhile (<100) . iterate (*2) $ 1
00:01 <kernelj_arch> here you're constructing a list for no reason, as opposed to a simple while loop
00:01 <ChaiTRex> kernelj_arch: 128
00:01 <ertes> kernelj_arch: calculate the integer logarithm to base 2
00:01 <Welkin> lists are loops
00:01 <Welkin> you'll learn that soon
00:01 infinity0 joined
00:01 <Welkin> lists are used more as control structures than as data structures
00:01 <ertes> kernelj_arch: https://hackage.haskell.org/package/integer-logarithms
00:02 <ertes> kernelj_arch: 2^(integerLog2 100) = 64
00:02 davidthomas joined
00:02 ContessaTP joined
00:03 <ChaiTRex> There should be some neat trick to get the next higher power of two using bitwise stuff.
00:04 <Welkin> ChaiTRex: power of two?
00:04 <Welkin> just left shift
00:04 infinity0 joined
00:04 <ChaiTRex> No, the next highest integer that is a power of two.
00:04 <ChaiTRex> Like with 124, the next highest is 128.
00:04 featherlessbiped joined
00:05 <Welkin> > 124 / 2
00:05 <lambdabot> 62.0
00:05 <ertes> ChaiTRex: that's what integerLog2 does… it basically just searches for the position of the highest bit
00:05 brisbin_ joined
00:05 <ertes> oh, and actually you can get (2^) faster by using 'bit'
00:05 <ertes> > bit 6 :: Integer
00:05 <lambdabot> 64
00:06 darjeeling_ joined
00:06 brisbin_ joined
00:06 abhiroop joined
00:07 infinity0 joined
00:08 lambda-11235 joined
00:08 der_landgraf joined
00:08 <ChaiTRex> > 68 .&. (68 - 1)
00:08 <lambdabot> 64
00:08 <ski> wouldn't `integerLog2' round down ?
00:08 <ChaiTRex> > map (\x -> x .&. (x - 1)) [1..32]
00:08 <lambdabot> [0,0,2,0,4,4,6,0,8,8,10,8,12,12,14,0,16,16,18,16,20,20,22,16,24,24,26,24,28,...
00:08 <ChaiTRex> Hmm, that's not it then.
00:08 <ertes> oh, yeah… well, just add 1
00:09 <kernelj_arch> and you have to -1 the input to integerLog2
00:09 <* ski> nods
00:09 infinity0 joined
00:10 <ertes> i'd rather compare
00:10 indi_ joined
00:10 <ertes> it's faster than doing arithmetic unconditionally
00:10 Elhamer joined
00:10 <kernelj_arch> what do you mean? usually unconditional arithmetic is faster since no branching in the CPU
00:11 <ertes> unless GHC optimises it to do the (subtract 1) in-place, but i doubt it
00:11 Elhamer__ joined
00:11 <ertes> kernelj_arch: only if you can do it in-place
00:12 <ertes> alright, running out of battery… bye =)
00:12 <kernelj_arch> yeah I'm quite far away from understanding the haskell internals and how things actually execute
00:12 <kernelj_arch> cya ertes
00:12 <ski> > until (>= 100) (* 2) 1 -- fwiw
00:12 <lambdabot> 128
00:12 infinity0 joined
00:12 <ski> @index until
00:12 <lambdabot> Prelude
00:12 <ski> @type until
00:12 <lambdabot> (a -> Bool) -> (a -> a) -> a -> a
00:13 CountryNerd joined
00:13 <kernelj_arch> yea that's what I was looking for
00:14 castlelore joined
00:14 castlelore joined
00:14 <kernelj_arch> weirdly there's no 'while' to go with 'until'
00:15 infinity0 joined
00:15 takle joined
00:15 <kernelj_arch> ChaiTRex: http://stackoverflow.com/questions/53161/find-the-highest-order-bit-in-c#53184
00:16 <kernelj_arch> essentially munge over all the bits to the right then do minus the right shift
00:17 them_1 joined
00:18 baweaver joined
00:18 Aruro joined
00:19 t7 joined
00:19 augur joined
00:20 uglyfigurine joined
00:21 castlelore joined
00:21 filterfish joined
00:21 hive-mind joined
00:22 erikd joined
00:22 filterfish joined
00:23 newhoggy joined
00:24 oisdk joined
00:27 falafel joined
00:30 cpup joined
00:30 takle joined
00:31 castlelore joined
00:31 castlelore joined
00:31 Moto-chan joined
00:35 butterthebuddha joined
00:38 blym_ joined
00:39 Guest71 joined
00:42 geekosaur joined
00:44 <actualHuman_462> Wouldn't this be faster?
00:44 <actualHuman_462> > (\n -> take 1 . filter (>= n) . map (2^) $ [1..]) $ 100
00:44 <lambdabot> [128]
00:45 <actualHuman_462> Or is there something expensive about exponents?
00:45 <kernelj_arch> > bit 6
00:45 <lambdabot> 64
00:45 <kernelj_arch> > (\n -> take 1 . filter (>= n) . map bit $ [1..]) $ 100
00:45 <lambdabot> [128]
00:46 <Welkin> > bit 4 <> bit 2
00:46 <lambdabot> error:
00:46 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M654175259134...
00:46 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
00:46 <Welkin> > bit 4 `Data.Monoid.mappend` bit 2
00:46 pisomojado joined
00:46 <lambdabot> error:
00:46 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M847344327479...
00:46 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
00:46 <Welkin> o.o
00:46 <Welkin> :t bit
00:46 <lambdabot> Bits a => Int -> a
00:47 <Welkin> :t (bit 4) + (bit 2)
00:47 <lambdabot> (Bits a, Num a) => a
00:47 <Welkin> > (bit 4) + (bit 2)
00:47 <lambdabot> 20
00:47 <Welkin> okay
00:47 <Welkin> there is just no show instance...
00:47 <Welkin> weird
00:47 xcmw joined
00:47 <Welkin> er
00:47 <Welkin> no monoid instance maybe?
00:48 halogenandtoast joined
00:48 <Welkin> > bit 4
00:48 <lambdabot> 16
00:48 <Welkin> > bit 2
00:48 <lambdabot> 4
00:48 <Welkin> > bit 0
00:48 <lambdabot> 1
00:48 <actualHuman_462> What would the identity be for an arbitrary set of bits?
00:49 <Welkin> 0
00:49 <Welkin> binary addition
00:49 jason85 joined
00:49 acertain joined
00:50 <Welkin> > Sum (bit 4) <> Sum (bit 2)
00:50 <actualHuman_462> Oh, I guess 0 is always 0s forever , ja, this makes sense
00:50 <lambdabot> Sum {getSum = 20}
00:50 <Welkin> lol
00:50 sgronblo joined
00:50 <Welkin> well that works
00:50 oisdk_ joined
00:52 <kernelj_arch> > Product (bit 4) <> Product (bit 2)
00:52 <lambdabot> Product {getProduct = 64}
00:52 eacameron joined
00:54 Proteus joined
00:54 Akahige joined
00:54 Akahige joined
00:55 raynold joined
00:55 na_th_an joined
00:56 Proteus joined
00:58 indi_ joined
00:58 newhoggy joined
01:02 HoierM joined
01:03 eacameron joined
01:05 meba joined
01:05 <xcmw> State is to MonadState as Maybe is to what? I don't see a MonadMaybe typeclass.
01:06 <monochrom> Perhaps MonadError ()
01:07 JeanCarloMachado joined
01:07 jleon joined
01:07 <geekosaur> Maybe doesn't really need one, does it?
01:07 <xcmw> monochrom: That would work. Thanks
01:07 thunderrd_ joined
01:08 <benzrf> is Perhaps a type constructor
01:08 kyle1320 joined
01:09 <monochrom> No, it's my English.
01:09 <monochrom> Ahem. Our English.
01:09 fragamus joined
01:10 cyborg-one joined
01:11 <* ski> . o O ( "mayhaps","perchance" )
01:11 modal joined
01:12 newhoggy joined
01:14 <kernelj_arch> I think I'm really slow at programming, especially Haskell
01:14 <kernelj_arch> but then it took me several days to write some Java app that only calculated the price of a shopping basket where special offers applied
01:15 <EvanR> theres speed of typing the code, and speed of getting a working program
01:15 <kernelj_arch> after having to include all the object orientation and writing unit tests for everything and writing javadoc etc.
01:15 <EvanR> if you consider production apps that go up and sit there broken for years... thats hotta hurt benchmarks
01:16 ertes joined
01:16 <EvanR> im surprised you took so long to write java, doesnt the IDE do most of the work
01:16 Coldblackice joined
01:16 <EvanR> (of the typing part)
01:16 <kernelj_arch> it does a lot of it but somehow it still took forever
01:17 <monochrom> Relocate to Narnia. :)
01:17 <kernelj_arch> it doesn't type the javadoc for you, except for the parameter names etc.
01:17 <kernelj_arch> and refactoring is still hard with an IDE
01:17 <EvanR> if i randomly wake up and sample what im doing while programming, and its usually typing a for loop, i get mad
01:18 <EvanR> something is broken about that process
01:18 <monochrom> Also the IDE doesn't auto-type lens-style code, only getter-setter style code. That may matter. :)
01:19 <EvanR> i like that the IDE could type your lens style support code, but doesnt have to, because it can be autogenerated ahead of time
01:19 <kernelj_arch> because I'm writing the program top-down none of the classes or methods I'm using actually exist for it to type for me
01:20 eschnett joined
01:20 peterbecich joined
01:20 <Welkin> there are no classes or methods in haskell
01:20 <kernelj_arch> the only part the IDE helps with there is doing the import line after you've wrote it
01:20 Rodya_ joined
01:20 <kernelj_arch> I'm not aware that there are IDEs for Haskell neither?
01:20 <Welkin> emacs with haskell-mode
01:21 <Welkin> there is a text editor for haskell written in haskell called Yii
01:21 <Welkin> and leksah
01:21 newhoggy joined
01:21 <EvanR> screw IDEs, screw code generators, we need a paperclip AI to see what youre trying to do and suggest oddball courses of action
01:21 <Welkin> Yi*
01:22 <Welkin> https://github.com/Fuco1/clippy.el
01:22 <ski> there are methods of type classes in Haskell
01:22 <Welkin> Yi: http://yi-editor.github.io/
01:22 <Welkin> Leksah: http://leksah.org/
01:23 <Welkin> don't forget clippy, though
01:23 <Welkin> emacs is the best IDE
01:24 <kernelj_arch> I don't emacs
01:24 <kernelj_arch> also for some reason I'm writing this code in a web browser
01:26 peterbecich joined
01:26 peterbec` joined
01:26 <ertes> EvanR: if the IDE makes your work 5 times as efficient, but you still need to do 10 times the work, because it's java, it doesn't really help =)
01:26 peterbec` joined
01:27 <ertes> we need haskell-clippy.el
01:27 <Welkin> clippy should work with haskell
01:27 <monochrom> "It looks like you need to switch to Lisp." :)
01:28 brynedwards joined
01:28 <EvanR> i just rewrote some code that took somebody a couple months, because i couldnt read it, in a day. something is not good about "just get it working as fast as possible"
01:28 <ertes> "it seems like you are trying to create a module… need any help? a) read about the history of haskell modules, b) watch SPJ's famous ‹haskell is useless› remark, c) buy real support for real work for realz this time"
01:29 <EvanR> i realize this sort of thing is not taught in school
01:29 Supersonic112_ joined
01:29 <EvanR> and wondering why, what to do about it
01:29 <Welkin> or as they say in afrikaans: skool
01:30 eacameron joined
01:31 <ertes> recently i watched a talk about a company that started their business using clojure, and the presenter was always returning to: "well, you know, it's fine to start with something like clojure, because you can always switch to java when your business grows"
01:32 <EvanR> lol
01:32 <ertes> i couldn't help thinking: "that's the dumbest thing i've ever heard"
01:32 <EvanR> wait that sadly makes sense :(
01:32 <kernelj_arch> it's all about Scala nowadays
01:32 <ertes> why does it? not that i'm a big fan of clojure, but it's way better than java at… everything
01:33 <ertes> kernelj_arch: i'd probably choose clojure over scala, of those two were the only options
01:33 <EvanR> because when you grow to like 40 programmers, you cant find and or afford people that know clojure or scala or haskell
01:33 <EvanR> and theres no java-of-haskell
01:33 <kernelj_arch> I was trying to get an interview for a job doing Haskell and they decided they only wanted Scala developers
01:33 <ertes> EvanR: you don't need to find someone who knows clojure… all you need is a smart programmer
01:33 <ertes> ironically he said that himsefl
01:33 <EvanR> same thing
01:33 <Welkin> kernelj_arch: don't bother looking for a job using a specific language
01:33 <EvanR> they have a hard time finding clojure people in new orleans
01:33 <Welkin> most of the places I have looked at that use haskell are terrible
01:33 <Welkin> just because they use haskell doesn't make it a good place to work
01:33 <kernelj_arch> Welkin: ironically I was looking for C/C++ jobs
01:34 <EvanR> either who know/like it, or who can learn it quickly
01:34 <EvanR> Welkin: id love to see a terrible haskell job
01:34 <Welkin> I work with a great startup now writing javascript and ruby
01:34 <kernelj_arch> and I ended up doing an assignment in Java for a Java job
01:34 <ertes> EvanR: what's the worst case? you need to hire someone to work remotely
01:34 <ertes> it's not that bad
01:34 <EvanR> ertes: a single person?
01:34 <monochrom> The law of enlightened programming employment: The employers think the good employees are all out of town, the employees think the good employers are all out of town.
01:35 asmyers joined
01:35 <Welkin> EvanR: one of those particular companies doesn't even exist anymore
01:35 <Welkin> it got killed off
01:36 <Welkin> the haskell job market just sucks
01:36 <iqubic> Is there a way to embed a gloss image view in a haskell gi-gtk program?
01:36 <Welkin> look for a good company and then introduce haskell, don't look for a company that uses haskell, becuse it very well may be a terrible place to work
01:36 <iqubic> Or is there another way to do Graphics in Gi-Gtk
01:37 <EvanR> yeeeah... right.
01:37 <ertes> Welkin: you shouldn't rate the entire haskell industry by the failure of one company… the problem likely wasn't haskell =)
01:37 <Welkin> the problem isn't haskell
01:38 <Welkin> it is that you can't judge a company by the languages they use
01:38 <Welkin> it doesn't mean much, if anything
01:38 <EvanR> ive come to terms in my haskell evangelism that people are just dsyfunctional
01:38 bjz joined
01:38 <ertes> contrary to what paul graham believes a good language doesn't have too much influence on *whether* you succeed, but it may decide how well you do down the line
01:38 <EvanR> and bad at spelling
01:38 takle joined
01:38 <Welkin> unfortunately, a lot of the companies I spoke with who use some kind of functional language were not very good
01:39 <Welkin> not that any of the mediocre java/.net/python ones were either
01:39 cdg joined
01:39 guampa joined
01:39 <dmj`> EvanR: :)
01:39 <frontendloader> theres a lot of opportunity with Phoenix/Elixir now
01:39 <frontendloader> thats starting to take off
01:39 <frontendloader> not haskell, but still
01:40 <EvanR> i support the elixir fandom here in new orleans
01:40 <Welkin> frontendloader: I looked into it, and it is not looking good
01:40 <Welkin> phoenix is basically rails for elixir
01:40 <Welkin> with all of the problems/baggage of rails
01:40 <EvanR> but none of the performance issues
01:40 <EvanR> and none of the ruby
01:41 skeet70 joined
01:41 <Welkin> I don't see a reason to use elixir (or plain erlang for that matter) when you can use haskell
01:41 <Welkin> there are few, if any, situations where you gain an advantage using it
01:42 <Welkin> most people's web apps are not telecom infrastructure
01:42 <EvanR> any sort of functional-ish anything, if people get into it, will lead them to haskell, which leads them to leave the industry and pursue a PhD. mission accomplished
01:42 <iqubic> So, anyone know the right way to do graphics in gi-gtk?
01:42 <ertes> erlang does have a few advantages though like very good support for distributed programming and online migrations
01:43 Axman6 joined
01:43 malthe joined
01:43 <ertes> in comparison cloud haskell is pretty much a toy
01:43 <iqubic> I was thinking of using gloss, but then I decided I wanted a more sophisticated UI
01:43 <EvanR> cloud haskell has to deal with the fact that its haskell
01:43 _sras_ joined
01:43 <ertes> it has to deal with the fact that it's GHC
01:43 <iqubic> So I decided to use gi-gtk, but now I need a way to graphics in gi-gtk.
01:43 <EvanR> "cloud" anything = IO
01:43 <Welkin> to say the least, one startup I spoke with (that was using elixir) had their product manager call me, and she asked me some mind-bogglingly stupid questions that made no sense
01:44 <EvanR> which has no abstract form!
01:44 sellout- joined
01:44 <ertes> IO is not really the problem
01:44 <ertes> erlang has IO, too… it just doesn't know it =)
01:44 <EvanR> erlang is permanently in IO, any expression could evaluate to cause a message pass
01:45 <Welkin> so you can't judge a company by the languages they use
01:45 <EvanR> or an IO error
01:46 newhoggy joined
01:47 <iqubic> So no one knows how to do graphis in gi-gtk in haskell?
01:48 <monochrom> I say that people dig Elixir because they secretly dig dynamic typing.
01:48 <Welkin> the vast majority of the elixir community are ruby programmers
01:48 <Welkin> so it's no surprise
01:48 <Welkin> it was made to look like ruby even
01:48 <hamishmack> iqubic: https://github.com/haskell-gi/gi-gtk-examples/tree/master/fastdraw
01:49 <monochrom> Basically finally a Scheme that doesn't use s-expression syntax.
01:49 <hamishmack> iqubic: This might also be useful https://github.com/haskell-gi/gi-gtk-examples/blob/master/carsim/CarSim.hs
01:50 <iqubic> Why is that so confusing?
01:51 <* ski> . o O ( SRFI 49,"Indentation-sensitive syntax" by Egil Möller in 200[34] at <https://srfi.schemers.org/srfi-49/srfi-49.html> )
01:51 erikd joined
01:51 <iqubic> Why is graphics in Haskell-gi so confusing and hard?
01:52 <ertes> iqubic: what's the use case?
01:52 <hamishmack> There is a bit of a disconnect between the gi-gtk (which has GObject introspection) and cairo (which does not)
01:53 <hamishmack> The key is this https://github.com/haskell-gi/gi-gtk-examples/blob/master/fastdraw/FastDraw.hs#L81
01:54 <hamishmack> It takes you from gi-gtk land into cairo’s Render monad
01:56 blym_ joined
01:56 <iqubic> How does that work?
01:56 crobbins joined
01:57 <hamishmack> onWidgetDraw canvas $ \(Context fp) -> withManagedPtr fp $ \p -> (`runReaderT` Cairo (castPtr p)) $ runRender $ do …
01:57 cranej joined
01:57 vaibhavsagar joined
01:58 <iqubic> Yes, I see it.
01:58 <iqubic> It's a callback function.
01:58 <hamishmack> canvas is Gtk DrawingArea you want to draw on
01:58 <iqubic> Sure. I get that.
01:59 <iqubic> And this is the Drawing function.
01:59 <hamishmack> It hooks the widget draw event
01:59 ystael joined
02:00 <hamishmack> So you can use http://hackage.haskell.org/package/cairo-0.13.3.1/docs/Graphics-Rendering-Cairo.html
02:00 hucksy joined
02:00 <hamishmack> To draw on the widget
02:01 <hamishmack> Or you could use something else that works on top of cairo like https://hackage.haskell.org/package/diagrams-cairo
02:01 filterfish joined
02:02 <iqubic> hamishmack: Will that also provide me the framework to create a GUI?
02:03 biglambda joined
02:03 cpennington joined
02:03 <iqubic> Also, what is the diagrams-rasterific that hackage page mentions?
02:04 minn joined
02:04 <iqubic> Nevermind, I found that.
02:04 <hamishmack> Sorry perhaps I missunderstood what you meant when you said “but now I need a way to graphics in gi-gtk”
02:04 <iqubic> hamishmack: That is what I mean.
02:05 <iqubic> I want a way to have a gi-gtk application with gtk widgets and a way to draw graphics at the same time.
02:05 <hamishmack> Cool. gi-gtk itself will let you create a lot of cool UI widgets
02:05 <minn> There is a graphic (maybe the cover of a journal or book) where the logical connectives 'morph' into their corresponding types. I can't find this anywhere via Google. I thought someone here might have it stored away.
02:06 beanbagula joined
02:06 <hamishmack> the DrawingArea widget gives you an easy way to draw stuf as well
02:06 <hamishmack> inside the bounds of the widget
02:06 <hamishmack> There are ways to draw over the top of stuff too IIRC
02:06 <iqubic> Will diagrams-cairo work with a DrawingArea Widget?
02:07 <hamishmack> Yes
02:07 <iqubic> The I have a working solution to my problem.
02:07 <hamishmack> You will need that magic onWidgetDraw line
02:07 <hamishmack> and then from there you should be able to call diagrams-cairo
02:08 <iqubic> What magic onWidgetDraw line?
02:10 fXl joined
02:10 <iqubic> Why not just use this
02:10 <iqubic> @hackage gi-cairo
02:10 <lambdabot> http://hackage.haskell.org/package/gi-cairo
02:10 <hamishmack> onWidgetDraw canvas $ \(Context fp) -> withManagedPtr fp $ \p -> (`runReaderT` Cairo (castPtr p)) $ runRender $ do …
02:10 <iqubic> hamishmack, I'll need to pick that apart sometime.
02:11 <iqubic> But is Diagram-Cairo any better that gi-cairo?
02:11 <hamishmack> cairo does not come with GObject introspection data, so gi-ciaro is almost completely empty
02:11 <hamishmack> just has a few types, non of the functions
02:11 butterthebuddha joined
02:12 <iqubic> Oh. So I should use Diagrams-Cairo instead?
02:12 <iqubic> Now how does that magic onWidgetDraw line work?
02:12 <iqubic> WHat exactly is that lamba doing?
02:12 <hamishmack> diagrams-cairo or https://hackage.haskell.org/package/cairo directly
02:13 <iqubic> What's the difference between the two packages?
02:13 <iqubic> And what is that lambda doing there in the onWidgetDraw function?
02:13 <hamishmack> diagrams is a higher level draing library
02:14 <hamishmack> It is unpacking the gi-cairo type
02:14 <hamishmack> it then gets cast to a https://hackage.haskell.org/package/cairo type
02:15 <iqubic> hamishmack: Why is it so complex though?
02:15 <hamishmack> We should have a helper function somewhere
02:15 <hamishmack> the problem is there is no good place to put it
02:15 <iqubic> So we don't have a helper function?
02:16 <iqubic> Why is the unpacking of the gi-cairo type so complex?
02:16 newhoggy joined
02:16 <iqubic> So if I want to use that magic onWidgetDraw line, what do hackage packages do I need?
02:17 <iqubic> And what comes after the do at the very end of that line?
02:17 hive-mind joined
02:17 <hamishmack> gi-gtk and cairo (probably gi-cairo too just for the types)
02:17 abhiroop joined
02:17 <hamishmack> https://github.com/haskell-gi/gi-gtk-examples/blob/master/fastdraw/FastDraw.hs#L81
02:19 <hamishmack> If you are going to use diagrams-cairo you may just need onWidgetDraw canvas $ \(Context fp) -> withManagedPtr fp $ \p -> let cairo = Cairo (castPtr p) in …
02:20 <iqubic> hamishmack: I am not going to use diagrams-cairo.
02:20 <iqubic> So I guess I need that magic line.
02:20 <iqubic> As much as I want to know how it works, I don't think I will be able to.
02:20 Rodya_ joined
02:21 <iqubic> I'll just treat like a black box function for now.
02:21 <hamishmack> Its basically an ungly cast from something we know is a pointer to a cairo context to another thing we know is a cairo context
02:21 <hamishmack> s/ungly/ugly/
02:22 <iqubic> So it uses FFI to do the cast?
02:22 <hamishmack> We could make a nicer cast function but it would have to live in a gi-gtk-cairo package or something like that
02:22 <iqubic> I see.
02:22 <hamishmack> to avoid adding unecessary dependencies
02:23 <iqubic> So, what type should the drawing function at the end be?
02:23 <hamishmack> Render ()
02:23 <iqubic> Cool.
02:23 <iqubic> And then why are we using return true?
02:24 <hamishmack> Oh yes sorry Render Bool
02:24 <hamishmack> Not sure if the return value is used
02:24 <iqubic> I think it is, but I'm not sure.
02:25 <iqubic> It is used.
02:25 <iqubic> A return of true tells GTK that we have finished processing onWidgetDraw.
02:26 <iqubic> And no other callback functions should be called for this widget and event.
02:26 <hamishmack> https://developer.gnome.org/gtk3/stable/GtkWidget.html#GtkWidget-draw
02:27 uglyfigurine joined
02:27 <iqubic> So the output is used.
02:27 <hamishmack> Yes
02:28 <iqubic> What is that statement about the Widget's UL corner must be painted at the origin?
02:28 pisomojado joined
02:28 takle joined
02:29 <iqubic> hamishmack: Thank you so much for your help. However, now I must go. Sorry for leaving.
02:29 <hamishmack> No worries. Good luck.
02:29 louispan joined
02:30 pavonia joined
02:33 erikd joined
02:33 butterthebuddha joined
02:33 paul0 joined
02:34 Aruro joined
02:35 zv joined
02:35 jaziz joined
02:37 plutoniix joined
02:39 ystael joined
02:40 taksuyu joined
02:42 newhoggy joined
02:43 filterfish joined
02:44 filterfish joined
02:45 exferenceBot joined
02:45 newhoggy joined
02:46 rblaze1 joined
02:47 augur joined
02:48 abhiroop joined
02:48 pwnz0r joined
02:49 hexagoxel joined
02:49 augur joined
02:49 ChaiTRex joined
02:54 xcmw joined
02:56 blym_ joined
02:59 roconnor joined
03:00 fresheyeball joined
03:01 halogenandtoast joined
03:01 <kernelj_arch> it compiles and... it works for 3 out of 12 test cases!!!
03:02 <kernelj_arch> great, now I have to guess what's wrong with it
03:03 <kernelj_arch> at least it doesn't time out
03:03 caasih joined
03:03 smillmorel joined
03:07 dm3 joined
03:07 blym_ joined
03:08 fresheyeball joined
03:09 <fresheyeball> so I just want to do a small thing with ghcjs
03:09 <fresheyeball> and its freakn' baffling
03:09 <fresheyeball> source code says
03:09 <fresheyeball> type MonadDOM = IO
03:09 <fresheyeball> err sorry
03:10 <fresheyeball> type MonadDOM = MonadIO
03:10 <fresheyeball> but when I try to use it in practice
03:10 <fresheyeball> with an IO Monad
03:10 <fresheyeball> I get No instance for (MonadDOM IO)
03:10 <fresheyeball> how is that possible?
03:10 <hamishmack> Are you compiling with GHC?
03:11 nicknovi1 joined
03:11 <hamishmack> When compiled with ghc (instead of ghcjs) MonadDOM is not MonadIO
03:11 <fresheyeball> I am compiling with GHC
03:12 <hamishmack> Instead it is a reader monad that has the javascript context
03:12 <hamishmack> You may need to choose a JSaddle runner package
03:13 <hamishmack> For instance jsaddle-warp, jsaddle-webkit2gtk or jsaddle-wkwebview
03:13 <fresheyeball> Would it be possible to get the hello world example updated?
03:13 <fresheyeball> thats all I want
03:13 <fresheyeball> also got to go ttyl
03:13 <hamishmack> They each have “run” functions
03:14 <hamishmack> Is ghcjs-dom-hello broken?
03:14 otto_s joined
03:15 <hamishmack> The run functions take a JSM () and turn it into IO ()
03:17 <kernelj_arch> my god, I built the tree wrong, what a disaster
03:17 <hamishmack> The MonadDOM and DOM in ghcjs-dom are really just MonadJSM and JSM (there is a historic reason for the different name, but they are the same now)
03:17 <thang1> kernelj_arch: lol I do that all the time, no worries :p
03:18 bjz joined
03:18 takle joined
03:18 felixsch__ joined
03:18 Wizek_ joined
03:19 blym_ joined
03:19 <kernelj_arch> passed with flying colours, I forgot to add the size of the tree to the right to the size on the left
03:19 dfranke joined
03:19 foofighterbar joined
03:19 <thang1> is it just a normal BST?
03:20 <kernelj_arch> no it's a weird one
03:20 <thang1> Never heard of a Weird tree :p
03:21 minn joined
03:22 <kernelj_arch> I have both leaf and emptybranch leaf nodes along with the node nodes
03:22 <kernelj_arch> and the nodes store the min&max of all the nodes underneath along with the count of leaves
03:23 subtlebot joined
03:23 <thang1> what's the difference between leaf and emptybranch leaf?
03:24 <lpaste> halogenandtoast pasted “DigestPassword.hs” at http://lpaste.net/355057
03:24 <halogenandtoast> Is there any good way to combine those into one line? ^^
03:24 <kernelj_arch> a leaf has a value inside it and is counted as a leaf, the emptybranch is more like a null
03:24 <halogenandtoast> or clean it up at least?
03:24 skeet70 joined
03:25 Destol joined
03:25 <thang1> kernelj_arch: you don't need to represent a null in haskell. The leaf signifies that it's the last one so it's useless redundancy to have a null leaf?
03:25 <kernelj_arch> halogenandtoast: I think you can use the Maybe monad
03:25 <thang1> Like, a node is either "I am a node with data and have at least one child" or "I am a node with data and have no children"
03:26 <halogenandtoast> kernelj_arch: What do you mean by that?
03:26 <thang1> http://stackoverflow.com/questions/19655870/simplifying-nested-maybe-pattern-matching
03:26 <thang1> check this out, halogenandtoast
03:27 <kernelj_arch> thang1: the emptybranch signifies that there isn't a last one
03:27 <thang1> As in, it's an infinite tree?
03:27 <glguy> halogenandtoast: digestPassword x :: IO (Maybe SomeDigest) ?
03:27 <halogenandtoast> glguy: IO (Maybe Text)
03:28 abhiroop joined
03:28 jleon joined
03:29 <glguy> halogenandtoast: If there was more going on that this you could use MaybeT IO, but the syntactic overhead is too high in this small case
03:29 {emptyset} joined
03:30 <halogenandtoast> Okay, I'm actually fine with this being the simplest solution I just keep feeling like I could use fmap and it keeps ending up with the wrong type.
03:30 mmachenry1 joined
03:30 <kernelj_arch> what type do you get?
03:31 butterthebuddha joined
03:31 <halogenandtoast> well, step by step I tried ` digest <- digestPassword <$> password
03:31 <halogenandtoast> Couldn't match type ‘Maybe’
03:32 <halogenandtoast> with ‘HandlerT Auth (HandlerT site IO)’
03:32 <kernelj_arch> yeah you're doing that wrong
03:32 <halogenandtoast> I didn't think I was doing it right :p
03:32 <kernelj_arch> lookupPostParam "password" is the Maybe value
03:32 Costar joined
03:32 featherlessbiped joined
03:32 <kernelj_arch> so that goes on the rhs of the fmap
03:33 <kernelj_arch> liftIO . digestPassword <$> lookupPostParam "password"
03:34 <halogenandtoast> kernelj_arch: your solution produces
03:34 <halogenandtoast> Couldn't match type ‘Maybe Text’ with ‘Text’
03:34 <halogenandtoast> Expected type: Maybe Text -> Maybe Text
03:34 <halogenandtoast> Actual type: Text -> Maybe (Maybe Text)
03:35 <kernelj_arch> oh is this inside a do
03:36 <halogenandtoast> yes
03:36 <halogenandtoast> isn't it always :p
03:38 <kernelj_arch> I think having a Maybe (Maybe x) is bad, you can use 'join' on it
03:40 Argue joined
03:40 JeanCarloMachado joined
03:42 ystael joined
03:43 xcmw joined
03:44 Xanather joined
03:47 <halogenandtoast> Okay, not sure where to use join, I'll probably stick with what I have and revisit it when I learn more.
03:47 butterthebuddha joined
03:49 PennyNeko joined
03:50 Goplat joined
03:53 <lyxia> :t (fmap . fmap) join . traverse
03:53 <lambdabot> (Applicative f, Traversable m, Monad m) => (a1 -> f (m a)) -> m a1 -> f (m a)
03:53 johnw_ joined
03:53 <thang1> oooh talk burrito me, baby, aww yiss
03:54 <lyxia> :t maybe (return Nothing)
03:54 takle joined
03:54 <lambdabot> Monad m => (a1 -> m (Maybe a)) -> Maybe a1 -> m (Maybe a)
03:55 boj joined
04:02 newhoggy joined
04:03 Maxdamantus joined
04:05 nicknovi1 joined
04:06 lambdaman joined
04:06 meba joined
04:06 <thang1> hmm...
04:07 <thang1> can I just put a link to a google doc in the submission part of the haskell summer of code bit?
04:07 butterthebuddha joined
04:08 unyu joined
04:09 systemfault joined
04:10 pisomojado joined
04:10 systemfault joined
04:11 keyboardsurfer joined
04:11 krypton joined
04:15 newhoggy joined
04:15 newhoggy joined
04:16 flatmap13 joined
04:16 codesoup joined
04:18 ericsagnes joined
04:18 Khisanth joined
04:22 Rodya_ joined
04:22 sleffy joined
04:22 dan_f joined
04:24 <sophiag`> i went through Huet's Zipper paper and translated the code from OCaml (which i hardly know) and it was mostly pretty easy except for this one function that uses a recursive where expression that doesn't make any sense to me. here's the code with the function in question on line 44 if anyone is willing to take a look: https://gist.github.com/Sophia-Gold/2562237e6f1964ce7edb30dcb6027db1
04:26 minn joined
04:26 leonardys joined
04:26 <sophiag> there was also a function using an @ symbol, which i couldn't find in any OCaml references but based on context assumed was an infix concat. not sure if i'm correct abou that though...
04:26 bjobjo joined
04:26 AaronFriel left
04:27 AaronFriel joined
04:27 <Axman6> something definitely looks odd there. can you add the ocaml version? (and maybe give the gist a .hs file name so it gets syntax highlighting)?
04:27 <Axman6> oh I'm an idiot, it's thete
04:27 <sophiag> the OCaml version is right beneath it
04:27 <Axman6> there*
04:27 <sophiag> good call on syntax highlighting tho
04:28 <Axman6> I think you have the wype wrong, looks like it should be nth :: Location a -> Int -> Either String (Either String (Location a))
04:28 <sophiag> it does...except the OCamL version only takes one argument
04:28 <Axman6> man, can't type at all today
04:28 <sophiag> that's what confused me
04:28 <sophiag> it seems it should be nth Loc n = nthrec n
04:28 <geekosaur> I don;t see where n is supposed to come from there... but suspect it should be loc
04:29 <geekosaur> er, x
04:29 skeet70 joined
04:29 <sophiag> err actually wait not exactly (referring to my last comment)
04:29 <sophiag> n is the depth of the node it's looking for
04:30 <sophiag> and x actually represents a tuple since Location is a product type...
04:31 leonardys joined
04:35 Aruro joined
04:36 mzf joined
04:38 eklavya joined
04:38 <ski> sophiag : yes, `@' would be `++' in Haskell
04:38 newhoggy joined
04:39 vaibhavsagar joined
04:40 castlelore joined
04:40 castlelore joined
04:41 <ski> sophiag : no, it shouldn't be `nth Loc n = nthrec n' (or rather, that wouldn't help .. though i guess it strictly speaking wouldn't hurt either). instead of `nthrec = case n of' you want `nthrec n = case n of'
04:41 <iqubic> It looks correct.
04:41 <iqubic> Not sure what the issue is.
04:41 erikd joined
04:41 <sophiag> ski: right, that's why i corrected myself
04:42 <ski> if you enable `LambdaCase', then you could say instead `nthrec = \case of'
04:42 <ski> `\case' corresponds to `function'
04:43 <iqubic> What's LambdaCase? Is it a language pragma?
04:43 <sophiag> right i figured something like \n -> case n of
04:43 ystael joined
04:43 JoshS joined
04:43 <ski> iqubic : it's a language extension
04:44 <ski> sophiag : aye, also works
04:44 <sophiag> ski: but then do i need to change the type signature? i'm not sure where the n comes from in nth (Loc x) = nthrec n
04:44 <ski> no, it should be `nth (Loc x) = nthrec', as you had it in the gist
04:44 <ski> no `n' there
04:45 <iqubic> So then where does the n come from
04:45 <ski> i'm wondering whether you want to use `error' in place of `failwith' ..
04:45 <ski> iqubic : from `nthrec'
04:45 fragamus joined
04:45 <sophiag> yeah it would make more sense to use Maybe than Either, but i was trying to be faithful to the original
04:46 <sophiag> but i'm still confused about "where nthrec = \n -> case n of
04:46 flatmap13 joined
04:46 <iqubic> It's a where binding. Not sure how the n gets there though
04:46 <ski> `nthrec' is a function
04:46 <iqubic> Yes, it is.
04:46 <sophiag> i just mean it's not compiling. could be the type signature
04:46 <ski> `nth (Loc x)' will return `nthrec', a function, that expects a further argument (called `n' in there)
04:46 <iqubic> Defined in that where statement
04:47 <ski> i suppose something like
04:47 <ski> nth :: Location a -> Integer -> Either String (Either String (Location a))
04:47 <ski> .. though it might be better to use
04:47 <ski> nth :: Location a -> Integer -> Either String (Location a)
04:48 jmcarthur joined
04:48 <ski> if you want it to be pretty faithful, while using `Either' for the failures
04:48 <iqubic> And that's the correct type signature for the function.
04:48 <sophiag> i'm still getting errors
04:48 <ski> but then you shouldn't wrap the `goDown' and `goRight' calls in `Right'
04:49 <ski> because those calls will themselves decide whether to return `Left' or `Right'
04:49 <sophiag> ah there we go
04:49 <ski> this way, you'll be merging the different failure conditions into the same `Left ...'
04:49 <sophiag> right, that's why i had them wrapped in _two_ Eithers before
04:49 <sophiag> the answer is no Eithers because they're already in the other signature
04:49 abhiroop joined
04:49 <sophiag> or rather no constructors
04:49 <ski> rather than having both `Left ...' and `Right (Left ...)' as failure cases (and `Right (Right ...)' as success case)
04:50 <iqubic> Yes, that sound good.
04:50 <iqubic> OCaml sounds like a pain to work with, I'd have to say
04:51 <ski> it's not that bad, i think
04:51 <sophiag> yeah i like OCaml
04:51 <sophiag> don't confuse my ignorance in reading it with the language :)
04:52 <ski> it seems there's two classes of failure cases here
04:52 <sophiag> hmm. even with all the Right constructors moved GHC still expects it to return Location a
04:53 <iqubic> What's the type signature you have for that function currently?
04:53 <ski> on the one hand, failure classes that could reasonably be avoided by making sure to fulfil the preconditions (like passing a positive integer to `nth')
04:53 mjora7 joined
04:53 <ski> s/failure classes/failure cases/
04:54 sproingie joined
04:54 sproingie joined
04:54 <ski> on the other hand, failure cases that it seems couldn't reasonably always be avoided in bugfree code (like going up from the top)
04:54 <iqubic> So what is the right way to write this function?
04:55 <ski> the latter might be nicely expressed by `Maybe' (or `Either', but preferably not with `String' as describing the failure condition) in Haskell
04:55 <ski> @quote stark
04:55 <lambdabot> AlanPerlis says: The string is a stark data structure and everywhere it is passed there is much duplication of process. It is a perfect vehicle for hiding information.
04:55 <ski> the former could well use `error' instead, i think
04:56 geekosaur joined
04:56 sssilver joined
04:59 boj joined
05:01 <sophiag> ski: Either vs. Maybe doesn't explain why this is one function isn't compiling though
05:01 takle joined
05:02 texasmynsted joined
05:02 <ski> i don't know how your code looks currently
05:03 <sophiag> here's the updated version: https://gist.github.com/Sophia-Gold/2562237e6f1964ce7edb30dcb6027db1
05:04 flatmap13 joined
05:05 <biglambda> Why would all of my values be less than one if I’m generating random CFloats?
05:06 <biglambda> using System.Random for fuzz testing.
05:06 <biglambda> So I’m hoping to have the full range of values.
05:07 <ski> sophiag : ah, i see :)
05:08 <sophiag> biglambda: how would you generate random floats over an arbitrary range?
05:08 <ski> `goRight $ nthrec (n-1)' should be `goRight =<< nthrec (n-1)'
05:08 <biglambda> I’m just using the standard instance of Random
05:09 <sophiag> i'm just saying it doesn't make much sense to have random floats in a range of say 1..100. i suppose you mean a random integer 0-9 for each digit of precision over that range?
05:09 <sophiag> ski: thanks. sadly, i think i never would have picked up on that
05:09 <biglambda> Well I’m fuzz testing so I want the FULL range of possible values.
05:10 <sophiag> because goRight returns an Either monad i need to bind the value to it?
05:10 <biglambda> I need to see if any inputs to my system can crash it.
05:10 <sophiag> err function, not value
05:10 <ski> sophiag : yes. you could also manyally `case' on it, but using `=<<' is simpler. it's what it's intended for
05:10 <sophiag> biglambda: just scale it up to the range you need
05:10 <ski> sophiag : well, an `Either'-action, not an `Either' monad
05:11 <ski> (or an `Either String'-action, to be pedantic)
05:11 <sophiag> can you explain that distinction?
05:12 crobbins joined
05:12 <ski> `Either String' is a monad
05:12 <ski> a value of type `Either String T', for some type `T' (in your case `Location a'), is not a monad
05:12 <ski> it's a monadic action
05:12 <sophiag> oh interesting. i never realized that
05:12 soniku joined
05:12 <ski> monads are not run-time things
05:13 <sophiag> could you say the same for Maybe and the Just type?
05:13 <ski> there is only a single `Maybe' monad. but many values of type `Maybe T' (assuming `T' has some values)
05:13 <ski> `Maybe' is a type. `Just' is not a type, it's a value
05:13 <ski> `Maybe' is a type constructor. `Just' is a data constructor
05:13 <ski> all data constructors are values
05:14 <sophiag> i mean the value constructed by Just. returning that would be an action of the Maybe monad?
05:14 <sophiag> i suppose it's quite obvious when i put it that way
05:15 <ski> the value itself is a `Maybe'-action
05:16 <ski> `Nothing' is a `Maybe'-action, that represents failure to compute a result
05:16 <ski> `Just x' is a `Maybe'-action, that represents success to compute the result `x'
05:16 <ski> `Maybe' is a monad for expressing possible failure to compute a result (but no further information in case of failure)
05:17 <sophiag> right, got it
05:17 <ski> `Either E' tags failures with values of type `E'
05:17 andersamer joined
05:17 lavalike_ joined
05:17 <andersamer> hello
05:17 <Maxdamantus> I'd say to be more accurate, the thing defined when you write `instance Monad Maybe` is a monad.
05:18 <ski> for lists, `[]' (the empty list value) is a `[]'-action, representing no solutions being computed
05:18 <ski> `[x]' represents a single solution, `x', being computed
05:18 <ski> and so on
05:18 <Maxdamantus> "here is a Monad Maybe: return = Maybe; (>>=) = .."
05:18 <Maxdamantus> er, return = Just
05:18 <ski> yes, the monad is `Maybe', together with the implementation of `return' and `(>>=)', satisfying the laws
05:19 <ski> for short, we say "the monad `Maybe'"
05:19 <Maxdamantus> I'd say "the Maybe monad"
05:19 <* ski> nods
05:19 <Maxdamantus> Because Maybe itself is not a monad. It's just a type constructor.
05:19 xiinotulp joined
05:19 <ski> but since we're using the type class system, each type, like `Maybe' can be associated in at most one way to such implementations
05:20 <ski> so the type serves to uniquely identify the monad, in Haskell's type class system
05:20 <Maxdamantus> You could theoretically (maybe not in Haskell) have a type constructor defined like `type Identity x = x` then have an "identity monad" that would be defined using `instance Monad Identity`
05:20 <ski> hello andersamer
05:20 <Maxdamantus> return = id; (>>=) = id
05:21 <ski> `(>>=) = flip ($)', rather
05:22 lavalike joined
05:23 Rodya_ joined
05:23 <Maxdamantus> ah yes, that.
05:23 <* Maxdamantus> sometimes imagines the function to be the first argument.
05:24 <* andersamer> stares in awe at the level of intelligence of the people on #haskell
05:25 <sophiag> wait, why would it be like reverse application in that case?
05:25 <ski> (>>=) :: Identity a -> (a -> Identity b) -> Identity b
05:26 <ski> (>>=) :: a -> (a -> b) -> b
05:26 <Maxdamantus> well, if you imagine `map :: (a -> b) -> a -> b`, `map f` is the same as `f`
05:26 <Maxdamantus> and in the identity monad, `map` is the same as `bind`
05:26 <ski> andersamer : .. did you have a question ?
05:26 <Maxdamantus> but since you have `a -> (a -> b) -> b` in Haskell, you have to flip the application around.
05:27 <sophiag> so it's because in the case of identity you want to return a not b?
05:27 <andersamer> ski no sorry i kinda just wanted to see this channel for a bit
05:27 <johnw_> Maxdamantus: in non-Haskell, you can certainly do that
05:27 <* ski> will leave this one for Maxdamantus ..
05:27 <Maxdamantus> johnw_: yeah, I know.
05:27 <ski> andersamer : feel free to lurk
05:28 <Maxdamantus> The only reason it doesn't make sense in Haskell is because Haskell wants to infer the instance from types.
05:28 takle joined
05:28 <Maxdamantus> and then whenever you write `a >>= b`, it could just decide to use the identity monad if it allowed such ambiguous instances.
05:29 reggie_ joined
05:29 <Maxdamantus> sophiag: it's just a matter of input order.
05:30 <Maxdamantus> sophiag: in Haskell you have `(>>=) action fn` rather than `(>>=) fn action`
05:31 bjz joined
05:32 xcmw_ joined
05:32 <sophiag> ah i see. realistically though, you wouldn't want an identity Monad so that wouldn't be an issue
05:33 <johnw_> why wouldn't you want one?
05:33 <Maxdamantus> Well, an identity monad is useful when you're writing monad combinators.
05:34 <Maxdamantus> and it does exist in mtl, but it has something like `newtype Identity a = Identity a`
05:34 reggie__ joined
05:34 <johnw_> or any time you need to prove a functor, but don't need one; it turns monad transformers into plain monads, for example
05:34 <johnw_> s/prove/provide
05:34 Spondyl joined
05:35 <Maxdamantus> Yeah, it's sort of like thinking about the unit type/value
05:35 <johnw_> exactly
05:35 <Maxdamantus> it's useless at some level.
05:35 <johnw_> zero doesn't seem very useful for doing addition, until it totally is :)
05:35 <Maxdamantus> but if you're trying to use parametric code it's potentially useful.
05:35 <johnw_> it's the mempty of the endfunctor world
05:36 <* ski> idly ponders functors between categories of ends
05:38 <sophiag> johnw_: that's a very good way of thinking about it
05:39 monochrom joined
05:39 <johnw_> it's not just a metaphor
05:40 <johnw_> there's a category in which Identity actually is the moral equivalent to what "mempty" means
05:41 tripped joined
05:42 connrs joined
05:43 butterthebuddha joined
05:43 <sophiag> do you just mean the category of endofunctors or more specifically?
05:43 <sophiag> lists?
05:43 ystael joined
05:44 <johnw_> there's a monoidal category where monads are represented as the monoid object "(Endo[Hask], Identity, Compose)"
05:45 MP2E joined
05:45 wroathe joined
05:45 <sophiag> i thought that was the very definition of a monad?
05:45 <johnw_> it's one definition
05:46 <johnw_> there's another in terms of adjunctions, where you don't talk about monoids that much
05:46 retry joined
05:47 <sophiag> i think that's how they're defined in the Catsters videos, which was a bit confusing for me. i need to rewatch that section
05:47 <johnw_> yeah, the adjunction approach is a bit more "fundamental"
05:48 <johnw_> since the monoid object approach only deals with the composite functor of the two adjoints
05:48 skeet70 joined
05:48 <retry> I'm using intero on emacs, the dropdown menus specific to intero are blank. Why is this ?
05:50 slack1256 joined
05:50 abhiroop joined
05:50 fakenerd joined
05:52 cfricke joined
05:52 BartAdv joined
05:54 takuan joined
05:56 andersamer left
06:00 abhiroop joined
06:00 wroathe joined
06:02 hurkan joined
06:03 ccomb joined
06:04 lambdaman joined
06:06 jleon joined
06:06 newhoggy joined
06:14 forgottenone joined
06:14 soniku joined
06:14 dm3 joined
06:16 wroathe joined
06:17 newhoggy joined
06:20 slack1256 joined
06:20 spatial joined
06:23 mithrandeer joined
06:23 Rodya_ joined
06:26 ryxai joined
06:27 newhoggy joined
06:28 butterthebuddha joined
06:29 leejamw joined
06:30 Argue joined
06:30 slack__ joined
06:33 abhiroop joined
06:34 takuan joined
06:35 Aruro joined
06:35 JeanCarloMachado joined
06:36 ubsan_ joined
06:37 shesek joined
06:37 Hunter1 joined
06:37 xormor joined
06:38 rockfordal joined
06:38 jleon joined
06:39 Hunter1 joined
06:39 mithrandeer joined
06:41 newhoggy joined
06:42 preyalone joined
06:43 FreeBirdLjj joined
06:44 Argue_ joined
06:45 teggi joined
06:46 ystael joined
06:46 geekosaur joined
06:46 plot joined
06:46 hurkan left
06:48 wroathe joined
06:49 JuanMiguel joined
06:49 abhiroop joined
06:50 jleon joined
06:51 newhoggy joined
06:51 Hunter1 joined
06:52 kritzcreek joined
06:54 mmachenry joined
06:54 sproingie joined
06:58 <retry> Anybody here use intero ?
07:00 newhoggy joined
07:02 jleon joined
07:05 FreeBirdLjj joined
07:09 connrs joined
07:09 newhoggy joined
07:11 ChaiTRex joined
07:12 <srhb> retry: Have you tried backing up your Emacs config and making a minimal one with just Intero?
07:12 <srhb> retry: 9/10 times etc.
07:12 <Lokathor> i wish the text package could be broken up a bit some of the time
07:12 Hunter1 joined
07:12 <srhb> Lokathor: How so?
07:13 <Lokathor> srhb, it's one of the longest to build packages
07:13 ccomb joined
07:14 <srhb> Lokathor: Ah, I didn't know, I use precompiled ones...
07:14 <Lokathor> srhb, are you one of those nix people?
07:14 jleon joined
07:14 seveg joined
07:14 <srhb> Lokathor: I am. :)
07:14 <Lokathor> ugh, you nix people :P
07:15 <srhb> Lokathor: Come to the future, we have binary caches. ;-)
07:15 <Lokathor> do they run on raspberry pi?
07:15 <Lokathor> will i get all my steam games too?
07:15 <srhb> Lokathor: Steam games, yes. Raspberry Pi, you'd probably need to set up your own Hydra, which may be quite tricky :P
07:15 butterthebuddha joined
07:15 oish joined
07:16 <Lokathor> all my ~windows only~ steam games i should specify :P
07:16 <srhb> Lokathor: Doesn't Nix run on Windows?
07:16 <srhb> It probably needs some love, but I think the basics are in place.
07:17 <srhb> Anyway... Tangent. :-P
07:17 <dmj`> srhb: not well, but you can cross compile for windows
07:17 <Lokathor> ah, i thought it was a complete OS unto itself
07:17 <srhb> dmj`: Ah, ok :)
07:17 <srhb> Lokathor: That's NixOS
07:17 <srhb> Lokathor: (Built around Nix)
07:17 newhoggy joined
07:17 <Lokathor> ah ha
07:17 FreeBirdLjj joined
07:18 <dmj`> w/ NixOS you can version the kernel, the bootloader is generated out of entries from the nix store as well
07:19 connrs joined
07:19 wroathe joined
07:20 ner0x652 joined
07:20 <Lokathor> oh my gosh it finished building
07:21 ragepandemic joined
07:21 <dmj`> text?
07:21 <Lokathor> yes
07:21 srbaker_ joined
07:21 <dmj`> w/ nix?
07:21 <Lokathor> no just normal text
07:21 <srhb> Couldn't cabal new-build support binary caches as well?
07:21 <srhb> Doesn't it use a similarly deterministic build process to nix?
07:21 <srhb> Or is it just the sharing that's similar.
07:21 <Lokathor> we use stack around these parts, pilgrim
07:22 <dmj`> Lokathor: haskellPackages.ghcWithPackages (p: with p; [ text ])
07:22 <dmj`> nix-shell -p “ ^
07:22 <srhb> Lokathor: Ah, I've no idea if that could work as well.
07:22 <Lokathor> dmj`, i'm not using nix :P
07:22 <dmj`> Lokathor: it’s high time you did
07:22 <cocreature> srhb: even if it did, you run into problems as soon as something requires a foreign library
07:22 <Lokathor> just plain old debian jessie on a raspberry pi
07:22 <srhb> cocreature: Oh?
07:22 _sras_ joined
07:23 <cocreature> srhb: nix tracks everything, cabal new-build will at best track haskell libraries
07:23 <srhb> cocreature: Right, okay.
07:23 <cocreature> srhb: so if my haskell library depends on some C library you’re out of luck
07:23 <dmj`> cocreature: true but new-build is more incremental
07:23 <dmj`> I’m wondering how they will play together
07:23 <cocreature> dmj`: oh I’m not saying new-build is doing anything wrong. I really like it. I’m just pointing out why binary caches are not that trivial for new-build
07:23 <_sras_> Why does this overlapping instance happen when there is no `DbField` instance for Text http://lpaste.net/355027 ?
07:24 <srhb> cocreature: yeah, thanks for pointing that out. :)
07:24 <dmj`> cocreature: In order for nix to have incremental haskell builds, I think it would have to assemble packages w/o Cabal
07:24 <dmj`> cocreature: ah
07:24 <srhb> I think I have *most* of the goodness from Nix, aside from building statically linked binaries for use in a heterogeneous environment.
07:25 Argue joined
07:25 FreeBirdLjj joined
07:25 <dmj`> srhb: nix might soon let you swap out the lib implementation
07:25 <dmj`> libc*
07:25 <srhb> dmj`: That's interesting. :)
07:25 newhoggy joined
07:25 <dmj`> so using musl, since glibc has serious issues with static linking
07:25 <cocreature> srhb: also nix only has one version of a package in most cases which makes binary caches pretty reasonable. with cabal you’ll have to cache multiple versions of a package depending on the versions of dependencies and that would result in a gigantic cache
07:25 <srhb> But the basic problem is that /nix/.../whatever won't exist if I move my binary to some other server
07:25 <Lokathor> so folks
07:26 <Lokathor> i am back to the classic problem
07:26 <srhb> cocreature: Right.
07:26 <dmj`> Lokathor: right, time for nix
07:26 <dmj`> ;)
07:26 <glguy> _sras_: the left side of the => in an instance doesn't matter for picking instances
07:26 <srhb> cocreature: But I think people would benefit a lot from a "some of the newest ones" cached
07:26 <Lokathor> STM is the best for in memory concurrent modification, but your program needs to shut down eventually, so we want to store things in a database
07:26 <Lokathor> how do we best merge these things
07:26 <glguy> that just has constraints that need to be true if that instance is picked
07:26 <Axman6> _sras_: there _could_ be a DbField instance for Text
07:26 <srhb> Lokathor: You mean serializing things from some STM computation? I think it depends on "things"
07:27 <sophiag> does Haskell have functions like snd and fst except for sum types? like inl and inr?
07:27 <cocreature> srhb: I’m not so sure about that tbh. building a package once is usually not a big deal ime. building it again for every package is annoying but that’s what cabal new-build/stack already prevent
07:27 <Lokathor> sophiag, not in the general case
07:27 <clever> srhb: https://github.com/lethalman/nix-user-chroot and https://github.com/matthewbauer/nix-bundle
07:27 <dmj`> sophiag: Prisms I think do that
07:27 <srhb> cocreature: Okay.
07:27 <clever> srhb: this uses mount namespacing to chroot without needing root
07:27 <Axman6> sophiag: lens - Prism
07:27 plot joined
07:27 <srhb> clever: What is this sorcery :o
07:27 <Axman6> :t _Left
07:27 <lambdabot> (Applicative f, Choice p) => p a (f b) -> p (Either a c) (f (Either b c))
07:27 <glguy> sophiag: inl and inr are Left and Right
07:27 <Axman6> > Left 1 ^? _Left
07:28 <clever> srhb: the same sorcery that chrome uses to sandbox its processes
07:28 <lambdabot> Just 1
07:28 <srhb> clever: Cool!
07:28 <sophiag> glguy: great, thanks!
07:28 <Lokathor> srhb, i mean that there's some sort of state that we're controlling access and modification of with STM, but we also want to be able to make sure that all STM comitted changes become DB changes as well, so they're always matching
07:28 takle joined
07:28 <_sras_> Axman6: DbField instance is defined be me. Not part of a library.
07:28 <srhb> Lokathor: Ah.
07:28 <clever> srhb: grsecurity was disabling non-root namespace access, but with grsecurity going subscription only, that doesnt matter now
07:28 <glguy> _sras_: that doesn't matter
07:28 <sophiag> i'm just going over some papers in OCaml and wanted to use idiomatic haskell rather than TypeOperators
07:28 <srhb> clever: Those are just voodoo words to me. :-)
07:28 <Axman6> _sras_: the point is that just because there isn't an instance fot Text now, there could be one later
07:29 taksuyu joined
07:29 <Lokathor> srhb, the alternative is to have the game state only be the DB, and all "game state changes" are DB actions
07:29 <Lokathor> and let the DB transactions handle it
07:29 <Axman6> _sras_: and then what happens when you call form with a ~ Text?
07:29 <srhb> Lokathor: But that's probably expensive, yeah.
07:30 <srhb> Lokathor: I mean iirc Civilization games do something like this with sqlite, but they are also painfully slow.
07:30 <srhb> As soon as you let go of the permanently in sync requirement, you gain a lot.
07:30 <Axman6> Lokathor: have you looked at something like acid-state?
07:30 zeroed joined
07:30 <Axman6> gives you in memory data structures, with ACID guarantees
07:31 <Lokathor> srhb, in this case, the basic gameplay will be an IRC bot that you can issue commands to, and it "sets up" your turn, then once the turn runs (1/hr say, or possibly even less frequent) it does all the actions that the players did. So actually running the turns can take up to several seconds just fine
07:32 <srhb> Lokathor: Ah okay, then just doing everything as db actions is fine, i think.
07:32 <Lokathor> Axman6, in this case i'm more concerned with being able to turn the bot off and on without losing my data. Does acid-state support serialization to disk?
07:32 <srhb> Lokathor: Or, yes, acid-state for the awesomeness :)
07:32 <srhb> It does.
07:32 <srhb> (hence the name)
07:32 <Lokathor> i don't get it
07:32 <srhb> Well, the atomically :)
07:32 <Lokathor> *looks at the hackage page*
07:33 <Lokathor> *ACID is in caps*
07:33 <srhb> :-)
07:33 <Lokathor> "oh, ACID means something to someone somewhere I guess"
07:33 newhoggy joined
07:33 <srhb> atomicity, consistency, isolation, durability
07:34 <_sras_> Axman6: Not getting you. "the point is that just because there isn't an instance fot Text now, there could be one later", why not complain then, when such an instance is defined?
07:34 <Lokathor> I think i'll consider using persistent for at least a bit. I feel like it'd be cool to show off to my friends a working example of a thing that's using a DB while also having the DB details entirely abstracted away
07:34 <Lokathor> one of them didn't even believe that it was possible to have a DB interface be DB-type agnostic
07:35 <srhb> Lokathor: It's fun for trying out, but it's way more verbose than acid-state.
07:35 <srhb> But yeah, try both ;-)
07:35 wroathe joined
07:35 <Lokathor> does acid-state have a tutorial?
07:36 <srhb> Lokathor: https://ocharles.org.uk/blog/posts/2013-12-14-24-days-of-hackage-acid-state.html -- or try one of the old happstack tutorials that use it.
07:37 <Lokathor> >> Keep in mind that acid-state does not provide schema migrations. If you plan on changing the definition of your data-type during the lifetime if your application (you most likely do), ...
07:37 <Lokathor> ominious
07:37 <Lokathor> I will be changing the schema very, very often i think :P
07:37 <srhb> Lokathor: migrations really aren't that hard to write.
07:38 <pavonia> Given a list of infixes and a word S, how do you check if all infixes occur in S at least once such that no two of the infixes overlap each other? For example, check ["o", "oo"] "foo" would fail but check ["o", "oo"] "fooo" would be okay
07:41 sgflt joined
07:41 newhoggy joined
07:43 phyrex1an joined
07:44 Denthir joined
07:46 srhb joined
07:46 cranej joined
07:46 ystael joined
07:47 vlatkoB joined
07:47 takle joined
07:48 <Lokathor> srhb, AcidState migrations are *how* easy to write through? mkMigrate "migrateAll" is pretty easy
07:49 <Lokathor> because this is a game i'd want to be doing incrimental development on, so i'd be regularly adding a field every time there's some new cool thing i want to add
07:49 Athas joined
07:50 newhoggy joined
07:50 <srhb> Lokathor: Basically the same, except you have to deal manually with new fields, but I assume you have to do the same for persistent really.
07:50 <Lokathor> if you're only adding a field, you actually don't
07:50 <srhb> Lokathor: (as in, if you added foo :: String to your serialized type, you will have to decide how it gets populated for existing values)
07:50 <srhb> Lokathor: Oh, interesting.
07:51 <srhb> Lokathor: How does one even handle the lack of a value then?
07:51 <Lokathor> it can just add a field, it will detect that the existing table lacks that field, and it just adds a column into the DB
07:51 lavalike joined
07:51 <srhb> Lokathor: Which is nullable, then?
07:51 <Lokathor> there are special rules for non-nullable columns and default values and such
07:51 <srhb> Lokathor: Right, but then you're just paying the cost in the client code.
07:51 wroathe joined
07:52 <srhb> You may have to anyway (explicitly making the new field Maybe NewThing) but if you don't, you can just handle it in the migration.
07:52 {emptyset} joined
07:53 <Lokathor> true, with Persist you're limited to a subset of types, ones that fit easily into the common external DB types
07:53 <srhb> Yeah. :)
07:53 <Lokathor> AcidState lets you use any crazy haskell type, it seems
07:53 <srhb> Any non-function type, basically.
07:53 <Lokathor> dataist nonsense
07:53 <srhb> :-)
07:53 <Lokathor> pure propaganda
07:53 mmn80 joined
07:55 <Lokathor> well i've not used persisent deeply
07:55 <Lokathor> just ran through a tutorial some time
07:55 <Lokathor> but you might want to give it a look
07:57 FreeBird_ joined
07:57 ragepandemic joined
07:58 <Lokathor> http://lpaste.net/355062 :(
07:58 cranej joined
07:58 <Lokathor> Haskell just isn't quite ready on RPi
07:59 newhoggy joined
08:00 cranej joined
08:01 <cranej> cls
08:02 <srhb> Lokathor: Ouch!
08:02 <srhb> Lokathor: And I have used persistent before, it's just a while ago.
08:02 <srhb> I prefer less ORM'y approaches when I need to use postgres anyway.
08:06 augur joined
08:06 sproingie joined
08:06 sproingie joined
08:07 wroathe joined
08:07 cranej joined
08:08 newhoggy joined
08:08 meba joined
08:08 <Lokathor> i don't even know what any of that means :P
08:09 <srhb> Lokathor: I prefer a more raw, sql'y approach to interacting with the database :)
08:09 <Lokathor> but don't you want ~type safety~
08:09 <srhb> I do!
08:10 <srhb> And yes, those two are a bit at odds. :)
08:10 <srhb> Perhaps I should try persistent again, I just found it a bit cumbersome and lacking in expressiveness.
08:12 <Lokathor> ever played Neptune's Pride?
08:12 <srhb> Nope
08:12 <Lokathor> let me start by saying: never play this game.
08:12 xormor joined
08:13 <Lokathor> but anyway it's this amazing long-form real time strategy game that you can play with huge groups of people
08:13 <Lokathor> each game plays out managed by a server, with player inputs that actually go into effect each "tick"
08:13 <Lokathor> but game ticks are like 1/hour, and many neptune's pride games take days and days of time to play out
08:14 <Lokathor> it's the most stressful thing, really
08:14 soniku joined
08:14 <Lokathor> I want to make a game like that, with the time elements and playing out slowly, but purely co-op
08:15 <Lokathor> so the heavy processing comes in small bursts, most of the time the game is either totally idle or possibly parsing a player saying what they want queued up
08:15 newhoggy joined
08:16 <srhb> Lokathor: OK. :)
08:16 <srhb> Sounds like a fun project.
08:16 reggie_ joined
08:16 <Lokathor> Neptune's Pride is all the fun of Risk and Monopoly, looming over your soul for days at a time :P
08:16 <Lokathor> this will hopefully be more fun, like Kitten's Game or Candy Box
08:18 nilof joined
08:18 boj joined
08:19 cranej joined
08:20 <Lokathor> yep, tried a second time, aeson definitely doesn't work on RPi
08:20 <Lokathor> ah well
08:23 wroathe joined
08:23 newhoggy joined
08:24 jleon joined
08:24 marr joined
08:25 lep-delete joined
08:25 <Jinixt> what's the difference between StateT (ExceptT) and ExceptT (StateT)?
08:25 <Jinixt> (and other args of course)
08:26 <Lokathor> Jinixt, roughly, and as i recall it, the order of the stacking affects which can cancel the other
08:26 ph88 joined
08:27 <Lokathor> so the second form is either a StateT or an error and no state changes, the first form keeps state changes up to the error point
08:27 <Lokathor> *i think*
08:27 <Athas> Lokathor: other way around.
08:28 <* Lokathor> shakes fist at his own foggy old brain
08:28 <Jinixt> so ExceptT (StateT) can be used for backtracking maybe?
08:28 takle joined
08:29 fotonzade joined
08:29 <Jinixt> trying to think of it in practice
08:29 <Athas> Jinixt: I think you would go nuts if you tried to use backtracking where aborted branches could still have state effects.
08:30 <Jinixt> ah right, brainfart
08:30 <Jinixt> well, unless the failures are instant :)
08:30 <Lokathor> Athas, it'd be no worse than python!
08:30 <Jinixt> but yeah i see what you mean
08:33 <Athas> Lokathor: and look where that gets us!
08:33 <Athas> Jinixt: but the other way around makes sense. Backtracking where state effects can be aborted may be useful.
08:34 <Jinixt> yeah
08:35 Aruro joined
08:38 richi235 joined
08:38 wroathe joined
08:39 newhoggy joined
08:42 Gurkenglas joined
08:42 tobiasBora joined
08:43 <Gurkenglas> Have there been proposals to write codes that only activates when some package is used, so that, say, lens, needs not drag in all the dependencies? (Is there some language where lens would not have that problem?)
08:44 <Gurkenglas> -write codes+allow writing code
08:44 gmcabrita joined
08:44 acidjnk22 joined
08:47 ystael joined
08:48 <MarcelineVQ> if there's something similar to the speciic part of lens you want you could use possibly backpack to let yourself choose the provider that makes sense
08:48 takle joined
08:49 Aruro joined
08:49 <Lokathor> MarcelineVQ, http://hackage.haskell.org/package/pcgen :3
08:50 <Lokathor> Gurkenglas, if you're looking to provide optional support for a package when it's in the compilation base, you can do that, but it's clunky
08:50 <Lokathor> using the CPP and the MIN_VERSION macro it generates
08:51 takle joined
08:51 kuribas joined
08:51 <MarcelineVQ> Just needs docs and a MonadRandom instance :>
08:51 fizbin joined
08:51 <Gurkenglas> Ooh. Why doesn't lens already do that?
08:53 <Lokathor> Gurkenglas, because it's clunky as frig :P
08:53 <Gurkenglas> but there'd be just up to one cpp around the entirety of each module, and one around each package dependency declaration in the .cabal
08:53 <Lokathor> MarcelineVQ, the generators don't get the MonadRandom instances, just the things you'd do with the generators have those
08:53 <Gurkenglas> What solution would be less clunky than that?
08:54 <Lokathor> Gurkenglas, all that MinVersion does is check what the minimum version of a package in the build is, so what you can do with that is quite limited. You're mostly able to import an additional module (or more than one) and provide an extra typeclass instance or something
08:54 wroathe joined
08:55 newhoggy joined
08:56 <Lokathor> oh, i see what you're saying now
08:56 <MarcelineVQ> ah right, for some reason I'm always expecting monadrandom to do more than it does
08:56 <Lokathor> i guess lens could optionally depend on text, etc etc
08:56 <Gurkenglas> Huh? MinVersion on whether there's a version for unordered-containers. If so, put it into the dependencies and bring Data.HashSet.Lens into existence.
08:56 <Gurkenglas> Yes, that
08:56 butterthebuddha joined
08:57 <Lokathor> MinVersion can't affect the cabal file
08:57 zeroed joined
08:57 <Lokathor> so i feel like the cabal file would become mysteriously confusing if you overuse that trick
08:57 <Gurkenglas> It's just one wrapping cpp line around each package lens serves up optionally
08:58 <Gurkenglas> um line pair i guess if you count however you end a block
08:58 aib joined
08:58 Digit joined
09:00 mabox joined
09:00 <Gurkenglas> Is there some way to influence the cabal file based on the packages that are already in scope?
09:00 ryxai joined
09:01 <Digit> hi following https://wiki.haskell.org/Roll_your_own_IRC_bot when i got to stage 4, upon compile it complains Equations for ‘eval’ have different numbers of arguments. i have no idea what's causing this or how to remedy. (haskell newbie still)
09:02 newhoggy joined
09:03 <Lokathor> Gurkenglas, not that I know of. The cabal file directs how the build goes, once the build is happening it's probably too late. Might be some arcane trick though.
09:03 <hexagoxel> Gurkenglas: not really. cabal flags affect dependencies, dependencies affect solver, and you are asking for the solver (output) to affect flags.
09:04 <hexagoxel> i'd need some more specialized mechanism
09:04 <hexagoxel> *it'd
09:04 <Gurkenglas> So the way to proceed here would be to patch cabal with a flag to weakly depend on a package, as in only when it's already there
09:05 <MarcelineVQ> Digit: include your code and error in some sort of pastebin link, such as http://lpaste.net/
09:05 <Lokathor> rust supports this with "features"
09:07 sproingie joined
09:07 <Gurkenglas> Hmm. Or maybe this can be hacked around. When I import a module, does its package have to be in my dependencies or only in the build plan?
09:07 ryxai joined
09:08 <Digit> oh, nm. i think i stumbled into a fix. o_O against what seemed to work in previous following of the tute years ago, and against what the tute seems to say.
09:08 <MarcelineVQ> Gurkenglas: I really think you should look at ghc backpack. what you're suggesting seems pretty brittle
09:09 seveg joined
09:10 wroathe joined
09:10 <Gurkenglas> Actually it doesn't even sound like a hack. Just take the dependencies out of the cabal file completely, and make cpp cut out all the lens modules whose target packages are missing.
09:11 <Gurkenglas> I'm trying to lift the barrier to depending on lens here, wouldn't lens needing backpack make the problem even worse?
09:11 <MarcelineVQ> you just want to reduce lens? aren't there packages that provide each component of lens essentially if you wanted a split
09:11 ryxai_ joined
09:11 <MarcelineVQ> like newtype and microlens etc
09:12 ryxai joined
09:12 <Gurkenglas> But there are exponentially many subsets of the set of packages lens serves up lenses for
09:17 uglyfigurine joined
09:18 <Lokathor> Gurkenglas, the thing is, CPP makes testing much harder
09:18 <Lokathor> you have to build every possible config and test them all if you want to really cover your bases
09:18 <Lokathor> which is why lens doesn't do that
09:19 Levex joined
09:20 newhoggy joined
09:20 <Gurkenglas> If none of the optional modules depend on each other, is there any conceivable way that there might be problems that wouldn't be detected by testing the maximal config?
09:20 rrampage joined
09:20 simukis joined
09:22 fkurkowski joined
09:24 tsmish joined
09:24 MoALTz joined
09:26 wroathe joined
09:27 boombanana joined
09:28 m0rphism joined
09:29 newhoggy joined
09:30 sepp2k joined
09:33 mbuf joined
09:36 grayjoc joined
09:37 m` joined
09:39 uncorroded joined
09:40 <Myrl-saki> @pl \x -> f (g x) x
09:40 <lambdabot> f =<< g
09:41 augur joined
09:41 mzf joined
09:41 bollu joined
09:44 newhoggy_ joined
09:46 srbaker_ joined
09:46 insitu joined
09:47 filterfish joined
09:48 ystael joined
09:49 louispan joined
09:50 geekosaur joined
09:50 xfix joined
09:53 krypton joined
09:54 spinus joined
09:56 oish joined
09:57 epsilonhalbe joined
09:57 baldrick joined
09:57 uncorroded joined
09:57 wroathe joined
09:58 cschneid_ joined
10:00 Wizek_ joined
10:01 bennofs joined
10:01 newhoggy joined
10:02 buttbutter joined
10:02 buttbutt1r joined
10:03 <jophish> ocharles: We're chatting about the differences between Rel8 and Selda in #nixos-hercules. It would be nice to hear your thoughts on this if you're willing.
10:08 jleon joined
10:09 louispan joined
10:13 Mon_Ouie joined
10:13 wroathe joined
10:15 soniku joined
10:17 NikolajK joined
10:18 epsilonhalbe left
10:20 bollu joined
10:23 cschneid_ joined
10:24 BartAdv joined
10:25 krypton joined
10:28 netheranthem joined
10:28 crave joined
10:31 OnkelTem joined
10:35 yellowj joined
10:39 seveg joined
10:40 newhoggy joined
10:43 bvad joined
10:44 cranej joined
10:44 wroathe joined
10:44 oisdk joined
10:45 DexterLB joined
10:46 bollu joined
10:46 erikd joined
10:46 DocWinter joined
10:49 ystael joined
10:50 aarvar joined
10:51 Yuras joined
10:53 louispan joined
10:55 fXl joined
10:57 NyanPasu joined
10:57 sproingie joined
10:57 sproingie joined
10:57 cschneid_ joined
10:59 <Myrl-saki> How to use reflex-dom to set ID?
10:59 mmachenry joined
10:59 Aeroxam joined
11:00 geekosaur joined
11:02 Snircle joined
11:02 newhoggy joined
11:06 osa1_ joined
11:10 osa1 joined
11:12 bjz joined
11:12 jutaro joined
11:12 anuxivm joined
11:14 dm3 joined
11:16 wroathe joined
11:16 minn joined
11:17 unyu joined
11:18 cbaatz joined
11:18 rockfordal joined
11:20 bvad joined
11:22 NikolajK joined
11:22 <dysfun> is there a less opaque Data.Dynamic (where I can see the type) or do i have to make my own with Typeable?
11:22 <ephemeral> what's the typical usecase for records vs defining the same without?
11:23 louispan joined
11:23 cfricke joined
11:24 <dysfun> wanting to access the fields by name
11:25 <ephemeral> yeah, but like, in the wild :P
11:26 <dysfun> the same answer?
11:26 <hexagoxel> wanting unpack/run for newtypes, i.e. the constructor's reverse.
11:26 jutaro joined
11:26 <cocreature> I would say almost all of my constructors with more than 1 field are records
11:27 <ongy> I'd say almost all with more than 2
11:27 bollu joined
11:28 bollu joined
11:28 <dysfun> remember that records don't force you to type the names, so they only really impose the generation of accessors on you
11:29 <MarcelineVQ> record update syntax is also useful in modifying arbitrary fields of some default value while keeping the rest the default: if defaultVal is some large record with many fields you can update just one with, defaultVal { someField = stuff }
11:30 <dysfun> i personally prefer lenses for that
11:30 <MarcelineVQ> you'll see this quite often in libraries as configurations
11:30 <dysfun> i saw a quite neat trick of using records to fake optional parameters
11:31 <hexagoxel> you don't need field names if you only ever "consume" the whole struct.
11:31 biglama joined
11:32 <hexagoxel> and perhaps when it is an information-hiding wrapper, where you internally always look on all fields anyways.
11:32 erikd joined
11:33 <hexagoxel> oh, and there is sum-types, too.. records are less common for those.
11:35 tlaxkit joined
11:36 ziyourenxiang joined
11:37 <ephemeral> valuable info
11:37 spatial joined
11:38 <spatial> I have a question about hmatrix
11:38 thc202 joined
11:38 zariuq joined
11:38 jutaro joined
11:40 eklavya joined
11:40 sampuka_ joined
11:40 <srhb> spatial: Ask and you may receive and answer.
11:40 <srhb> an*
11:40 ner0x652 joined
11:41 <spatial> How do I get the 'max' indexes of either all rows or all columns of a matrix ? Like np.argmax(axis-0) in Python's numpy
11:42 minn joined
11:42 bvad joined
11:42 <spatial> maxIndex :: Container c e => c e -> IndexOf c in https://hackage.haskell.org/package/hmatrix-0.17.0.1/docs/Numeric-LinearAlgebra-Data.html#g:14
11:42 ziocroc joined
11:43 <spatial> maxIndex $ mymatrix Should be something like this.
11:45 jutaro joined
11:47 bvad joined
11:47 wroathe joined
11:47 <ephemeral> hmm
11:48 <ephemeral> :t 1.5
11:48 <lambdabot> Fractional t => t
11:48 <ephemeral> :t 1/2
11:48 <lambdabot> Fractional a => a
11:48 Jesin joined
11:48 <ephemeral> what
11:48 <ephemeral> that's not what my ghci is saying
11:48 <ephemeral> oh nvm
11:48 <ephemeral> :t Just 1.5
11:48 <lambdabot> Fractional a => Maybe a
11:48 <ephemeral> :t Just 1/2
11:48 <lambdabot> (Num a, Fractional (Maybe a)) => Maybe a
11:48 <ephemeral> what's up with that?
11:48 <srhb> ephemeral: Precedence
11:48 <dibblego> Just (1/2)
11:49 <ephemeral> oh
11:49 <ephemeral> hah
11:49 <srhb> ephemeral: Function application binds tighter than operator application
11:49 <ephemeral> so, what exactly does (Just 5)/7 mean?
11:49 <ephemeral> if it means anything at all
11:49 <srhb> ephemeral: Just what the type said. :)
11:49 ystael joined
11:50 <srhb> ephemeral: Given a Fractional instance for (Maybe a) you get a Maybe a
11:50 <srhb> but there isn't such an instance usually.
11:50 <Gurkenglas> spatial, "map maxIndex . toRows" and "map maxIndex . toColumns".
11:50 cpennington joined
11:52 Jesin joined
11:53 buttbutt2r joined
11:53 <ephemeral> (f . g) x is equivalent to g (f x) right?
11:54 buttbutt2r left
11:54 <srhb> ephemeral: f (g x)
11:54 <ephemeral> hmm
11:54 buttbutt2r joined
11:55 <spatial> Gurgenglas : Thanks. m <- randn 4 2 map maxIndex . toRows $ m
11:55 dm3 joined
11:56 madsj joined
11:58 laplacian joined
11:59 zaphyr_ joined
12:00 beaky joined
12:00 danza joined
12:00 <Gurkenglas> Channel convention has it to write such like "do m <- randn 4 2; map maxIndex . toRows $ m". You can rewrite that code as "map maxIndex toRows <$> randn 4 2".
12:01 <Gurkenglas> oops, "map maxIndex . toRows <$> randn 4 2"
12:02 <spatial> Use the do notation. What is the second ?
12:02 <Gurkenglas> oops^2 "map maxIndex . toRows $ m" is not IO so you must have written that into ghci instead of a do block
12:02 sdothum joined
12:02 <spatial> That is right.
12:03 wroathe joined
12:03 noam joined
12:04 <Gurkenglas> so it would be "return . map maxIndex . toRows $ m" lol whatever. The second one uses (<$>), which is an alias ("synonym") for "fmap :: Functor f => (a -> b) -> f a -> f b" (IO is a Functor)
12:06 <spatial> maxindexes :: Matrix Double -> IO (Vector Int) maxindexes m = do let idxs = map maxIndex . toRows $ m in return $ fromList idxs
12:06 <spatial> I just have matrices and vectors now
12:06 <mpickering> If I have some monadic actions m (Maybe a) then I suppose I should use the MaybeT transformer to get "sequence" to do the right thing?
12:07 mbuf joined
12:08 <cocreature> mpickering: yep
12:08 <cocreature> mpickering: at least if MaybeT does the “right thing” for you :)
12:08 oisdk joined
12:08 niklasb joined
12:08 niklasb joined
12:08 <mpickering> Which is, if the first action evaluates to Just then don't evaluate any more of the actions
12:08 Aruro joined
12:09 <Gurkenglas> asum then, not sequence
12:09 meba joined
12:10 <Gurkenglas> :t runMaybeT . asum . fmap MaybeT
12:10 <lambdabot> (Functor t, Monad m, Foldable t) => t (m (Maybe a)) -> m (Maybe a)
12:11 JeanCarloMachado joined
12:11 <mpickering> ah right, I was using sequence because I had "fmap mconcat . sequence" which is not that I want
12:11 <mpickering> thanks
12:11 <mpickering> :t asum
12:11 <lambdabot> (Alternative f, Foldable t) => t (f a) -> f a
12:12 <Gurkenglas> :t (ala MaybeT . alaf Alt) foldMap -- if you dont like the Functor constraint
12:12 <lambdabot> (Monad n, Foldable t) => t (n (Maybe b)) -> n (Maybe b)
12:13 JeanCarloMachado joined
12:14 <Gurkenglas> spatial, "maxindexes = return . fromList . map maxIndex . toRows", and there's no need for maxindexes to return IO (Vector Int) instead of the Vector Int you get if you leave out the "return ."
12:15 biglambda joined
12:16 <Gurkenglas> spatial, does that even work? maxIndex returns an Int, and I don't see an Element instance for Int on https://hackage.haskell.org/package/hmatrix-0.17.0.1/docs/Numeric-LinearAlgebra.html#t:Element
12:16 JonReed joined
12:16 sproingie joined
12:16 sproingie joined
12:16 darlan joined
12:17 niklasb joined
12:17 soniku joined
12:18 homesitter joined
12:19 geekosaur joined
12:20 FreeBirdLjj joined
12:20 nuclx joined
12:21 psylentvoid joined
12:21 revtintin joined
12:24 mbuf joined
12:30 connrs joined
12:31 bvad joined
12:33 newhoggy joined
12:33 spatial joined
12:34 exferenceBot joined
12:35 Levex joined
12:35 wroathe joined
12:35 mbuf joined
12:35 <spatial> Gurkenglas: I multiple an IO Vector with another IO Vector using liftM2
12:35 <spatial> The second Vector is the indexes Vector of Ints
12:36 <spatial> So I decided to return IO.
12:37 yellowj joined
12:39 homesitter joined
12:41 binaryplease joined
12:42 gawen joined
12:46 HoierM joined
12:47 Levex joined
12:47 bjz joined
12:48 cpup joined
12:50 ystael joined
12:50 FreeBirdLjj joined
12:51 wroathe joined
12:52 umib0zu joined
12:55 Kreest__ joined
12:56 agjacome joined
12:57 crave joined
12:57 wildlander joined
12:59 zargoertzel joined
13:00 biglambda joined
13:05 jluttine joined
13:05 fizbin joined
13:05 blym_ joined
13:05 <mpickering> :t ala
13:05 <lambdabot> (Rewrapped t s, Rewrapped s t, Functor f) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s)
13:09 Yuras joined
13:09 pimpin8 joined
13:11 rcschm joined
13:11 NikolajK joined
13:11 Argue joined
13:12 ckubrak joined
13:13 vaibhavsagar joined
13:14 jship joined
13:16 NikolajK left
13:17 Denthir joined
13:19 sproingie joined
13:20 chendo_ joined
13:20 smillmorel joined
13:21 hoknamahn joined
13:21 osa1 joined
13:22 wroathe joined
13:22 mda1 joined
13:23 umib0zu joined
13:24 cpennington joined
13:25 dedicated joined
13:26 bvad joined
13:31 chlong joined
13:32 Shock_ joined
13:32 sproingie joined
13:33 Levex joined
13:37 meba joined
13:38 wroathe joined
13:39 <torstein> Is it possible to use a constructor from a GADT to define the type sig for another constructor in another GADT? This gives me kind errors: data Row (a :: MList CellType) where EmptyRow :: Row ('MCons 'None ('MCons 'None ('MCons 'None 'MNil))); data Game (a :: MList (MList CellType)) where EmptyGame :: Game ('MCons 'EmptyRow ('MCons 'EmptyRow ('MCons 'EmptyRow 'MNil)))
13:44 andersamer joined
13:45 andersamer left
13:46 Mon_Ouie joined
13:47 hrk joined
13:47 mheinzel joined
13:48 forgottenone joined
13:49 saep joined
13:51 ystael joined
13:52 biglambda joined
13:53 cpennington joined
13:54 uuplusu joined
13:54 harfangk joined
13:56 <geekosaur> torstein, no more than it is to use a constructor from one ADT in another ADT
13:56 <geekosaur> well, you can do so under the same circumstances
13:57 <geekosaur> (that is, type constructors yes, data constructors no)
13:57 <torstein> geekosaur I thought TypeInType allowed it
13:57 <geekosaur> TypeInType shouldn't affect *data* constructors?
13:58 <geekosaur> unless they are promoted
13:58 mda1 joined
13:58 <geekosaur> oh, I see, it is promoted
13:58 Rodya_ joined
13:58 <geekosaur> what ghc version? I think promotion isn't possible for some things currently
13:58 <geekosaur> or might require 8.2
13:59 <torstein> geekosaur, Yeah it's 8.0.2.
14:00 <torstein> So the only possible way is just to write out all the Empty cells explicitly
14:01 solution_ joined
14:01 <geekosaur> https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/glasgow_exts.html#overview which should be 8.0.1 (dunno why not 8.0.2) but I can't tell if this affects you
14:02 <geekosaur> also I was apparently thinking of the pre-TypeInType shortcoming
14:03 ckubrak joined
14:05 pisomojado joined
14:05 jbgi joined
14:05 DocWinter joined
14:06 Deide joined
14:09 blym_ joined
14:09 geekosaur joined
14:09 ericsagnes joined
14:12 hrk joined
14:13 fragamus joined
14:15 tomphp joined
14:17 alx741 joined
14:18 soniku joined
14:21 oisdk joined
14:22 ckubrak joined
14:25 takle joined
14:25 wroathe joined
14:27 mda1 joined
14:28 tromp joined
14:28 ninjazoete joined
14:30 connrs joined
14:31 buttbutter joined
14:32 buttbutt1r joined
14:33 Elish joined
14:34 nicknovi1 joined
14:36 Mon_Ouie joined
14:37 tapirus joined
14:37 xenog joined
14:39 Sose_ joined
14:39 connrs joined
14:39 barbos joined
14:40 seveg joined
14:41 laserpants joined
14:42 jmcarthur joined
14:42 featherlessbiped joined
14:43 takle joined
14:44 sgronblo joined
14:44 theelous3 joined
14:44 pie_ joined
14:45 <pie_> what does univalence as in "Homotopy Type Theory: univalent foundations of mathematics" mean?
14:45 sepp2k joined
14:45 kittyP joined
14:45 kritzcreek joined
14:45 plakband joined
14:46 abel-abel joined
14:47 <plakband> Is it possible to have a top level definition with an instance of NFData completely evaluated at compile time?
14:47 homesitter joined
14:49 cpup joined
14:49 nomicflux joined
14:49 barbos joined
14:50 HoierM joined
14:51 eacameron joined
14:52 ystael joined
14:54 xenog joined
14:54 romank joined
14:55 <laserpants> Is there a clever way to fold a Text value with a way to "exit early"?
14:57 _sras_ joined
14:57 takle joined
14:57 wroathe joined
14:58 romank joined
14:58 umib0zu joined
14:59 ner0x652 joined
15:02 soniku joined
15:02 unyu joined
15:03 <Gurkenglas> How do I enable type applications in lambdabot?
15:03 cpup joined
15:04 nrmh joined
15:04 beerdrop joined
15:06 takle joined
15:07 sheogorath joined
15:07 robotroll joined
15:07 crobbins joined
15:07 romank joined
15:08 <Gurkenglas> laserpants, foldlM with Either after lazily turning it into a String
15:08 SlowBait joined
15:09 <laserpants> Gurkenglas: ok, yes I realized that there is no point using Text when I traverse the whole thing anyway
15:09 <sheogorath> Can i get the compiler to complain at a constant that evaluates to a runtime error? Like 1/(5-5)
15:09 sleffy joined
15:10 <exio4> > 1/(5-5)
15:10 <lambdabot> Infinity
15:10 <exio4> sheogorath: that's not a runtime error? ;)
15:10 <geppettodivacin> laserpants: Alternatively, there's Text.foldr, which allows you to break out early through bouncy folds.
15:10 newhoggy joined
15:10 <laserpants> bouncy?
15:11 <geppettodivacin> I got the term from here: https://github.com/quchen/articles/blob/master/useful_techniques.md
15:11 mettekou joined
15:11 Itkovian joined
15:11 <Gurkenglas> Dangit, ninja'd. You can reimplement foldlM using Text.foldr and then you dont need to turn it into a string
15:11 <geppettodivacin> It's really just the idea that foldr gives control flow over to your function half the time, and so that function can determine whether to keep going.
15:11 <sheogorath> right, div 1 (5-5) then
15:11 Costar joined
15:12 <mettekou> Is there a library out there which can compute the difference between two values of the same algebraic data type and pretty print it, much like a diff tool for text files?
15:12 <nrmh> sheogorath, I've never tried it, but I believe Liquid Haskell lets you do this. Donno about an easier way.
15:14 <nrmh> sheogorath, is there a reason you're not, say, wrapping it in a Maybe?
15:14 <mettekou> Never mind, this will do: http://hackage.haskell.org/package/debug-diff.
15:14 Welkin joined
15:15 m1dnight_ joined
15:15 <sheogorath> Was looking to do fixed-point calculation where compiler can check overflow the bits. 5 bit thing * 5 bit thing is 10 bit thing, make sure it's less than 64 at compile time
15:15 <Welkin> What's the story with mac os sierra? does it still break haskell?
15:15 bjz_ joined
15:15 nomicflux joined
15:16 <Welkin> Or is it finally safe to upgrade?
15:16 rcat joined
15:17 <geekosaur> 8.0.2 should be fine
15:18 newhoggy joined
15:19 <nrmh> sheogorath, does the program receive any input that might affect what calculations it might do?
15:20 xcmw joined
15:20 codesoup joined
15:20 dm3 joined
15:21 <sheogorath> don't have a program, just theorising data type. but yeah, some things are constant and should be checked but others are runtime
15:22 <nrmh> GADTs and the like, could give you type level information on the bits of your numbers.
15:23 <sheogorath> yes, moving to type level is probably the way.
15:24 <nrmh> But what you want to do in the case of a calculation exceeding 64 bits will probably affect what you should do.
15:24 Itkovian_ joined
15:25 <sheogorath> compile error i suppose
15:25 krypton joined
15:25 pisomojado joined
15:25 <nrmh> Well, if your program takes user input, you can't compile error based on that input.
15:25 <sheogorath> the number of bits are compile time but their value is run time
15:26 oish joined
15:26 mekeor joined
15:26 yrid joined
15:27 <pie_> what does deep pattern matching mean_
15:27 <nrmh> I'm totally lost on what your goal is. What do you need to constrain the numbers to 64 bits for?
15:27 Rodya_ joined
15:28 Goplat joined
15:28 wroathe joined
15:29 <Welkin> not lazy pattern matching
15:30 <Welkin> https://wiki.haskell.org/Lazy_pattern_match
15:31 <sheogorath> fitting them in a register.
15:33 sproingie joined
15:33 sproingie joined
15:33 <nrmh> How are you encoding them as fixed point?
15:33 newhoggy joined
15:34 smillmorel joined
15:34 montik joined
15:35 <sheogorath> a runtime word x and two compile time integers p q such that our number a is equal to x*2^p and less than 2^q or something like that
15:35 <montik> hi! A general fp question: Is it possible to implement fold with map?
15:36 <Tuplanolla> No, montik.
15:36 <Welkin> map is a specialized version of a fold
15:36 barbos joined
15:36 <montik> all right, thanks
15:36 <Welkin> the rule of `map` is that it must not modify the structure of the data
15:37 <Welkin> it is only allowed to modify the content
15:37 <Welkin> a fold can do both
15:38 alunduil joined
15:39 <SlowBait> Is there a good for things other than lists?
15:39 <Welkin> ?
15:39 <SlowBait> Sorry
15:39 <Welkin> what do you mean?
15:39 <SlowBait> Fold
15:39 <SlowBait> A fold
15:39 ccomb joined
15:39 <Welkin> I don't follow what your question is
15:40 nh2 joined
15:40 <Tuplanolla> Is fold good for things other than lists? Yes.
15:40 <sheogorath> >:t foldr
15:41 <Welkin> you can fold over any data structure
15:41 <Welkin> as long as you define the implementation
15:41 <Tuplanolla> Is there a good thing for lists besides fold? Yes again.
15:41 <Welkin> folding over trees, graphs, sequences, arrays, maps, etc
15:41 Boomerang joined
15:42 <SlowBait> What would a fold for trees look like?
15:42 <Welkin> SlowBait: a tree traversal
15:43 <Welkin> whichever one you choose: in-order, pre-order, post-order, level-order
15:43 flatmap13 joined
15:44 <SlowBait> Got it
15:44 <c_wraith> the easiest is pre-order, of course. Because it always is. :)
15:44 wroathe joined
15:48 <nrmh> sheogorath, why do you need runtime fixed-points that fit in your register?
15:49 <SlowBait> Should it always be possible to implement id with a fold?
15:49 cpup joined
15:49 <c_wraith> Depends on the exact definition of fold you're using.
15:49 <c_wraith> A common definition is catamorphism, in which case it's always possible to implement id
15:50 <c_wraith> But there are other folds. Things like foldl aren't catamorphisms, or even close
15:50 <Welkin> if your fold and unfold form a catamorphism
15:50 <SlowBait> But it's not a requirement?
15:50 <c_wraith> depends on your definition of fold
15:51 <Welkin> I mean a hylomorphism
15:51 <Welkin> :P
15:51 <Welkin> to many morphisms
15:51 <c_wraith> that makes more sense.
15:51 <Welkin> too many*
15:51 darlan joined
15:51 <SlowBait> Heheheh
15:52 <SlowBait> Is there a list somewhere?
15:52 <Tuplanolla> Yes, but it's not a useful one, SlowBait.
15:52 <Welkin> https://en.wikipedia.org/wiki/Hylomorphism_(computer_science)
15:52 <c_wraith> SlowBait: I missed the beginning of what you're working on. In many cases, "the fold" for a data structure means the catamorphism, which is a mechanical translation to church-encoded form.
15:52 <Welkin> just look at "See Also" at the bottom
15:52 <MitchellSalad> SlowBait: what's a list? you mean a reified catamorphism?
15:52 cdg joined
15:53 ystael joined
15:53 <Tuplanolla> All you really need is cata, ana and hylo, SlowBait. Anything else is just looking for trouble.
15:53 <Tuplanolla> Whether you like trouble is another thing.
15:53 <c_wraith> things like histo can give you better efficiency
15:53 newhoggy joined
15:53 seveg joined
15:53 <c_wraith> For certain use cases.
15:54 <SlowBait> Tuplanolla thanks
15:54 <SlowBait> Histo?
15:54 <Welkin> just look them up on wikipedia
15:54 <Welkin> they should all be there
15:54 m1911 joined
15:55 <Welkin> lol
15:55 <Welkin> guess not for histomorphism
15:55 <c_wraith> http://www.cs.ox.ac.uk/people/nicolas.wu/publications/Histomorphisms.pdf
15:55 <nrmh> Wikipedia is the poorman's guide to category theory. ;)
15:55 <c_wraith> I don't recommend actually reading it. :)
15:55 nobodyzxc joined
15:55 <c_wraith> But if you care, the reference exists!
15:55 <Welkin> I found this too http://stackoverflow.com/questions/24884475/examples-of-histomorphisms-in-haskell
15:55 <c_wraith> that's where I got the link to the paper. :)
15:56 jsgrant joined
15:57 pisomojado joined
15:57 dm3 joined
15:57 bjz joined
15:58 MDA2 joined
15:58 urodna joined
15:59 nomicflux joined
16:00 m1911 joined
16:00 zeroed joined
16:00 flatmap13 joined
16:00 bennofs joined
16:00 okuu joined
16:00 wroathe joined
16:03 <sheogorath> nrmh: need? :) It's performance ofc. The operations like (.*.) :: P p q -> P u v -> P (p+q) (u+v) just need a single machine multiplication, which is cool.
16:03 pie_ joined
16:03 <Myrl-saki> @djinn [m a] -> m a
16:03 <lambdabot> Error: Undefined type []
16:04 <Welkin> :exref [m a] -> m a
16:04 kernelj_arch joined
16:04 <Welkin> :exfer [m a] -> m a
16:04 <geekosaur> it's :exf
16:04 <Welkin> :exf [m a] -> m a
16:04 <c_wraith> Welkin: you probably need to at least tell it m is a Monad
16:04 <Welkin> o.o
16:04 <Myrl-saki> Errr. Just ignore that.
16:04 <Welkin> :exf Monad m => [m a] -> m a
16:04 <Welkin> good idea
16:04 <Myrl-saki> Turns out that I need something better.
16:04 <c_wraith> :t sequence -- just in case
16:05 <lambdabot> (Monad m, Traversable t) => t (m a) -> m (t a)
16:05 <Myrl-saki> c_wraith: That's m [a] though.
16:05 <c_wraith> oh, I see.
16:05 <exferenceBot> replying took too much time (60sec), aborting.
16:05 <c_wraith> You need a fold of some sort at the same time
16:05 <SlowBait> So histo is like complete induction, while cata is more like basic induction?
16:05 <Myrl-saki> c_wraith: But yeah. It's my fault either way.
16:05 <exferenceBot> could not find expression
16:05 <c_wraith> SlowBait: yeah
16:05 <Myrl-saki> c_wraith: I'm looking at the docs of the library I'm using instaed.
16:06 <sheogorath> nrmh: I have an Integer version im trying out which is simpler, just the current exponent x*2^p and no upper bound. But that's not as fun :)
16:06 newhoggy joined
16:06 tomphp joined
16:07 <nrmh> sheogorath, why fixed-point numbers?
16:07 trism joined
16:08 JeanCarloMachado joined
16:08 <c_wraith> fixed-point is really good for any use case where you don't want increased density around 0
16:09 <c_wraith> Coordinate systems is one obvious example
16:10 peterbecich joined
16:10 <kernelj_arch> or when you want to process stuff fast because floating point is hella slow
16:10 JeanCarloMachado joined
16:11 <sheogorath> well current version basically floating point with explicit exponent so that constant optimisation gets to make it fixed
16:11 <c_wraith> There was that amusing case with Q3:A where they ran into the resolution limits for 32-bit floats in their larger maps. floats on ulp apart were the equivalent of a couple feet apart at the edges of some of the large maps.
16:11 <c_wraith> *one ulp
16:11 GeorgeEdward joined
16:12 homesitter joined
16:12 <sheogorath> if i could check overflow on the constant exponent and have a compile time error that would be cool
16:12 segmond left
16:12 <sheogorath> also doing it because bit twiddling is fun :)
16:13 meandi_2 joined
16:13 <nrmh> But how do you avoid runtime checking if you read numbers via IO?
16:14 <sheogorath> work on the maximum possible number basically. some 5 bit number times some 5 bit number is a 10 bit number
16:15 <kernelj_arch> unless by number you mean two's complement signed, in which case you get a 9 bit number
16:15 <Myrl-saki> c_wraith: Just decided to change it to `m [a]` because the docs to have nothing yet. :D
16:16 wroathe joined
16:16 <c_wraith> Myrl-saki: you can always throw some sort of fold into it afterwards. :)
16:17 <Myrl-saki> c_wraith: Yep. :P
16:17 godfrey joined
16:17 <Myrl-saki> Oh, turns out that `option` doesn't allow children.
16:17 <Myrl-saki> (Aside from text. This is HTML)
16:18 ChaiTRex joined
16:19 <godfrey> hi guys any good QuickCheck tutorial? no idea where to start
16:19 tomphp joined
16:20 pisomojado joined
16:21 mjora7 joined
16:21 newhoggy joined
16:22 <sheogorath> kernelj_arch: really? 2 bit mul only fits in 4 bit decimal(-2*-2=4) binary(10*10=0100)
16:25 Denthir joined
16:25 <kernelj_arch> that's a corner case that you would normally saturate on I guess
16:26 tomphp joined
16:27 newhoggy joined
16:27 oish joined
16:27 sellout- joined
16:27 <sheogorath> I prefer my answers correct though.
16:28 AndChat|144384 joined
16:28 fragamus joined
16:28 AndChat|144384 joined
16:29 <kernelj_arch> practically you wouldn't have -2 in a 2-bit fixed point because that isn't 1 sign bit & 1 value
16:29 roconnor joined
16:29 <kernelj_arch> you'd have a symmetrical range e.g. -32767..32767
16:29 <sheogorath> ? "two's complement signed"
16:30 <kernelj_arch> the only case where you need the extra bit is -32768 * -32768
16:31 SlowBait joined
16:32 <kernelj_arch> it's pretty much like doing -32768 * -1 in normal two's complement arithmetic, it's an overflow condition
16:32 tomphp joined
16:33 torgdor joined
16:33 SlowBait joined
16:33 isBEKaml joined
16:34 torgdor joined
16:34 SlowBait joined
16:36 AndChat|144384 joined
16:36 sproingie joined
16:36 AndChat|144384 joined
16:36 <kernelj_arch> I don't know whether to do Haskell or Java or C++ or something else... trying to prepare for job interviews
16:37 erikd joined
16:37 <Welkin> kernelj_arch: it depends on what kind of job you want to get
16:37 <Welkin> don't learn soething because you think it will be good for interviews
16:37 <Tuplanolla> Do you really need to prepare for interviews?
16:38 <Welkin> if there is no reason to learn C++ or java, then don't
16:38 <Welkin> the best language for interviews in my space is javascript
16:38 <kernelj_arch> I already know them -ish
16:38 <Welkin> because that is what I use
16:38 <Welkin> I used haskell in my interviews for positions where I use js and ruby though
16:38 <Welkin> and it worked out fine
16:38 <Welkin> no one there knew haskell, but they got the basic idea of what I was doing
16:38 <GeorgeEdward> imo it's better to learn algorithmic complexity and problem solving, doesn't matter too much about the language
16:38 <Tuplanolla> Your time is better spent reading about the company.
16:39 <Welkin> interviews are bullshit though
16:39 <kernelj_arch> I don't know which company is going to offer me an interview next
16:39 <Welkin> they vary widely from company to company
16:39 <GeorgeEdward> if you can whiteboard psuedocode a solution you'd be fine picking up [insert language]
16:39 cdg joined
16:40 <Welkin> kernelj_arch: I did the same thing when I got desperate while looking for work, and it ended up terribly when I tried to pick up all kinds of crap like java and c#, etc.
16:40 <Welkin> choose one thing and stick with it
16:40 <Welkin> for me that was javascript web apps and startups
16:40 <Welkin> it worked out much better once I chose something specific
16:40 <sheogorath> kernelj_arch: my point with growing the range is that there won't be overflow, but if we statically rule out the largest negative then i suppose that's fine, im not sure how that affects other operations though
16:41 oish joined
16:41 <kernelj_arch> well I've been trying to focus on C++ and I haven't been having much luck with it for some reason
16:42 venkat24 joined
16:42 <Welkin> C++ jobs don't seem all that common, and the people who use it are usually extremely experienced (it seems)
16:42 <Welkin> it all depends on what kind of job you want
16:42 <Welkin> not all programming is the same
16:42 <kernelj_arch> nearly all my actual experience is in C/C++
16:43 <Welkin> right, but you are a student?
16:43 <Welkin> then that doesn't mean much
16:43 <kernelj_arch> no 4 years commercial experience
16:43 <Welkin> oh?
16:43 <Welkin> doing what though?
16:43 <Welkin> or a better question is, what do you *want* to do?
16:43 <kernelj_arch> DSP and telecoms protocol stacks
16:44 <GeorgeEdward> tbh if you know anything outside of the java mindset the universities are pumping out you'll be alright
16:44 <kernelj_arch> is what I was doing, I want to do high frequency trading or sth
16:44 <Welkin> I see
16:44 <Welkin> from what I have seen, hft uses c++ (but also ocaml at Jane street, and haskell elsewhere)
16:45 <Tuplanolla> They also use Visual Basic 6.
16:45 <monochrom> With your background, you can do radio-frequency trading and disrupt the whole industry :)
16:45 <Welkin> I would never write c++, because I build web apps
16:45 <Tuplanolla> Questionable trading is not the only disgusting part in those jobs.
16:47 <kernelj_arch> I haven't tried applying to Jane Street yet
16:47 wroathe joined
16:47 <featherlessbiped> monochrom: that's just low frequency trading
16:48 <MarcelineVQ> :>
16:48 <monochrom> Oh oops hehe
16:48 <monochrom> High frequency is how many transactions per secound again?
16:49 <monochrom> Should I upgrade to microwave trading?
16:51 <featherlessbiped> sure i'll trade you my toaster for your microwave
16:51 <Welkin> gamma wave trading
16:51 <isBEKaml> monochrom: did you perhaps forget that microwave also falls under radio frequencies?
16:51 tomphp joined
16:51 <Welkin> or just use neutrinos
16:52 <Welkin> kernelj_arch: I'm curious why you want to do hft
16:52 <Welkin> it wouldn't be my cup of tea
16:52 <featherlessbiped> i've read that programmers are in financial industry are treated as second class to traders
16:52 <Welkin> I mostly build user interfaces
16:52 <kernelj_arch> it pays a lot because it's in finance and it means I get to do performance optimizations
16:52 <Welkin> and apis
16:53 <Welkin> lol
16:53 <Welkin> I somehow knew that your answer would be "it pays a lot"
16:53 <Welkin> that is the worst reason, but go ahead and you'll find out yourself
16:53 <mniip> wouldn't you be interested in better heuristics rather than performance
16:53 ystael joined
16:53 halogenandtoast joined
16:54 <Welkin> there is a *reason* it pays a lot :P
16:54 JuanMiguel joined
16:54 <Welkin> and it's not because they are generous
16:54 conal joined
16:55 <mniip> wow
16:56 <mniip> my partially applied type families proposal
16:56 <pie_> monochrom, radio freq trading...lol :P
16:56 <mniip> has made it into rust o-O
16:56 <isBEKaml> mniip: you didn't make a proposal for rust too, right?
16:56 <Tuplanolla> Wow considering you submitted it for GHC or what, mniip?
16:56 <mniip> no
16:56 <mniip> yes
16:56 <sheogorath> boolean blindness
16:56 Rodya_ joined
16:57 <mniip> well, it has made it into rust proposals somehow
16:57 shivansh joined
16:57 shivansh left
16:57 <Welkin> mniip: it was the russian government
16:58 newhoggy joined
16:58 <pie_> wait, so he submitted it to haskell but it got into rust is that how im supposed to read this?
16:58 <mniip> https://github.com/ghc-proposals/ghc-proposals/pull/52
16:58 <pie_> in soviet internet, rust haskell you
16:58 darjeeling_ joined
16:59 ephemeral joined
16:59 <dmj`> his haskell is rusty
17:00 <isBEKaml> Well, somebody definitely wanted their rustiness haskellified
17:01 <isBEKaml> "Your Rustiness, would you like some Haskell in your tea?"
17:02 <pie_> I love the smell of burnt Curry in the morning.
17:02 smillmorel joined
17:03 mohsen_ joined
17:03 wroathe joined
17:05 <Eduard_Munteanu> I would like a hask of your finest wine.
17:06 <mohsen_> Hi. What book do you suggest to learn Haskell>
17:06 Boomerang joined
17:06 <mohsen_> ?
17:06 <isBEKaml> !lyah
17:06 <Eduard_Munteanu> @where lyah
17:06 <lambdabot> http://www.learnyouahaskell.com/
17:06 <mniip> pie_, curry the mathematician?
17:06 <isBEKaml> uhh.. what happened to our resident bookeeper?
17:06 <isBEKaml> mniip: Well, Haskell "Burnt" Curry
17:07 <mniip> `Burnt`
17:07 <Eduard_Munteanu> Mr. Burns.
17:07 <monochrom> Haha mniip that's surreal.
17:08 <mohsen_> isBEKaml: I actually asked this question months ago, but I forgot the name of the book guys here suggested, but I guess they were suggesting it over lyah, I've read half of the chapters of lyah, but now my friend wants to learn Haskell, so I thought maybe its better to recommend him the book you guys suggest.
17:08 <monochrom> I wonder if PHP is the next :)
17:08 FreeBirdLjj joined
17:08 <mniip> hahaha
17:08 <isBEKaml> mohsen_: LYAH is good for starters. Although people here recommend haskellbook as well, if you don't mind the price
17:09 <hpc> lyah's main weakness is a lack of exercises
17:09 <hpc> which may or may not end up affecting you
17:09 <isBEKaml> mohsen_: http://haskellbook.com/
17:09 systemfault joined
17:09 <hpc> @where learnhaskell
17:09 <lambdabot> https://github.com/bitemyapp/learnhaskell
17:09 <hpc> ^ a decent meta-resource
17:09 <mohsen_> isBEKaml: Is it okay a newbie start with it? I mean haskellbook
17:09 <isBEKaml> mohsen_: haskellbook is bitemyapp's book with one other author
17:09 <nrmh> mohsen_, absolutely.
17:09 <Eduard_Munteanu> Pay a Haskell Programmer?
17:09 <monochrom> Yes haskellbook is from the ground up.
17:10 <isBEKaml> mohsen_: It's specifically targeted for building haskell concepts from the ground up (I mean, from first principles)
17:11 <mohsen_> Hmmm
17:11 <fragamus> is there a more idiomatic way of saying ((flip runStateT)0)
17:11 <monochrom> To the point that Chapter 1 has you practice substitution.
17:12 <monochrom> fragamus: I think that's pretty idiomatic already. But don't forget the 3rd option: infix.
17:13 <fragamus> oh yeah
17:13 <lyxia> you don't need the parentheses around flip runStateT
17:13 <glguy> I've been recommending Hutton's "Programming in Haskell" as a starting point
17:13 mbuf joined
17:13 <fragamus> I think im going to go with ((flip runStateT)0)
17:13 <fragamus> Hutton book is awesome
17:14 newhoggy joined
17:14 <glguy> Make sure you work through the "Calculating Compilers" section toward the end, it's pretty slick
17:14 <mohsen_> glguy: Is the way it descibes concepts easily understandable?
17:14 aaronmcadam joined
17:14 <glguy> mohsen_: Yeah, it covers the language well and gets you there in under 300 pages
17:15 osa1 joined
17:15 eklavya joined
17:15 <mohsen_> glguy: Is it paid? Where can I find it?
17:16 ByronJohnson joined
17:16 <glguy> For example: https://www.amazon.com/Programming-Haskell-Graham-Hutton/dp/1316626229/ref=dp_ob_title_bk
17:16 <glguy> Wherever you get a copy, make sure you get the second edition
17:16 <isBEKaml> mohsen_: IIRC, the latest edition is paid. Earlier editions are freely available on Hutton's site
17:16 <glguy> it was updated recently
17:17 <isBEKaml> Or was that Simon Thompson? I forget
17:18 ACW joined
17:19 wroathe joined
17:20 subtlebot joined
17:21 JeanCarloMachado joined
17:22 dan_f joined
17:22 <monochrom> @quote monochrom book
17:22 <lambdabot> monochrom says: rumour: SPJ will write a thick book "A New Science of Kind"
17:23 <isBEKaml> Sorry, I got it wrong - I somehow had it in my mind that Haskell Craft's 1st edition was freely available online from his site (Simon Thompson, not Hutton)
17:23 <monochrom> Actually I meant:
17:23 pylbrecht joined
17:23 <monochrom> @quote monochrom curriculum
17:23 <lambdabot> monochrom says: In an imperative curriculum you're like chapter 2 for-loops and chapter 10 binary search trees. In a functional curriculum you're like chapter 2 binary search trees and chapter 10
17:23 <lambdabot> XML processing using arrows. The difference in productivity is incredible
17:23 meba joined
17:24 <monochrom> Now I guess I have to update it to "chapter 10 writing your own compiler"
17:24 <Welkin> chapter 11: create a new universe
17:24 <isBEKaml> monochrom: heh, extremely functional productivity!
17:24 <Welkin> but we all know that god hacked the world together in perl
17:24 mithrandeer joined
17:25 <isBEKaml> Welkin: I thought it was Lisp - the world is still round, not in odd shapes. Surely?
17:25 <Welkin> isBEKaml: https://www.xkcd.com/224/
17:25 <isBEKaml> I know the reference - I was playing on nail clippings
17:26 Levex joined
17:26 acidjnk joined
17:27 <monochrom> Actually I guess Richard Eisenberg wrote A New Science of Kind as his PhD thesis.
17:27 insitu joined
17:28 oisdk joined
17:28 barbos joined
17:29 yellowj joined
17:30 newhoggy joined
17:30 darjeeling_ joined
17:34 romank joined
17:35 wroathe joined
17:35 roconnor joined
17:35 petercommand joined
17:36 pungi-man joined
17:37 takuan joined
17:37 <Welkin> it's 1337 o'clock
17:37 <Welkin> :D
17:37 Guest78102 left
17:37 <monochrom> heh
17:38 fragamus joined
17:38 <monochrom> Did you know: 31337 is a prime number.
17:39 <monochrom> I use it for my RSA encryption all the time. (Just kidding!)
17:39 FreeBird_ joined
17:40 Aruro joined
17:41 ubsan_ joined
17:41 mithrandeer joined
17:42 <jmcarthur> 1000000000000066600000000000001 is the largest prime number I have memorized and is therefore used for all my keys
17:43 buttbutt1r joined
17:43 buttbutter joined
17:43 satojk joined
17:43 gienah joined
17:44 <Tuplanolla> My favorite prime is 27.
17:45 Guest5629 joined
17:45 <Tuplanolla> The best part is that most people agree it's very nice.
17:45 <MarcelineVQ> hey if it ends in 7 it's close enough
17:45 <kernelj_arch> is that in octal or something?
17:45 oisdk joined
17:46 ryxai joined
17:47 <lyxia> who jokes in octal
17:47 ryxai joined
17:48 ChaiTRex joined
17:48 ryxai joined
17:49 mithrandeer joined
17:49 gugah joined
17:50 ryxai joined
17:50 <kernelj_arch> isn't -1 a prime number?
17:50 <iqubic> Why do programers confuse Chrismas and Halloween?
17:51 <iqubic> Because OCT 31 = DEC 25
17:51 newhoggy joined
17:51 plot joined
17:51 ryxai joined
17:52 JimmyJon joined
17:53 ryxai joined
17:54 ystael joined
17:54 biglambda joined
17:56 mithrandeer joined
17:56 ccomb joined
17:56 <glguy> kernelj_arch: It's not
17:57 Rodya_ joined
17:58 ACW left
18:00 epsilonhalbe joined
18:00 <iqubic> Are there any negative primes?
18:00 <ertes> 65537 is a prime number, too, and i do actually use it in my RSA keys all the time
18:01 ichor joined
18:01 <ertes> iqubic: if you generalise the notion, you could think of -1 as a prime
18:01 <Tuplanolla> In some contexts it's useful to think of 1 as prime, but I've never seen anyone extend it to negative numbers.
18:01 <glguy> But under the standard definition, prime numbers are natural numbers greater than 1 that have only themselves and 1 as divisors
18:02 <iqubic> I see.
18:02 <iqubic> How hard is it to use Haskell to calculate a prime number?
18:02 <ertes> iqubic: as in find prime numbers?
18:03 <kernelj_arch> > 1+1
18:03 sleffy joined
18:03 <lambdabot> 2
18:03 <kernelj_arch> prime number, calculated
18:03 <iqubic> isPrime :: Int -> Bool
18:03 <ertes> iqubic: just use a library like arithmoi
18:03 <iqubic> That's the function I want.
18:03 <iqubic> ertes, those exist?
18:04 <ertes> iqubic: https://hackage.haskell.org/package/arithmoi-0.5.0.0/docs/Math-NumberTheory-Primes-Testing.html
18:04 iomonad joined
18:04 <Tuplanolla> The answer is "pretty easy" since that's merely `Int`, iqubic.
18:04 <ertes> iqubic: although it doesn't *quite* have the type signature you want to, but you can apply (. toInteger)
18:04 Coldblackice joined
18:05 <iqubic> Yeah, Integer is what I want.
18:05 <iqubic> Isn't it the same type?
18:05 grayjoc joined
18:05 <ertes> no
18:05 <ertes> > maxBound :: Int
18:05 <lambdabot> 9223372036854775807
18:05 <ertes> > maxBound + 1 :: Int
18:05 <lambdabot> -9223372036854775808
18:06 wroathe joined
18:07 <ertes> Integer is the type of integers, Int is a type of small, usually machine-sized integers
18:07 solarus joined
18:07 simukis joined
18:07 <ertes> Int is most likely isomorphic to Int32 or Int64 for you, depending on your architecture
18:09 xenog joined
18:10 gehmehgeh joined
18:10 takle joined
18:11 ertes joined
18:12 newhoggy joined
18:12 <iqubic> ertes, I see.
18:12 <iqubic> Now, whats a Word?
18:13 montik joined
18:13 <kernelj_arch> machine sized integer but unsigned
18:13 <pikajude> A Word is an unsigned integral type, with the same size as Int.
18:13 <tfc[m]> hey if i have a type "data Foo = Foo | Bar | Baz deriving (Read)", and do read "Bar" :: Foo, it works. But if i do read "bar" :: Foo (lower case), it doesn't. Is there a way for read to be case insentitive?
18:13 <pikajude> just like in #haskell, where negative words are discouraged, negative Words are impossible.
18:14 <kernelj_arch> tfc[m]: implement Read yourself?
18:14 <ertes> tfc[m]: not with the parsers that Read deriving generates
18:14 <benzrf> tfc[m]: you're not supposed to use Read for serious programs anyway, realyl
18:14 <tfc[m]> kernelj_arch: yes that would be the next step, although i hoped to be able to use read
18:14 <benzrf> i think it's supposed to be mainly a debugging thing
18:14 <ertes> tfc[m]: but your question suggests that Read is not what you need… use a real parser library like megaparsec
18:14 <pikajude> or parsec
18:14 <pikajude> or attoparsec
18:14 <tfc[m]> ok, that's what i planned in case there is no automatic method for that
18:14 <tfc[m]> thanks
18:15 robkennedy joined
18:19 nicknovi1 joined
18:20 kazagistar joined
18:24 oleksiyp joined
18:25 epsilonhalbe left
18:25 akr[m] left
18:25 mjora7 joined
18:26 epsilonhalbe joined
18:26 chaosmasttter joined
18:28 newhoggy joined
18:28 <iqubic> Are there any parser guides I can look at?
18:29 <sm> iqubic: megaparsec has good tutorials
18:30 modal joined
18:30 Uakh joined
18:30 zargoertzel joined
18:32 zariuq joined
18:33 conal joined
18:34 epsilonhalbe left
18:34 ckubrak joined
18:37 pie_ joined
18:37 newhoggy joined
18:37 leat joined
18:37 sproingie joined
18:37 sproingie joined
18:38 nicknovi1 joined
18:38 wroathe joined
18:41 erikd joined
18:41 m00n joined
18:41 Xanather joined
18:41 haskgur joined
18:41 <haskgur> hi can someone please explain myMap f = foldr ((:).f) []
18:41 cdg joined
18:41 <haskgur> i don't understand the second argument to foldr
18:42 <haskgur> myMap f = foldr ((:).f) []
18:42 mjora7 joined
18:42 peterbecich joined
18:42 <haskgur> hi can someone please explain myMap f = foldr ((:).f) []
18:44 <DoubleDonkey> Just so it's clear myMap f = foldr ((:).f) [] is also myMap f xs = foldr ((:).f) [] xs
18:44 <cocreature> haskgur: do you understand foldr in general?
18:44 <Tuplanolla> You might want to start with `myId = foldr (:) []`, haskgur.
18:45 mda1 joined
18:45 soniku joined
18:45 augur joined
18:46 <cocreature> inlining the definition of (.) might help if you are confused how operates on (:)
18:47 <Gurkenglas> inlining the definition of foldr might help
18:47 FreeBirdLjj joined
18:48 <pimpin8> whats this chan about
18:48 <cocreature> pimpin8: it’s about the haskell programming language
18:48 <pimpin8> whtas that
18:48 <cocreature> https://www.haskell.org/
18:49 newhoggy joined
18:49 <pimpin8> thanks mate
18:49 pimpin8 left
18:50 <torstein> How come that doing :t shows the type for some data types and the type constructors for others? E.g. data CellType = X | O; data State = Empty | InPlay; :t move EmptyBoard (Cell X MZ MZ) :: Board ('MCons (Cell CellType Nat Nat) 'MNil) 'InPlay
18:50 <Gurkenglas> Weird, why does this replace f with (:) on step 3 -> 4?
18:50 <Gurkenglas> http://bm380.user.srcf.net/cgi-bin/stepeval.cgi?expr=foldr+%28%28%3A%29.f%29+%5B%5D+%5Ba%2Cb%2Cc%5D
18:51 <cocreature> Gurkenglas: huh? what’s step 3 supposed to be? and what does replacing (:) mean?
18:52 ixxie joined
18:52 <Gurkenglas> That link shows me https://gyazo.com/cbd094ba61cdb2626618961b048032c5 , do you see something else?
18:52 <kernelj_arch> your link shows a blank page for me
18:53 <fragamus> i have this pwd >>= ls >>= testdir and I want to modify it to return m (a,b) where a is a FilePath and b is the Bool result of testDir
18:53 <cocreature> oh sry, one of my filters seems to be broken and hid your message
18:53 jimmyrcom joined
18:53 <fragamus> trying to make a one-liner here
18:53 <simony> hm, anyone used both trifecta and megaparsec and have opinions/thoughts on picking between the two?
18:54 wroathe joined
18:54 newhoggy joined
18:55 <cocreature> simony: megaparsec is significantly easier to pick up because the docs are better. trifecta has better error messages but it’s harder to figure out how to use it (not because it’s difficult but because it’s undocumented)
18:55 ystael joined
18:55 <cocreature> I haven’t compared them when it comes to performance
18:55 <simony> I'd guess if one is considering either one, performance may not be the main concern
18:55 xcmw joined
18:55 dysfun joined
18:55 <Gurkenglas> fragamus, will ls accept "." for the local path? Then you could do '(,) <$> pwd <*> ls "." >>= testdir'
18:56 barbos joined
18:56 <cocreature> simony: well if you need somewhat readable error messages, attoparsec is simply not an option ime
18:56 <cocreature> but you might still be parsing relatively large human input so performance can become a problem
18:56 bennofs joined
18:56 <fragamus> Gurkenglas: wild
18:56 <cocreature> human generated meaning that error messages matter
18:57 <Gurkenglas> fragamus, oops need to bracket the (ls "." >>= testdir)
18:57 <simony> I did get trifecta working for a little toy project (small inputs in a chat bot), but just found megaparsec and wondering if it's worth exploring
18:57 <cocreature> I tend to use megaparsec for most projects these days
18:57 mmachenry joined
18:58 takle joined
18:58 Wuzzy joined
18:58 <Gurkenglas> I wonder whether there's some DSL that can be compiled to either of the parser packages, one for error messages and the other for performance
18:58 <cocreature> Gurkenglas: that’s the parsers package :)
18:59 <Gurkenglas> Parser combinator library combinators! Brilliant!
18:59 hust921 joined
18:59 Rodya_ joined
19:00 <simony> IIRC it's pretty easy to swap in attoparsec for the parser I wrote for trifecta
19:00 nrmh left
19:00 mithrandeer joined
19:00 <cocreature> yeah, the parsers package is basically the only way to use trifecta so it’s easy to switch
19:03 kamyar joined
19:03 <kamyar> Hello all!
19:03 <kamyar> Anyone can help me about Arrows?
19:03 <cocreature> kamyar: if you ask a question, me might :)
19:04 <kamyar> cocreature: I have got intuition about Monads, Monad Transformers, ....
19:04 <kamyar> cocreature: But I cant understand Arrows by now
19:05 <Gurkenglas> (Of course it's written by ekmett. Who else?)
19:05 tromp joined
19:06 okuu joined
19:06 ryxai_ joined
19:06 fragamus joined
19:07 <kamyar> cocreature: Can u help me understand and digest Arrow concept?
19:08 erikd joined
19:09 wroathe joined
19:11 srbaker joined
19:11 newhoggy joined
19:12 <cocreature> kamyar: https://cdsmith.wordpress.com/2011/07/30/arrow-category-applicative-part-i/ might be helpful. but tbh I never use Arrow because I never find myself in situations where it seems like the right abstraction, so I’m probably the wrong person to ask here
19:12 smillmorel joined
19:13 moth joined
19:13 <kamyar> cocreature: I wanna use HXT which is the best xml parser in haskell world. It uses Arrows
19:13 chaosmasttter joined
19:14 smillmorel left
19:17 takle joined
19:17 oish joined
19:17 srbaker joined
19:18 lyxia joined
19:18 JeanCarloMachado joined
19:18 pwnz0r joined
19:19 srbaker_ joined
19:19 newhoggy joined
19:20 <cocreature> kamyar: whether hxt is the best xml parser is at least debatable but fair enough :) although iirc hxt is one of those libraries that doesn’t really have any good reason for using Arrow and could just be using Monad, e.g, https://github.com/UweSchmidt/hxt/tree/master/hxt-monad
19:21 Aruro joined
19:21 mada joined
19:22 Moto-chan joined
19:23 mithrandeer joined
19:23 jship joined
19:24 JoshS joined
19:25 <Myrl-saki> Should I use LiquidHaskell for an API?
19:26 blender joined
19:27 geekosaur joined
19:27 <kamyar> cocreature: Thanks anyway!
19:28 newhoggy joined
19:28 carlomagno joined
19:30 kamyar joined
19:30 augur joined
19:32 <kamyar> Sorry fellows! I have another question: please see my code snippet and the error: http://lpaste.net/355068
19:34 <kamyar> I cant guess what is the problem: MapM gets a function getting a type and returning monad (like redis.get) and a list (like lifted redis.keys output)
19:35 <cocreature> the type of `keys` is `keys :: (RedisCtx m f) => ByteString -> m (f [ByteString])`. so location_list is of type `f [ByteString]`. in most case f will be "Either Reply" so you’ll have to pattern match and check for the error
19:35 <geekosaur> but it wants a list (actually a Traversable, thus the t0) of ByteString and got a list of list of ByteString
19:35 <geekosaur> oh, hm, maybe
19:35 newhoggy joined
19:36 <kamyar> cocreature: I just wanted to omit pattern match boilerpalte using lift
19:36 <cocreature> kamyar: I don’t see how lift helps avoids checking for an error
19:37 <kamyar> cocreature: But the error text is saying sth else!
19:38 <cocreature> kamyar: which error text?
19:38 <kamyar> cocreature: At the end of my lpatse
19:38 <geekosaur> well, it;s saying it got some Traversable of list of ByteString
19:38 <cocreature> kamyar: that’s exactly what I said. mapM expects a "t ByteString" in your case where t is Traversable. but you are passing f [ByteString] so GHC sets t = f and complains that ByteString and [ByteString] are not the same
19:39 <kamyar> cocreature: Thanks! Got the key!
19:39 <kamyar> geekosaur: Thanks!
19:39 <geekosaur> this is one of the downsides of Traversable, so many things are Traversable that it's hard to decipher this kind of error :/
19:39 <monochrom> Oh w00t, hxt-monad, ertes will be happier :)
19:40 <cocreature> monochrom: it sadly looks like it’s sort of dead
19:40 <cocreature> never made it to hackage and the last signficant commit was in 2015
19:40 <geekosaur> (Foldable's even worse in that regard. sometimes I can see why H'98 specialized it all to lists)
19:40 takle joined
19:41 wroathe joined
19:41 <kamyar> Hey fellows! I am a Haskell programmer from Iran! In case it concerns to u! We are making Haskell community bigger here!
19:42 ninjazoete joined
19:42 <torstein> I'm having some trouble writing a Show instance for a GADT: data Board l (s :: State) where DoMove :: Board l s -> Cell t x y -> Board l s ;; Getting kind errors when trying: instance Show l => Show (Board l State where ;; State already derives Show
19:42 tristanp joined
19:42 <benzrf> kamyar: cool :)
19:43 <geekosaur> that said, a type annotation in the right place would let it know you were expecting the Traversable to be a list, and then it can tell you something more sensible
19:43 <cocreature> torstein: please make an lpaste with your code and the error message
19:43 <monochrom> "s :: State" probably does not mean what you think.
19:43 <cocreature> geekosaur: heh, I’ve just been wondering if I should propose adding TypeApplications to Haskell2020 for that exact reason :)
19:44 <torstein> monochrom, what does it mean?
19:44 Yuras joined
19:44 <geekosaur> s is a type whose kind is State
19:45 <cocreature> that’s to that uncommon for GADTs
19:45 <geekosaur> if you wanted the type s to always be State then just don't use a type variable for it
19:45 <ertes> hehe
19:45 atec joined
19:46 anon109 joined
19:46 <torstein> geekosaur, I need it to be a variable in order to use for inference in a type family
19:46 <monochrom> cocreature: I got my suspicion from "Show (Board l State)" and "State derives Show". In these two phrases clearly so-called "State" is a non-kind.
19:46 newhoggy joined
19:46 anon109 left
19:46 <cocreature> monochrom: good point :)
19:46 soniku joined
19:47 Big_G joined
19:47 <torstein> monochrom: i have: data State = Empty | InPlay width DataKind
19:47 <torstein> with*
19:48 <monochrom> That doesn't change my assessment.
19:49 augur joined
19:50 Denthir joined
19:51 <cocreature> torstein: I really think it would help if you could paste the code or at least the relevant parts of it and the error message somewhere
19:53 Kuros` joined
19:53 <torstein> cocreature, monochrom: Take a look: https://pastebin.com/8RwjdXGW
19:53 <torstein> ignore line 21-23
19:54 <monochrom> You are still not distinguishing the State type and the 'State kind.
19:55 <monochrom> "Board l State" does not exist, period. There are only "Board l Empty", "Board l Inplay", and "Board l Finished".
19:55 newhoggy joined
19:56 ystael joined
19:56 <monochrom> This is why encoding dependent types by Haskell DataKind is morally wrong.
19:56 bollu joined
19:56 <monochrom> You encourage people to think more muddily, not more clearly.
19:56 <lpaste> glguy pasted “for torstein , typechecks now” at http://lpaste.net/355070
19:57 wroathe joined
19:58 srbaker__ joined
19:58 <torstein> monochrom, I don't know what else approach to take; functions that operate on Boards are supposed to give a compile error if the board is invalid, i.e. calling 'move' on a Finished board, calling 'whoWon' on a non-finished board etc ..
19:58 takle joined
20:00 mjora7 joined
20:00 Rodya_ joined
20:00 umib0zu joined
20:01 rkazak joined
20:02 <monochrom> I haven't studied this particular game, but my understanding of most games is that game board status is patently a run-time-only thing.
20:04 <glguy> The specification for the problem is https://github.com/data61/fp-course/blob/master/projects/TicTacToe/TicTacToe.markdown
20:04 <glguy> (I'm assuming)
20:04 tromp joined
20:04 <torstein> Yeah that's right it's an exercise for the NICTA haskell course
20:05 inkbottle joined
20:05 <glguy> Whether or not it's a good idea to embed so much in the types of the game representation, that's the exercise
20:05 <monochrom> Oh, I guess Tic Tac Toe is one of those that have statically known end-status. (Generally any game with a pre-announced fixed length.)
20:05 barbos joined
20:06 <torstein> Yeah, but the state cannot be induced by the number of moves alone, hence it's necessary to encode the whole board in the types, at least as far as I can make out
20:06 <monochrom> At this rate, screw end-status. Put the whole board in types. There are only 19683 of them.
20:06 <iqubic> So is TicTacToe hard to make in Haskell?
20:07 <glguy> iqubic: Nope
20:07 <iqubic> Why not just use a 2-d List of chars?
20:07 <glguy> that'd work just fine
20:08 <cocreature> you probably want at least a separate type that only allows for three field states instead of using Char
20:08 <iqubic> Sure. That'd workd
20:08 danvet joined
20:09 <iqubic> Why are we talking about TicTacToe in Haskell?
20:09 <geekosaur> [29 20:04:55] <torstein> Yeah that's right it's an exercise for the NICTA haskell course
20:10 fragamus joined
20:10 <iqubic> Ah.
20:10 krypton joined
20:10 Itkovian joined
20:10 soniku joined
20:11 <torstein> iqubic, the exercise specified that calling a function on a unsuitable board should result in a compile time error (as opposed to a runtime error or returning a Maybe)
20:12 takle joined
20:12 earldouglas joined
20:13 wroathe joined
20:13 Levex joined
20:13 vikaton joined
20:13 <monochrom> Next April 1st, Eisenberg's postdoc paper: Dependent Haskell Chess :)
20:15 <Rembane> :D
20:15 <MarcelineVQ> monochrom: well you know, once pi types are in..
20:15 dfeuer joined
20:16 newhoggy joined
20:17 cschneid_ joined
20:17 cloudhead joined
20:17 <MarcelineVQ> I wonder what the intended compile-time solution for the tic-tac-toe game is
20:18 <MarcelineVQ> what level of enforcement I mean
20:20 <torstein> The solution is here: https://github.com/tonymorris/fp-course/tree/master/projects/TicTacToe/haskell/src/TicTacToe
20:20 <torstein> Though I don't understand any of it
20:21 <MarcelineVQ> phew, that's a lot of kitchen sinks
20:21 zargoertzel joined
20:21 <torstein> yeah.. Surely my attempt at a solution is better, though I'm not sure it's possible to follow through
20:22 takle joined
20:22 <MarcelineVQ> dibblego: this feels like the kind of answer you make available to goof people that just look for the answers :>
20:23 arpl joined
20:23 ryxai joined
20:23 dm3 joined
20:23 carlomagno1 joined
20:24 jao joined
20:24 newhoggy joined
20:29 wroathe joined
20:29 ninjazoete joined
20:29 cschneid_ joined
20:29 ziocroc joined
20:30 <kamyar> Sorry!
20:30 <kamyar> I have another question!
20:30 <kamyar> I want to pattern match items of a list/traversable
20:31 mithrandeer joined
20:32 <kamyar> for example: P1 x = y
20:32 <kamyar> then get x
20:32 <kamyar> now suppose I have a list of y's
20:32 <kamyar> and wanna get a list of x's
20:33 <monochrom> Haha MarcelineVQ
20:33 <geekosaur> Traversable'll only work with OverloadedLists extension, I think. Lists are matchable with (:) or, for fixed sizes, the [x] syntax. remember that pattern matching is on structure though, not value
20:33 <geekosaur> (although Num is special cased, ick)
20:34 newhoggy joined
20:36 <cocreature> kamyar: write a function "extract (P1 x) = x" and then map that over the list
20:36 <kamyar> cocreature: I just got it and I am doing! Thnx
20:37 whiteline_ joined
20:37 Big_G joined
20:38 sproingie joined
20:38 sproingie joined
20:38 newhoggy_ joined
20:41 ailio joined
20:41 seveg joined
20:42 takle joined
20:42 eschnett joined
20:43 <revtintin> \q
20:44 <ailio> hey guys, having something similar like this termbin.com/q65m can I achieve something similar like `g` of `f` or not?
20:44 <ailio> `g` fails but would be much nicer to write :(
20:44 kazagistar joined
20:44 wroathe joined
20:44 blender joined
20:45 erikd joined
20:46 <glguy> ailio: sum . map val
20:47 <ailio> yeah, this is a stupid example.. I just stripped it down to the essentials
20:47 newhoggy joined
20:49 <ailio> but I mean like can I transform a function `f (SomeData x)` to one that doesn't contain the constructor in the signature
20:49 mkoenig joined
20:49 m00n joined
20:50 <kernelj_arch> :t foldr
20:50 <lambdabot> Foldable t => (a -> b -> b) -> b -> t a -> b
20:51 <kernelj_arch> :info Foldable
20:53 <kernelj_arch> ailio: you could make SomeData a Foldable and write your own foldr for it, then it will work
20:54 robertkennedy joined
20:54 Elhamer joined
20:54 <kernelj_arch> no wait that won't work
20:54 gehmehgeh joined
20:54 <monochrom> I am not sure what you mean, ailio. For example, in your paste, which one is the ideal you desire, "g :: SomeData -> Int" or "g = foldr ((+).val) 0"? (You can only choose one.)
20:55 mjora7 joined
20:56 <kernelj_arch> monochrom: he wants something equivalent to f
20:56 ystael joined
20:56 newhoggy joined
20:57 blender joined
20:57 <monochrom> That cannot be the complete truth. Suppose you want something equivalent to 1 bitcoin. And I give you 1 bitcoin exactly.
20:57 <kernelj_arch> he wants something that looks like g but works like f, I'm not sure what is hard to grasp about this
20:57 <ailio> kernelj_arch: thx, I think that would be handy anyway later
20:58 <monochrom> OK, then teach me what he means.
20:58 <ailio> kernelj_arch: oh, why not?
20:58 <kernelj_arch> it's the wrong kind
20:58 <monochrom> Not to mention that "looks like g but works like f" is ambiguous too.
20:58 cdg joined
20:59 <kernelj_arch> ailio: write a destructor function getData then you can have foldr ((+).val) 0 . getData
21:00 MDA2 joined
21:00 Welkin joined
21:00 wroathe joined
21:00 <kernelj_arch> ailio: or use type instead of newtype :P
21:01 <ailio> hm, I guess I just stick with `f` then
21:01 Rodya_ joined
21:01 IanKelling joined
21:01 <kernelj_arch> you have to destruct the SomeData somewhere
21:02 Aruro joined
21:02 newhoggy joined
21:03 kazagistar joined
21:03 oisdk joined
21:04 <ailio> makes sense, I just thought there would be some other way.
21:05 Itkovian joined
21:07 revtintin joined
21:10 newhoggy joined
21:12 tristanp joined
21:13 tristanp joined
21:14 gehmehgeh joined
21:15 Sose_ joined
21:17 montik joined
21:17 slack1256 joined
21:19 mithrandeer joined
21:19 infinity0 joined
21:20 <Myrl-saki> Should I use *morphisms for actual code?
21:20 whiteline joined
21:20 blender joined
21:21 <Eduard_Munteanu> Probably not. I've hardly seen that in actual code.
21:21 ichor joined
21:22 newhoggy joined
21:22 <geekosaur> I'm under the impression that the only useful ones in general are already in standard libraries
21:22 homesitter joined
21:23 <Myrl-saki> That.. makes sense.
21:23 ragepandemic joined
21:23 wroathe joined
21:24 Discovery joined
21:25 <Gurkenglas> Why does base source say "uncurry f p = f (fst p) (snd p)", not "uncurry f (p, q) = f p q"?
21:25 meba joined
21:25 Arizona6882 joined
21:26 <benzrf> Gurkenglas: i think that's lazier
21:26 <benzrf> like "uncurry f ~(p, q) = f p q"
21:26 <Gurkenglas> Oh right. That, then.
21:26 <benzrf> @let uncurryA f p = f (fst p) (snd p); uncurryB f (p, q) = f p q
21:26 <lambdabot> Defined.
21:26 <geekosaur> it might also play better with some RULES pragmas
21:27 <benzrf> > uncurryA (\_ _ -> 3) undefined
21:27 <lambdabot> 3
21:27 <benzrf> > uncurryB (\_ _ -> 3) undefined
21:27 <lambdabot> *Exception: Prelude.undefined
21:27 <Myrl-saki> I think I need a zygomorphism though...
21:28 <geekosaur> just watch out for the zygohistomorphic prepromorphisms >.>
21:28 <Myrl-saki> geekosaur: :D
21:28 takle joined
21:28 <Myrl-saki> Add a columns container
21:28 <Myrl-saki> Add as many column elements as you want
21:28 <Myrl-saki> Each column will have an equal w
21:28 <Myrl-saki> Errr
21:28 <Myrl-saki> Dammit. Sorry.
21:29 <Myrl-saki> [[a] -> m a]
21:29 <Myrl-saki> Some crappy monad recursion magic. Is this correct?
21:30 xcmw joined
21:30 mjora7 joined
21:30 tromp joined
21:31 erikd joined
21:31 newhoggy joined
21:31 eacameron joined
21:31 <Myrl-saki> :t undefined :: [[a] -> m a]
21:31 danza joined
21:31 <lambdabot> [[a] -> m a]
21:32 Matthias_ joined
21:32 <geekosaur> :exf "[[a] -> m a]"
21:32 <exferenceBot> maybeToList Nothing
21:32 <geekosaur> heh
21:32 <Myrl-saki> lol
21:32 <MarcelineVQ> lazy exf!
21:32 <benzrf> ayy lmao
21:32 <Myrl-saki> The question is how I should do this...
21:32 <geekosaur> :exf "Monad m => [[a] -> m a]"
21:32 <exferenceBot> maybeToList Nothing
21:32 <benzrf> Myrl-saki: where does the list come from
21:32 <geekosaur> *eyeroll*
21:33 wroathe joined
21:33 <benzrf> this doesn't seem like a plausible top-level definition type, except for something app-specific
21:33 <MarcelineVQ> geekosaur: what answer were you after? it's a bit of an ambigous problem
21:33 <Myrl-saki> benzrf: It requires MonadFix, I think.
21:33 seangrove joined
21:33 <Myrl-saki> Basically, it's wiring everything to each other.
21:33 <geekosaur> I was just curious, I can't think of much thats generic there
21:33 <MarcelineVQ> ye
21:34 tromp joined
21:34 <fragamus> we need to ditch the remaining syntactic sugar and make haskell into a lisp
21:34 <Tuplanolla> (Yes vote.)
21:35 <Myrl-saki> Hmmm
21:35 <Myrl-saki> Maybe.
21:36 newhoggy joined
21:36 shainer left
21:37 <iqubic> Why do we need to turn haskell into lisp?
21:37 <Myrl-saki> Why not?
21:37 <Myrl-saki> If I get this to compile, I *may* have to sacrifice my first-born.
21:38 <Myrl-saki> :D
21:38 <Matthias_> Is there someone who can clarify the Replace typeclass example in section 4 on this haskell wiki page for me: https://wiki.haskell.org/GADTs_for_dummies?
21:38 <Matthias_> I would have expected the first instance "instance Replace t a a t" to be "instance Replace a a b b" (i.e. more resemblant of the base case one would write in Prolog / the hypothetical example in section 2)
21:39 bollu joined
21:40 <Myrl-saki> http://ix.io/sd1
21:40 <Myrl-saki> Untested.
21:40 aer[m] joined
21:40 aer[m] joined
21:41 DocWinter joined
21:41 <Myrl-saki> That's wrong.
21:42 <Myrl-saki> Retrying. Lol.
21:42 mstruebing joined
21:43 ego joined
21:44 <Myrl-saki> It...
21:44 <Myrl-saki> compiled.
21:44 <Myrl-saki> I have no idea if it works, but it compiled.
21:44 akegalj joined
21:45 eacamero_ joined
21:45 <Profpatsch> Is there something like V in Purscript as Haskell library? https://pursuit.purescript.org/packages/purescript-validation/3.0.0/docs/Data.Validation.Semigroup#t:V
21:45 Aruro joined
21:46 Elhamer_ joined
21:46 cschneid_ joined
21:46 Elhamer__ joined
21:49 sleffy joined
21:49 <Myrl-saki> Yeah... this is stupid.
21:49 <fragamus> the reason why we have to turn haskell into a lisp is that template haskell sucks and lisp macros rock
21:50 <fragamus> macros rule templates drool
21:50 <c_wraith> Profpatsch: yeah.. I don't recall offhand what package it's in.
21:51 <iqubic> What's the difference between template haskell and a lisp macro?
21:51 eacameron joined
21:51 <fragamus> when you write a lisp macro, you can depend on the fact that there is no syntax in the code that you are operating on
21:51 <fragamus> it is an AST
21:52 <MarcelineVQ> c_wraith, Profpatsch: https://hackage.haskell.org/package/validation-0.5.4/docs/Data-Validation.html#t:AccValidation
21:52 <iqubic> How is that better than template haskell?
21:53 <fragamus> so you can easily manipulate that AST, and the macro language is lisp instead of a bolted on language like template haskell
21:53 <Welkin> you can define arbitrary syntax with template haskell
21:53 <Welkin> lisp macros are still standard lisp
21:53 hiratara joined
21:53 nyuszika7h joined
21:54 geekosaur joined
21:54 <fragamus> yes with template haskell you can get by but template haskell is a hack
21:55 <fragamus> bolted onto haskell
21:55 <Myrl-saki> Well shit. It actually compiles.
21:55 newhoggy joined
21:55 <iqubic> What compiles?
21:55 <Arizona6882> there are no good refactoring tools in haskell, that is more sad than template haskell
21:55 <Welkin> why do you need refactoring tools?
21:55 eacamero_ joined
21:55 <Welkin> the compiler is your best refactoring tool
21:56 plot joined
21:56 <Arizona6882> i mean program helping Me write and modify other programs
21:56 <Arizona6882> not an editor macro
21:56 <Jinxit> "why do we need a meat knife when we have a swiss army tool"
21:56 <fragamus> i don't want to start a language fracas but the reasoning is pretty well explained here: http://www.paulgraham.com/avg.html
21:56 <Myrl-saki> Eh.
21:56 <Myrl-saki> I get `sequence . fmap f` getting warned to rewrite as `traverse f`
21:56 <Myrl-saki> That's good enough for me.
21:57 <Arizona6882> Welkin: compiler can not even change name of variable, its not refactoring anything
21:57 <Welkin> fragamus: nothing is well explained by paul graham
21:57 <Welkin> he just likes to hear himself talk
21:57 <fragamus> well there is that
21:57 <Welkin> Arizona6882: find-and-replace
21:57 ystael joined
21:57 <Welkin> that is your editors job
21:58 <Jinxit> Welkin: how about "move this lambda to a separate function"
21:58 <fragamus> I just love our type system but i hate the little bits of syntax we have
21:58 <Tuplanolla> I put my latest project on hold, because it was too tedious to manually rename and split modules, Welkin.
21:58 <Tuplanolla> No amount of `awk` helped.
21:58 <Arizona6882> Welkin: not, you did not Understand what i said. I said help, i did not say babysit.
21:58 eacameron joined
21:59 <MarcelineVQ> hmm, module split-off is reasonably oft-requested
21:59 <Welkin> I don't understand what the problem is
21:59 <sm> Arizona6882: I think some of the IDE addons can do that
22:00 <Welkin> there is not a magical piece of software with a button you click that reads "refactor my code"
22:00 toor__ joined
22:00 <Welkin> you have to do the work yourself
22:00 newhoggy joined
22:00 <Jinxit> that depends on where you draw the line for "doing the work"
22:00 <Arizona6882> Welkin: there was haskell refactorer
22:00 <c_wraith> there is again.
22:01 <c_wraith> HaRe was resurrected and renamed.
22:01 <Arizona6882> c_wraith: not really, though HaRe can do stuff. c_wraith are you familiar with capabilities of original tool?
22:01 <Profpatsch> MarcelineVQ: Holy crap, it has a lens dependency.
22:01 <Profpatsch> wtf
22:01 <iqubic> What is HaRe?
22:02 Rodya_ joined
22:02 <bennofs> iqubic: haskell refactoring tool
22:02 <MarcelineVQ> Profpatsch: hmm, that's a little silly, though I bet there's another package that does that job without that
22:03 carlomagno joined
22:03 Rodya_ joined
22:03 eacameron joined
22:05 <fragamus> I guess we could write a lisp that compiles to haskell as a target language
22:05 <iqubic> fragamus: Do we want to do that?
22:05 <fragamus> there are some good reasons
22:05 <Profpatsch> MarcelineVQ: Maybe just copy https://github.com/purescript/purescript-validation/blob/v3.0.0/src/Data/Validation/Semigroup.purs
22:06 <Profpatsch> It’s MIT-licensed.
22:08 eacameron joined
22:08 newhoggy joined
22:08 Akahige joined
22:09 <MarcelineVQ> Profpatsch: https://hackage.haskell.org/package/either-4.4.1.1/docs/Data-Either-Validation.html exists, though it also has a fair dep list due to it's other jobs
22:10 <Arizona6882> fragamus: "We wrote our software in wierd AI language" seriously?
22:10 <fragamus> I guess
22:10 <Arizona6882> lisp is most fundamental language of sanity, no AI at all. just good ideas.
22:10 darjeeling_ joined
22:11 <Profpatsch> edwardk: Is there a reason Validation has a Monoid constraint and not a Semigroup one?
22:11 <Profpatsch> MarcelineVQ: Thanks!
22:11 eacamero_ joined
22:11 robkennedy joined
22:11 <Profpatsch> Looking for a ekmett library was my hunch as well.
22:11 <Profpatsch> :)
22:11 <edwardk> Profpatsch: adoption? =)
22:11 <MarcelineVQ> I think it's gabriel's
22:12 <MarcelineVQ> or he contributed, maybe I'm mixing up git history
22:12 <MarcelineVQ> Profpatsch: It has instances for semi and monoid though
22:13 <edwardk> Profpatsch: the Alternative needs Monoid, and Semigroup isn't yet a superclass of Monoid, so its awkward picking up (Semigroup m, Monoid m) all over in the meantime
22:13 <edwardk> once semigroup is a proper superclass of monoid next year or so this goes away
22:13 <Profpatsch> edwardk: Ah, I see.
22:13 <fragamus> https://gist.github.com/fragamus/984a3b9313c708b2455c0efd22bdef2d
22:13 <Profpatsch> I think I can live with that. :)
22:13 <Profpatsch> Awesome.
22:13 <fragamus> i need a little assistance with my gist above
22:15 <Profpatsch> edwardk: I get the feeling that writing stuff like EitherT is mostly just boilerplate. Is that true?
22:15 <Profpatsch> Or am I missing something?
22:16 <edwardk> ?
22:16 <edwardk> you mean the experience as a library author? or vs. say effect systems?
22:16 <Profpatsch> Yes, as a library author
22:16 <edwardk> you do occasionally run into tricky instances here and there
22:16 erisco joined
22:16 <edwardk> but for the most part, yeah =)
22:16 eacameron joined
22:16 <edwardk> i learned a lot just from the sheer constant repetition though
22:16 <edwardk> helped a lot with intuitions
22:17 <Profpatsch> You add lots of instances to your types, so I wonder how hard it is.
22:17 lambdaman joined
22:17 <Profpatsch> Probably recognizing the instances and validating laws is the tricky part.
22:17 <edwardk> i try to ensure that all my things work with all my other things. that causes me to have to write lots of instances, because er.. haskell is bad at code reuse ;)
22:17 <edwardk> at least where instances are concerned
22:17 <Profpatsch> > bad at code reuse
22:17 <lambdabot> error:
22:17 <lambdabot> Variable not in scope:
22:17 <lambdabot> bad
22:17 <Profpatsch> From a very high level, probably. :P
22:18 <edwardk> well, there is a rigorous way i like to talk about it
22:18 <Profpatsch> *using* these libraries feels like eliminating a lot of duplicate code though.
22:18 RGamma joined
22:19 <edwardk> if we state that the notion of a mathematical theory is that you have sorts (types), operations as functions between those sorts, and laws about those operations, then we can make rigorous what haskell is bad at
22:19 <Gurkenglas> Could lens reduce its dependencies by cpp-ing the parts that provide for other packages out of scope when those packages aren't being used?
22:19 <edwardk> a typeclass is sort of the declaration of a theory. subclassing relationships provide refinements of theories
22:19 newhoggy joined
22:19 <johnw> Gurkenglas: how would you ask Hackage for "lens + this dependency I do want"?
22:19 <edwardk> Gurkenglas: in a lot of my packages i have -f-whatever options that can be used to turn off individual dependencies
22:20 <Profpatsch> It’d be npm all over again
22:20 <Gurkenglas> johnw, by depending on lens and that dependency
22:20 <johnw> ah
22:20 <edwardk> unfortunately they can only be used by users manually. i don't know what you are going to install later that will need those dependencies
22:20 <Profpatsch> Isn’t there pretty good dead code elimination done by GHC?
22:20 <Arizona6882> was there a proposal to make Monoid a superclass of Num? (defaulting it to addition)
22:21 <edwardk> Arizona6882: no refinement is being done to the num hierarchy at this time
22:21 <Gurkenglas> The user would have to rebuild the changed lens modules for each package that depends on it, yes
22:21 <edwardk> Gurkenglas: there is no way for me to detect this in lens
22:21 watabou joined
22:21 mmachenry joined
22:21 <edwardk> Gurkenglas: i can give you build flags, which i do for dozens of packages, but you have to use them manually
22:21 <Arizona6882> seems very good ideas to being able to call mappend on everything good, including number fields
22:22 <edwardk> Arizona6882: there is a fairly strong argument against it in that for Int there are a good half dozen viable monoid instances, and no clear culture that (<>) is "additive" by default.
22:22 lambdaman joined
22:23 <Gurkenglas> Wasn't there something about cabal generating MIN_VERSION macros that you could use to remove sections when they wouldn't compile because a dependency isn't available?
22:23 <edwardk> Gurkenglas: MIN_VERSION comes long after the dependency has been incurred
22:23 <edwardk> if you use -f-whatever, then i explicitly disable the dependency
22:23 <fragamus> this bug is kicking my ass https://gist.github.com/fragamus/6a54eb38952aaeefdf32a5e0636cec11
22:23 <edwardk> then i detect _that_ fact with MIN_VERSION
22:23 <Gurkenglas> I guess you know more about this stuff than me. But it sounds like a patch to cabal could make this possible?
22:23 <edwardk> but i can't detect that it isn't installed yet
22:24 <edwardk> yes you could replace the way we build packages entirely and solve this problem =P
22:24 <edwardk> =)
22:24 <edwardk> it wouldn't be a small patch and its not a small change in the set of assumptions we use
22:25 carlomagno joined
22:25 <Matthias_> exit
22:25 Matthias_ left
22:25 <edwardk> for sandbox users its pretty viable to add support to cabal for 'soft' dependencies
22:25 <edwardk> that require packages to be rebuilt if any of the 'soft' dependencies are later added
22:25 <edwardk> this might fit into the new-build culture
22:26 <edwardk> i take build stuff as largely gospel given and then adapt my workflow around it, so if you get that changed upstream? i'll adapt
22:26 <edwardk> if you don't, i'm not losing sleep ;)
22:26 <sm> Arizona6882: confirmed, Intellij-Haskell (eg) can do refactoring
22:27 raichoo joined
22:27 ubsan_ joined
22:27 <fragamus> callooh callay
22:27 <Arizona6882> sm: renaming?
22:27 newhoggy joined
22:27 <sm> yup
22:27 <sm> in single-package projects
22:27 <Arizona6882> nice, anything more advanced?
22:28 richi235 joined
22:28 <sm> I see extract type parameter and a few other things in the menu
22:28 wroathe joined
22:29 <Arizona6882> original refactorer had human friendly features like generalisations
22:29 <sm> have you investigated the recent reboot of HaRe ? Does it work ?
22:30 <sm> if so I'm sure it's a lot more featureful
22:30 <Arizona6882> i did, its basically one man project, it does work, it is a start from scratch, most of features are not yet there
22:31 tristanp joined
22:31 hiratara joined
22:31 <sm> https://github.com/haskell-tools/haskell-tools, right ?
22:31 louispan joined
22:32 <Gurkenglas> Inlining happens across package boundaries, right?
22:32 <sm> I think you've just described all haskell dev tools ever :)
22:32 eacameron joined
22:32 bollu_ joined
22:32 <Arizona6882> sm: https://github.com/RefactoringTools/HaRe
22:33 bollu_ joined
22:33 <edwardk> Profpatsch: er i wa sdescribing a thing before i got distracted
22:33 nomicflux joined
22:33 <sm> oh interesting, two separate projects
22:34 <Gurkenglas> Soft dependencies could work without recompilation if you sacrifice inlining, right?
22:34 <edwardk> anywyas, the theory stuff, basically if we say that theories/classes are defined by operations and laws, then we can define refinements of a given theory as adding more laws or more operations (or more types)
22:34 <Arizona6882> sm: HaRe has good goals, of guaranteeing that program meaning does not change
22:35 systemfault joined
22:35 <edwardk> in category theory terms we can look at the pushout of two refinements as a new theory as well. where we take everything implied by each refinement and add all the joint consequences of those laws
22:36 <edwardk> haskell deals well with theories where you add laws and operations together in lock-step, because you can't specify how your superclasses (the simpler theories you are built out of) behave due to new laws without the user having to write the instances by hand with all their members
22:36 newhoggy joined
22:36 systemfault joined
22:36 <edwardk> default signatures works okay for linear class hierarchies, but it means you have to have everything defined in one ginormous source file
22:37 <edwardk> but it doesn't handle wide, flat "lattices" of constraints at all
22:37 <edwardk> the classic OOP paradigm with multiple inheritance actually gets somewhat better code reuse than the haskell typeclass model, because you can specify the behavior of your superclasses' members.
22:37 <edwardk> mixin traits give you something similar in other languages
22:38 <Myrl-saki> FRP is pretty sad. ` else return never
22:38 <edwardk> but if you go to do this in scala you run into a problem
22:38 <edwardk> you can define say, an instance of something that extends Monad[F[_]] with Comonad[F[_]] -- but often the 'theories' we're interested in are actually conditional theories.
22:39 <edwardk> the instance of Comonad ((,) e) is always there, but the instance of Monad ((,) e) is predicated on e being a Monoid.
22:39 sproingie joined
22:40 lambdaman joined
22:40 robertkennedy joined
22:40 <edwardk> and scala (and every other OOP language at present) lacks the ability to say that the object you are using as an "instance" is a subclass of Monad[(E,_)] when E is a Monoid, and a subclass of Comonad[(E,_)] all the time.
22:40 atomi joined
22:40 <edwardk> you need a form of pushout for these conditional theories
22:41 eacameron joined
22:41 <edwardk> so OOP gives you better code reuse but for a crippled dialect of theories, haskell gives you worse code reuse, but a more expressive dialect of theories
22:41 <edwardk> if that makes any sense
22:42 <sm> interesting, edwardk
22:42 <Gurkenglas> Perhaps a language extension that turns all identifiers into implicit parameters, so lens can define "setOf l = views l singleton" without importing Data.HashSet and then the user has to import Data.HashSet in order to use setOf
22:43 <Arizona6882> > compare 1 2 `mappend` compare 3 1
22:43 <lambdabot> LT
22:43 <Arizona6882> > 1 `mappend` 2
22:43 <lambdabot> error:
22:43 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M513011972826...
22:43 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
22:43 andrei joined
22:43 <edwardk> Gurkenglas: to be frank that sounds horrible
22:44 raichoo joined
22:44 <Myrl-saki> @exf MonadFix m => [[a] -> m a] -> [a] -> m [a]
22:44 <lambdabot> Done.
22:44 newhoggy joined
22:44 <MarcelineVQ> ​:exf
22:44 <Myrl-saki> :exf "MonadFix m => [[a] -> m a] -> [a] -> m [a]"
22:45 <Gurkenglas> Because it'd turn out of scope error messages into implicit parameter not provided error messages?
22:45 <exferenceBot> could not find expression
22:45 <Myrl-saki> :(
22:45 <Myrl-saki> @exf MonadFix m => [[a] -> m a] -> m [a]
22:45 <lambdabot> Done.
22:45 <Myrl-saki> :exf "MonadFix m => [[a] -> m a] -> m [a]"
22:46 <exferenceBot> could not find expression
22:46 <Myrl-saki> I just realized something...
22:46 <Gurkenglas> Maybe it'd be "import _ as HashSet" in Data.HashSet.Lens and the user would write "import Data.HashSet.Lens using Data.HashSet"
22:46 tromp joined
22:47 <iqubic> Gurkenglas: Why do you think that would help us?
22:47 <MarcelineVQ> :t sequence . sequence (undefined :: [[a] -> m a])
22:47 <lambdabot> Monad m => [a] -> m [a]
22:47 <Myrl-saki> Nooo
22:47 <Gurkenglas> iqubic, lens could have less dependencies and more people could use lens and we wouldn't need a zoo of lens libraries
22:48 <Myrl-saki> :t \ms -> mfix (\xs -> traverse ($ xs) ms)
22:48 erikd joined
22:48 <lambdabot> (Traversable t, MonadFix m) => t (t b -> m b) -> m (t b)
22:48 <Myrl-saki> ;)
22:50 <Myrl-saki> @pl \ms -> mfix (\xs -> traverse ($ xs) ms)
22:50 <lambdabot> mfix . flip (traverse . flip id)
22:50 <Myrl-saki> Fuck. It still doesn't work. :(
22:51 <Myrl-saki> Hmmm
22:51 raichoo joined
22:51 <Myrl-saki> :t mfix . flip (traverse . (&))
22:51 <lambdabot> (Traversable t, MonadFix m) => t (t b -> m b) -> m (t b)
22:51 <Myrl-saki> Meh. Too complicated. I don't want to read that after not working on the project for a week.
22:52 newhoggy joined
22:54 Guest60990 joined
22:57 noan_ joined
22:57 aarvar joined
22:57 mda1 joined
22:58 bennofs1 joined
22:58 ystael joined
22:59 folsen joined
22:59 TimWolla joined
22:59 ogre joined
22:59 s4msung joined
23:00 Liskni_si joined
23:00 urdh joined
23:00 kosmikus joined
23:00 newhoggy joined
23:00 <andrei> What libraries are there to match arbitrary Haskell structures with patterns aside from t-regex? I have a datastructure and want to match several rules against it.
23:00 avn_nb joined
23:00 uuplusu_ joined
23:00 m0rphism joined
23:00 michi7x7 joined
23:01 kriton joined
23:02 <erisco> Myrl-saki, hm, that is a rough one
23:02 <erisco> how about mfix . (id ~> (&) ~> id) (flip traverse)
23:02 Atlantic777 joined
23:02 Atlantic777 joined
23:03 taktoa joined
23:03 padre_angolano joined
23:04 <erisco> also for = flip traverse
23:04 takle joined
23:04 cgfbee joined
23:07 <Myrl-saki> erisco: Isn't for = flip map?
23:08 newhoggy joined
23:08 <Myrl-saki> But you're onto something though.
23:08 <Myrl-saki> :t mfix . flip (traverse . (&))
23:08 <lambdabot> (Traversable t, MonadFix m) => t (t b -> m b) -> m (t b)
23:08 sampuka_ joined
23:09 <erisco> I don't know what "map" you're talking about
23:09 <Myrl-saki> erisco: flip map.
23:09 <Myrl-saki> Err
23:09 <MarcelineVQ> forM = flip mapM = flip traverse = for
23:09 <erisco> :t flip map
23:09 <Myrl-saki> flip fmap
23:09 <lambdabot> [a] -> (a -> b) -> [b]
23:09 <Myrl-saki> :t for
23:09 <lambdabot> (Applicative f, Traversable t) => t a -> (a -> f b) -> f (t b)
23:09 <Myrl-saki> Oh what.
23:09 <Myrl-saki> :t fmap
23:09 <lambdabot> Functor f => (a -> b) -> f a -> f b
23:10 <Myrl-saki> :t mfix . for . (&)
23:10 <lambdabot> error:
23:10 <lambdabot> • Occurs check: cannot construct the infinite type: b ~ m b
23:10 <lambdabot> Expected type: a1 -> (a -> m b) -> m (a -> m b)
23:10 <erisco> you have to apply (&) to the second argument, which is why I am using ~>
23:10 <Myrl-saki> erisco: Ahh
23:10 <erisco> you can also use <*>
23:10 <erisco> :t mfix . for <*> (&)
23:10 <lambdabot> error:
23:10 <lambdabot> • Occurs check: cannot construct the infinite type:
23:10 <lambdabot> b1 ~ (((a -> a) -> b) -> b) -> b1
23:10 <Myrl-saki> :t mfix . (id ~> (&) ~> id) for
23:10 <lambdabot> error:
23:10 <lambdabot> • Variable not in scope:
23:10 <lambdabot> (~>) :: (a3 -> a3) -> (a2 -> (a2 -> b1) -> b1) -> t0
23:11 <erisco> oh, that's slightly wrong
23:11 <erisco> well it can still be done but we have to lift
23:11 <Myrl-saki> erisco: Where is ~> defined?
23:11 <Myrl-saki> Lens?
23:11 <erisco> typecompose
23:13 <Myrl-saki> :t mfix . for <*> (&)
23:13 <lambdabot> error:
23:13 <lambdabot> • Occurs check: cannot construct the infinite type:
23:13 <lambdabot> b1 ~ (((a -> a) -> b) -> b) -> b1
23:13 <Myrl-saki> Welp. I'll do this on my computer. BRB.
23:13 newhoggy joined
23:14 erikd joined
23:15 justanotheruser joined
23:15 <erisco> so we can also do mfix . (liftA2 for <$> pure <*> pure (&))
23:16 <Myrl-saki> :t mfix . (for =<< (&))
23:16 <lambdabot> Traversable ((->) ((a1 -> a -> a) -> a1)) => (a1 -> a -> a) -> ((a1 -> a -> a) -> a1) -> a
23:16 ehsanullahjan joined
23:16 <Myrl-saki> That doesn't seem like it lol
23:16 ehsanullahjan joined
23:17 <erisco> :t mfix . (liftA2 for <$> pure <*> pure (&))
23:17 <lambdabot> (Traversable t, MonadFix m) => t (t b -> m b) -> m (t b)
23:17 <Myrl-saki> :t liftA2
23:17 <lambdabot> Applicative f => (a -> b -> c) -> f a -> f b -> f c
23:18 <Myrl-saki> I have no idea lol
23:18 <erisco> it is actually straight-forward
23:18 biglambda joined
23:19 <Myrl-saki> Oh okay. Now I have a better idea.
23:19 <erisco> I have to keep finding it but here is the explanation http://stackoverflow.com/a/34536499/260584
23:19 <Myrl-saki> By "better idea" I mean that I'm getting things. Not that I found something. Whoops.
23:20 <Myrl-saki> Wouldn't it be better to use a cofunctor instance?
23:20 dan_f joined
23:20 <Myrl-saki> Oh wait no. That still doesn't handle swapping.
23:21 raichoo joined
23:22 <erisco> to go all the way you have mfix <$> (liftA2 for <$> pure <*> pure (&))
23:22 <erisco> then maybe you can find reductions just using Applicative laws from here
23:22 <Myrl-saki> :t \a b -> f a (g b)
23:22 <lambdabot> error:
23:22 <lambdabot> • Could not deduce (Show t0) arising from a use of ‘f’
23:22 <lambdabot> from the context: (FromExpr t, Show t1, Show t2)
23:22 <Myrl-saki> @pl \a b -> f a (g b)
23:22 <lambdabot> (. g) . f
23:23 takle joined
23:24 <Myrl-saki> erisco: Would you actually do something like this in actual code? ._."
23:24 <erisco> I did once
23:24 <Myrl-saki> :t delete
23:24 <lambdabot> Eq a => a -> [a] -> [a]
23:24 <erisco> but it would be better if we can find some reductions
23:26 <Myrl-saki> erisco: I think the one using TypeCompose would be the best.
23:27 rockfordal joined
23:27 mewa joined
23:27 cpup joined
23:27 dmwit_ joined
23:28 <Myrl-saki> erisco: `(~>) id (&) for`, I think.
23:28 <Myrl-saki> Oh wait no.
23:28 <Myrl-saki> Maybe (. (&)), but I think I need more sleep to handle such type juggling.
23:28 <Myrl-saki> (And of course, that looks ugly. I have to read more aobut TypeCompose. Seems good.)
23:28 <erisco> there is a particular idiom for ~> and I illustrated it above
23:29 <erisco> it is from Conal's Semantic Editor Combinators
23:29 <Myrl-saki> erisco: Yeah. I don't quite understand it though.
23:29 <Myrl-saki> I'm guessing it means "keep 1st, modify second, don't post-processO?
23:29 romank joined
23:30 <erisco> then I did something similar with the Applicative equations I linked
23:30 sssilver joined
23:30 <erisco> with the hopes that some Applicative equivalances would become obvious
23:30 <erisco> or maybe if when the functions specialised something would be obvious there
23:30 <Myrl-saki> a ~> b ~> c == (\x y -> c (a x) (b y)) ?
23:30 newhoggy joined
23:31 Welkin joined
23:31 <Myrl-saki> Oh wait.
23:31 <erisco> (f ~> g) h is \x -> g (h (f x))
23:31 <Myrl-saki> (a ~> b ~> c) == (\x y -> c $ f (a x) (b y)) ?
23:31 augur joined
23:32 <erisco> so f maps the argument and g maps the return
23:32 <erisco> ~> is right-associative
23:32 <Myrl-saki> Mhm.
23:32 <Myrl-saki> Ahhh
23:34 louispan joined
23:34 <erisco> then there is another absurd method...
23:36 <erisco> actually I don't think that one will work well... is more impressive if all the binders are on the outside
23:36 newhoggy joined
23:37 daveisdave_ joined
23:37 <daveisdave_> Hello?
23:38 snowalpaca joined
23:38 dmwit joined
23:38 <daveisdave_> does anyone know anything about jquery?
23:38 snowalpa_ joined
23:39 modal joined
23:39 <daveisdave_> I got the strangest spam email today, and I'm following it down the rabbit hole. But I'm pretty much computer illiterate, and need a little help.
23:40 <daveisdave_> anyone?
23:41 codesoup joined
23:41 <dibblego> daveisdave_: this channel is for haskell
23:41 <daveisdave_> ok. you know where I could go for some help? I just wanted to know what a jquery script does
23:42 Melite joined
23:43 <geekosaur> presumably #jquery
23:43 <geekosaur> (some 400 users even)
23:44 cpup joined
23:44 <daveisdave_> ok thanks
23:44 <daveisdave_> have a good one
23:44 newhoggy joined
23:44 cschneid_ joined
23:45 <erisco> Myrl-saki, well for the sake of it anyways, it is mfix . lurryA @N2 (for <$> _1 <*> ((&) <$> _2))
23:46 <Welkin> :t lurryA
23:46 <lambdabot> error:
23:46 <lambdabot> • Variable not in scope: lurryA
23:46 <lambdabot> • Perhaps you meant ‘curry’ (imported from Data.Tuple)
23:46 <erisco> would be nice to get mfix on the inside but I'd have to think about how to deal with the binders on the inside
23:46 <Welkin> wtf is `lurryA`?
23:46 <erisco> you need to get it from my silly data-function-tacit package
23:47 <Welkin> how is it possible that random people arrive in this channel who don't even know what haskell is, and asked totally unrelated questions?
23:47 fragamus joined
23:47 <Welkin> ask*
23:47 <Welkin> what do they think it is? And are they mistyping something else? If so, what?
23:48 <glguy> You can list channels by population and just join popular channels
23:48 <Welkin> oh shit...
23:48 <erisco> after some linux channels and python, haskell has the most users... probably not the reason
23:48 <Welkin> why is nix broken on sierra???
23:49 nakal_ joined
23:49 anuxivm joined
23:49 <Welkin> has anyone else run into this `Illegal instruction: 4` issue with nix after upgrading to mac os 10.12?
23:49 markus1189 joined
23:49 tromp joined
23:50 markus1199 joined
23:50 <MarcelineVQ> is that irony Welkin? :>
23:50 <Welkin> irony?
23:50 <erisco> that's actually a reasonable problem I didn't think about... hrm
23:50 <Welkin> I was told that ghc 8.0.2 worked on sierra, so I took the chance
23:50 <Welkin> I thought nix would work too
23:50 romank joined
23:50 <Welkin> I had 8.0.1 at the time running on yosemite
23:51 a3Dman joined
23:51 <Eduard_Munteanu> Also Maybe folks living in Haskell
23:51 <Eduard_Munteanu> *maybe
23:51 newhoggy joined
23:51 <fragamus> hey im having serious trouble i need help
23:52 <Welkin> MarcelineVQ: no, because it is haskell related
23:52 <geekosaur> the "4" is just repeating the "illegal instruction" (SIGILL = 4). but I would expect to have to reinstall stuff like nix and other package managers (homebrew, macports) after upgrading OS
23:52 <fragamus> i am trying to traverse a directory tree and keep a counter during the traversal but it doesnt work
23:52 gmcabrita joined
23:52 tlaxkit joined
23:54 theDon_ joined
23:54 <erisco> fragamus, we're going to need more information. can you lpaste your code?
23:55 sampuka joined
23:55 <fragamus> https://gist.github.com/fragamus/6a54eb38952aaeefdf32a5e0636cec11
23:56 <Myrl-saki> int getRandom () { return 4; } -- determined by a fair dice roll
23:56 <Myrl-saki> ;)
23:56 <erisco> then also please tell us what the program does and what you want it to do instead
23:57 infinity0_ joined
23:57 infinity0_ joined
23:57 <Eduard_Munteanu> fragamus, I bet you're not skipping '.' and '..'
23:58 <Eduard_Munteanu> (hence infinite loop)
23:58 <Myrl-saki> `** Message: console message: http://localhost:8080/static/all.js @7186: uncaught exception in Haskell main thread: TypeError: undefined is not an object (evaluating 'a.f')
23:58 <fragamus> im not having that problem seemingly
23:59 <fragamus> but my state is not working as expected
23:59 ystael joined
23:59 newhoggy joined
23:59 infinity0_ joined
23:59 infinity0_ joined