<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:00 <Gurkenglas> Function composition. It is only a convenient shorthand which, when you manage to use it without the brackets directly around it, is a hint that your code is elegant :3
00:00 alveric1 joined
00:00 rcschm joined
00:00 eacameron joined
00:00 <Gurkenglas> (satisfiable . _) is (\x -> satisfiable (_ x))
00:01 infinity0 joined
00:01 tromp joined
00:02 <Engen> Gurkenglas: oh I see. The implicit nature of variable x (in your example) never seems to make sense to me coming from a C background
00:02 samtay joined
00:03 <Engen> so coming back to the issue at hand, we want to a -> Formula a, I've defined it as a -> Term a hmm
00:03 infinity0 joined
00:04 ertes joined
00:05 <Gurkenglas> You want a Bool. You have "any :: (a -> Bool) -> [a] -> Bool", "satisfiable :: Formula a -> Bool" (recursively), "Con :: t -> Term t", "xs :: [a]" and "func :: Term a -> Formula a". Anyone got a Scratch-like that can let him lego this together?
00:06 infinity0 joined
00:07 <Engen> hey hey! got it!
00:07 <Engen> I call func onto Con
00:08 <Gurkenglas> (func :: Term a -> Formula a) applied to (Con :: t -> Term t) implies that Term a is equal to t -> Term t :P
00:09 infinity0 joined
00:10 kritzcreek joined
00:10 <Gurkenglas> (in this case, that is - a better phrase than "is equal to" would be "can be unified with". For example, the a in (id :: a -> a) is not equal to the String ("asd" :: String), but id can be applied to "asd".)
00:11 <Engen> yeah so, (satisfiable . func . Con) is what I have
00:11 <Engen> I'm sorry that my terminology isn't correct
00:12 <Gurkenglas> I'm not, I get to make fun of someone >:D
00:12 <Engen> I guess "can be unified with" is synonymous to "composed of"
00:13 <Gurkenglas> (satisfiable . func . Con) looks right. Not sure whether you've got that last part right. a can be unified with String. [a] can be unified with String. String can be unified with String. Int cannot be unified with String.
00:14 <Gurkenglas> (String can be unified with a, too - "can be unified with" is a symmetric relation)
00:15 <Gurkenglas> "<Engen> I call func onto Con" <- the right formulation would have been "I compose func with Con"
00:15 bjz joined
00:17 cpennington joined
00:17 MarioBranco joined
00:17 <Engen> Gurkenglas: duely noted.
00:17 e14 joined
00:18 nille joined
00:18 Freundlich joined
00:19 darlan joined
00:20 butterthebuddha joined
00:21 gugah joined
00:21 saussure joined
00:23 <Engen> Gurkenglas: thanks for the help :)
00:25 andro_ joined
00:26 prophile joined
00:29 eacameron joined
00:30 gestone joined
00:31 <zachk> did they change the haskell layout parser in the past few years?
00:38 biff` joined
00:39 saussure joined
00:39 jedws joined
00:40 zcourts joined
00:44 tristanp joined
00:44 <lyxia> zachk: no idea. Why do you ask?
00:46 <zachk> ghc thought I was in a do block when I was missing a parentheses in a function definition and wanted a let binding for a '='
00:48 takle joined
00:48 <lyxia> = most often comes with a let
00:49 <zachk> just found it to be a weird error message
00:49 <zachk> well g'night
00:51 saussure joined
00:51 esph joined
00:55 trolling joined
00:55 patbecich joined
00:56 jshjsh joined
00:57 fragamus joined
00:58 zcourts joined
01:01 rickygee joined
01:02 <EvanR> ok. i know several not really solutions and some ok solutions, but what is the real final solution to this: collect a list of entries during a monadic action, like IO
01:02 <EvanR> without reversing
01:03 <EvanR> i.e. ordered forward in time
01:03 <gestone> so i've read haskell from first principles and now i'm looking to build something
01:03 patbecich joined
01:03 <EvanR> Data.Sequence ?
01:03 <EvanR> builder?
01:03 Supersonic112_ joined
01:03 <EvanR> some fancy type shenanigans
01:03 gugah joined
01:04 gestone joined
01:04 <gestone> so i have read most of haskell programming from first principles and now i think i'm ready to build something
01:05 <gestone> does anyone have any suggestions?
01:05 <ab9rf> a burrito?
01:05 <* ab9rf> runs
01:05 <Tuplanolla> Risch integrator, gestone.
01:05 <ab9rf> (sorry, i just saw a chipotle ad)
01:06 <* Tuplanolla> runs as well.
01:06 <ab9rf> tradionally, one writes an irc client
01:06 <EvanR> its like a jedi's lightsaber, each one is personally crafted
01:07 <gestone> ahh
01:07 <EvanR> bonus points for making it look like the graphics in the old movie "the matrix"
01:07 <ab9rf> heh
01:07 <gestone> oh dear that Risch integrator
01:07 <ab9rf> mine was written in emacs-lisp :)
01:07 ziyourenxiang joined
01:08 <gestone> hmm an irc client you say?
01:08 <EvanR> seems legit
01:08 <gestone> haskell has good support for sockets?
01:08 Goplat joined
01:09 <ab9rf> i've never really tried, but they shouldn't be that hard
01:09 <EvanR> ghc has a nice concurrent I/O manager
01:09 <EvanR> and nice concurrency libraries
01:09 neoo joined
01:09 <gestone> ah do you guys think simon's parallel and concurrent programming book would be a solid read before getting started then?
01:09 <EvanR> you can use sockets at whatever level of detail you want
01:09 <EvanR> definitely
01:10 <ab9rf> yeah, if you want to learn the FFI you can always rwite your own bindings to the syscalls
01:11 <EvanR> well, Network.Socket is low level enough already
01:11 <gestone> oh interesting
01:11 Mibaz joined
01:11 neoo joined
01:12 <ab9rf> for an irc client Network is probably sufficient
01:12 <ab9rf> you don't need UDP for an IRC client
01:12 <ertes> gestone: it's a very good book (simon's) and i recommend everybody to read it… however… why don't you just go and build something? you're currently running the risk of a form of procrastination that is very characteristic to haskell
01:12 <ertes> gestone: don't worry about getting everything perfect… start by getting something *at all*
01:13 <gestone> ertes: ah alright. guess best way to learn is by just doing
01:13 samtay joined
01:13 carlomagno joined
01:14 <gestone> just feel like there's so much to learn first to do things correctly in this language which isn't a bad thing at all, i certainly love the challenge
01:14 neoo joined
01:14 <ertes> gestone: that would be terrible
01:14 takle joined
01:14 <ertes> gestone: the problem is that you will *never* run out of things to learn in haskell
01:15 <ertes> and one year from now you will look at your old code and think: "wow, that was primitive… i'd do it completely differently today"
01:15 <unknownln> I find writing code helped me a ton to understand the motivation behind different abstractions and ghc extensions and whatnot, which in turn made it way easier to learn them. The same stuff, when I started out, made no sense at all to me when I first read about them
01:15 <EvanR> gestone: in comparison to language X... going back and refactoring haskell code is pretty pleasant
01:16 <ertes> by not ever actually writing something, you will rob yourself of that experience =)
01:16 <EvanR> so just f-ing write code
01:16 neoo joined
01:16 <gestone> ertes: i hope i certainly feel so :). i just keep on getting sucked into things. trying to understand free monads right now and why they're used, but i guess i shouuld just build something
01:17 <gestone> EvanR: yeah, i'll go do that
01:17 <gestone> is there some sort of like... code review channel of some sort?
01:17 <ertes> gestone: you will never understand free monads in an actual programming setting, if all you're writing is toy examples
01:17 tromp joined
01:17 buglebudabey joined
01:17 cyborg-one joined
01:17 FreeBird_ joined
01:17 <EvanR> you want to write hello world in haskell, let me tell you a little about free monads
01:18 juanpaucar joined
01:18 <ertes> gestone: and if you have trouble deciding what to do, i can give you a challenge that is very easy to implement, but has a surprisingly high improvement ceiling
01:18 neoo joined
01:18 <gestone> ertes: yeah that's what i figured. i just want to know when i can identify an appropriate use case
01:18 <gestone> ertes: that'd be interesting, i'd be up for it
01:19 <ertes> gestone: don' worry about it… you will learn to see the patterns
01:19 <ertes> gestone: write an echo server
01:19 asm_ joined
01:19 meba joined
01:19 <gestone> ertes: huh i'll give it a shot
01:19 <ertes> gestone: you have 12 hours
01:20 neoo joined
01:21 louispan joined
01:22 fragamus joined
01:23 <samtay> A small CLI app is a great first project, that will usually let you flex some of what you've learned but also get used to the ecosystem and some common packages (like optparse-applicative)
01:23 sleffy joined
01:23 <ertes> gestone: bonus points if i can have multiple concurrent connections, more bonus points if i can choose the listening port from the command line
01:25 <gestone> ertes: heh alright
01:25 tmciver joined
01:26 Bhootrk_ joined
01:26 <EvanR> thats going to be a bling echo server
01:26 wroathe joined
01:28 NextHendrix left
01:28 orhan89 joined
01:30 teurastaja joined
01:32 BlueRavenGT joined
01:33 Welkin joined
01:33 fragamus joined
01:34 hamishmack joined
01:35 Uncripted joined
01:36 samtay joined
01:38 prophile joined
01:40 takle joined
01:43 erikd joined
01:43 mjora7 joined
01:45 sheaf joined
01:46 flatmap13 joined
01:50 lambdamu_ joined
01:51 <ab9rf> what's an echo server?
01:51 <Welkin> what's an echo server?
01:51 <ab9rf> oh, you mean an implemnentation of the "echo" service?
01:51 <ab9rf> i'm slew
01:51 <Welkin> oh, you mean an implemnentation of the "echo" service?
01:51 <gestone> :O
01:51 <Welkin> :O
01:51 lritter joined
01:51 <EvanR> hmm
01:52 <* ab9rf> RSTs Welkin's connection
01:54 fizruk joined
02:00 Supersonic112_ joined
02:00 hucksy joined
02:02 gmhafiz joined
02:05 lambda-11235 joined
02:06 e14 joined
02:08 <Lokathor> gestone, https://github.com/Lokathor/haizod it's old and I want to replace it with a better version some time, but here's a small enough demo
02:08 nomotif joined
02:10 louispan joined
02:10 spoonm joined
02:11 bjz joined
02:15 <benzrf> this is probably not the right place to ask, but im not sure where exactly is better -
02:15 falafel joined
02:15 <benzrf> does c-- have computed jumps that don't push a stack frame?
02:16 takle joined
02:18 MarioBranco joined
02:20 exferenceBot joined
02:23 louispan joined
02:24 tromp joined
02:24 peterbecich joined
02:25 hexagoxel joined
02:27 tristanp joined
02:27 <ab9rf> benzrf: i think so based on the spec, but i'm not sure
02:27 <benzrf> hrm
02:28 <ab9rf> gotos can be computed, as can tail calls
02:28 <ab9rf> as can cut-tos
02:29 erikd joined
02:29 wroathe joined
02:29 <wilornel> Hmmm .. here's an interesting one I don't quite understand. `myX = 1 :: Int ; foo :: Int -> Int foo x = myX` . If I set `foo :: a -> a`, it does not work. The function wants anything but I return specificall an Int. Is it because it wants to be polymorphic?
02:30 jerbome_ joined
02:30 MarcelineVQ joined
02:31 <ab9rf> benzrf: labesl are first-class values and the argument to goto may be any expression as long as it evaluates to a label
02:31 <benzrf> nice
02:31 <wilornel> However, if I have `let myX = 1 :: Num a => a` and then `foo :: Int -> Int`, it works?
02:31 <benzrf> ab9rf: what are cut-to
02:32 <ab9rf> benzrf: cut-to is used with continuations
02:32 <ab9rf> benzrf: nonlocal jump
02:33 <ab9rf> benzrf: thre is also jump, used for tail calls
02:33 <benzrf> how does tail call differ from cut to
02:34 <monadicDuck> @wilornel: myX is an integer so the behavior seems expected?
02:34 <lambdabot> Unknown command, try @list
02:34 <wilornel> ah I think I get it
02:35 <wilornel> assuming the first argument can be anything, the returned value needs to be of the same type
02:35 <wilornel> if I'm returning an Int no matter what the first argument is, the types of the input and output wont match
02:36 <wilornel> if I assume that the input is `Num a`, then I can assume that the output is `Num a` and I can return Int in that case
02:36 saussure joined
02:36 esph joined
02:37 <wilornel> even though Int < a , and Int < Num, only Int < Num, with constrained/ad-hoc polymorphism works, because we can only get and do return something in Num
02:37 MarioBranco joined
02:38 <wilornel> in the case of Int < a, with full-on polymorphism, the input type could be Num but it could also be String, and then it does not make sense to return Int
02:38 Lokathor joined
02:38 <EvanR> wilornel: is that supposed to be subtyping, that is not the right way to think of type classes or polymorphism
02:39 <wilornel> In functional programming class we learned about this syntax between types. I think it was something like Int < Num or Int < a. Meaning that Int is a more specific type than Num and a. Is there such a way of doing comparisons between types in Haskell, I wonder?
02:39 <EvanR> actually what is < supposed to be there
02:39 <Welkin> Num is not a type
02:39 <Welkin> Int is a type
02:39 <Welkin> Num is a typeclass
02:39 <wilornel> ah yes
02:39 <Welkin> a is a type variable
02:40 wei2912 joined
02:40 <wilornel> You can't say that Int is more specific than a?
02:40 <Welkin> it is
02:40 <EvanR> wilornel: there is no relationship like that... but you can say Int is an instance of the Num class, or that it has an implementation for the Num class
02:40 <Welkin> because `a` is a variable
02:40 <wilornel> yeah
02:40 <Welkin> it could be anything withint the type constraint that is given
02:40 <Welkin> if any
02:40 <EvanR> Int is a specialization of the polymorphic type forall a . a
02:41 mooooooooo joined
02:41 <EvanR> two different issues going on
02:41 <Welkin> otherwise, haskell has an implied `forall` on type variables
02:41 connrs joined
02:41 <wilornel> yes
02:41 <EvanR> neither Int -> b or a -> Char are more specific than each other, so youre getting into a partial order at best
02:42 mizu_no_oto joined
02:42 <EvanR> think of forall a b . a -> b as ready to take a substitution for a, e.g. forall b . Char -> b
02:43 <wilornel> I see. I think I'll need to practice my intuition a little bit
02:43 saussure joined
02:44 <EvanR> in forall a . Num a => a -> a, youre ready to substitute, say Num Int => Int -> Int, and then you can only proceed if you have an instance of Num for Int
02:44 ChaiTRex joined
02:45 <EvanR> ghc does the finding of instances for you
02:45 juanpaucar joined
02:45 yamad joined
02:46 <EvanR> the instance is concretely some bundle of functions (+) (*) negate and fromInteger (etc) for your type
02:46 tristanp joined
02:46 tromp joined
02:48 <wilornel> Yes!
02:49 <wilornel> I wonder, all of these definitions , lke Num and Real and Int might not have been existant or created properly in the past. When the lagnague evolves, the contributors fix these types and typeclasses hierarchies,. Have there been problems wit hthis? back compatibility problems?
02:49 <EvanR> sure
02:50 <EvanR> and then people fix their code
02:50 <EvanR> or continue to use old ghc
02:50 wroathe joined
02:51 louispan joined
02:51 Lokathor joined
02:52 drewbert joined
02:57 drewbert joined
02:58 beerdrop joined
02:58 ChaiTRex joined
03:00 raynold joined
03:01 anodium joined
03:08 takle joined
03:09 tromp joined
03:11 felixsch_ joined
03:14 jgt joined
03:14 drewbert joined
03:18 saussure joined
03:19 baroque joined
03:20 meba joined
03:20 fizruk joined
03:20 svgDelux joined
03:23 teggi joined
03:25 hybrid joined
03:26 eSVG joined
03:28 CoderPuppy joined
03:29 takle joined
03:31 gmhafiz_ joined
03:31 ChaiTRex joined
03:31 tristanp joined
03:35 pavonia joined
03:39 simon`` joined
03:39 geekg_000 joined
03:41 geekosaur joined
03:44 takle joined
03:46 geekg_000_ joined
03:48 tristanp joined
03:48 <Lokathor> does JuicyPixels have a way to flip an image?
03:48 <Lokathor> i'm not seeing anything ready made
03:48 takle joined
03:51 xiinotulp joined
03:51 <EvanR> its based on REPA right, maybe look there
03:52 wroathe joined
03:53 <Lokathor> JuicyPixels-repa seems to be a different package
03:53 <Lokathor> hmm, https://www.stackbuilders.com/tutorials/haskell/image-processing/ oh my
03:53 <EvanR> hrm, maybe basic JuicyPixels is just for loading and saving
03:54 brynedwards joined
03:58 bjz joined
03:59 <geekosaur> that is my understanding, yes
03:59 takle joined
04:00 tristanp joined
04:00 ericsagnes joined
04:00 davr0s joined
04:07 takle joined
04:08 jmcarthur joined
04:10 infinity0 joined
04:11 descender joined
04:14 wroathe joined
04:15 takle joined
04:18 saussure joined
04:19 louispan joined
04:22 tristanp joined
04:23 begriffs joined
04:23 takle joined
04:26 nomotif joined
04:31 jerbome_ joined
04:33 mivael_ joined
04:35 wroathe joined
04:35 arquebus joined
04:35 wedens joined
04:36 arquebus joined
04:36 saussure joined
04:36 arquebus joined
04:37 arquebus joined
04:42 systadmin joined
04:44 LordBrain joined
04:46 juanpaucar joined
04:51 systemfault joined
04:53 begriffs joined
04:53 nshepperd joined
04:56 wroathe joined
05:01 sleffy joined
05:02 twomix joined
05:04 dewzer joined
05:10 {emptyset} joined
05:11 louispan_ joined
05:11 gestone joined
05:12 zetetetete joined
05:12 <zetetetete> What's better, haskell or OCaml?
05:13 <cocreature> zetetetete: that depends on who you ask :)
05:14 jgt joined
05:14 <zetetetete> I've heard that Haskell is for "pretentious academics writing experimental and impractical features based on research papers"
05:15 <capisce> you've been misinformed
05:15 <c_wraith> it does work for that.
05:15 <c_wraith> It also works for building real-world software
05:15 <c_wraith> it's a multi-purpose language
05:16 yamad joined
05:16 <c_wraith> It also works for non-pretentious academics advancing the state of the art in practically useful type theory. Quite of lot of that going on.
05:16 wroathe joined
05:17 systadmin joined
05:17 <glguy> I heard if you pressed A right when the Pokeball closes that it helps catch the Pokemon
05:18 <systemfault> Does it work for pretentious non-academics writing real-world software? :)
05:18 <c_wraith> systemfault: it works for me!
05:18 <systemfault> <3
05:18 baldrick2 joined
05:19 <systemfault> glguy: It worked in Yellow, I'm pretty sure... (The only version I played a good 15 years ago)
05:20 <c_wraith> crazy how 15 years ago, pokemon was an old series.
05:20 meandi_2 joined
05:21 tromp joined
05:22 laxbro joined
05:23 <laxbro> What's up!
05:23 <c_wraith> ahoy, laxbro
05:23 eklavya joined
05:24 <vimalloc> So if I had something that could be computed in either applicative or monad, should I prefer one over the other?
05:24 <c_wraith> vimalloc: Well.. is the computation different either way?
05:24 <vimalloc> No, end result would be the same going either route?
05:24 <c_wraith> Sure, but it might be more efficient one way or another.
05:24 <vimalloc> er, s/\?//
05:25 <cocreature> vimalloc: do you mean that you can generically compute it for all instances of Applicative or that you are working with a fixed type but you can use its Applicative instance or its Monad instance?
05:25 <vimalloc> cocreature: fixed type
05:25 neoo joined
05:26 <c_wraith> Applicative can be better optimized, but it isn't always.
05:26 <cocreature> for most types, it probably doesn’t matter
05:26 wonko7 joined
05:26 <c_wraith> I do often prefer Applicative if it makes my code shorter. I wrote some parsers last night that were 5 lines using do notation and 2 lines using Applicative combinators. They're pretty similar in readability.
05:27 neoo joined
05:27 <vimalloc> Sweet, so basically pick the one that is easier to read, and worry about optimization later as needed?
05:27 <c_wraith> Well, the Applicative stuff is more dense - might be slower to read the first time.
05:27 <c_wraith> vimalloc: absolutely.
05:28 <vimalloc> thx guys :)
05:28 neoo joined
05:29 <cocreature> there are some types where the Applicative instance actually behaves differently. perhaps the most popular one is haxl but that’s rare enough that if you’re using such a type you’re probably aware of it
05:30 neoo joined
05:31 BlueRavenGT joined
05:31 aijony joined
05:32 neoo joined
05:33 fizruk joined
05:34 neoo joined
05:34 segmond joined
05:35 butterthebuddha joined
05:35 neoo joined
05:37 nomotif joined
05:37 wroathe joined
05:39 begriffs joined
05:40 cpennington joined
05:41 greg_ joined
05:43 begriffs joined
05:43 tristanp joined
05:44 tristanp joined
05:45 eacameron joined
05:45 begriffs joined
05:46 jedws joined
05:46 ongy joined
05:49 eacamero_ joined
05:50 dan_f joined
05:53 turbo_ joined
05:54 dewzer joined
05:55 juanpaucar joined
05:55 node joined
05:57 vlatkoB joined
06:01 augur joined
06:02 Punisher joined
06:03 SpinTensor joined
06:07 eklavya joined
06:09 tristanp joined
06:11 tommd joined
06:12 gestone joined
06:17 sternmull joined
06:19 wroathe joined
06:23 mfukar joined
06:24 Kuros` joined
06:24 aijony joined
06:26 patbecich joined
06:26 osa1 joined
06:27 nomotif joined
06:36 juanpaucar joined
06:40 wroathe joined
06:45 takle joined
06:46 Trendrrr joined
06:50 mohsen_ joined
06:52 turbo_ joined
06:54 jimmyrcom_ joined
06:59 <turbo_> h
06:59 turbo_ left
07:00 jgt joined
07:01 robotroll joined
07:03 Bassetts joined
07:03 rickygee joined
07:03 sheaf joined
07:06 conal joined
07:06 jhenligne joined
07:06 kaychaks joined
07:07 rickygee joined
07:08 thebardian_ joined
07:08 thebardian_ joined
07:08 <EvanR> how i learned to stop worrying and love reversing a list used as a log
07:09 <EvanR> well a finite log
07:09 kaychaks_ joined
07:10 kaychaks_ joined
07:10 grizwako joined
07:12 saussure joined
07:12 kaychaks_ joined
07:12 <EvanR> thinking about making a structure based on IntMap which gives you a -> Log a -> Log a, and you can extract a list or a finite portion of this later
07:12 <EvanR> but since i havent seen anyone do this, im wondering what im missing
07:14 thebardian joined
07:15 vlatkoB_ joined
07:16 SeMas joined
07:16 ragepandemic joined
07:19 Wizek joined
07:20 filterfish joined
07:21 takle joined
07:21 meba joined
07:21 tromp joined
07:21 wroathe joined
07:22 thebardian joined
07:22 jerbome_ joined
07:24 turbonikke89 joined
07:24 turbonikke89 left
07:25 simukis joined
07:25 xall joined
07:25 nomotif joined
07:27 Okey joined
07:28 Xanather joined
07:28 thebardian joined
07:29 takuan joined
07:32 patbecich joined
07:34 Herbstkind joined
07:34 kirelagin joined
07:37 Cerise joined
07:37 Cerise joined
07:38 thebardian joined
07:39 ErinvanderVeen joined
07:39 nickolay_ joined
07:39 takle joined
07:40 Punisher left
07:41 saussure joined
07:43 wroathe joined
07:43 tefter joined
07:44 danvet joined
07:46 takle joined
07:49 dm3 joined
07:55 jsb joined
07:57 louispan joined
07:58 connrs joined
07:58 juanpaucar joined
07:59 saussure joined
08:01 _main_ joined
08:01 yobohohoz joined
08:02 _main_ joined
08:03 wroathe joined
08:05 __main__ joined
08:05 Gurkenglas joined
08:06 hamishmack joined
08:07 inad922 joined
08:08 dewzer joined
08:10 gestone joined
08:15 connrs joined
08:15 Guest10 joined
08:16 wonko77 joined
08:18 saussure joined
08:20 raduom joined
08:21 connrs joined
08:21 SkyPatrol joined
08:26 systadmin joined
08:27 Cerise joined
08:27 Cerise joined
08:27 osa1 joined
08:28 saussure joined
08:29 balor joined
08:31 lminy_ left
08:33 patbecich joined
08:34 S1 joined
08:36 Trendrrr joined
08:36 Trendrrr joined
08:38 lep-delete joined
08:41 raichoo joined
08:41 acidjnk22 joined
08:42 ralu joined
08:44 Nicmavr joined
08:45 wroathe joined
08:46 Cioran89 joined
08:46 saussure joined
08:47 dewzer joined
08:47 Test1223 joined
08:47 Kreest__ joined
08:48 chbatey joined
08:50 <Test1223> Hey, I just started getting to know Haskell in Uni, and have a beginner exercise that is recommened to do...and I think it's quite simple, but I still can't work it out. Is it okay to ask for help with that here?
08:51 IanKelling joined
08:51 <c_wraith> Test1223: sure. use a pastebin (lpaste.net is provided for haskell code, if you need one) for any code you have, a description of the trouble you're having, and any error messages you are getting.
08:56 Trendrrr joined
08:57 <[exa]> Hm guys, is there some good latex package for typesetting haskell source?
08:59 paolino joined
09:01 mohsen_ joined
09:03 <cocreature> [exa]: the standard latex packages for typesetting source code should work, e.g. listings or minted
09:04 saussure joined
09:05 connrs joined
09:05 eacameron joined
09:07 juanpaucar joined
09:08 <[exa]> great, thanks
09:08 <[exa]> i was battling with minted's python, listings work greaat
09:10 thc202 joined
09:10 <Test1223> https://pastebin.com/gi7A7DXu well here's my problem, it's kinda embarassing lol. And sadly I don't have any code yet. I can imagine what it should work like, but I have no idea how to implement it. Can anybody give me a hint in the right direction?
09:11 <oherrala> Test1223: make a function which checks if the first element of the list is the element given
09:13 <oherrala> Test1223: then, if the above check fails, you'll take tail of the list and do the check again => that's recursion
09:14 <lpaste> Test1223 pasted “Test 1” at http://lpaste.net/1304125987176316928
09:14 moongazer joined
09:14 <lpaste> Test1223 pasted “Test 1” at http://lpaste.net/1321772564686569472
09:15 jerbome_ joined
09:15 <Test1223> sorry didn't know how lpaste.net worked. I have tried it like that, but I think I am doing something wrong
09:16 saussure joined
09:20 ErinvanderVeen joined
09:20 connrs joined
09:24 bjz joined
09:24 paolino joined
09:25 athan joined
09:26 phyrex1an joined
09:27 wroathe joined
09:27 <ErinvanderVeen> Test1223: I want to ask you to consider the following things: 1. What happens when you run out of elements in the List. 2: You're comparing a (which is an a) and x (which is a b), can you do this?
09:28 ljc joined
09:28 Itkovian joined
09:28 zariuq joined
09:30 <Test1223> If I run out, I got an empty set which then means the statement is false. And I thought I would be comparing input "a" with input "b", maybe I understood something wrong
09:31 connrs joined
09:32 <ErinvanderVeen> The a and the b in the function definition define the type. Right now, I could call your function like such: check 1 [true], is a little weird. You would ideally want that your function could only be called with the same type element as list.
09:34 catsup joined
09:35 <grizwako> You probably want to compare Int with [Int]
09:35 cloudhead joined
09:35 ErinvanderVeen joined
09:35 <Test1223> https://thepasteb.in/p/2RhKyVOp5Q4c4 I got it working now, so a -> [a] means, I compare and a to a list which contains a's right?
09:35 Yuras joined
09:35 <grizwako> yep
09:35 catsup joined
09:36 <ErinvanderVeen> I see you also added a patternmatch for the empty list.
09:36 <grizwako> and you handled empty list, this looks fairly good to me
09:36 <grizwako> (i am newbie myself)
09:37 <Test1223> Then another question I have, I added the (Eq a) because the compiler told me lol...if I got it right the purpose is to check if a and [a] are the same type, right? But I thought the letter a implied that
09:37 ziocroc joined
09:37 hackebeilchen joined
09:38 <grizwako> yeah, but there are types that you can not directly compare
09:38 bjz joined
09:38 TheFuzzball joined
09:39 <grizwako> http://stackoverflow.com/questions/10956419/why-isnt-every-type-part-of-eq-in-haskell
09:40 <Test1223> I will read that, thank you. And another question: when defining a function let's say a -> [a] -> a -> Bool Is the last part always the result and everything before that an input?
09:40 <Test1223> Hope that question makes sense
09:40 <ErinvanderVeen> That question does make sense
09:41 <ErinvanderVeen> It has to do with the beauty of functional programming.
09:41 Boomerang joined
09:41 <grizwako> sorry if it looks scary, it is not so much, when you get to map/filter, it will click
09:41 Gloomy joined
09:41 neoo joined
09:41 Trendrrr joined
09:42 <grizwako> answer to your question is yes, there is more to it (partial application)
09:42 nickolay_ joined
09:42 <ErinvanderVeen> If I give your "a -> [a] -> [a] -> Bool" a single Int, It cannot return an answer. Instead, it will return a new function: [Int] -> Int -> Bool.
09:42 ahihi joined
09:42 <cocreature> Test1223: "Eq a" doesn’t mean that you can compare if things are of the same type. It means that if you have two _values_ that are _both_ of the same _type_ a. you can check if they are the same values
09:43 <ErinvanderVeen> Typo: Should be "a -> [a] -> a -> Bool"
09:43 neoo joined
09:43 <Test1223> thank your for all the answers, I think I understand it better now
09:44 <Test1223> Is experience with non-functional languages advised before getting to know a functional one, btw?
09:44 connrs joined
09:44 <grizwako> depends on how you are learning
09:45 neoo joined
09:46 <grizwako> generally, such experience will help because you will have some idea about how data is flowing trough your program
09:46 <ErinvanderVeen> And they can also provide you with basic knowledge on types.
09:46 <Test1223> I take computer science classes, but I started in summer semester. I have what people usually have in the 2nd semester, and I will have in my 2nd what they have had in the 1st. It's meant to not require backround knowledge, but I think some courses can be confusing without having done the prior stuff yet
09:46 <grizwako> personally, I think it would be better if people learned functional first and other paradigms later
09:47 neoo joined
09:47 twomix joined
09:47 <[exa]> Test1223: imho every programmer should know how to do structured programming in assembly (= almost in C) because that gives you a very good understanding how actual hardware works. With some small exceptions the rest of non-functional programming is expendable.
09:48 grizwako_ joined
09:48 erikd joined
09:48 kirelagin joined
09:49 neoo joined
09:50 neoo joined
09:50 Gloomy joined
09:50 patbecich joined
09:51 <[exa]> Test1223: anyway, data structure complexity analysis is one of the exceptions -- most of them are suited for imperative programming with references.
09:51 neoo joined
09:52 <Test1223> I will have some assembly later this year, so I hope it will help me understand somethings better then
09:52 Trendrrr joined
09:52 saussure joined
09:54 rickygee joined
09:55 takle joined
09:55 <maerwald> [exa]: uhm?
09:55 <maerwald> there are a lot of non-functional programming languages that are not expendable
09:56 <maerwald> but this is probably OT now
09:56 <maerwald> wasn't there a channel for derailed discussions?
09:56 <ongy> -overflow exists
09:57 alx741_ joined
09:57 paolino joined
09:59 osa1_ joined
10:00 FreeBirdLjj joined
10:03 Trendrrr joined
10:04 netheranthem joined
10:06 paolino joined
10:07 ridho joined
10:07 SkyPatrol_ joined
10:08 wroathe joined
10:09 paolino joined
10:11 juanpaucar joined
10:11 saussure joined
10:14 anuxivm joined
10:16 bennofs joined
10:16 scottj joined
10:16 bjz joined
10:18 louispan joined
10:18 kirelagin joined
10:19 thebardian joined
10:20 Guest10 joined
10:21 gmhafiz_ joined
10:23 tromp joined
10:24 sampuka joined
10:27 filterfish joined
10:28 Bluer joined
10:28 bjz joined
10:28 saussure joined
10:29 Bluer joined
10:30 Bluer joined
10:31 nickolay_ joined
10:32 Test1223 joined
10:35 filterfish_ joined
10:36 jao joined
10:36 <Test1223> https://pastebin.com/09aq5Yzc back with another problem :(
10:37 <Test1223> not sure what I am doing wrong this time
10:37 <ongy> Test1223: what's the error?
10:38 <Test1223> variable not in scope
10:39 <ongy> and I can tell you, you are overthinking things, or not thinking enough. (this can be really short, but let's see why your version doesn't work)
10:39 <ongy> Test1223: which one? The paste looks ok to me, can you add the error message
10:39 NextHendrix joined
10:40 <Test1223> Well I think I could also just add the two lists together, if you mean that with overthinking. (It's an optional exercise given to use and it says we have to program it recursive, so I am not sure if adding both lists would count as recursive or not)
10:41 kirillow joined
10:41 <NextHendrix> hi guys
10:41 <NextHendrix> trying to get the title from a page given the url
10:41 <NextHendrix> having a little trouble when the page title has emojis in it
10:41 <NextHendrix> https://ptpb.pw/piOH/hs -- current rough draft
10:42 <NextHendrix> gives "https://sighup.nz (Ahoy-hoy \226\152\131 SIGHUP)"
10:42 <grizwako_> Test1223, you can remove Eq a constraint
10:43 <NextHendrix> should be Ahoy-hoy ☃ SIGHUP
10:43 <Test1223> it says couldn't match expected type '[a] with acutal type '[a] -> a]'
10:43 <grizwako_> add (x:xs) (y:ys)
10:44 <lyxia> NextHendrix: how are you printing it
10:44 <NextHendrix> well the function returns an IO ByteString
10:45 <Test1223> grizwalko_ where add that? in the last line?
10:45 LKoen joined
10:45 <ongy> Test1223: ah right, you are only giving 1 argument to add' in the second clause
10:46 <grizwako_> Test1223, you have two lists, you need to combine heads of each into a list and add tails of each to what you have combined
10:46 <Test1223> add' :: (Eq a) => [a] -> [a] -> [a]
10:46 <Test1223> add' a [] = a
10:46 <Test1223> aaaah
10:46 <Eduard_Munteanu> > show "https://sighup.nz (Ahoy-hoy \226\152\131 SIGHUP)"
10:47 <lambdabot> "\"https://sighup.nz (Ahoy-hoy \\226\\152\\131 SIGHUP)\""
10:47 <Test1223> oops; ah I get it now
10:47 <Eduard_Munteanu> > show "Ahoy-hoy ☃ SIGHUP"
10:47 <lambdabot> "\"Ahoy-hoy \\9731 SIGHUP\""
10:47 <Test1223> it works now, thank you guys again.
10:47 ragepandemic joined
10:48 <ongy> Test1223: I think that example isn't really a good one though, add' = (++) makes this thing rather minimal
10:48 <grizwako_> Test1223, you should have one ":" and one "++" in your last definition
10:48 <amx> NextHendrix: take a look at Data.Text.Encoding
10:48 <lyxia> NextHendrix: \226\152\131 is UTF-8 for ☃
10:48 <NextHendrix> amx: thanks
10:48 <NextHendrix> lyxia: i assumed as much
10:48 <grizwako_> and you have to handle case where first list is empty and when second list is empty
10:48 <Eduard_Munteanu> Yeah, you probably don't want a ByteString.
10:49 <lyxia> and a bytestring doesn't assume any encoding
10:50 <ongy> grizwako_: first and second list empty work with the current version
10:50 <grizwako_> I know :)
10:50 wroathe joined
10:50 <Test1223> Actually it gives me an error if I don't handle those cases
10:50 rickygee joined
10:50 <Eduard_Munteanu> Actually, you probably want to convert String directly to Text.
10:51 <ongy> oh right, it tells you with -Wall
10:51 <ongy> converting string to bytestring is always a mess with encodings
10:52 <Test1223> grizwako_ what do you mean with having one "." and one "++" in my last definition?
10:52 <grizwako_> one ":"
10:53 <grizwako_> in your last "line" where you are doing "appending" there should be no []
10:54 felixsch__ joined
10:54 <Test1223> I changed that, and it works now. Thanks. And the ":" is no requriment
10:54 <grizwako_> example: [1] ++ [2] == 1 : 2 : []
10:55 SpinTensor joined
10:55 <Test1223> https://thepasteb.in/p/lOhO41nqN3ZCB I just did it like that now
10:56 <grizwako_> well, it works, but I think you missed point of exercise
10:56 freusque joined
10:56 <Eduard_Munteanu> I think the exercise should have disallowed the use of (++) altogether.
10:56 <grizwako_> you should try to use ":" and recursion
10:56 osa1 joined
10:57 <Test1223> I just roughly translated the exercise there are several others which are part of it, this one was one of few, all with the same rules. I think I need to use the ":" later on, but I 'm not sure
10:57 <grizwako_> I will throw out some "code" here, and think about it for a bit
10:57 Guest10 joined
10:58 <Test1223> How would I got about handling the case if one list contains numbers and the other chars though?
10:58 <Eduard_Munteanu> Don't you have lists of the same type?
10:59 <grizwako_> [1] ++ [2] ++ [3,4,5] === 1:2:3:4:5:[] === 1:2:3:[4,5] === 1:[2,3,4,5] === [1,2,3,4,5]
10:59 jedws joined
10:59 <Eduard_Munteanu> :t (++)
10:59 <lambdabot> [a] -> [a] -> [a]
10:59 Toto_ joined
11:00 <Toto_> palindrome :: (Eq a) => [a] -> Bool palindrome [xs] = True palindrome xs = if head xs == last xs then palindrome (tail xs) else False
11:00 <Toto_> i cannot figure out why my code is worng
11:00 <Test1223> ah true
11:00 <grizwako_> Test1223, if you have later exercises that require : and recursion, it is fine, just continue doing them
11:01 <Eduard_Munteanu> Toto_, you drop the first element but not the last.
11:01 <Toto_> oh right
11:01 <Toto_> thanks
11:01 <Test1223> grizwako_ yes of course
11:01 <Eduard_Munteanu> Toto_, you also need to handle empty lists
11:02 <Toto_> ok will add that too
11:03 <Eduard_Munteanu> Toto_, to be fair, there's an easier and more succint way of doing it.
11:03 Snircle joined
11:03 <Toto_> yes i am listening
11:03 <Eduard_Munteanu> :t reverse
11:03 <lambdabot> [a] -> [a]
11:03 <Eduard_Munteanu> That's a hint ^^.
11:04 Guest10 joined
11:04 <Toto_> i have to check if reverse of the list is equal to the list
11:04 <Eduard_Munteanu> Yep.
11:05 <Toto_> thank you for the guidance
11:05 ErinvanderVeen joined
11:05 saussure joined
11:05 unK_ joined
11:06 Trendrrr joined
11:06 twanvl joined
11:07 oisdk joined
11:07 Guest12483 joined
11:08 sn[m]1 joined
11:08 mmn80 joined
11:09 SkyPatrol joined
11:09 jedws joined
11:11 buttbutter joined
11:11 gestone joined
11:12 wroathe joined
11:12 Guest14726 joined
11:14 ragepandemic joined
11:14 raduom joined
11:14 kwippler joined
11:15 patbecich joined
11:16 juanpaucar joined
11:18 bvad joined
11:19 Puggy joined
11:21 oisdk joined
11:24 saussure joined
11:29 benl23 joined
11:31 ompaul joined
11:31 osa1 joined
11:31 moongazer joined
11:32 zcourts joined
11:32 asthasr joined
11:32 wroathe joined
11:33 SepakoRayl joined
11:33 wright joined
11:33 dni joined
11:34 ertes joined
11:35 dm3 joined
11:35 systadmin joined
11:36 bendo joined
11:36 ixxie joined
11:36 nikhil_ joined
11:37 ragepanda joined
11:37 <nikhil_> how can I add indented code here?
11:39 <ongy> where? if you want us to read it, lpaste.net is your best address
11:40 rickygee joined
11:40 <nikhil_> what is lpaste.net? i am new to IRC channel
11:41 dni joined
11:42 <ongy> lpaste.net is a website. It's in the spirit of pastebin, just better :) at least for everything haskell related. You can put your code in there and post the link to it here (pasting more than 2 lines in irc is generally frowned upon)
11:42 saussure joined
11:43 <nikhil_> ok
11:43 ragepandemic joined
11:44 yrid joined
11:44 dddddd joined
11:46 shesek joined
11:47 Guest10 joined
11:51 darlan joined
11:51 _flow_ joined
11:52 spion joined
11:52 drewbert joined
11:52 buglebudabey joined
11:53 dm3 joined
11:54 tromp joined
11:58 sdothum joined
11:59 yellowj joined
11:59 <SepakoRayl> Hello guys, I have a design problem regarding the renaming/typecheck stages for a compiler of a toy language I am making. Does anyone have the time to give a fast advice?
12:01 saussure joined
12:01 epsilonhalbe joined
12:02 <simon``> When writing a parser should I write it in such a way that so it will accept *only* valid dataformat or should I allow (for simplicity) a superset of input data and do a validity check later on?
12:03 <cocreature> SepakoRayl: just asking your question directly is going to work better
12:03 scottj left
12:04 <ongy> simon``: depends a little on how/what you have to check. Generally full parsing/validation before anything else is a good thing, but checking things like length fields can be better as a 2nd step (but I would do it in the parser api)
12:04 systadmin left
12:05 <simon``> ongy: I want to parse chess PGN files and I am unsure which checks the parser should do and which I should do later on
12:06 <simon``> e.g. valid move checks seem to me a bit much for a parser
12:06 <simon``> on the other hand it should probably check if the move numbers appear in correct order
12:07 <ongy> I agree. But it would make sense to bundle those from an api side. So when the application calls "readPGN" (or whatever you call it) you get back something that's fully checked, but have a smaller parser (parsec?) and then some logic on the parsed structures
12:07 <cocreature> simon``: generally, I just do what’s easier in a particular case
12:07 butterthebuddha joined
12:07 <cocreature> and I agree with ongy, include those checks in the same API
12:07 freusque joined
12:08 rockfordal joined
12:09 <simon``> Ok, that makes sense
12:10 <simon``> I am using megaparsec, but separating the advanced logic from the parser but don't expose the distinction to the end user is probably a good idea
12:10 <SepakoRayl> ok here goes nothing, I have the following ast: http://lpaste.net/355723. Now I will most likely use the state monad to implement the renaming actions but I see myself writing multiple renameNodeType actions. I can write a typeclass but it feels a bit hackish. Is there a better approach or am I overthinking this? Just trying to pick up best approac
12:10 <SepakoRayl> hes for learning purposes.
12:12 gestone joined
12:13 Guest10 joined
12:13 Trendrrr joined
12:14 wroathe joined
12:15 cspollard joined
12:15 ErinvanderVeen joined
12:17 jgt joined
12:18 FjordPrefect joined
12:18 zeta joined
12:19 saussure joined
12:19 bjz joined
12:20 juanpaucar joined
12:20 connrs joined
12:21 <cocreature> SepakoRayl: what do you mean by multiple “renameNodeType” actions? one for each type?
12:21 <zeta> hi there! I'm looking for a ToJSON instance for Certificate (the one in X509). Unfortunately, it doesn't exist in Data.X509 and it cannot be derived automatically (there a representation choice to be made). Any pointers?
12:22 spion joined
12:23 jgt1 joined
12:24 sigmundv joined
12:24 systadmin joined
12:24 eliasr joined
12:24 Trendrrr joined
12:25 <Boomerang> zeta, why do you need a ToJSON instance for X509? Quickly looking into it, it looks like the standard way to serialize/deserialize x509 is by using ASN.1 which the Haskell x509 package seems to be providing an instance for (ASN1Object).
12:27 plutoniix joined
12:27 <zeta> Boomerang: i'm trying to do that because I want to ingest it in elasticsearch for full text search. I didn't try deriving json instance for ASN1Object though
12:28 <SepakoRayl> cocreature yes one for each type.
12:28 romank joined
12:29 <cocreature> just write separate functions. a typeclass does not really help you here
12:29 saussure joined
12:31 bjz_ joined
12:32 <SepakoRayl> mhm I guess it just looks a bit ugly so I was looking for alternatives, anyway I will get back to it, thanks
12:35 <cocreature> SepakoRayl: generally, when you’re thinking about creating a typeclass, think about whether you can write useful code that is polymorphic and uses this typeclass. for your example, I doubt that’s the case. you would just be using a typeclass to reuse the same identifier
12:35 Trendrrr joined
12:36 <SepakoRayl> That's the reason it felt hackish.
12:37 <SepakoRayl> yea ok I will jus go with multiple functions and I will tolerate the typed names
12:38 dddddd_ joined
12:41 CoderPuppy joined
12:43 romank joined
12:44 mrkgnao joined
12:44 e14 joined
12:45 shangxiao joined
12:46 dewzer joined
12:46 roconnor joined
12:47 ChaiTRex joined
12:49 wei2912 joined
12:51 connrs joined
12:51 ysangkok left
12:54 Trendrrr joined
12:55 <cspollard> I'm struggling with this idea about monad transformers
12:55 <cspollard> it seems like you should always be able to go from
12:55 <cspollard> t m a -> m (t Identity a)
12:55 wroathe joined
12:56 prophile joined
12:56 oisdk joined
12:56 <cspollard> does anyone know if this is already in a library?
12:56 saussure joined
12:56 <cspollard> it's almost like a MComonad a la MMonad from the mmorph library?
12:58 dm3 joined
12:58 <ertes> cspollard: try this: StateT s IO a -> IO (s -> (a, s))
12:59 CoderPuppy joined
13:00 torstein joined
13:00 <cspollard> ertes: you mean try creating such a function?
13:00 rickygee joined
13:01 jerbome_ joined
13:02 <hpc> i read that as "McMonad"
13:03 <* hpc> orders 3 happy/alex meals
13:03 kirelagin joined
13:03 <cspollard> hpc: :-D
13:03 <cspollard> hpc: or maybe :-O is more appropriate
13:04 <hpc> cspollard: btw i thiiiiiink the concept you're looking for is commutative monads
13:04 <hpc> but i could be wrong, you should try out the math yourself
13:05 jgt1 joined
13:05 freusque joined
13:05 sheaf joined
13:05 simendsjo joined
13:06 <cspollard> hpc: seems plausible, but I would want a monad trans t such that forall m I can "swap" t and m, right?
13:06 <cspollard> hpc: I guess t itself is not a monad
13:07 dni joined
13:07 <ertes> cspollard: yes
13:08 <ertes> i think it's a form of distributivity
13:08 <cspollard> ertes hpc: I am wondering if such a thing is already coded up in a library?
13:08 <cspollard> ertes hpc: it seems useful... yes some kind of distributivity indeed
13:09 zeta joined
13:09 Trendrrr joined
13:09 <ertes> if there were such a library, 'free' woud probably use it
13:09 <ertes> https://hackage.haskell.org/package/free-4.12.4/docs/Control-Monad-Trans-Free.html#v:joinFreeT
13:10 connrs joined
13:11 <cspollard> ertes: thanks will have a look
13:12 dm3 joined
13:14 <systadmin> Is there a way to convert a string to Integer or Float?
13:15 <exarkun> Do you mean is their either a way to convert a string to an Integer or a way to convert a string to a Float?
13:16 <exarkun> Or do you mean is there a way to convert a string to an Either Integer Float?
13:16 dewzer joined
13:16 FreeBirdLjj joined
13:17 tromp joined
13:17 <systadmin> Is there a way to convert a string to Integer
13:17 wroathe joined
13:17 bjz joined
13:18 <exarkun> One way you can find the answer to a question like that is to search Hoogle for the type signature that such a function would necessarily have
13:18 <exarkun> Hoogle: https://www.haskell.org/hoogle/
13:18 <exarkun> So, for example, try searching for Text -> Integer
13:18 romank joined
13:19 <systadmin> ok
13:20 sz0 joined
13:20 <exarkun> Since there are a bunch of different string types, you might want to try a few to see if you get interestingly different results (eg there might be a nice `String -> Integer` that you don't find if you only look for `Text -> Integer`, etc)
13:22 saussure joined
13:22 Tesseraction_h joined
13:22 buglebudabey joined
13:23 davr0s joined
13:24 juanpaucar joined
13:25 Trendrrr joined
13:25 felixsch_ joined
13:27 {emptyset} joined
13:29 saussure joined
13:31 coltfred joined
13:32 jgt1 joined
13:33 HoierM joined
13:33 sepp2k joined
13:34 HoierM joined
13:34 noan joined
13:35 pie_ joined
13:35 GamboPango joined
13:35 fizruk joined
13:35 HoierM joined
13:36 HoierM joined
13:38 aarvar joined
13:39 petervaro joined
13:40 Trendrrr joined
13:41 oisdk joined
13:41 gnu5 joined
13:43 e14 joined
13:43 fragamus joined
13:47 kritzcreek joined
13:50 osa1 joined
13:50 osa1 joined
13:50 dni joined
13:50 jhenligne joined
13:50 nschoe joined
13:52 e14 joined
13:52 gnu5 left
13:52 jgt1 joined
13:56 kau joined
13:58 neoo joined
13:58 wroathe joined
13:59 patbecich joined
14:00 ErinvanderVeen joined
14:00 <NextHendrix> is there any documentation anywhere for Data.Text.Format
14:00 zcourts joined
14:01 pie_ joined
14:01 bjz joined
14:01 neoo joined
14:02 MarioBranco joined
14:04 neoo joined
14:04 yrid joined
14:04 CoderPuppy joined
14:04 <sm> https://hackage.haskell.org/package/text-format/docs/Data-Text-Format.html
14:04 baldrick joined
14:06 neoo joined
14:06 Goplat joined
14:07 fotonzade joined
14:08 neoo joined
14:09 fragamus joined
14:09 kuribas joined
14:10 neoo joined
14:10 MarioBranco joined
14:10 <kuribas> I did a job test on hackerrank (out of curiosity, not interest). They masked a runtime error in the output. How would that ever be useful?
14:11 <kuribas> Alright, in real life you don't get test cases for free, but why no error message?
14:12 neoo joined
14:12 coltfred joined
14:12 MarioBranco joined
14:13 Bhootrk_ joined
14:15 agjacome joined
14:15 ErinvanderVeen joined
14:15 Trendrrr joined
14:16 buglebudabey joined
14:18 jmcarthur joined
14:19 xtreak joined
14:19 juanpaucar joined
14:20 SkyPatrol joined
14:21 sigmundv joined
14:22 <buglebudabey> i have to parse the following with aeson: https://en.wikipedia.org/w/api.php?action=query&titles=Albert%20Einstein&prop=links. Do I have to make a data type to parse the whole thing into even though i only care about the links?
14:25 selthas joined
14:26 Trendrrr joined
14:27 Guest10 joined
14:27 Guest10 joined
14:27 tromp joined
14:28 nilof joined
14:28 buglebudabey left
14:28 buglebudabey joined
14:31 saussure joined
14:32 codesoup joined
14:33 ChaiTRex joined
14:33 oisdk joined
14:34 <kuribas> Would copying code from an open source library be considered cheating in a contest?
14:34 <wilornel> what's a challenging task I could try to solve using haskell?
14:35 henrytill joined
14:35 <kuribas> something practical?
14:35 <wilornel> yeah that would also be nice
14:36 <wilornel> oh... Is that it? just something practical? haha
14:36 <buglebudabey> wilornel anything game related ive found to be a hurdle, but that's just me
14:37 <exarkun> kuribas: Different contests have different rules.
14:37 <kuribas> wilornel: I mean, other than an exercise from a haskell course, or from one the programming contest sites.
14:37 <lyxia> buglebudabey: you can just write a type with the fields you need
14:38 <kuribas> exarkun: well, they say no cheating or plagiarism, but it isn't well defined.
14:38 <exarkun> kuribas: Plagiarism is pretty well defined, I think. It's use of someone else's work _without citation_.
14:38 <buglebudabey> lyxia oh really, so if i parse json with just the fields 'links' and 'title' i could do that?
14:38 <exarkun> kuribas: But when in doubt, ask? I'm sure the contest organizers want to help the contestants participate fairly.
14:38 <kuribas> exarkun: So I'm fine if I cite the source of a datastructure?
14:39 <lyxia> buglebudabey: sure.
14:39 Trendrrr joined
14:39 <exarkun> kuribas: I don't see how that could be called plagiarism.
14:39 dddddd joined
14:40 wroathe joined
14:40 <kuribas> exarkun: And I suppose cheating means looking up the solution on google or letting someone else do the work.
14:40 <lyxia> past some level, these challenges are more about recognizing the right data structure to use rather than implementing it
14:41 <exarkun> kuribas: Could be. I think it depends on the contest.
14:41 <kuribas> lyxia: the last "expert" question involves a suffix tree. Creating one is a lot of work relatively...
14:42 Guest10 joined
14:42 Kreest_ joined
14:43 Noldorin joined
14:44 ctag joined
14:46 meck joined
14:48 baldrick joined
14:49 romank joined
14:52 romank joined
14:53 Xion_ joined
14:53 c4r50nz joined
14:55 jmcarthur joined
14:55 Trendrrr joined
14:55 rickygee joined
14:56 TheFuzzball joined
14:56 dm3 joined
14:56 dni joined
14:59 exferenceBot joined
14:59 cpennington joined
14:59 gugah joined
15:00 theelous3 joined
15:00 coot____ joined
15:01 wroathe joined
15:03 cyborg-one joined
15:11 begriffs joined
15:13 gmhafiz_ joined
15:16 jgt1 joined
15:18 johnw_ joined
15:19 CoolerX joined
15:19 koserge joined
15:19 <CoolerX> is there some way to create new domains from the primitives?
15:20 <CoolerX> newtype PositiveInt = Int x | x > 0
15:20 begriffs_ joined
15:20 <geekosaur> no
15:20 <adamCS> Hello! type-level-list question: If I have a type-level-list membership proof GADT, it's easy enough to turn that into an int indicating the list position of the element. Is it possible to go the other way? I'm trying to serialize and, the hard part, deserialize, these proofs. Here's a paste with things more explicit: http://lpaste.net/355728
15:21 <CoolerX> geekosaur, is there some fundamental reason thats not a feature?
15:22 patbecich joined
15:22 wroathe joined
15:22 ctag joined
15:24 <geekosaur> the type system doesn't support subtyping. specifically: it's a runtime condition, it cannot be checked at compile time
15:24 juanpaucar joined
15:24 <hpc> ^
15:24 <hpc> as soon as you have a type that captures a value being > 0, you need to track the property of being greater than zero for everything statically
15:25 <geekosaur> you can do it by carrying around type level proofs like agda and idris, but that gets painful _fast_
15:25 <hpc> usually in those languages you take a more constructive path and design the type such that it only expresses the properties you want
15:25 <hpc> consider data Nat = Z | S Nat
15:26 <maerwald> geekosaur: why
15:26 kerbyu joined
15:28 johnw__ joined
15:30 Trendrrr joined
15:32 <lyxia> adamCS: the problem here fromInt :: Int -> TypeListElem xs x is that x and xs can be instantiated arbitrarily at the call site.
15:32 teggi joined
15:33 <lyxia> adamCS: you must hide them with an existential type
15:33 <EvanR> CoolerX: you can use Numeric.Natural though
15:33 <EvanR> or Word instead of Int
15:33 robotroll joined
15:33 <adamCS> lyxia: Yes. I kind of get that. But I'm not really clear how.
15:34 Cassiopaya joined
15:34 <EvanR> maerwald: intuitive facts of number theory may not have a convenient proof that you can churn out before lunch
15:34 <adamCS> lyxia: I can tell from the errors that I'm not constraining x and xs enough somehow. But at that point I'm stuck.
15:34 <EvanR> especially in haskell
15:35 <maerwald> EvanR: well sure, but that's just the learning curve with proof assistants
15:35 jerbome_ joined
15:35 saussure joined
15:35 <maerwald> it sounded like he's saying it doesn't scale or something
15:35 FreeBirdLjj joined
15:35 <EvanR> doing it in haskell surely is more painful than even that
15:35 ccomb joined
15:36 <EvanR> also i havent seen too much interest in treating Int that way
15:37 <EvanR> unless we go liquid haskell
15:37 crobbins joined
15:38 <EvanR> CoolerX: see also liquid haskell
15:38 Cerise joined
15:38 Cerise joined
15:39 <lyxia> adamCS: you will also need to represent the length of the list in case your index goes out of bounds. I added some types you can use for this. http://lpaste.net/355728#a355729
15:39 Mon_Ouie joined
15:39 <maerwald> EvanR: sure, but he was talking about Agda, Idris and so on where this is part of the language/compiler
15:40 <EvanR> i assumed we were talking about attempting to be like agda within haskell, given the context
15:40 begriffs joined
15:40 Trendrrr joined
15:41 bigos joined
15:41 ons joined
15:42 <maerwald> EvanR: I agree that's a rather awkward attempt
15:42 <adamCS> lyxia: Thanks! I will fiddle from there and see where I can get. Why does that hiding help? I would sort-of understand if the existential's constructor also had some constraint that enforced the membership of x in xs but in this case all it does is hide it. I'm confused.
15:43 wroathe joined
15:43 <EvanR> i still believe in the prospects of a general program of doing everything within something like agda, proving everything, and outputting the real code in haskell, ocaml, C
15:43 <maerwald> EvanR: it would be better to output it in C so you can also try to prove performance properties on it
15:43 <EvanR> because i havent seen enough to make me think thats unfeasible
15:44 <maerwald> that's what the fstar project mitls tries to do
15:44 <EvanR> yes im writing a lot of C code at work these days, for arduinos, i feel like i could prove its right
15:44 <EvanR> i feel silly writing the C code directly
15:44 <adamCS> lyxia: Ah. I get it. Now the function decides x, not the caller.
15:45 <adamCS> lyxia: Thanks!
15:45 rcat joined
15:45 ErinvanderVeen joined
15:45 dm3 joined
15:45 urodna joined
15:46 jerbome_ joined
15:46 <CoolerX> EvanR, why is liquid haskell not standard?
15:46 <EvanR> its a different language
15:46 juanpaucar joined
15:47 <CoolerX> why not make it part of haskell?
15:47 <EvanR> as cool and simple as basic haskells type system, this is just the beginning of a huge universe of things to try
15:47 dewzer joined
15:48 <EvanR> CoolerX: honestly i dont know liquid haskell so couldnt tell you the prospects of making extensions in ghc for it
15:48 <CoolerX> is it slower at runtime?
15:49 aarvar joined
15:49 <CoolerX> all the book keeping is done at compile time right?
15:49 <EvanR> the idea is to check bounds at compile time
15:49 <EvanR> not what else it can check
15:50 <EvanR> the more you check at compile time, the less you have to check at runtime, even for detecting fatal errors
15:50 alx741 joined
15:50 Cerise joined
15:51 Cerise joined
15:51 <* EvanR> looks at stack of papers consisting of a billion languages to check a billion different things at compile time
15:53 Trendrrr joined
15:53 yamad joined
15:56 wroathe joined
15:57 <CoolerX> EvanR, doesn't liquid haskell check arbitrary predicates at compile time?
15:57 <CoolerX> seems like that would be enough to check everything
15:57 <EvanR> no
15:58 <EvanR> not arbitrary
15:58 <EvanR> you have to be able to express it in their language
15:58 tommd joined
15:59 TheFuzzball joined
16:02 <CoolerX> EvanR, anyway why do we use haskell instead of liquid haskell?
16:02 mmn80 joined
16:02 <maerwald> CoolerX: it's not "instead"
16:02 dewzer joined
16:02 <davean> CoolerX: They're not or
16:02 <maerwald> liquidhaskell is an extension
16:02 <geekosaur> because liquid haskell is experimental and known to be buggy and unstable
16:03 <EvanR> gaseous haskell must be really bad then
16:03 dddddd joined
16:03 <EvanR> supercritical haskell
16:03 buglebudabey joined
16:04 darlan joined
16:04 <bjs> plasma haskell
16:06 caumeslasal joined
16:06 sigmundv joined
16:07 conal joined
16:07 sleffy joined
16:08 <CoolerX> bjs, is that the haskell used to program particle accelerators?
16:08 <bjs> CoolerX: whatever it is it's the hottest language around
16:09 moth joined
16:10 descender joined
16:11 jhenligne joined
16:11 cpennington joined
16:12 whaletechno joined
16:12 oisdk joined
16:15 ErinvanderVeen joined
16:17 yogsototh1 joined
16:20 SpinTensor joined
16:20 HoierM joined
16:21 grayjoc joined
16:21 wedens joined
16:22 romank joined
16:22 moongazer joined
16:23 dfeuer joined
16:24 mohsen_ joined
16:24 <maerwald> HDD :P (aka hype-driven development)
16:25 ambrosia joined
16:26 dewzer joined
16:27 Kuros` joined
16:28 Wuzzy joined
16:28 tsmish joined
16:29 saussure joined
16:31 FreeBirdLjj joined
16:32 Yuras joined
16:32 patbecich joined
16:33 ixxie joined
16:35 romank joined
16:35 barak joined
16:37 Trendrrr joined
16:37 izabera joined
16:38 romank joined
16:38 <izabera> WHY DOES EVERYTHING TAKE A PETABYTE OF RAM TO COMPILE
16:38 tzh joined
16:38 <ab9rf> dpm
16:38 <ab9rf> doesn't everyone have a petabyte of ram?
16:39 <izabera> my laptop doesn't
16:39 crobbins joined
16:39 <ab9rf> get a new one
16:39 <ab9rf> honestly, i have no idea what you're talking about
16:39 <hpc> 640 petabytes of ram should be enough for anyone
16:39 <ab9rf> i have 8 GB and can compile most things with no trouble
16:39 <hpc> i compiled ghc on a box with 1G of ram
16:40 <hpc> (6.12-ish or early 7)
16:40 raynold joined
16:40 <hpc> ((it was a while ago))
16:40 <izabera> how long did it take?
16:40 <izabera> a few hours?
16:41 crobbins joined
16:42 ziocroc joined
16:43 <ab9rf> i've never actually attempted to compile ghc
16:43 <ab9rf> never had a good reason to do so
16:43 jutaro joined
16:44 yogsototh_ left
16:44 <hpc> ab9rf: i was under the influence of being a young(er) idiot and decided that was the easiest path to upgrading ghc on an ubuntu box
16:44 prkc joined
16:45 <hpc> i have since learned the error of my ways and run fedora on slightly less embarassing hardware with stack
16:45 <ab9rf> heh
16:45 tommd joined
16:45 justanotheruser joined
16:45 <hpc> it's a decent exercise once in a while though
16:45 isBEKaml joined
16:45 <hpc> just compile the bleedingest-edge ghc you can and try out whatever the newest thing is
16:46 dni joined
16:46 <hpc> packaging be damned
16:46 <hpc> izabera: i just started it in a new tab in screen and went back to irc
16:46 <hpc> izabera: at the end of the day it was done and working
16:47 tomphp_ joined
16:48 <izabera> literally "at the end of the day"
16:48 yellowj joined
16:48 <hpc> it could have been 6 hours or 15 minutes :P
16:49 Trendrrr joined
16:50 <hpc> oh, i converted a coworker to haskell this week
16:51 <hpc> he read through LYAH up to the Functor chapter (didn't write any haskell code though)
16:51 <hpc> then went to read some perfectly idiomatic python and it all looked terrible and noncomposable
16:51 <* hpc> was so proud
16:52 <EvanR> watch out now http://mypy-lang.org/
16:52 <StoneToad> lol hpc
16:52 <hpc> i think i have read that PEP
16:52 <hpc> it's pretty crap
16:53 <hpc> an optional extension that enables optional type checking that doesn't have a supported implementation
16:54 <EvanR> gradual typing
16:55 <EvanR> very gradual
16:55 <EvanR> "use static types where it makes sense, otherwise dont"
16:55 <hpc> and then it never makes sense because the lower-level functions aren't written with types in mind
16:56 <hpc> it's right up there with "evenually consistent" in terms of lying buzzwords
16:56 mizu_no_oto joined
16:56 saussure joined
16:57 jordan4444 joined
16:58 geekg_000_ joined
16:58 <maerwald> EvanR: mypy is awesome, but in practice has a lot of shortcomings
16:59 crobbins joined
16:59 gugah joined
16:59 Welkin joined
16:59 <maerwald> you can't really trust it
16:59 gestone joined
16:59 <EvanR> i dont have much experience with type systems on top of dynamic types that dont really work
17:00 <Welkin> flow?
17:00 Lazersmoke joined
17:00 crobbins_ joined
17:00 <Welkin> the concept of "optional" or "gradual" typing is completely stupid
17:00 <hpc> EvanR: look at typescript
17:00 <Welkin> either use types or don't
17:00 jordan4444 joined
17:00 <maerwald> it isn't
17:00 <EvanR> heard of it
17:00 <Welkin> typescript sucks though
17:00 <hpc> it's basically javascript with ADTs-ish
17:00 <Welkin> it's extremely OOP
17:01 <hpc> yeah
17:01 <maerwald> the idea behind it is that you start with a prototype, that's easier with dynamic types
17:01 <Welkin> the way I write javasccript it more like scheme than anything else
17:01 <maerwald> and then gradually "harden" your codebase
17:01 <hpc> EvanR: the other one i would suggest is puppet, if you can go for domain-specific languages
17:02 <hpc> EvanR: it has optional type annotations that take effect dynamically
17:02 <hpc> but it tends to work out very close to static types because the language is pure
17:02 <EvanR> oh nice
17:02 <Welkin> I've played with flow, and it's a crappy solution
17:02 <Welkin> just use purescript if you want types
17:02 <Lazersmoke> optional typing allows you to introduce some safety into an unsafe environment without investing too much effort into rewriting your code
17:02 <Lazersmoke> it's not meant to be a full typing solution
17:02 <hpc> no effects happen until all the pure code finishes evaluating
17:02 <hpc> which means you traverse typechecking before effects always
17:02 <EvanR> thats pretty awesome
17:02 <jordan4444> http://lpaste.net/355733
17:03 <hpc> yeah, i wasn't expecting to like it as much as i do now
17:03 <jordan4444> can anyone help me finish the function at the bottom?
17:03 geekg_000 joined
17:03 Trendrrr joined
17:03 <hpc> if you've ever used nix, puppet is better ;)
17:03 <EvanR> hpc: i can see that working out for dynamic language X
17:03 <jordan4444> i have a tree data structure and i wanna count and return the amount of leaves
17:03 <EvanR> if it doesnt need TH-like effects prior to being "ready"
17:03 <EvanR> which ruby does ... a lot...
17:04 <EvanR> but honestly doesnt need to
17:04 juanpaucar joined
17:04 <hpc> it soooooooort of does, but that preprocessing is required to be effectively pure as well
17:05 <hpc> or the puppet community labels you a bad person who should feel bad
17:05 hybrid joined
17:05 <hpc> also that preprocessing happens on the server instead of the client
17:05 <Lazersmoke> jordan4444: you should make Noten a type parameter and derive foldable/traversable/functor/whatever
17:05 <hpc> so if you misbehave you get mutations on /multiple/ systems instead of just one
17:05 dan_f joined
17:05 <EvanR> i am becoming persuaded
17:05 <Welkin> hpc: this puppet? https://en.wikipedia.org/wiki/Puppet_(software)
17:05 <hpc> yep
17:06 <Welkin> why not nixos?
17:06 bollu joined
17:06 <Lazersmoke> jordan4444: or you can just use `Data.Tree.Tree Noten`, I think it is isomorphic to Baum
17:06 <hpc> i tried it, i literally could not figure out the chain of effects that leads to a file being dropped in /etc
17:06 <hpc> it was the first thing i installed on my current hardware
17:07 <hpc> got it very close to configured how i want after a solid week or so
17:07 bollu joined
17:07 <hpc> then hit a massive roadblock i couldn't understand, switched to fedora and was configured within the day
17:08 <hpc> nixos is a weird sort of language where everything is building up to expressing a single json-like data structure
17:08 <hpc> and then a msterious /something/ traverses it to do things to your system
17:08 <hpc> but i could never find any specifics on what that traversal was
17:08 <jordan4444> Lazersmoke im not sure what to do with that
17:09 <jordan4444> im not that advanced in haskell
17:09 <hpc> jordan4444: start with naming the parameter to the function
17:09 <hpc> anzahlStueckeMelodien tree = undefined
17:09 <hpc> jordan4444: then pattern match on it - the type Entwuerfe has only one constructor so use that
17:10 anodium joined
17:10 <hpc> anzahlStueckeMelodien (Entwuerfe left right n) = undefined
17:10 <jordan4444> anzahlStueckeMelodien mbaum = sum(mbaum Noten)
17:10 <jordan4444> noten is not in scope
17:10 Trendrrr joined
17:10 <Welkin> why is your program in german?
17:10 <jordan4444> because i am german
17:10 <hpc> Noten is defined at the top level, and you're using it at the value level
17:10 <hpc> two separate namespaces
17:11 <EvanR> ünicode var names ftw
17:11 <jordan4444> undefined functions dont do anything right
17:12 <Welkin> that's not completely true
17:12 <Lokathor> jordan4444, well, they crash your program if you evaluate them
17:12 dewzer joined
17:12 <Welkin> you cannot start a variable name with anything other than a lowercase ascii letter
17:12 <EvanR> bollocks
17:12 <bollu> cocreature: ping? I need help with build errors
17:12 <hpc> doesn't have to be ascii
17:12 <hpc> it has to be "lower case" and it has to be a "letter"
17:13 <Welkin> > let 你好 = "Hello" in 你好
17:13 <lambdabot> "Hello"
17:13 <Welkin> wtf??
17:13 darjeeli1 joined
17:13 <EvanR> ok good
17:13 <Welkin> since when
17:13 <Welkin> last time I tried that it failed
17:13 <hpc> according to whatever combination of unicode specifications and report-specific stuff haskell uses
17:13 <bollu> I'm having trouble building LLVM-hs. Can I please have some help? https://github.com/llvm-hs/llvm-hs/issues/107
17:13 <Lokathor> > let ĉĵĥ x = undefined in ĉĵĥ 7
17:13 <lambdabot> *Exception: Prelude.undefined
17:13 <Welkin> did this change recetly?
17:13 <Welkin> recently*
17:13 <hpc> iirc the only haskell-specific quirk is that the character ':' is an upper-case symbol and all other symbols are lower-case
17:13 <LKoen> > let ñ = 3 in ñ
17:13 Gurkenglas joined
17:13 <lambdabot> 3
17:14 <LKoen> > let ø = 3 in ø
17:14 <lambdabot> 3
17:14 <jordan4444> anzahlStueckeMelodien (Entwuerfe mbaum bbaum n) = sum(mbaum Noten)
17:14 <jordan4444> i need to replace noten with something
17:14 <jordan4444> because its not a type constructor
17:14 <hpc> Welkin: i am not aware of it ever working that way (at least as far as being halfway between unicode-anywhere and unicode-nowhere)
17:14 ilyaigpetrov joined
17:14 saussure joined
17:14 <Welkin> there might be another case that I'm not considering then where it doesn't work
17:15 <jordan4444> im not even sure if i need sum to count all of the leafes
17:15 <Welkin> I know it failed on something like that last time I tried (about 8 months or so ago)
17:15 kadoban joined
17:15 <Welkin> I don't write my programs in chinese very often, so it doesn't come up
17:16 guest918 joined
17:16 <hpc> i write all of my programs in wingdings
17:16 <jordan4444> lol
17:17 <Welkin> jordan4444: your function name looks like "anal stuck" something to me
17:17 <jordan4444> : /
17:17 netheranthem joined
17:17 <jordan4444> am i even on the right track
17:17 eklavya joined
17:17 <jordan4444> anzahlStueckeMelodien (Entwuerfe mbaum bbaum n) = sum(mbaum Noten)
17:17 <jordan4444> "Not in scope: data constructor ‘Noten’"
17:17 <jordan4444> http://lpaste.net/355733
17:18 <Welkin> Noten is not a data constructor
17:18 <Welkin> it is a type alias in your example
17:18 <hpc> jordan4444: decompose the problem a bit
17:18 <hpc> jordan4444: write a function of type Baum :: Int first
17:18 <guest918> hey guys
17:19 sellout- joined
17:19 <guest918> am new around here
17:19 drewbert joined
17:19 <monochrom> hpc: ::? ->?
17:19 baldrick joined
17:19 <hpc> ...
17:19 <hpc> Baum -> Int
17:19 <jordan4444> which baum?
17:19 <monochrom> :)
17:19 <* hpc> dies of embarassment
17:19 sellout- joined
17:20 oisdk joined
17:20 <monochrom> Well this code does infect value-type-confusionitis to everyone who reads it :)
17:20 <guest918> um any of you guys code in python
17:20 rickygee joined
17:20 <maerwald> yes, but how is that relevant?
17:20 <Welkin> guest918: before I found the salvation of haskell, I once did
17:20 SeMas joined
17:20 <monochrom> I think I wrote 10 lines of python, ever.
17:21 <hpc> asp is the best snake-oriented programming language
17:21 <EvanR> i had a slime world clone in pygame once
17:21 <albystein> nice well am a python coder
17:21 <jordan4444> i have way more experience with python too
17:21 <Welkin> hpc: active server pages?
17:21 <Welkin> lol
17:21 <jordan4444> haskell is just frustrating
17:21 <albystein> thats cool
17:21 <Welkin> jordan4444: it gets easier once you understand how it works
17:22 <hpc> Welkin: https://duckduckgo.com/Asp_(reptile)?ia=web
17:22 <Welkin> there are two namespaces
17:22 <Welkin> values-level, and type-level
17:22 <albystein> um I wanted to ask has any one ever installed python kivy on kali linux
17:22 <Welkin> albystein: go ask in #python or #linux or something
17:23 <monochrom> haha hpc about asp
17:23 <jordan4444> http://lpaste.net/355733
17:23 <jordan4444> im just starring at my code and the compiler keeps making me feel bad
17:23 Trendrrr joined
17:24 <jordan4444> i thought haskell is so simple and powerful, why cant there be a one line solution? i just wanna count the amount of something
17:24 mfukar joined
17:25 <Welkin> jordan4444: just keep working until you get to the point where you can write all the types for your program, then fill in the definitions, and it runs perfectly the first time without any errors
17:25 <Welkin> jordan4444: in haskell, always write your types first
17:25 saussure joined
17:25 <Welkin> it is half of the language
17:25 <jordan4444> the types are working
17:25 <hpc> Welkin: he already has the types, there's just a bit of a hangup on separating type-level and value-level
17:25 <jordan4444> its just the last line that is undefined
17:25 <monochrom> Your Entwuerfe is a very complicated type.
17:25 <c_wraith> One thing I learned when writing a large project in Haskell for the first time - no language lets you get away with less complexity than is present in the problem specification.
17:25 <hpc> and how to actually consume the types he wrote
17:26 <jordan4444> ^
17:26 <EvanR> c_wraith: unless the problem happens to have been solved in the stdlib specifically for you
17:26 <kuribas> c_wraith: and if you problem involves mutable algorithms?
17:27 <kuribas> EvanR: are any lib
17:27 <Welkin> kuribas: use ST
17:27 <Welkin> or inline-c
17:27 <monochrom> But what you need to learn now is pattern matching.
17:27 epsilonhalbe joined
17:27 teurastaja joined
17:27 <EvanR> kuribas: we just need the count number of something lib
17:28 tromp joined
17:28 <Welkin> the simplest way to count the number of items in some kind of data structure is to fold over it, construct a new list, and get the length
17:28 <kuribas> EvanR: erm I meant if it's implemented in a lib on hackage...
17:28 albertus1 joined
17:29 <Welkin> or you could just (+1) a starting value of 0 instead of making the list
17:30 <Welkin> I'd say those are equally simple
17:31 <Lazersmoke> jordan4444: you should either a) write a mono-traversable instance for your tree, b) write/derive a traverseable/foldable instance for your tree by moving Noten to a type parameter, or c) use a built in type that represents your tree better
17:31 Trendrrr joined
17:31 <Lazersmoke> you should be able to do like `sum . (1 <$)` or something
17:31 saep joined
17:31 <Lazersmoke> there might even be a `count :: Foldable t => t a -> Int` or something
17:31 eHammarstrom joined
17:32 TheFuzzball joined
17:32 <Welkin> it's too simple for there to be on already
17:32 gestone joined
17:33 guest918 joined
17:34 segmond joined
17:35 patbecich joined
17:36 <guest918> guys am finding it had to join #linux
17:36 <guest918> there is something about registering
17:37 <EvanR> ask #freenode
17:37 <monochrom> http://chrisdone.com/posts/teaching
17:37 bmm joined
17:37 <guest918> EvanR: okay
17:38 <guest918> join /freenode
17:38 codesoup joined
17:38 Trendrrr joined
17:39 erisco joined
17:40 systemfault joined
17:40 jgt1 joined
17:41 meba joined
17:41 <guest918> any python coders around
17:41 mmmooot joined
17:41 Destol joined
17:41 thunderrd joined
17:42 CoolerX left
17:42 <hpc> ask #python
17:42 <cocreature> bollu: pong
17:43 <mmmooot> What is the purpose of 'newtype'? Performance?
17:43 esph joined
17:43 <erisco> mmmooot, sometimes, and other times to select type class instances
17:44 <mmmooot> erisco: what do you mean by that?
17:44 saussure joined
17:44 <erisco> per class there is at most one instance per type
17:44 <cocreature> you could use data for that as well
17:44 romank joined
17:44 <erisco> so by using newtypes you can define more instances for a base type
17:45 <cocreature> one advantage of newtype over data is that you can reuse instances from the base type via GeneralizedNewtypeDeriving
17:45 <erisco> you can use data but it might change semantics due to bottom
17:46 Trendrrr joined
17:46 jao joined
17:47 jerbome_ joined
17:49 <athan> Does anyone here know of an asynchronous testing library? Where "success" is determined by invoking some IO action, and the test case itself blocks until all registered "success" calls are invoked or something?
17:50 <EvanR> monochrom: the post seems tojust end, was there a follow up?
17:50 <athan> like cont-style Hspec
17:51 oisdk joined
17:53 saussure joined
17:57 dewzer joined
17:57 <Welkin> hello athan
17:59 Wizek_ joined
18:01 romank joined
18:03 takle joined
18:03 RouxTheDay joined
18:05 sellout- joined
18:05 ian-mi joined
18:05 moop left
18:08 vlatkoB joined
18:08 sigmundv joined
18:08 <athan> Hey Welkin, how've you been?
18:08 guest918 joined
18:08 juanpaucar joined
18:09 guest918 joined
18:10 Frans-Willem joined
18:11 <bollu> cocreature: I'm back
18:11 <cocreature> bollu: I left a comment on the github issue
18:11 <bollu> I see
18:11 saussure joined
18:11 <bollu> oh, that one. Yeah, I read your response
18:12 <bollu> I'll try to upgrade to the latest version of the package and GHC and get back to you
18:12 <bollu> does stack support the latest GHC?
18:14 Trendrrr joined
18:15 fizruk joined
18:15 Discovery joined
18:15 dan_f joined
18:16 <bollu> cocreature: I left a comment with extra info
18:16 <bollu> cocreature: I wonder if it is because the system also has clang?
18:17 cpennington joined
18:18 tomphp joined
18:18 <cocreature> bollu: the newest stackage lts comes with ghc 8.0.2 so you should be able to just bump your stackage snapshot
18:18 <cocreature> we definitely had people successfully building llvm-hs on os x so the fact that it has clang doesn’t seem to always be problematic
18:18 bmm joined
18:19 <bollu> I see, interesting
18:19 <bollu> cocreature: did you take a look at my comment?
18:19 Ranhir joined
18:20 connrs joined
18:22 Trendrrr joined
18:22 neoo joined
18:24 neoo joined
18:24 tomphp joined
18:26 yellowj joined
18:26 darjeeli1 joined
18:26 neoo joined
18:26 Kuros` joined
18:28 nosefouratyou joined
18:29 neoo joined
18:29 dewzer joined
18:29 nomotif joined
18:30 <bollu> cocreature: which flag are you referring to, exactly?
18:30 neoo joined
18:30 stefann joined
18:31 saussure joined
18:32 <stefann> @pl \f a b c -> f (a, b, c)
18:32 <lambdabot> (. (,,)) . (.) . (.)
18:32 <erisco> :t curry3
18:32 <lambdabot> error:
18:32 <lambdabot> • Variable not in scope: curry3
18:32 <lambdabot> • Perhaps you meant ‘curry’ (imported from Data.Tuple)
18:33 neoo joined
18:33 Trendrrr joined
18:34 neoo joined
18:35 fresheyeball joined
18:35 drewbert joined
18:35 <fresheyeball> hello sunday haskellers
18:36 <fresheyeball> I'm playing with singletons and hitting an error of much strangeness
18:36 <Tuplanolla> Singletons working as intended.
18:36 <erisco> that could be any singletons error
18:36 <fresheyeball> Tuplanolla: haha
18:36 <cocreature> bollu: there is a cabal flag called `shared-llvm` in llvm-hs. set that to true
18:36 <fresheyeball> http://lpaste.net/355736
18:37 <bollu> cocreature: I see, lemme try that
18:37 <fresheyeball> http://lpaste.net/355737
18:37 <fresheyeball> I just don't see how such a simple one is failing
18:37 <fresheyeball> I would prefer not to introduce UndecidableInstances
18:38 <bollu> cocreature: uh, does that mean that I need to build llvm-hs from source?
18:39 <cocreature> bollu: given that “building from source” is pretty much how we all get our Haskell packages, sure. but you can just specify the flag in your stack.yaml and stack will build it for you
18:39 sternmull joined
18:39 <bollu> cocreature: I mean, how do I specify this option through the stack interface?
18:39 <bollu> cocreature: but build from source, I meant build it separately and then point stack to it :)
18:39 <lyxia> I think UndecidableInstances is a prerequisite of type-level programming like singleton...
18:40 <cocreature> bollu: read the manual :P https://docs.haskellstack.org/en/stable/yaml_configuration/#flags
18:40 <fresheyeball> grr
18:40 <hpc> UndecidableInstances effectively makes the class constraint system turing complete (with a stack limit)
18:40 <hpc> which... certainly gives you type-level programming :P
18:40 <fresheyeball> I thought adding derving to the quasi-quote would get rid of this eror
18:40 <fresheyeball> but I was wrong!
18:41 <fresheyeball> No instance for (Eq (Sing AreaName)
18:41 <bollu> cocreature: ah, thanks xD
18:41 Wizek joined
18:41 Wizek_ joined
18:41 tommd joined
18:42 takle joined
18:43 <fresheyeball> so how can I get a show instance for my Sing?
18:44 <lyxia> fresheyeball: it's pretty benign though, in the sense that at worst it makes GHC loop infinitely, and there are also safeguards against that. UndecidableInstances is not as yucky as IncoherentInstances.
18:44 tomphp joined
18:44 <bollu> cocreature: WTF, that worked
18:44 <bollu> cocreature: sorcery?
18:44 <bollu> cocreature: I don't get it, the default is "true"
18:44 <lyxia> fresheyeball: why do you want to show a Sing
18:45 <bollu> so why did I have to explicitly set it?
18:45 <fresheyeball> lyxia: I have a type that contains a sing
18:45 <fresheyeball> and I'd like to log it
18:45 Trendrrr joined
18:45 <lyxia> can't you convert that sing to an AreaName first
18:45 <cocreature> bollu: because stack thinks it’s a good idea to ignore default values and just always default all flags to false.
18:46 <bollu> cocreature: ..seriously?
18:46 <bollu> uh, stack devs, rationale?
18:46 drewbert joined
18:46 <cocreature> I guess I should just flip the way the flag works but that kind of sucks
18:46 <cocreature> bollu: maybe we even have a fix for that in 4.1
18:46 <bollu> cocreature: do tell?
18:47 <cocreature> trevor added something related to this but I don’t remember if it works for stack as well
18:47 <lyxia> fresheyeball: what happens if you try deriving instance Show (Sing AreaName)
18:47 <bollu> cocreature: BTW, is there any help needed with llvm-hs? huge thanks for maintaining this
18:48 <cocreature> bollu: I think https://github.com/llvm-hs/llvm-hs/commit/e39ec6862c950a22320b928ffdbf0f71bf38edf7 has fixed this. it would be great if you could test if this works for you (it’s included in 4.1.0
18:48 <cocreature> )
18:48 oleks joined
18:48 <bollu> cocreature: testing
18:50 <mmmooot> Is there something like 'partition' but which splits a list into N lists instead of just 2?
18:50 connrs joined
18:50 <kadoban> Based on a classifying function?
18:51 flatmap13 joined
18:51 <EvanR> :t groupBy
18:51 <lambdabot> (a -> a -> Bool) -> [a] -> [[a]]
18:52 <kadoban> I don't think so, at least I'd be interested if it exists. You can build it fairy easily using a Data.Array.Array of lists for instance, but not one I know exists. Yeah, you can do it based on sortBy and groupBy
18:52 jerbome_ joined
18:52 <Fairy> I'm not a building block!
18:52 Trendrrr joined
18:52 <kadoban> xD
18:53 <Tuplanolla> That would be `(Traversable f, Ord a) => f a -> Map a (f a)` or something.
18:53 kritzcreek joined
18:53 <hanna> Hmm; what kind of data structure would be suited to storing a “map” of a configuration space? For example let's say I have IDs ranging from 0 to 1,000,000; and for every ID I would like to store a value (e.g. `data State = Present | Missing | Error | InProgress` or whatever). The catch is that since I'm pretty sure the majority of these values are going to be the same (either Present or Missing, in
18:53 <hanna> contiguous chunks) I'd like to have my data structure optimize for the common case of “merging” contiguous values - e.g. if IDs 0 through 200,000 are all marked “Present”, then it would only store `(0, 200000) Present` or some equivalent thereof. I'd like at most O(log n) access to any ID, and efficient append (ideally, adding 100 entries in a row should be close to O(1) amortized), so some sort of
18:53 <hanna> tree-like (finger tree?) structure seems ideal.
18:54 <Xion_> Quad tree?
18:54 <Xion_> Or any similar 2D partitioning tree.
18:54 rickygee joined
18:54 <hanna> But I don't want to implement the meat of this data structure, including balancing etc., myself - so I'm thinking about using some sort of pre-existing tree-like structure to do the heavy lifting; but I don't know if any of the existing generic tree containers are flexible enough to support my use case
18:55 <kadoban> It's more 1D though. Sounds a bit like a fenwick tree almost?
18:57 <bollu> cocreature: yep, looks like it works.
18:57 <bollu> cocreature: I think the API changes in 4.0.1?
18:57 <bollu> cocreature: I need to fix my code now :P
18:57 <cocreature> bollu: yep
18:57 <bollu> 4.1.0*
18:58 meoblast001 joined
18:58 <cocreature> bollu: but it changes for the better :)
18:58 <bollu> cocreature: I'm sure :)
18:58 saussure joined
18:58 <bollu> cocreature: going back to what I asked: how can I help?
18:58 <hanna> The data type I was looking at was Data.Sequence; which would allow efficient append (a very common operation) - at most I'd have to make my custom “append” operation uncons first and check to see if it can be “merged” with the value next to it; and I could probably make use of findIndexR to allow inserting at arbitrary positions
18:59 <hanna> It seems like that would meet my requirements without requiring me to do too much
18:59 <hanna> Just wondering if there's a better data structure ready-made for my use case
19:00 <cocreature> bollu: adding support for missing features or even just figuring out what’s missing and opening issues for that is always great. someone asked for support for LLVM’s metadata instructions a few days ago, so implementing that would be great
19:00 Trendrrr joined
19:00 twomix joined
19:01 squisher joined
19:01 squisher joined
19:02 <kadoban> hanna: Can't think of anything built-in.
19:03 <kadoban> Fenwick tree I mentioned above wouldn't be good. I think a kind of modified segment tree would work and be fairly efficient both in space and time.
19:04 mada joined
19:05 <bollu> cocreature: cool, sure thing
19:05 JScully joined
19:05 <cocreature> bollu: if you start working on something that takes more than an evening it’s probably a good idea to open an issue first to avoid accidentally duplicated work in case someone else is also working on it
19:06 wroathe joined
19:06 <bollu> cocreature: I see, very well
19:06 connrs joined
19:06 <bollu> cocreature: I may want to do weird things with LLVM that fit no one's agenda :P eg. try to expose things to Polly
19:06 MrWoohoo joined
19:07 tommd joined
19:07 <bollu> cocreature: but yes, I'll ping github / you
19:07 Trendrrr joined
19:07 <JScully> hi there
19:07 <JScully> i have a question about sign extending a nibble so that i can get a byte
19:07 <mmmooot> is there a simple way to compare constructors of two values of the same type, disregarding the constructor parameters and not pattern matching on every constructor?
19:07 <JScully> i learned that i have to fill it with the most significat bit
19:08 <JScully> so 0101 as a nibble is going to be 0000101 and 1101 as a nibble is going to be 11111101, is this correct? cant be, right?
19:08 spacecadetbrown joined
19:08 marr joined
19:08 <lyxia> it is correct
19:09 <JScully> i dont understand that
19:09 <monochrom> One of two correct ways anyway :)
19:09 <kadoban> JScully: Could be. That's what you'd do if they were signed values in the usual twos-complement way.
19:09 <JScully> 11111101 is not the same as 1101 :|
19:09 <kadoban> JScully: In one encoding it is, namely twos-complement.
19:10 <cocreature> bollu: as long as we manage to let you or anyone else do weird things without making life worse for the ones that don’t, I’m all for it :)
19:10 <monochrom> You are not going to look for sameness. You are going to look for "why need more bits, what's the purpose" and act accordingly.
19:10 chaosmasttter joined
19:10 <lyxia> mmmooot: http://stackoverflow.com/questions/43944044/checking-that-two-values-have-the-same-head-constructor?s=7%7C0.0000
19:10 <monochrom> http://www.vex.net/~trebla/humour/tautologies.html #5
19:10 <JScully> what i want to do is multiply two nibbles
19:11 <mmmooot> as thanks monochrom
19:11 sepp2k1 joined
19:11 <JScully> the function that makes the calculation expects bytes
19:11 <JScully> so i have to fill them
19:11 <JScully> https://pastebin.com/NNwpfYRY
19:11 <monochrom> OK, what does 1101 stand for? Does it stand for 13 or does it stand for -3 ?
19:11 hybrid joined
19:11 gestone joined
19:11 <JScully> thats what i did for creating the byte
19:11 <JScully> hm how do i know :D
19:12 Gloomy joined
19:12 <monochrom> That's the problem.
19:12 <JScully> i dont get it
19:12 <monochrom> If you want 1101 to stand for 13, the correct extension is 00001101. If you want 1101 to stand for -3, the correct extension is 11111101.
19:12 juanpaucar joined
19:13 <JScully> but 11111101 is 253
19:13 <monochrom> Oh is it? Or is it -3?
19:13 <kadoban> JScully: You must know or be told, or be able to tell from context or something. You can't really correctly tell what something means without knowing the encoding.
19:13 <monochrom> > \b11111101 :: Int8
19:13 <lambdabot> <hint>:1:19: error:
19:13 <lambdabot> parse error (possibly incorrect indentation or mismatched brackets)
19:13 <monochrom> > 0b11111101 :: Int8
19:13 <lambdabot> error: Variable not in scope: b11111101
19:14 <monochrom> Ah what's the binary notation again?
19:14 <pikajude> haskell has binary notation?
19:14 <JScully> damn, have no idea how 11111101 can be -3
19:14 Trendrrr joined
19:14 <monochrom> OK, I guess just go with 00001101 and be done?
19:14 <Tuplanolla> Needs `BinaryLiterals`.
19:15 <Boomerang> > 0xFD :: Word8
19:15 <JScully> no
19:15 <lambdabot> 253
19:15 <monochrom> I am not a stakeholder, I am fine with giving wrong advice and seeing you fail.
19:15 <EvanR> zero is 0000000, -1 is 11111111, -2 is 11111110, -3 is 11111101, its counting down from max
19:15 <kadoban> JScully: https://en.wikipedia.org/wiki/Two's_complement should get you started.
19:15 cpup joined
19:15 <JScully> if 11111101 is -3 , how do you represent 253?
19:15 <EvanR> you cant
19:15 <Boomerang> JScully: with 9 bits
19:15 <JScully> ahh
19:15 <EvanR> it goes up to 127
19:15 <monochrom> Int8 is not going to have 253. It's -128 to 127.
19:15 <Welkin> JScully: is it signed?
19:16 <Welkin> signed/unsigned is a pain in the ass
19:16 <monochrom> Word8 has 253 but it won't have -3.
19:16 <Welkin> C makes it worse though
19:16 <JScully> aaahaa! :^
19:16 Smaczny joined
19:16 <Welkin> because it implicitly converts
19:16 saussure joined
19:16 <lyxia> a question about "sign extending" without a signed representation sounds quite odd.
19:16 <Welkin> you won't have that issue in haskell
19:16 cyborg-one joined
19:16 <JScully> is there any tool where i can verify my calculations
19:16 <EvanR> famous last words
19:16 <JScully> online
19:17 <JScully> multiplying signed bytes
19:17 <Welkin> JScully: use your built-in calculator
19:17 <Tuplanolla> You have GHCi too, JScully.
19:17 <Welkin> it should have a programmer/binary/hex mode
19:17 <Welkin> at least on windows it does
19:17 <JScully> i have GHCI
19:18 <Tuplanolla> So `:seti -XBinaryLiterals` and `import Data.Word`.
19:18 mkoenig joined
19:18 <monochrom> Also Data.Int
19:18 <EvanR> you need a function to render Int8's in twos complement binary
19:18 <monochrom> That too.
19:19 Xion_ joined
19:19 <glguy> convert to Word8, show Int At Base
19:19 <monochrom> A binary calculator is least effort.
19:19 <EvanR> which base?
19:19 <Tuplanolla> :t showIntAtBase -- We have this.
19:19 <lambdabot> (Show a, Integral a) => a -> (Int -> Char) -> a -> ShowS
19:19 <glguy> 2
19:19 <kuribas> > printf "%b" (10 :: Int8)
19:19 <EvanR> ah
19:19 <lambdabot> error:
19:19 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M788646283129...
19:19 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
19:19 <monochrom> base 10 :)
19:20 <kuribas> > printf "%b" (10 :: Int8) :: String
19:20 <lambdabot> "1010"
19:20 <monochrom> http://www.vex.net/~trebla/humour/tautologies.html #10 :)
19:20 <kuribas> > printf "%b" (-10 :: Int8) :: String
19:20 <lambdabot> "11110110"
19:20 <monochrom> Oh neat, thanks kuribas
19:20 <JScully> well i wrote a calculator
19:20 ErinvanderVeen joined
19:20 <JScully> but i need to verify it
19:20 <JScully> does not make sense to write another one :D
19:20 <monochrom> > printf "%b" (-3 :: Int8) :: String
19:20 <lambdabot> "11111101"
19:20 <EvanR> > showIntAtBase 2 intToDigit (253) ""
19:20 <lambdabot> "11111101"
19:20 <EvanR> > showIntAtBase 2 intToDigit (253 :: Word8) ""
19:20 <lambdabot> "11111101"
19:21 <EvanR> > showIntAtBase 2 intToDigit ((-3) :: Word8) ""
19:21 <lambdabot> "11111101"
19:21 <EvanR> hrm
19:21 <EvanR> if you repeat things enough times, it becomes true
19:21 <kuribas> > showIntAtBase 2 intToDigit ((-3738927489278492631649816894718974819) :: Word8) ""
19:21 <lambdabot> "10011101"
19:22 <lyxia> > repeat False
19:22 <lambdabot> [False,False,False,False,False,False,False,False,False,False,False,False,Fal...
19:22 Trendrrr joined
19:22 <kuribas> neat, it also does compression!
19:22 <EvanR> the Truth at infinity
19:22 <monochrom> Haha kuribas how did you get that huge number? :)
19:22 <kuribas> typing :)
19:24 <pikajude> good ol' printf
19:24 systemfault joined
19:24 <JScully> so 1001 times 1011 should be 0011 right?
19:25 <EvanR> this is why we have computers
19:25 tomphp joined
19:25 <hanna> kadoban: I've thought some more about the problem and decided Sequence/fingertrees are probably insufficient; but I did remember the existence of Data.IntervalSet (which is basically my problem with the value type specialized to Bool)
19:25 <hanna> so I assume I could maybe find inspiration from its techniques
19:25 dewzer joined
19:25 skeuomorf joined
19:27 wroathe joined
19:27 <hanna> At the very least, failing all else, I could use multiple interval sets to approximate my needs (i.e. a separate interval set for each possible state; I'm using acid-state so I have the benefit of transactional invariants guaranteeing I can't accidentally end up with one index in multiple sets)
19:27 chaosmasttter joined
19:28 <hanna> “Fast Mergeable Integer Maps (1998) by Chris Okasaki, Andrew Gill http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.37.5452” this in particular seems like it could be relevant
19:28 <hanna> what I want is basically a mergeable integer map
19:28 <hanna> where the “merge” operation checks for leaf equality
19:29 Goplat joined
19:29 tromp joined
19:29 <torstein> does anyone use (spac)macs and know how to lookup haddock info? I can get type signatures with Hoogle but the function and argument description woult be nice.
19:30 <torstein> (spac)emacs **
19:30 Gloomy joined
19:31 <kuribas> hanna: why not a Map ID (ID, State)
19:31 <kuribas> hanna: the key is the lower index, the upper index is part of the value
19:32 romank joined
19:32 <kuribas> hanna: use lookupLE to find the interval
19:33 Trendrrr joined
19:33 <kuribas> which you can then check against the upper value.
19:34 saussure joined
19:35 ph88 joined
19:35 mizu_no_oto joined
19:37 fotonzade joined
19:37 <kadoban> That sounds quite decent, especially if you aren't worried about inconsistent states ^
19:38 <hanna> Hmm, could work; but what seems tricky is properly splitting up and merging value ranges
19:38 oisdk joined
19:38 <hanna> for example suppose I have range 1000 to 2000 set to “Queued”, and then I want to set 1050 to “Failed”
19:39 <hanna> Then in the meantime, 1000-1049 and 1051-2000 get set to “Done”
19:39 <hanna> I go back and retry the “Failed” entry at a later time and also set it to “Done”
19:39 <hanna> it would need to get re-merged with its siblings back into a single 1000-2000 range
19:39 <hanna> That's a lot of tricky logic, which an IntSet would avoid completely since it already implements this
19:40 <kadoban> There's a little logic required there, but it's not really that much. Wait, what? IntSet already implements this?
19:40 arj joined
19:41 portnov joined
19:41 <ph88> how can i optimize this code? https://bpaste.net/show/0604444066d2
19:42 meba joined
19:42 buttbutter joined
19:42 cbaatz joined
19:43 <hanna> Oh, sorry, I think I'm confusing IntSet with IntervalSet
19:43 geekg_000 joined
19:43 <portnov> http://hackage.haskell.org/package/batchd-0.1.0.0
19:43 <hanna> IntSet doesn't seem like it implements merging
19:44 <hanna> but IntervalSet certainly seems like it's designed to do this
19:44 svgDelux joined
19:44 takle joined
19:44 <hanna> From package `intset`, confusingly enough
19:45 Trendrrr joined
19:45 takle joined
19:45 Goplat joined
19:46 beanbagula joined
19:46 <kadoban> Oh I see, that makes more sense (though I haven't looked at IntervalSet)
19:46 <hanna> seems bitrotten to some extent
19:47 <[exa]> ph88: that seems a bit more like arithmetic exercise than programming
19:47 ziocroc joined
19:47 wroathe joined
19:48 dm3 joined
19:48 <Tuplanolla> Only number theory can save you now, ph88.
19:48 <hanna> Hmm, `cabal repl` fails loading bits-extras with `undefined symbol: popcountll`; is there any other way to get a REPL in which I can try this stuff out?
19:49 cpennington joined
19:49 <cocreature> you might be able to get some performance by grouping vector accesses to adjacent keys to get better cache locality
19:50 <kadoban> hanna: Probably means something is broken with dependency versions or something to that effect.
19:50 <kadoban> Or the thing itself is broken, I dunno.
19:50 <Lokathor> https://hackage.haskell.org/package/linear-1.20.6/docs/Linear-Quaternion.html#v:pow does this let me scale up and down? like for 3d graphics scaling?
19:51 <Lokathor> or am I not looking at the right thing? I just opened up the Linear docs like 30 minutes ago >_>
19:52 kirelagin joined
19:52 qguv joined
19:52 Trendrrr joined
19:52 Itkovian joined
19:52 saussure joined
19:53 <ph88> cocreature, i think i would have to make 3 intermediate vectors for the results of points VU.! (ii + 2 * n) and 2 * points VU.! (ii + n) and points VU.! ii and then sum them at the end .. could that work you think ?
19:54 <tfc[m]> hey there, i use conduit to talk with a server via TCP. it's like socket --> package_processor --> socket. it reacts to heartbeat requests and prints some payload stuff to my terminal when the server sends messages. now i also want to send the server messages from stdin back. how can y do something like (socket, stdin) --> package_processor --> socket ?
19:55 oisdk joined
19:55 <cocreature> ph88: I don’t see why you need intermediate vectors for that. you can first calculate the sum of points VU.! (ii + 2 * n) then the sum of -2 * points VU.! (ii + n) and then sum those
19:56 <cocreature> ph88: but really make a criterion benchmark and add your current code as a baseline before you start randomly changing things to see if they’re faster
19:56 <ph88> tfc[m], sourceHandle stdin from Data.Conduit.Binary and System.IO
19:56 Itkovian joined
19:57 <tfc[m]> ph88 ok, reading from stdin is no problem. the thing is that i need my conduit to use input both from the server and from stdin
19:57 <tfc[m]> so i need some kind of Y-combinator
19:58 <ph88> cocreature, good idea thanks, i will take a look at criterion too
19:58 <ph88> tfc[m], gotcha, i haven't used that before but i'm gonna help you find a nice function for it
19:58 qguv joined
19:58 sheaf joined
19:59 <tfc[m]> ph88 i just ran into "mergeSources" from stm-conduit. do you think this is the right thing for that?
20:00 <cocreature> ph88: another advantage of that is that if you show a benchmark here that people can actually run instead of three lines that are not a benchmark and in fact not even a full program, they’re significantly more likely to put time into figuring out how to improve your code :)
20:00 <hexagoxel> hanna: you did see the intset PR? manually applying that might be easier than making bit-rotten-extras work.
20:01 <ph88> tfc[m], not sure what "exhausted" means in the help text, but if it means the source has to send input every time it's requested than this function doesn't seem right for you because you need to give as many values from stdin and from socket
20:02 <tfc[m]> hm
20:02 <ph88> tfc[m], maybe you can make some kind of type that can send dummy values
20:02 <hanna> hexagoxel: ah, good catch
20:02 JagaJaga joined
20:02 RouxTheDay joined
20:02 <ph88> tfc[m], maybe try to find some source code that uses mergeSource to see how it's used
20:03 <tfc[m]> ph88 that's what i am doing. but there's not much...
20:03 <ph88> cocreature, i thought the profiling option of ghc was the only benchmark system there was
20:04 gabluc joined
20:04 bluepixel joined
20:04 <kuribas> hanna: aren't intervals sets about _overlapping_ intervals?
20:05 <cocreature> ph88: profiling and benchmarks are two different things. benchmarks show you how fast your code is by measuring how long it runs. profiling shows you how the runtime is split up between the different parts of your program
20:05 <ph88> ok
20:05 <hanna> kuribas: No, this seems like a simple “member / not member” set, but optimized to merge contiguous ranges
20:05 <kuribas> ok
20:06 biglama joined
20:07 TheFuzzball joined
20:07 exarkun joined
20:08 _ashbreeze_ joined
20:08 wroathe joined
20:11 saussure joined
20:11 gugah_ joined
20:12 esmiurium joined
20:12 gestone joined
20:14 merijn joined
20:15 quchen joined
20:15 qguv joined
20:16 tommd joined
20:16 oisdk joined
20:18 Trendrrr joined
20:20 kuribas` joined
20:20 bsmt joined
20:21 caumeslasal joined
20:22 Itkovian joined
20:22 <[exa]> if you have identifier f, what's the best english word for f' ?
20:22 <[exa]> apostrophed identifier?
20:22 <quchen> f-prime
20:22 TheFuzzball joined
20:22 <[exa]> lol
20:23 ph88 joined
20:23 qguv joined
20:23 <geekosaur> in haskell context that's prime, yeh
20:24 <[exa]> "prime" is not a common word for "derived function" right.
20:24 <[exa]> sorry. :]
20:24 <[exa]> misguided myself.
20:24 truelean joined
20:24 <geekosaur> not a common-language one, but a math-y one
20:25 jmcarthur joined
20:25 <[exa]> well, good to know
20:25 <[exa]> thanks
20:25 <Tuplanolla> Those pesky mathematicians can still outdo us with f-dot, f-hat, f-tilde, f-bar and many others.
20:27 AerialBoundaries joined
20:30 dfeuer joined
20:30 saussure joined
20:30 Trendrrr joined
20:32 Itkovian joined
20:32 patbecich joined
20:32 <monochrom> In the Haskell Community, "prime" refers to a futuristic Haskell. :)
20:33 dm3 joined
20:34 <cocreature> Tuplanolla: at least we have emoji!
20:39 caumeslasal joined
20:41 <ph88> is there any way to get the information of the cabal file in my program? i would like to show the version number when the user passes --version to the program
20:41 <quchen> ph88: Sure, Cabal’s API supports that
20:41 hololeap joined
20:41 <ph88> what else should i know about versioning my program ?
20:42 truelean left
20:42 <quchen> The PVP is Haskell’s version of semantic versioning.
20:42 <ph88> PVP ?
20:42 <quchen> A.B.C.D – B.C.D is like semver, A is another step »larger«.
20:42 <quchen> Package versioning policy.
20:43 <monochrom> You can find it somewhere on the haskell wiki
20:43 <quchen> Change D if all you did is fix bugs, change C if you added non-breaking features, change B when you introduced breaking changes, change A on major ovarhaul.
20:43 Trendrrr joined
20:43 gestone joined
20:44 <hvr> *cough* http://pvp.haskell.org/faq *cough*
20:44 <quchen> D means »nothing should break«, C means »very unlikely breakage, apart from maaaaybe name clashes«, B means »breakage possible«, A means »breakage very much possible«
20:44 <quchen> Ah
20:44 <bollu> if a library needs extension X, and I use said library, does my module not necessarily have X enabled?
20:44 <quchen> Nice site!
20:44 <orion> Why is PVP so bad?
20:44 <hvr> orion: that's a loaded question
20:44 <quchen> Why is there an atmosphere on the moon?
20:44 ckubrak joined
20:45 <orion> Who is John Galt?
20:45 <monochrom> bollu: No, your module doesn't always need X. It depends of course.
20:45 <bollu> monochrom: I see
20:45 <bollu> monochrom: interesting, because I spent the last 10 minutes assuming I had TypeFamilies available
20:46 ccomb joined
20:46 <ph88> compiling is so slow :*(
20:46 <monochrom> PVP is bad because semver is bad. :)
20:46 <ph88> elm has automatic versioning
20:46 <monochrom> (semver is bad because it is a total order.)
20:46 <bollu> monochrom: how does that work? automatic versioning?
20:46 jerbome_ joined
20:46 jao joined
20:46 <hvr> monochrom: in what sense is it a total order?
20:47 <monochrom> (The same badness as using totally-ordered numbers for precedence order.)
20:47 <cocreature> ph88: -O0 helps significantly during development for making compile times faster
20:47 <quchen> 10000 is pretty bad I hear
20:47 <hvr> monochrom: or what exactly is the ordering you see in SemVer?
20:47 <ph88> cocreature, oh ye right O2 was the default ?
20:48 <bollu> also, oh my god, who designed megaParsec? It's cool and all, but is super annoying to work with anything other than the default token type
20:48 <monochrom> Given two semver numbers x and y, it is always exactly one of: x<y, x=y, x>y.
20:48 <bollu> they could have at least provided [a] => Stream a :(
20:48 <bollu> or some wrapper thereof
20:48 zero_byte joined
20:48 <c_wraith> bollu: heh. I *just* ran into the same thing
20:48 <hvr> monochrom: ok, so you're merely refering to the lexicographic ordering of number vectors?
20:48 saussure joined
20:48 <Tuplanolla> How about we start between 0 and 1 and always pick the next version between the current version and either 0 or 1?
20:48 <bollu> c_wraith: PR plz? :P I'm re-implementing this by hand.
20:48 <c_wraith> bollu: fortunately, writing your own stream type is pretty painless
20:49 <ph88> bollu, https://github.com/elm-lang/elm-package#publishing-updates
20:49 <cocreature> ph88: I never remember what the defaults are. it’s either -O1 or -O0 but cabal and stack have their own defaults so if you care about it pass it explicitely
20:49 <bollu> c_wraith: yeah, just looking into the typeclass now
20:49 <monochrom> Not just that. The < order is also tied to "which direction is backward-compatible?"
20:49 <bollu> c_wraith: but I think I'll submit a PR nonetheless, because it seems useful to have
20:49 bennofs joined
20:49 <bollu> c_wraith: less weird corners = nicer API
20:49 <Tuplanolla> So we have 1/2, 3/4, 5/8, ...
20:50 baldrick joined
20:50 Trendrrr joined
20:50 <c_wraith> bollu: I can tell why it's implemented the way it is.. It's for source location tracking. easy with byte/character interfaces.. harder with arbitrary token types
20:50 wroathe joined
20:50 sedeki joined
20:50 <hvr> monochrom: ok, yeah. but that helps a lot to reduce the complexity of dependency constraint solving as you can map the problem to a linear finite domain
20:51 <monochrom> I agree! My "when to use a non-total order" scenerio doesn't happen ever.
20:51 <hvr> monochrom: and this gives you a lot of structure that makes things like the matrix builder even feasable
20:51 <hanna> The cases where semver breaks down seem to be isolated, imho
20:51 systemfault joined
20:52 <monochrom> But since the topic is "why is PVP bad" which is hypothetical to begin with... Let's add more hypothetical math to muddle the issue!
20:52 <c_wraith> bollu: it feels like it needs a bunch more to really be useful - like a whole module handling a bunch of the common issues.
20:53 <bollu> c_wraith: I see
20:53 coot____ joined
20:53 <bollu> c_wraith: I'm converting a Parsec parser to Megaparsec now
20:53 <c_wraith> bollu: which isn't to say it wouldn't be nice - it'd just be a bigger PR than just adding a Stream instance for a list of arbitrary tokens
20:54 <monochrom> Next April 1st someone should publish a paper on topological versioning!
20:55 <hvr> monochrom: but to be fair; the compatibility relation is not total
20:55 <bollu> c_wraith: yeah, you'd need a (x -> SourcePos) I think
20:55 <hanna> Semver breaks down when it obscures the relationship between “code order” and “chronology”
20:55 <ph88> cocreature, do you pass -O0 to stack or ghc-options ?
20:56 <bollu> monochrom: do you have a concrete example where you can assign no total ordering?
20:56 <c_wraith> bollu: I think actually x -> (SourcePos, SourcePos)
20:56 buglebudabey joined
20:56 <c_wraith> bollu: it wants a start and end location
20:56 <bollu> ah
20:56 <hanna> For example, some times developers start work on a new feature based on an “older” version of the code; and then e.g. release 5.7.2 which is newer and has more features than 5.8.0; trying to figure out as a user which version is the “newest” is difficult
20:57 <hanna> (this happened in the case of qtwebkit; and qt stuff in general has confusing version number chronology - it also happened in the case of nvidia drivers)
20:58 <monochrom> bollu: It has to do with branching. Let's use PVP for example. I have an old version 1.0.0. Based on that, I branch off two versions X and Y. Version X is derived from 1.0.0 and adds one feature. Version Y is derived from 1.0.0 and adds a different feature. Now I don't know how to number X and Y.
20:59 <ph88> meh ghc is so slow right now .. i pass this stack build --profile --ghc-options="-j4 -auto-all -rtsopts -O0" statistics-0.13.3.0: build takes a long time
20:59 <Tuplanolla> I wonder what sort of chaos would ensue if we actually used rational number vectors.
20:59 <EvanR> hahha
21:00 <monochrom> Also what hanna said. A different but more likely scenerio.
21:00 <EvanR> no man, reals
21:00 <EvanR> which project is approaching pi...
21:00 <bollu> monochrom: are they now not separate package?
21:00 <hanna> monochrom: usually, software branching happens in the specific circumstance of an important bug fix or enhancement from a later version being backported to a “stable” version, right?
21:00 <hvr> monochrom: you can pick any free major version for your branch
21:00 <bollu> EvanR: someone did that right? latex?
21:00 ertesx joined
21:00 <EvanR> ah
21:00 <monochrom> For example look at Linux kernels used in home routers. A very different timeline than desktop's and server's.
21:01 <bollu> EvanR: some package is versioned with the digits of pi
21:01 <bollu> monochrom: well, what do you propose? partial orders are a bad idea IMO.
21:01 <* monochrom> hugs his partial orders
21:02 yobohohoz joined
21:02 <hanna> monochrom: in which case there's not much of a conflict because say you have 1.0.2 and you release 1.1.0 as a new experimental version, then you want to backport a fix from this to the stable ver - it would become 1.0.3
21:02 dni joined
21:02 <geekosaur> bollu, that'd be TeX
21:02 <hpc> bollu: partial orders might be bad because they aren't total orders, but they're awesome because they're not unordered
21:02 <bollu> what's the free object in the algebra of partial orders?
21:02 <hanna> I don't think releasing two separate orthogonal features as “different” version numbers happens in practice
21:02 <bollu> hpc: no, I mean: to represent *this* scenario
21:02 Trendrrr joined
21:02 bjz joined
21:02 <bollu> hpc: I like partial orders :P
21:02 <hpc> ah :P
21:03 <bollu> > what's the free object in the algebra of partial orders? anyone
21:03 ertesx joined
21:03 <lambdabot> <hint>:1:24: error: parse error on input ‘in’
21:03 <bollu> geekosaur: ah yes, ty
21:03 <geekosaur> hanna, I have seen it happen with niche commercial software
21:03 <monochrom> I think discrete orders are free partial orders.
21:03 <bollu> monochrom: ah, yes, no structure.
21:03 <cocreature> ph88: with stack I use "stack build --fast" which passes -O0
21:03 <bollu> monochrom: is there a final object? { * } would work I think?
21:04 jship joined
21:04 <bollu> what's the initial object in the algebra of partial orders**
21:04 <monochrom> Yeah I think {*} works. But I'm rusty on this.
21:04 <bollu> which is the free partial order
21:04 toby joined
21:04 <monochrom> Maybe {}.
21:05 Scip joined
21:05 Guest27121 joined
21:06 jrn1024 joined
21:06 toby_ joined
21:07 jshjsh joined
21:07 <Welkin> has anyone used pygments to add syntax highlighting to haskell or purescript code?
21:07 <Welkin> it lookes like it doesn't quite work
21:08 saussure joined
21:08 mjora7 joined
21:08 <bollu> monochrom: you can't define a function into {}
21:08 <hanna> The only problem with semver is assuming every package follows it
21:08 <monochrom> Initial! I just need {} -> another poset.
21:09 <bollu> c_wraith: how'd you get the source position from the underlying string parser or whatever?
21:10 <bollu> monochrom: no, I asked for final
21:10 <monochrom> {*} looks final.
21:10 <bollu> yeah
21:10 Trendrrr joined
21:10 <c_wraith> bollu: I cheated and just passed the third argument as both return values, since I didn't care about error reporting
21:10 <bollu> lol, I see
21:10 thebardian joined
21:10 <bollu> c_wraith: dang
21:10 <bollu> c_wraith: OK, for now I'll just do that
21:10 <bollu> but I need to fix this eventually
21:11 <c_wraith> bollu: I'm playing with that now, actually. I'll let you know if I get a result I'm happy with.
21:11 <bollu> sure, thanks a ton
21:11 <Profpatsch> quchen: fyi I took your mockup of a multi-keyed map and implemented a small preliminary version https://hackage.haskell.org/package/yarn-lock-0.2.0/src/src/Data/MultiKeyedMap.hs
21:11 <bollu> c_wraith: out of curiosity, what are you parsing
21:12 <Profpatsch> quchen: Maybe we can extend it to a full package?
21:12 wroathe joined
21:12 <quchen> »we«? :-þ
21:12 <c_wraith> A boring expression language. My experiment was mostly in parsing to a typed representation.. But so far it's actually really boring. I think I need richer types for it to get interesting.
21:12 kirelagin joined
21:12 unK_ joined
21:12 <Profpatsch> I’m not particularly experienced in writing basic data structures, so publishing it as nice package is probably out of my league.
21:13 <ph88> what part of the cabal api can i use to read the version number from the cabal file ?
21:13 <bollu> heh, I see
21:13 <Profpatsch> For anything more advanced than the few functions a better representation would probably be needed as well.
21:14 <Profpatsch> I’m not even sure whether the implementation is correct.
21:14 <Profpatsch> I’m just hoping for the best atm. :P
21:14 <quchen> You can try showing that it’s hard to prove incorrect using tests ;-)
21:14 <Profpatsch> Especially the Eq instance, maybe you can take a look at that?
21:15 <Profpatsch> I also have a hunch that Eq can be implemented without requiring Ord k
21:15 <bollu> c_wraith: what did you do for Ord?
21:15 <hvr> ph88: the same one used e.g. in https://github.com/hvr/multi-ghc-travis/blob/master/make_travis_yml_2.hs to read the tested-with: field
21:16 <bollu> c_wraith: did you have a "natural" ord instance for your tokens?
21:16 <Profpatsch> quchen: Here’s the commit if you have any comments about the code https://github.com/Profpatsch/yarn-lock/commit/c59fa278c506862d15374307d3d0e8c1e3c60e84
21:16 <c_wraith> bollu: I think I just derived it. It's meaningless, so I assume it was for storing in a Map or something
21:16 <bollu> I see
21:16 <hvr> ph88: happens right at the start of the genTravisFromCabalFile function
21:16 jmiven joined
21:17 cpup joined
21:17 <ph88> thx hvr
21:17 <ph88> be back later
21:17 aglorei joined
21:17 Trendrrr joined
21:18 <quchen> It sounds like a nice package idea to learn how to make a package with!
21:18 romank joined
21:18 <bollu> c_wraith: how does deriving Ord work? lex ordering for product types?
21:19 <monochrom> Yes.
21:19 <bollu> and for sum types?
21:19 <c_wraith> bollu: and sum types are ordered by constructor order as written
21:19 <bollu> monochrom: Ord is total order right?
21:19 <bollu> I see
21:19 <monochrom> Earlier constructors are <er
21:19 <bollu> that's.. bizzare?
21:19 <monochrom> Ord is total order so that we can put things in binary search trees.
21:20 <c_wraith> monochrom: unless it's Order for Float or Double, in which case it's.. not either of those
21:20 <EvanR> > (3 :: CReal) < 4
21:20 <lambdabot> True
21:20 <EvanR> good
21:21 <bollu> lol what?
21:21 aarvar joined
21:21 <EvanR> totally ordered mannnn
21:21 <bollu> no, why did you feel the need to check that?
21:22 <EvanR> > (3 :: CReal) < sqrt 9
21:22 <lambdabot> False
21:22 <EvanR> > (3 :: CReal) > sqrt 9
21:22 <lambdabot> False
21:22 <EvanR> o_O
21:22 <hvr> EvanR: try ==
21:22 <[exa]> oh noew
21:22 <EvanR> > (3 :: CReal) == sqrt 9
21:22 <lambdabot> True
21:22 <EvanR> O-O
21:22 <[exa]> whoa
21:22 <hvr> mind blown
21:23 <c_wraith> It's Eq instance cheats
21:23 <EvanR> i think its choosing a delta
21:23 <c_wraith> *Its
21:23 <c_wraith> because obviously that's impossible :)
21:23 <monochrom> > (10^50 ::CReal) == 10^50 + 1
21:23 nomotif joined
21:23 <lambdabot> False
21:24 <EvanR> this tangent is not going as expected
21:24 <monochrom> > (10^100 ::CReal) == 10^100 + 1
21:24 <lambdabot> False
21:24 <EvanR> > pi == atan 1 / 4 :: CReal
21:24 <lambdabot> error:
21:24 <lambdabot> • Couldn't match expected type ‘CReal’ with actual type ‘Bool’
21:24 <lambdabot> • In the expression: pi == atan 1 / 4 :: CReal
21:24 <EvanR> > pi == (atan 1) * 4 :: CReal
21:24 <lambdabot> error:
21:24 <lambdabot> • Couldn't match expected type ‘CReal’ with actual type ‘Bool’
21:24 <lambdabot> • In the expression: pi == (atan 1) * 4 :: CReal
21:24 <monochrom> I admit defeat.
21:25 Trendrrr joined
21:25 <EvanR> > pi == ((atan 1) * 4 :: CReal)
21:25 <lambdabot> True
21:26 <bollu> the more haskell I learn
21:26 <Philonous> Was CReal the one based on binary representation or continued fractions?
21:26 <bollu> the more I start reaching for Bifunctor and Profunctor
21:27 <EvanR> there are two CReals
21:27 <bollu> I can't tell if this is enlightment or gluttony anymore
21:27 <EvanR> both fast cauchy sequences
21:27 saussure joined
21:27 <[exa]> there isn't the N-parametrized CReal in lambdabot?
21:27 <EvanR> no...
21:28 aglorei joined
21:28 ertes joined
21:29 <nshepperd_> > 1 == (1 + 10^(-100) :: CReal)
21:29 <lpaste> Zemyla pasted “A weird Applicative I came up with while trying to write a regex library” at http://lpaste.net/355741
21:29 <lambdabot> *Exception: Negative exponent
21:29 <nshepperd_> Oh right
21:30 <nshepperd_> > 1 == (1 + 10^^(-100) :: CReal)
21:30 <Zemyla> So has anyone heard of anything similar to this type I created?
21:30 <lambdabot> True
21:30 <EvanR> ah ha!
21:30 <EvanR> so CReal is totally ordered, just violating laws in the process
21:31 <EvanR> just like Double!
21:31 <quchen> Everything is totally ordered, just violating some laws in the process.
21:32 <EvanR> agreed
21:32 juanpaucar joined
21:32 Trendrrr joined
21:33 <nshepperd_> We're all totally ordered here
21:33 <bollu> nshepperd1: perhaps you meant "well ordered"? :3
21:33 <* EvanR> orders a well
21:34 <quchen> Do they do deliveries to you?
21:34 <quchen> Well, ordered anyway.
21:34 <Zemyla> quchen: What law does () violate in its total order?
21:34 <quchen> Zemyla: For some value of »some«.
21:35 <dfeuer> Gurkenglas: See https://www.reddit.com/r/haskell/comments/6c6ld6/runstarray_seems_arbitrary/dhuoamj/
21:35 <Zemyla> Wait, you can't order it with bottom.
21:35 <quchen> Also: compare ⊥ ⊥ is not True. Bottom catches them all!
21:35 <bollu> > let y f = f y f in compare (y id) (y id)
21:35 <lambdabot> error:
21:35 <lambdabot> • Occurs check: cannot construct the infinite type:
21:35 <lambdabot> t ~ (t -> t1 -> t0) -> t0
21:35 wroathe joined
21:35 <bollu> > let y f = f (y f) in compare (y id) (y id)
21:36 <lambdabot> mueval-core: Time limit exceeded
21:36 <quchen> y f = f (y f)
21:36 <bollu> yeah
21:36 <bollu> is that the simplest way to create bottom?
21:36 <bollu> that's the first one I thought of at least
21:36 <Gurkenglas> dfeuer, I had started a response and then put it off. I guess I can circumvent the procrastination by moving to IRC.
21:36 <quchen> x=x -- bollu
21:36 <bollu> quchen: ah, right
21:36 <kadoban> > compare undefined ()
21:36 <lambdabot> *Exception: Prelude.undefined
21:36 <bollu> I'm.. not sure why the hell I reached for y id
21:36 <kadoban> I wonder why that instance of Ord even looks at its values ...
21:37 <dfeuer> Gurkenglas: no need to procrastinate :_P
21:37 <Gurkenglas> dfeuer, are you sure that that won't typecheck, in the sense of having tried it? Coz it seems to me like it should, though I havent tried it
21:37 <dfeuer> Gurkenglas: yes, I tried it.
21:37 <Gurkenglas> Need is not procrastination's point
21:39 <nshepperd_> Void is well ordered!
21:40 Trendrrr joined
21:40 <nshepperd_> Also, Int# :p
21:40 <kadoban> > compare (undefined :: Void) (undefined :: Void)
21:40 <lambdabot> EQ
21:40 <nshepperd_> Hmm maybe not
21:41 oisdk joined
21:41 <Gurkenglas> :t undefined :: (forall f. Applicative f => (Data.Array.ST.STArray s i e -> f (Array i e)) -> a -> f b) -> (forall s. ST s a) -> b -- Can I somehow have lambdabot tell me the rest of the type error
21:41 <lambdabot> error:
21:41 <lambdabot> • Cannot instantiate unification variable ‘a0’
21:41 <lambdabot> with a type involving foralls:
21:41 <nshepperd_> Can an Int# be non terminating?
21:41 dni joined
21:42 <nshepperd_> I guess not because there's nothing to enter
21:42 <MitchellSalad_> is it possible to write 'data Proxy k (a :: k) = Proxy' using KindSignatures syntax?
21:42 <MitchellSalad_> this doesn't work: 'data Proxy :: forall k. k -> (a :: k) -> Type where'
21:42 meba joined
21:42 <Zemyla> :t undefined :: (forall f s. Applicative (f s) => (Data.Array.ST.STArray s i e -> f s (Array i e)) -> a -> f s b)
21:43 <lambdabot> Applicative (f s) => (GHC.Arr.STArray s i e -> f s (Array i e)) -> a -> f s b
21:43 <Zemyla> Gurkenglas: There you go.
21:43 pookleblinky joined
21:43 <Zemyla> That's what you'll be wanting.
21:43 <Zemyla> Also, how do I request a feature be added to Data.Array?
21:45 saussure joined
21:46 <Zemyla> Because I want indexArrayF :: Ix i => Array i e -> b -> (e -> b) -> b
21:47 <hpc> which element of the array does it pick?
21:47 <Philonous> nshepperd_, data Proxy k (a :: k) :: * where ...
21:47 jshjsh joined
21:47 <Zemyla> I meant Array i e -> i -> b -> (e -> b) -> b.
21:47 jerbome_ joined
21:47 Trendrrr joined
21:47 <Philonous> Oh wait
21:47 <Philonous> Never mind
21:47 <Zemyla> It'd be along the lines of indexVectorM from the vector package.
21:48 <Rotaerk> huh, just learned of the proc keyword
21:48 <c_wraith> Rotaerk: Arrow syntax is terrifying
21:49 <Rotaerk> heh
21:49 <Gurkenglas> Zemyla, shouldn't that be Ix i => Array i e -> i -> Maybe e? (Also I have a hunch the i should be in front)
21:49 <MitchellSalad_> arrow syntax is awesome
21:49 drewbert joined
21:49 <c_wraith> bollu: Well... I've managed it, but it's terrible to use. megaparsec really is hostile to custom token types
21:49 cschneid_ joined
21:49 <Zemyla> Gurkenglas: If and only if it means that, when I pattern-match on the Maybe e, I get a value that contains no references to the array itself.
21:50 <Gurkenglas> Why should it mean that any more for your original type signature than for mine?
21:51 <bollu> c_wraith: lol
21:51 <bollu> c_wraith: do tell
21:51 <Zemyla> Gurkenglas: That's what I want the semantics of it to be.
21:51 Bassetts joined
21:51 <bollu> c_wraith: a gist would be nice
21:51 <Gurkenglas> I'm implying that those semantics are orthogonal to that type signature difference
21:52 exarkun joined
21:52 hiratara joined
21:52 <Zemyla> Gurkenglas: I know that, but I just want something like that because if I have x = a ! i, then the only way for x to stop being a thunk with a reference to the array it came from would be to fully evaluate it.
21:53 oisdk joined
21:53 <Zemyla> To WHNF.
21:53 <Zemyla> And given that the value in the array itself might not even be WHNF, that's unnecessary strictness.
21:53 <c_wraith> bollu: http://lpaste.net/355742 It should be multiple modules, but it's all there
21:53 <bollu> c_wraith: much obliged
21:54 <monochrom> Zemyla: Use a copy function that copies out a length-1 array at that position.
21:54 <monochrom> Actually that means "slice" and then "copy".
21:55 Trendrrr joined
21:55 <Zemyla> monochrom: You can't take slices of Arrays from the array package. And the copies still use the same (!) function, so the array would be full of thunks with references to the previous array, making it twice as bad.
21:55 drewbert joined
21:55 <monochrom> Oh, array package. I don't know what to do then.
21:55 <bollu> c_wraith: what the absolute madness
21:55 <monochrom> What I said is good for vector.
21:56 <geekosaur> also repa, I think?
21:56 <c_wraith> bollu: well, I mean.. it *should* have been a bunch of modules. :)
21:56 <monochrom> Also bytestring and text as it happens. (They share ideas.)
21:56 <bollu> c_wraith: how long does lpaste live for?
21:56 <bollu> c_wraith: I want to take a look at this sometime this week, but i'm not sure when I'll get the time
21:56 <bollu> c_wraith: do you mind if I put this in a personal gist?
21:56 <c_wraith> bollu: it seems to be eternal. or until the site dies
21:56 <geekosaur> until someone resets the db, which last happened a few years agfo
21:56 <monochrom> I think lpaste lives forever.
21:56 <bollu> I see, cool
21:56 <Zemyla> monochrom: That's because ByteString and Text can't store unevaluated Word8s or Chars.
21:57 <c_wraith> bollu: sure, copy it wherever. It's all just an experiment I've been playing with.
21:57 <bollu> c_wraith: cool, thanks!
21:57 <c_wraith> bollu: I've been writing it to learn about things anyway. Nothing of immediate practical use in there anyway. :)
21:57 <bollu> c_wraith: just for reference, I'm using megaparsec for this: http://github.com/bollu/simplexhc
21:58 <Gurkenglas> Is there a torrent of that db?
21:59 freusque joined
22:00 saftsuse joined
22:00 ego joined
22:01 <Rotaerk> hmm unclear on some aspects of the open source culture/community
22:02 castlelore joined
22:02 castlelore joined
22:02 RouxTheDay joined
22:02 nomotif joined
22:02 <Rotaerk> I made and used some pipes combinators that seem like they would be generally useful for solving a certain class of problems, might be useful to others
22:02 Trendrrr joined
22:03 <Rotaerk> do I simply submit a PR to pipes-extras, or discuss with the maintainer first, or just push out my own library, or what
22:03 dddddd joined
22:03 Eduard_Munteanu joined
22:03 <monochrom> I vote for discussing first.
22:03 <Rotaerk> k
22:03 saussure joined
22:04 Rodya_ joined
22:04 <monochrom> But to anticipate possible futures, the chronological order of the 3 options are: discuss; PR; revolt.
22:04 <Rotaerk> heh
22:04 im0nde joined
22:04 <monochrom> "when diplomatic efforts fail..."
22:04 im0nde joined
22:05 <Rembane> ...I always turn to lenses.
22:05 <hpc> "the citizens are revolting!" "yes, but there's no need to make fun of them"
22:05 <Rotaerk> lol
22:05 <kadoban> I prefer "You said it, they stink on ice!"
22:06 <Rotaerk> I'm not as math-enlightened as many haskellers seem to be, so I may miss some of the ways that these abstractions could be streamlined/optimized
22:06 <Rotaerk> maybe the names could use work too
22:06 ph88 joined
22:07 saep joined
22:10 butterthebuddha joined
22:11 ddere joined
22:18 Trendrrr joined
22:21 mkoenig joined
22:23 saussure joined
22:24 romank joined
22:25 tristanp joined
22:27 romank joined
22:28 anuxivm joined
22:30 pie_ joined
22:31 hiratara joined
22:31 tromp joined
22:32 juanpaucar joined
22:33 <ph88> does criterion have something to compare the results of the functions under test? i wanna make sure they are the same
22:34 Koterpillar joined
22:35 dan_f joined
22:36 <NextHendrix> is it possible to pattern match on the right hand size of ==
22:37 <lyxia> > let Just x == Just y = False in Just () == Just ()
22:37 <lambdabot> False
22:37 Trendrrr joined
22:37 <lyxia> NextHendrix: what are you trying to do
22:38 sleffy joined
22:38 <NextHendrix> think i've got stuck down a rabbit hole overcomplicating things
22:38 <NextHendrix> https://ptpb.pw/uW6q/hs
22:39 <NextHendrix> i have a function, that does multiple checks on some output
22:39 mr_sm1th joined
22:39 <NextHendrix> checkMsg
22:40 zcourts joined
22:40 e14 joined
22:40 <lyxia> Just url <- getUrlMsg message
22:40 <NextHendrix> the conditional statement checks if the result of another function is a Just or a Nothing, and if its a Just is runs another function with the returned value of the first
22:41 saussure joined
22:41 <lyxia> is that ^ what you meant
22:41 bendo joined
22:41 <NextHendrix> yeah i want to pattern match on the Just url
22:42 jmcarthur joined
22:42 <NextHendrix> but GHC says "variable not in scope: url :: URL"
22:42 <NextHendrix> can i not pattern match like that
22:43 <lyxia> note that I wrote an "<-" instead of "=="
22:43 <lyxia> == is not for pattern matching
22:44 <NextHendrix> i want to see is the result of isUrlMsg is a (Just <something>), and if so, run doUrl with that <something> that isUrlMsg returns
22:45 <lyxia> NextHendrix: | Just url <- isUrlMsg message = doUrl handle url
22:46 neoo joined
22:46 darjeeli1 joined
22:46 <NextHendrix> lyxia: runtime error if isUrlMsg returns Nothing, no?
22:46 <NextHendrix> > Nothing == False
22:46 <lambdabot> error:
22:46 <lambdabot> • Couldn't match expected type ‘Maybe ()’ with actual type ‘Bool’
22:46 <lambdabot> • In the second argument of ‘(==)’, namely ‘False’
22:47 neoo joined
22:47 <NextHendrix> tbh i think isUrlMsg is doing too much
22:48 <NextHendrix> i can just decomplicate it
22:48 <lyxia> no it won't error
22:48 <lyxia> the guard will simply not match
22:48 <NextHendrix> really?
22:48 <NextHendrix> neat
22:48 <lyxia> > let f x | Just y <- x = y |otherwise = "OK" in f Nothing
22:49 <lambdabot> "OK"
22:49 <NextHendrix> interesting
22:49 Trendrrr joined
22:49 <NextHendrix> so if something goes mad, the guard just passes it down
22:49 neoo joined
22:50 <NextHendrix> > let f x | Just y <- x = y | otherwise = "OK" in f (Just 4)
22:50 <lambdabot> error:
22:50 <lambdabot> • No instance for (Num [Char]) arising from the literal ‘4’
22:50 <lambdabot> • In the first argument of ‘Just’, namely ‘4’
22:51 neoo joined
22:52 tristanp joined
22:52 <lyxia> 4 must be a string
22:52 neoo joined
22:54 cloudhead joined
22:54 systemfault joined
22:54 mizu_no_oto joined
22:54 neoo joined
22:55 joco42 joined
22:56 thebardian joined
22:56 neoo joined
22:59 saussure joined
22:59 tristanp joined
23:00 tommd joined
23:02 <glguy> > let f x | Just y <- x = y | otherwise = "OK" in f (Just "4")
23:02 <lambdabot> "4"
23:02 Trendrrr joined
23:02 romank joined
23:04 bluepixel joined
23:04 izabera left
23:07 Gurkenglas joined
23:07 romank joined
23:10 <EvanR> heh... interesting
23:10 romank joined
23:10 <jle`> yeah, you can think of a normal guard `foo | myCondition = ....` as if it were `foo | True <- myCondition = ...`
23:11 <EvanR> i wrote this r >>= f = join (fmap f r). and was wondering why it wasnt an error, since my join function is called joinR
23:12 <jle`> it won't be an error, but it'll probably be an infinite loop, heh
23:13 lambda_foo joined
23:13 <EvanR> when mathematical facts become bugs
23:14 <EvanR> the opposite of the usual mathematical nonsense being normal code (x = x + 1)
23:14 <EvanR> or maybe theyre the same phenomenon
23:14 tromp joined
23:15 <EvanR> switcher :: R a -> E (R a) -> R a
23:15 <jle`> in mathematics you encounter the same problem when you define something in terms of itself in an unsound way
23:15 <EvanR> switcher start e = join (accum start (fmap const e))
23:15 <EvanR> space leaks eat my shorts
23:16 <jle`> since join is defined in terms of (>>=), then if you define (>>=) in terms of join, it's like "irreducible"
23:17 saussure joined
23:17 Trendrrr joined
23:19 tristanp joined
23:20 butterthebuddha joined
23:21 zennist joined
23:21 AfC joined
23:24 pita joined
23:25 Shatnerz joined
23:27 romank joined
23:28 saussure joined
23:29 moly joined
23:30 Trendrrr joined
23:30 theDon_ joined
23:32 romank joined
23:32 markus1189 joined
23:33 markus1199 joined
23:36 jerbome_ joined
23:36 <moly> I have a question about installing HaskellR using stack and nix.
23:37 <hanna> I'm trying to use http-conduit to POST the contents of a file. How do I tell the server about the filename/encoding? It doesn't seem like `setRequestBodyFile` does anything special here
23:37 roconnor joined
23:38 ssarah joined
23:38 e14 joined
23:38 <moly> stack can't find gcc, even though it is in my $PATH
23:40 nakal joined
23:40 mmn80 joined
23:40 juhp joined
23:40 benl23 joined
23:42 e14 left
23:42 Trendrrr joined
23:42 <glguy> moly: You forgot the part where you include all the output in a paste
23:43 shangxiao joined
23:43 meba joined
23:43 roconnor joined
23:43 <moly> http://lpaste.net/355743
23:45 <glguy> moly: Were there more details in config.log?
23:45 <moly> I haven't used nix before
23:45 <moly> I can't find the config.log
23:45 tromp joined
23:46 roconnor joined
23:46 saussure joined
23:47 <hanna> Ah, I think what I want is multipart form data, not setRequestBodyFile
23:47 <hanna> but it doesn't seem like http-conduit does this anymore post version 2.x? Old versions still had Network.HTTP.Conduit.MultipartFormData but it seems to have been mysteriously deleted
23:48 joaj joined
23:48 <hanna> ah, it was moved to http-client
23:48 wroathe joined
23:50 <Eduard_Munteanu> hanna, you could set the Content-Type as a header
23:50 <hanna> I actually specifically need the filename, and I also need it to be uploaded with a certain POST field name
23:50 <hanna> for the server to recognize it
23:51 <Eduard_Munteanu> You want a multipart form then.
23:51 <Eduard_Munteanu> Content-Type does allow you to specify the filename, but if you say you need it as a form...
23:53 romank joined
23:53 slack1256 joined
23:54 <slack1256> On a running application, is there a way to get the +RTS -s -RTS information?
23:54 YongJoon joined
23:54 <dmj`> slack1256: import GHC.Stats
23:54 Trendrrr joined
23:55 sea joined
23:55 <slack1256> Mmm and if the process is just running on my machine?
23:55 <slack1256> let's say, xmonad?
23:56 <Eduard_Munteanu> I suppose you can't modify and reload the config?
23:56 louispan joined
23:56 <Tuplanolla> Inspect `/proc/$!/cmdline`, slack1256.
23:56 zcourts_ joined
23:56 <slack1256> I can. I wanted to know if this was possible as is
23:57 <slack1256> for example, old unixes made some internal output available on SIGUSR1 on some commands
23:57 <Tuplanolla> Oh, you want the data instead of the options.
23:58 <dmj`> moly: you could probably do it with just nix
23:58 <slack1256> yeah, as If I had launched xmonad with +RTS -s -RTS
23:58 <moly> @dmj` you mean without stack?
23:58 <lambdabot> Unknown command, try @list
23:58 <dmj`> moly: yea
23:59 infinity0_ joined
23:59 infinity0_ joined
23:59 <dmj`> moly: seems like it needs inline-r, H and R
23:59 <dmj`> nix-shell -p "haskell.packages.ghc802.ghcWithPackages (pkgs: with pkgs; [H inline-r (import <nixpkgs> {}).R])"
23:59 alveric2 joined
23:59 jshjsh joined