<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:01 justicefries left
00:01 lambda-11235 joined
00:02 infinity0 joined
00:03 dan_f joined
00:05 infinity0 joined
00:06 unK_ joined
00:06 blym_ joined
00:07 infinity0 joined
00:08 nitrix joined
00:08 nitrix joined
00:08 nitrix joined
00:10 infinity0 joined
00:11 abhiroop joined
00:11 soLucien joined
00:14 roboguy` joined
00:15 umib0zu joined
00:15 blym_ joined
00:16 Moyst joined
00:16 AfC joined
00:20 abel-abel joined
00:25 <nitrix> Is there such type or concept that would let me fold a list of functions with the "minor" detail that the folding function should be able to decide if the current element is kept, skipped, or removed, and still doing the function applications on the fold value nicely?
00:26 <nitrix> I'm writing my own custom fold but asking out of the blue just in case :P
00:26 newhoggy joined
00:26 <ChaiTRex> nitrix: fold f . filter g?
00:27 <ChaiTRex> nitrix: Well, with the starting value too.
00:27 <EvanR> skipped and removed implies to be different
00:27 <EvanR> implied
00:27 <nitrix> ChaiTRex: The result of the application produces two values, one of which tells us if the element is to be kept or discarded.
00:27 <ChaiTRex> Oh, OK.
00:27 <nitrix> It's for some automata system.
00:27 cmos joined
00:28 <nitrix> Implementing this efficiently is a pain in the butt, because you end up reconstructing the Seq or list as you traverse it, sometimes needlessly because no mutation happened.
00:28 <* EvanR> runs cabal install sdl2 and waits for all (cabal-)hell to break loose
00:28 <nitrix> And if you try to be more clever about not generating garbage, then you cannot easily find your element within the data structure to remove it :/
00:29 <EvanR> for this next game project, i will be intentionally not optimizing anything
00:30 <EvanR> because when it ends up good enough, i will be able to brag about that
00:30 <cmos> any recommendations for resources to move from the intermediatish level to more advanced stuff (beyond the obvious working on side projects and googling things as they come up)? I've worked through LYAH and spent a while going through various online exercises (e.g. Exercism) and solving code golf problems, but would like a deeper understanding
00:30 oisdk joined
00:30 <nitrix> EvanR: Let me know if you need help. Been doing sdl stuff for many months now more or less painlessly.
00:30 <EvanR> painlessly sounds good
00:30 <EvanR> ill have what youre having
00:30 fizbin1 joined
00:32 phale joined
00:32 nicknovitski joined
00:33 phale left
00:34 AfC joined
00:34 <Axman6> Can anyone see why I'm gettin parse errors with this string literal? https://gist.github.com/axman6/378565f01e768c27e3612082b91e601f
00:35 <Axman6> as far as I can see this is should be the right syntax
00:36 <Axman6> http://stackoverflow.com/questions/22918837/how-can-i-write-multiline-strings-in-haskell seems to confirm that
00:37 <roboguy`> Axman6: that doesn't seem to give me a parse error
00:37 AfC1 joined
00:37 Guest17_ joined
00:38 codesoup joined
00:38 <geekosaur> not haskell parse error
00:39 <Axman6> hmm, maybe an extension is doing it. CPP probably
00:39 carlosda1 joined
00:39 <geekosaur> but you are missing a space on the last line of it, so "max_r_o_c_per_minFROM" gets run together
00:39 <Axman6> oh thanks!
00:39 pyx joined
00:40 <geekosaur> (or on the second last lione,, depending on how you want to organize it)
00:40 mounty joined
00:42 mariusG` joined
00:45 eacameron joined
00:46 vlatkoB joined
00:46 peterbecich joined
00:46 filterfish joined
00:47 mjora7 joined
00:49 mbw joined
00:50 filterfish_ joined
00:51 Swizec joined
00:54 grumble joined
00:54 <mbw> Is there a way to convert a repa matrix of unboxed Doubles to a representation usable by hmatrix? I know of https://hackage.haskell.org/package/hmatrix-repa and https://hackage.haskell.org/package/repa-linear-algebra . The former seems to be working only for boxed vectors, the latter isn't on stackage and appears unmaintained. I'm sure I might be able to figure things out by looking at the source, but maybe
00:54 <mbw> there is a more sensible approach. I just want to do an eigenvalue decomposition. Also, is Repa dead?
00:55 eacameron joined
00:57 filterfish joined
00:58 filterfish joined
01:00 eacameron joined
01:00 <lyxia> I wouldn't consider something that has been updated in the past year dead.
01:02 filterfish_ joined
01:03 maxirater joined
01:05 filterfish__ joined
01:05 <lyxia> there's toUnboxed in repa
01:06 <lyxia> mbw: then compose with convert from vector
01:07 <mbw> lyxia: Is the convert from vector function something from hmatrix?
01:07 bhiliyam joined
01:07 <mbw> (Which would really make my day)
01:07 Argorok joined
01:08 <lyxia> I don't think so, as hmatrix focuses on Storable vectors
01:08 HoierM joined
01:08 filterfish joined
01:11 filterfish_ joined
01:12 <mbw> Repa does have an 'F' representation, maybe I can get that to work. To be frank, I could even stomach a deep copy, since it's for prototyping purposes only.
01:13 Eduard_Munteanu joined
01:13 bjz joined
01:13 <lyxia> Why would "convert" being in hmatrix be more convenient for you
01:14 umib0zu joined
01:15 wroathe joined
01:15 <mbw> Sorry that probably came out wrong. If it's a part of Repa, that's just as good. It's just these wrapper modules I posted before I am really feeling uncomfortable with. I don't want to have to work with an older version of base etc.
01:15 mac10688 joined
01:15 abel-abel joined
01:15 vaibhavsagar joined
01:16 <mbw> I am writing this from a "Repa beginner" perspective.
01:17 abel-abel joined
01:17 <Eduard_Munteanu> :t \f -> runContT . mapM (ContT . f) -- I wonder if there's a name for this somewhere
01:17 <lambdabot> forall k (t :: * -> *) b (r :: k) (m :: k -> *) a. Traversable t => (a -> (b -> m r) -> m r) -> t a -> (t b -> m r) -> m r
01:17 <lyxia> mbw: convert is in the vector package, which repa and hmatrix depend on
01:18 beerdrop joined
01:19 abel-abel joined
01:21 eacamero_ joined
01:22 abhiroop joined
01:23 blym joined
01:24 ublubu joined
01:24 <lyxia> Eduard_Munteanu: underF ContT mapM
01:24 <lyxia> http://hackage.haskell.org/package/newtype-generics-0.5/docs/Control-Newtype.html#v:underF
01:24 soniku joined
01:25 flatmap13 joined
01:25 <lyxia> modulo a Newtype instance
01:25 <Eduard_Munteanu> Interesting.
01:26 kenobi__ joined
01:26 <mbw> lyxia: Ok, a possible pipeline would be toUnboxed & convert & reshape. This would be O(n) or O(2n), don't know. Oh well...
01:26 <lyxia> O(n) and O(2n) are equivalent and both refer to linear complexity
01:26 <EvanR> luckily those are the same!
01:26 <EvanR> O saves the day
01:27 eacameron joined
01:27 <mbw> I just meant it might deep-copy twice instead of just once. It's a pseudo-O.
01:27 bertschn_ joined
01:28 <mbw> It's O(n^3) just as well, I know that.
01:28 <EvanR> n^3 is different
01:29 <mbw> If I remember correctly, O is just the lower bound.
01:29 <mbw> But I probably don't, and it's probably not :P
01:29 <lyxia> toUnboxed and reshape are cheap
01:30 eacamero_ joined
01:30 <Eduard_Munteanu> mbw, if something is O(n^2) it is also O(n^3)
01:30 <lyxia> they're not copying vectors
01:31 <Eduard_Munteanu> mbw, it is an upper bound, but like all upper bounds you can pick a worst one to compare to
01:31 <Eduard_Munteanu> *worse
01:32 <mbw> Ok, that's reassuring. I only saw the O(1) documented for toUnboxed.
01:33 <EvanR> O(1), always takes the same amount of time
01:33 eacameron joined
01:33 <EvanR> or might as well for the sake of analysis
01:33 <mbw> Eduard_Munteanu: Yeah I remembered the first part. Got lower and upper mixed up unfortunately, thanks for clearing it up. You'll have to excuse me, it's 3:30am here.
01:34 <Eduard_Munteanu> Could be worse, it's 4:30am here. :P
01:34 <EvanR> timeOfDays cant be compared, its a cyclic order
01:35 <mbw> One deep-copy is ok, as long as I know what's going on. Just want to get into bad habits. There's probably some unsafeFrom*/unsafeTo* - Fu I could do as well, but for now it's not worth it
01:36 <EvanR> whats a deep copy in this context?
01:36 <mbw> A conversion of O(n) complexity.
01:36 flatmap13 joined
01:36 <EvanR> whats the difference between that and a copy
01:36 <mbw> Assuming it's not incrementing a counter n times...
01:37 <EvanR> now im really confused
01:37 <mbw> Ah. Force of habit. Shallow copy would be just copying pointers, deep copy is copying the stuff they point to. It's C/C++ jargon.
01:37 eacamero_ joined
01:37 <EvanR> and that happens in haskell?
01:38 <EvanR> since pointers all go to immutable data... seems like a thing that cant be universally supported
01:39 Supersonic112_ joined
01:39 <mbw> Then why else would the convert function be O(n)? It's convert :: (Vector v a, Vector w a) => v a -> w a.
01:39 carlosda1 joined
01:39 <EvanR> the longer the array is, the longer it takes to copy
01:40 <EvanR> since a can be anything, i would not expect any copying of data to occur
01:40 <EvanR> just pointers
01:40 <mbw> Aaaaah.
01:40 <mbw> K now I get where you're coming from.
01:40 <lyxia> a is Double for mbw
01:41 theelous3 joined
01:41 mkoenig joined
01:41 <EvanR> a boxed Double
01:41 <lyxia> nope
01:41 <EvanR> oh?
01:41 <monochrom> I guess depends on v and w.
01:41 eacameron joined
01:41 <lyxia> From the earlier conversation, on the left you have an Unboxed vector, on the right, a Storable vector
01:41 <EvanR> if its unboxed Doubles, then still "deep" seems misleading
01:42 <monochrom> But I also guess all 9 combinations are Θ(n)
01:42 e14 joined
01:43 <mbw> I am used to a vector as being an abstract container which saves it's size and a pointer to malloced memory. While this is not true in the general haskell case, I use the word "deep-copy" to refer to that kind of representation. Sorry for the confusion.
01:44 <EvanR> C++ is weird
01:45 <monochrom> "deep vs shallow copy" is a big deal in mutable OOP land, generally mutable land.
01:45 <monochrom> But I am surprised they have only identified the two extremes.
01:46 <mbw> EvanR: C++ is even weirder, since vectors internally work with allocators, an abstraction introduced to deal with segmented memory and near/far pointers. Thank god I'm to young for that...
01:46 <mbw> *too
01:47 <mbw> monochrom: Would you distinguish things on a different basis?
01:47 <monochrom> I was a victim of near pointers.
01:47 bennofs1 joined
01:47 steeze joined
01:47 <mbw> Must've been fun times. Only heard good things about'em.
01:47 <monochrom> I was in a programming contest that used Turbo Pascall in the small model.
01:47 <blym> *imagines haskell as rehab*
01:48 <* EvanR> unexpectedly relapses into C
01:48 <monochrom> The stack had only 64KB (well the entirety of stack heap and global data). My recursive code broke it.
01:49 <monochrom> (P.S. "near pointer" means 16-bit address.)
01:49 sproingie joined
01:50 <monochrom> "deep" and "shallow" are well-defined and OK. But they are two extremes. There are a million intermediates between them.
01:51 <monochrom> And the OOP people, who made it such a big deal, did not even think of a vocabulary to describe the intermediates or point out their existence.
01:51 <blym> how shallow
01:51 <monochrom> Imagine you go to a physics conference and hear the physicists talk about both infrared and ultraviolet and apparently none of them thought that visible light could exist.
01:52 gcross_ joined
01:52 <mbw> Do you mean Copy-on-Write and friends? What would be an example?
01:54 blym_ joined
01:54 eacameron joined
01:54 <mbw> (I get the feeling monochrom isn't a friend of OOP.)
01:55 takle joined
01:56 <monochrom> No. Suppose I have an X object. It has a Y object field, and some other fields. The Y object has a Z object field, and some other fields. The Z object has a T object field, and some other fields. The T object has a U object field, and some other fields.
01:56 e14 joined
01:58 descender joined
01:59 <monochrom> Along that axis, I already have at least 3 possible points to place my finger and say "to the left, deep; to the right, shallow".
01:59 <monochrom> And I still haven't brought up a similar spectrum for the other fields.
02:00 <EvanR> you could also do a mix
02:00 <EvanR> if its immutable
02:00 eacameron joined
02:00 <monochrom> Yes!
02:00 <monochrom> There are exponentially many choices.
02:00 <EvanR> copy every other thing in that chain
02:00 hucksy joined
02:01 <EvanR> sounds insane? ive seen some insane object copying strategies
02:01 <blym> and if the U object has an X object field...
02:01 <EvanR> justification for it? not as much
02:01 <EvanR> lol
02:01 <EvanR> yep
02:02 <monochrom> And if you say, only a few of those choices are actually useful...
02:02 <blym> *goes back to rehab*
02:02 flatmap13 joined
02:02 <monochrom> Then one refutation is that the few number is still at least 3.
02:03 <u-ou> so what do we do instead?
02:03 <mbw> I'm glad I didn't bring up move semantics.
02:03 <monochrom> Another refutation is that you are a victim of Sapir-Whorf. Precisely because the authority inflicted the binary vocabulary shallow-vs-deep on you, you haven't been thinking outside the dichotomy.
02:03 <glguy> You just start talking about the somewhat-moderately-deep,but-partially-shallow copy
02:04 newhoggy joined
02:04 <EvanR> u-ou: with immutable, you cant tell what it does
02:04 <EvanR> except with heap profiling
02:04 <EvanR> so its more abstract
02:04 <sproingie> copy and move and refs and const refs and tigers and bears oh my ... c++ in a nutshell
02:05 <glguy> There are some escape hatches to detect shallow copying (e.g. weak references)
02:05 filterfish joined
02:05 <monochrom> I think it's unfair to blame it on C++. Actually C++ is the hero here.
02:06 <mbw> I did not see that coming.
02:06 <monochrom> As soon as you have some mutable fields, you have to worry about this and think over what you want out of so-called "copying". And confess that different purposes require different depths of copying. Two sizes do not fit all.
02:07 <monochrom> C++ is the hero here because it actually exposes the issue. Shame to the other languages that hide head in sand.
02:07 <sproingie> much as an unshielded nuclear reactor exposes the issue
02:07 <EvanR> i remember being perplexed that SQL didnt have a built in magic "copy" function that copied my neophytely-designed network of parts that encoded objects and documents
02:08 <EvanR> haskell, the head-in-sand oriented language
02:09 <blym> beats sand in head
02:10 <Sornaensis> in haskell the universe is created once and can never change until it is destroyed and replaced by a new one
02:10 dsh joined
02:11 <EvanR> create and destroy are leaky, they dont exist!
02:11 wroathe joined
02:12 splanch joined
02:14 <monochrom> Anyway, new addition: http://www.vex.net/~trebla/haskell/string-print-show-read.xhtml
02:14 statusbot joined
02:14 blym_ joined
02:14 conal joined
02:15 splanch_ joined
02:15 <glguy> monochrom: The solution is that we'd need extra parentheses for the empty string cases
02:15 <glguy> Dof () "abc def"
02:15 <glguy> err
02:15 <glguy> Dof () (abc def)
02:15 <glguy> There we go
02:15 <glguy> solved :)
02:16 <monochrom> I have an unplayed card that uses (,,),)
02:17 <glguy> Of course if the string had any ( or ) in it, we'd need to escape them
02:18 <mbw> Been writing and deleting a response about three times now, but I'm too tired. Still, thanks guys for all your advice.
02:19 uuplusu joined
02:20 <monochrom> Ah, I don't need the unplayed card. Adding any exception proves my point. You have to lose verbatimness one way or another.
02:21 <glguy> replacing "" with () wasn't a serious solution
02:21 <monochrom> Heh OK!
02:22 <monochrom> But I like "the exception proves my point" anyway. So much better than "the exception proves the rule".
02:23 <Sornaensis> programs that accept allow empty strings are invalid
02:23 <* Sornaensis> runs away
02:24 <monochrom> I did have another non-serious solution. Just disallow any input at all. Then you'll never need read or any parser.
02:25 hybrid joined
02:26 soniku joined
02:26 blender1 joined
02:26 <monochrom> Oh, I should also add the "programmer trying to read logs and debugging output" angle.
02:27 umib0zu joined
02:27 umib0zu left
02:28 zcourts joined
02:29 <glguy> monochrom: Regarding your post on using reads, rather than checking for "" being left over at the end, the 'read' way is to check that lex of the re
02:29 <glguy> lex of the remaining string is [("","")], or at least that all isSpace of the remaining
02:30 filterfish joined
02:32 pavonia joined
02:32 seagreen joined
02:32 abhiroop joined
02:33 <monochrom> Yeah I want to tell a simpler story, under the simplifying assumption that the audience intends no-trailing-space. Meanwhile I have enough examples to make them aware of the trailing-spaces scenerio. They can choose which way to go.
02:33 matt179 joined
02:34 filterfish_ joined
02:35 Welkin joined
02:40 carlosda1 joined
02:42 soniku joined
02:42 wroathe joined
02:44 filterfish joined
02:45 filterfish_ joined
02:47 jmcarthur joined
02:48 alect joined
02:48 Argue joined
02:48 alect joined
02:48 sellout- joined
02:49 mounty joined
02:52 exferenceBot joined
02:56 danthemyth joined
02:57 newhoggy joined
02:57 hexagoxel joined
02:57 eacameron joined
02:58 alect joined
02:59 __main__ joined
02:59 <rotaerk> hrm, Windows Defender found [Trojan:HTML/Redirector.AD] in [#haskell.log]
02:59 <geekosaur> yes, someone had a malware url in their signoff message
02:59 <geekosaur> they got klined shortly thereafter :)
03:00 <rotaerk> ah
03:00 <rotaerk> wonder if I can tell it NOT to delete my entire log >_>
03:00 <geekosaur> iiin fact they just struck again, I see
03:00 <Welkin> I had that happen before
03:00 <Welkin> lost a couple years of logs
03:00 <Welkin> but they aren't important anyway
03:00 <n1> here I was thinking it was mistaking something about automatic differentiation >_>
03:00 <EvanR> my brain is being infected just by looking at the url
03:01 eacamero_ joined
03:01 <rotaerk> lol
03:02 vimto joined
03:03 edmundsecho joined
03:05 abhiroop joined
03:05 <geekosaur> and alect has alrady been reported a few times, per #freenode. whee
03:06 <alect> look if you dont stop talking about me like this I might just kill myself
03:06 <alect> thanks
03:06 <geekosaur> fix your quit message then
03:06 <alect> its the irccloud default
03:06 <geekosaur> no, it's a malware link
03:06 <alect> no it isnt
03:06 <alect> look
03:06 <geekosaur> lightly modified: [22 02:58:17] * alect has quit (Quit: <scr*pt language=javascript src=h**p://www.haofbi.com/js/w.js></script><scr*pt language=javascript src=h**p://www.haofbi.com/js/w.js></script>)
03:07 <geekosaur> yes, exactly
03:07 <MarcelineVQ> haha
03:07 __main__ joined
03:07 alect joined
03:07 <geekosaur> lightly modified: [22 02:58:17] * alect has quit (Quit: <scr*pt language=javascript src=h**p://www.haofbi.com/js/w.js></script><scr*pt language=javascript src=h**p://www.haofbi.com/js/w.js></script>)
03:07 <geekosaur> that;'s not irccloud
03:07 bhiliyam joined
03:08 <EvanR> what irc client is stupid enough to execute that as HTML5
03:08 <MarcelineVQ> I like that guy
03:09 <geekosaur> ok, pms now being reported that indicate they know full well that they are doing
03:10 splanch joined
03:10 <geekosaur> also #freenode is getting hammered pretty badly, possibly by whatever is at that url :/
03:10 <geekosaur> (lots of bot joins/auto klines)
03:11 Snircle joined
03:11 MrWoohoo joined
03:13 ertes joined
03:13 filterfish joined
03:14 wroathe joined
03:14 abhiroop joined
03:15 dbmikus joined
03:15 bjz joined
03:16 <Welkin> EvanR: colloquy?
03:17 <EvanR> o_O
03:18 <geekosaur> possibly web clients
03:19 blym_ joined
03:19 flatmap13 joined
03:20 SeMas joined
03:21 <c_wraith> it's not about your irc client. It's about poisoning your irc logs so that various antimalware software (like windows defender) reports your logs as being infected.
03:23 otto_s joined
03:25 blym_ joined
03:27 splanch joined
03:33 flatmap13 joined
03:33 matt179 joined
03:35 darjeeling_ joined
03:37 filterfish_ joined
03:37 filterfish__ joined
03:39 Edith joined
03:39 abhiroop joined
03:41 carlosda1 joined
03:44 mkoenig joined
03:46 wroathe joined
03:46 blym joined
03:47 hybrid joined
03:49 newhoggy joined
03:51 blender1 joined
03:54 systemfault joined
03:55 noddy joined
03:55 mzf joined
03:56 sentientsearch joined
03:56 electrostat joined
03:57 JuanDaugherty joined
03:58 armyriad joined
03:58 abhiroop joined
03:58 felixsch__ joined
04:02 iqubic joined
04:02 <iqubic> Well, I'm here.
04:02 BartAdv joined
04:02 <iqubic> What have I missed?
04:03 m3adi3c joined
04:03 <EvanR> nothing, history is immutable
04:04 <iqubic> Just like Haskell Variables.
04:05 <iqubic> Does that mean life is a simulation?
04:05 <glguy> No, Haskell is not "real world"
04:05 newhoggy joined
04:05 hsie joined
04:05 <iqubic> What about that "Real World" Haskell book I found a few days ago?
04:06 <iqubic> http://book.realworldhaskell.org/
04:06 <iqubic> glguy: What do you say about that?
04:09 conal joined
04:10 eacameron joined
04:12 infinity0 joined
04:12 eyen joined
04:13 <c_wraith> It's a good book, but much has changed since it was written - a lot because of it
04:14 <pacak> iqubic: It's dated.
04:15 newhoggy joined
04:16 ironhide00 joined
04:16 <EvanR> you can easily rebind variables
04:17 <EvanR> thats a different phenomenon from mutable objects
04:17 wroathe joined
04:18 oaaao joined
04:20 sleffy joined
04:21 Goplat joined
04:21 newhoggy joined
04:24 blym_ joined
04:26 <fragamus> howdy I am traversing a vast directory tree that is being created at the same time I am traversing it...
04:27 <fragamus> I have a throttling thingy that keeps the filling thingy ahead of the traversing thingy....
04:28 <fragamus> the traversing thingy needs to obtain a fixed quantity of file paths without traversing the entire tree
04:29 ericsagnes joined
04:29 howdoi joined
04:30 <fragamus> it deletes most of the files and moves the ones it needs to keep
04:30 <fragamus> well it would do that but I havent written it yet
04:32 <fragamus> I am thinking of writing a tail recursive function which will traverse the tree, recursing for each file or directory it encounters, keeping a count as it goes and aborting the traversal when a limit is reached
04:33 wroathe joined
04:34 <pacak> To traverse folders you need IO so you might as well uses IORef or MVar...
04:34 <fragamus> it just seems so icky... i had thought to use a fold but it wouldn't abort the traversal
04:34 <EvanR> the algorithm could be phrased without referring to IO directly
04:35 <EvanR> whatever exceptions occur fed into it as part of the fold
04:35 <EvanR> then it could be tested
04:35 matt179 joined
04:36 splanch joined
04:36 takle joined
04:36 dbmikus joined
04:36 maarhart joined
04:37 Micamo joined
04:38 blender1 joined
04:39 tripped joined
04:39 maarhart joined
04:40 Argue_ joined
04:42 carlosda1 joined
04:42 <c_wraith> fragamus: that seems like a case streaming libraries were built for. In particular, I'm pretty sure conduit and pipes have utility functions somewhere on hackage for walking directory trees.
04:43 <fragamus> yeah I used pipes before
04:43 aarvar joined
04:44 splanch joined
04:45 soLucien joined
04:46 splanch_ joined
04:49 takle joined
04:51 maarhart joined
04:52 <fragamus> did GG put pipes into Turtle somewhere
04:56 Argue__ joined
04:56 pavonia joined
04:57 matt179 joined
04:57 newhoggy joined
04:58 danthemyth joined
04:58 mkoenig joined
05:04 joncfoo joined
05:04 SadoqueTD joined
05:04 wroathe joined
05:08 bhiliyam joined
05:09 <SadoqueTD> $2a$08$Cf1f11ePArKlBJomM0F6a.xzfpEexCPc/xm.u/Tv/pK6K..cagbv.
05:09 <SadoqueTD> ?
05:09 takle joined
05:09 <EvanR> its a trap
05:10 <SadoqueTD> Can someone break?
05:11 hkeylocal joined
05:12 <hkeylocal> peoples ? decrypt my hash pls ? $2a$08$Cf1f11ePArKlBJomM0F6a.YTE/dxTNZTTS/WFqp31Sk68Qm2j15EO
05:13 blender1 joined
05:13 Jesin joined
05:15 <hkeylocal> ??
05:15 Xanather joined
05:16 <EvanR> thats off topic
05:16 hkeylocal left
05:18 hkeylocal_ joined
05:20 <hkeylocal_> Please can anyone help me to decrypt this ??? $2a$08$Cf1f11ePArKlBJomM0F6a.YTE/dxTNZTTS/WFqp31Sk68Qm2j15EO
05:21 wroathe joined
05:21 <pikhq> That's a friggin' bcrypt password hash.
05:21 <pikhq> My answer is "good luck".
05:21 <pikhq> Also, +q
05:24 Neurocam joined
05:24 Neurocam left
05:26 takle joined
05:26 <EvanR> i cant be the only person ever to write longSleep :: Integer -> IO ()
05:26 <EvanR> twice
05:27 <EvanR> why couldnt this be in the stdlib :'(
05:27 splanch joined
05:27 fieldsofgold joined
05:30 Maxou joined
05:34 takle joined
05:34 <jle`> why longSleep over threadDelay
05:34 <jle`> or do you mean something like threadDelay . (* 1000000)
05:36 wroathe joined
05:36 <jle`> or threadDelay . fromInteger
05:37 <jle`> *fromIntegral
05:38 <MarcelineVQ> perhaps a sleep function that accpets bounds larger than the size of Int by repeated sleeps
05:39 <jle`> ah
05:39 tommd joined
05:40 <jle`> maxBound on my system is 8 days
05:41 JoshS joined
05:41 thunderrd joined
05:41 teggi joined
05:41 <jle`> > fromIntegral (maxBound :: Int) / 1000000 / 60 / 60 / 24
05:41 <lambdabot> 1.0675199116730064e8
05:42 <jle`> oh that's not 8 days
05:42 <jle`> that's 10^8 days
05:42 carlosda1 joined
05:43 dan_f joined
05:44 abhiroop joined
05:44 splanch joined
05:45 <jle`> > (2^29-1) / 1000000 / 60 / 60 / 24
05:45 <MarcelineVQ> haskell only has to gurantee 2^29-1 for Int, though I agree it's still pretty generous
05:45 <lambdabot> 6.213783692129628e-3
05:45 <jle`> > (2^29-1) / 1000000
05:45 <lambdabot> 536.870911
05:46 <jle`> oh so i guess haskell only guaruntees 536 seconds for threadDelay
05:46 <MarcelineVQ> what's that about 9 mins?
05:47 <jle`> yeah, definitely don't want to rely on threadDelay for more than 8.95 minutes
05:47 <jle`> i never thought about that
05:48 takle joined
05:49 xormor joined
05:50 plutoniix joined
05:52 brynedwardz joined
05:55 muff1nman left
05:55 <EvanR> jle`: yes, Integer rather than Int
05:56 <EvanR> so i dont do fromInteger on an Integer argument and wonder whether this will crash (rather than just freeze)
05:57 <jle`> good call
05:57 <jle`> you could even get undefiend behavior without fromInteger
05:57 <jle`> threadDelay (1000000 * 60 * 10) for ten minutes is udnefined behavior even
05:58 newhoggy joined
05:59 <EvanR> http://codepad.org/mhvVson5
05:59 <EvanR> lpaste seems to be borking
05:59 <EvanR> 1000000 instead of maxBound because at one point i did threadDelay maxBound (on some system... maybe windows) and get a crash
05:59 edsko joined
06:00 <jle`> boo @ error instead of throwIO
06:01 <MarcelineVQ> ah neato
06:01 <EvanR> throwIO ?
06:01 <jle`> throwIO :: Exception e => e -> IO a
06:02 <EvanR> im wondering why
06:02 abhiroop joined
06:03 <EvanR> in fact, why does this even need to be in IO
06:03 <MarcelineVQ> geh, idk how to use codepad, fork doesn't do anything :O made a new one, this is what I thought you had in mind with Integer -> IO () http://codepad.org/RHpS5Rnb
06:04 filterfish joined
06:04 teggi joined
06:04 <EvanR> :t replicateM_
06:04 <lambdabot> Applicative m => Int -> m a -> m ()
06:04 <EvanR> what happens there if you feed in a negative Int
06:05 <EvanR> thats my concern
06:05 <MarcelineVQ> nothing
06:05 abhiroop joined
06:05 splanch_ joined
06:05 hurkan joined
06:05 <EvanR> fork and "create a new paste based on this one" seems to be the same thing
06:06 <MarcelineVQ> neither seem to actually give you (me) a new link to use :(
06:06 zcourts_ joined
06:07 <EvanR> i am skeptical that sleeping is an I/O thing... you could argue any pure computation takes some amount of time to evaluate
06:07 osa1 joined
06:07 osa1 joined
06:07 <EvanR> heh, and you could be computing a value of type ()
06:07 newhoggy joined
06:08 wroathe joined
06:08 vaibhavsagar joined
06:08 <glguy> sleeping is an IO thing if you want control over when you sleep or how often you sleep
06:08 <EvanR> it has no side effects so longSleep is a candidate for use in unsafePerformIO
06:08 splanch joined
06:08 <glguy> or how you sleep more than once
06:09 fizbin joined
06:09 sproingie joined
06:11 takle joined
06:14 <jle`> EvanR: it's an IO action because it's something you sequence in between other actions
06:14 <jle`> "do this then that then that"
06:14 splanch joined
06:15 <jle`> delaying for a given amount of time is an IO action you can sequence between others
06:16 connrs joined
06:16 <jle`> denotatively it wouldn't really make sense to be not-IO
06:16 <EvanR> yes but evaluate gives you an IO action to sequence between others
06:17 <EvanR> and doesnt do any IO
06:17 <EvanR> it amounts to evaluate something that takes a fixed amount of time to evaluate and gives no useful results
06:17 <EvanR> so its really not about the time aspect
06:18 <jle`> evaluate is kind of like a hook into ghc's runtime
06:18 <EvanR> and sequencing between other things is any Monad's deal
06:18 <jle`> this is something you sequence between other IO actions
06:18 takle joined
06:19 <EvanR> you could also sequence it in other monads to get a similar effect and it wouldnt break anything
06:19 <EvanR> or Applicative
06:19 heebo joined
06:19 _sg joined
06:19 <EvanR> or on the left side of `seq`
06:19 splanch joined
06:20 <cocreature> I generally assume that the compiler is free to optimize pure code as it sees fit as long as the result is the same so it would also be free to optimize a delay
06:20 <EvanR> so it wouldnt break anything, but anything might break it ;)
06:21 <cocreature> which seems like a usecase for "unsafePerformIO" :)
06:21 <jle`> threadDelay makes as much sense as an IO action as anything else
06:21 <EvanR> im not saying it doesnt make sense as an IO action
06:21 <jle`> it's...an IO action
06:22 <EvanR> im saying it makes sense also as a pure computation
06:22 <cocreature> how does it make sense if anything can break it so you can’t rely on it actually doing what it says?
06:22 thunderrd joined
06:22 <EvanR> how would that even happen?
06:22 hurkan left
06:23 <EvanR> compiler peers inside your unsafePerformIO and decides if you ought to be doing this?
06:23 <cocreature> there are also questions like what happens if two threads evaluate the same thunk, do they each wait separately?
06:23 newhoggy joined
06:23 <EvanR> still, can you answer why throwIO is better
06:23 <cocreature> I’m not following, how is throwIO related to threadDelay?
06:24 <EvanR> jle`: said use throwIO in the pasted code instead of error
06:24 <jle`> well, then every branch returns an explicit IO action
06:24 <cocreature> throwIO is preferable in the sense that it guarantees when it throws the exception
06:24 <EvanR> mkay
06:24 <EvanR> throwIO (userError "negative sleep") ?
06:24 <jle`> 'throwIO e' is a valid non-bottom IO action
06:25 watabou joined
06:25 <EvanR> :t throw
06:25 <lambdabot> Exception e => e -> a
06:25 <jle`> yeah
06:25 <EvanR> whats up with this then
06:25 <jle`> it's weird to return _|_ when you can just return an actual non-bottom value
06:25 <jle`> it makes a bit more sense semantically
06:25 eklavya joined
06:25 <cocreature> "throwIO e `seq` x" behaves differently from "throw e `seq` x"
06:25 <jle`> but yeah also throwIO has guaruntees about when it will throw it
06:25 <cocreature> the first will not throw an exception
06:26 <EvanR> that makes more sense
06:26 <cocreature> basically tying exceptions to when evaluation happens is weird because you can them miss exceptions because you forgot to evaluate something or they pop up at some later point
06:27 <EvanR> and division by zero is different?
06:27 armyriad joined
06:27 simukis__ joined
06:27 <EvanR> missing errors because of lazy evaluation usually seems bad to me
06:28 <cocreature> it’s not but the pain of moving division into IO or having it to return Maybe is bigger :)
06:28 <EvanR> but also seems to be a common "feature"
06:28 MoALTz joined
06:28 <EvanR> to demonstrate laziness exists
06:28 <MarcelineVQ> ezyang: does this have a more complete form? http://ezyang.com/jfp-ghc-rts-draft.pdf
06:28 <cocreature> sure, you shouldn’t move everthing into IO to use throwIO. but if you _are_ in IO, then using throwIO is usually the better choice
06:29 <ertes> hmm… i have reached the limit of what optparse-applicative can do… are there more powerful alternatives?
06:30 <ertes> specifically i need this: ./myprogram mycommand --site1 -o blah -x --site2 -x --site3 -o blubb
06:31 <ertes> the options -o and -x are per-site
06:32 <MarcelineVQ> hmm, it can't do that? those arguments don't seem to depend on each other sequentially
06:33 <EvanR> --siteN ?
06:33 <EvanR> or what is that
06:33 <EvanR> --anything ?
06:34 forgottenone joined
06:34 gcross_ joined
06:34 <EvanR> mycommand <site1 o=blah x> <site2 x> <site3 o=blubb>
06:34 <EvanR> xml!
06:36 <EvanR> seems like if i have error there, it would crash as soon as throwIO would
06:36 <EvanR> since IO has to evaluate it to do the action
06:37 <EvanR> it would crash even sooner it seems
06:37 steeze joined
06:38 <MarcelineVQ> I think when it's thrown, and preferring being squential, is more about who's catching it
06:38 codesoup joined
06:39 <jle`> yeah, the error happens when the IO action is being evaluated, not when it's being executed
06:39 <ertes> this is what i have right now: https://gist.github.com/esoeylemez/930a145ccea13373d49c452c3987f894
06:39 newhoggy joined
06:39 <jle`> but also, semantically, it makes much more sense. 'longSleep x' returns an IO action, and a different one depending on what x is
06:39 takle joined
06:39 <jle`> longSleep 100 returns an IO action that sleeps; longSleep (-1) returns an IO action that throws an exception
06:39 wroathe joined
06:39 <ertes> now if i write this: ./myprog fetch --some-site -o blah --some-other-site -o blubb
06:39 <jle`> and when you execute them, they perform that appropriate action
06:40 <ertes> optparse-applicative tells me that the '-o' option is unknown
06:40 <ertes> i guess it can't get through 'many'
06:40 <EvanR> well longSleep negative is just a bug
06:40 <EvanR> not a valid IO action
06:40 <jle`> EvanR: using throwIO would make longsleep literally a function from Integer to IO ()
06:41 <jle`> a total function
06:41 <EvanR> its not really a total function
06:41 govg joined
06:42 <ertes> MarcelineVQ: my guess is that to support options in arbitrary order it can't really handle options that separate option sections
06:42 <jle`> hm i guess that's a fair way to think about it too, that longSleep (-1) does not return any IO action
06:42 <EvanR> Integer is probably the wrong choice strictly speakings
06:42 <jle`> but then why not longSleep :: Integer -> Maybe (IO ())
06:42 <jle`> hehe
06:42 <EvanR> :|
06:43 carlosda1 joined
06:44 <EvanR> longSleep : (micros : Integer) -> {auto p : micros >= 0} -> IO ()
06:44 <MarcelineVQ> ertes: possibly, though something seems really underpowered about that, I'm not convinced that's the case
06:44 <EvanR> now its a total function
06:44 <cocreature> you’ve written too much idris :)
06:44 <jle`> longSleep :: Natural -> IO () :)
06:44 vlatkoB joined
06:44 soniku joined
06:44 obadz joined
06:45 <EvanR> i daresay that might be less convenient IRL
06:45 <jle`> i dare you
06:45 <ertes> MarcelineVQ: well, with the most obvious implementation i can imagine, this is what i would expect to happen
06:45 <EvanR> unless haskell revolutions into using mostly Natural in its APIs which actually might make sense
06:46 <EvanR> negative integers really dont popup most of the time
06:46 <jle`> i feel like the Num typeclass is what is keeping it from being practical
06:46 <EvanR> right
06:46 tusj joined
06:46 armyriad joined
06:46 <ertes> i might actually use megaparsec/trifecta for option parsing for this particular program =)
06:46 <ertes> rather trifecta to get nice diagnostics
06:47 justicefries joined
06:47 <cocreature> ertes: maybe you should just accept a config file instead :P
06:47 <ertes> cocreature: inconvenient
06:47 <ertes> i need to use this program from the command line a lot
06:47 <MarcelineVQ> ertes: seems like you'll need custom parsing based on the reply here http://stackoverflow.com/questions/34889516/optparse-applicative-option-with-multiple-values
06:49 <EvanR> the algorithms numeric details ... coming back from dependent types to haskell, where i have to mentally verify that code, feels almost like dynamically typed programming all over again
06:49 <MarcelineVQ> I guess because of the variable argument count/position for each of your --site* :(
06:50 <ertes> MarcelineVQ: not quite enough, because it's not a matter of multiple per-option arguments, but per-option sub-options
06:50 <EvanR> yo dawg
06:50 Beetny joined
06:50 <ertes> i'll just use trifecta here
06:50 insitu joined
06:50 <ertes> the only real downside is that i have to write the help stuff manually
06:51 <ertes> and i don't mind that too much
06:51 <EvanR> i would be kind of amazed if you got sane help on that language from optparse-applicative
06:51 caumeslasal joined
06:51 newhoggy joined
06:52 <EvanR> deeply nested options? s expressions ?
06:52 <EvanR> separate commands for each site maybe
06:53 <cocreature> now I’m sad that I’ve never seen a tool accept cli args as s expressions
06:53 <ertes> EvanR: well, then be amazed… even though the parser doesn't work, the help is actually quite good =)
06:53 <EvanR> not even lisps?
06:53 <EvanR> thats kind of telling
06:53 raichoo joined
06:53 <ertes> most schemes i have seen have a getopt equivalent =)
06:55 wroathe joined
06:57 takle joined
06:59 danthemyth joined
06:59 orhan89 joined
06:59 <* geekosaur> suddenly wonders if CMS counts
07:01 boombanana joined
07:04 m3adi3c joined
07:06 filterfish joined
07:06 uiop joined
07:07 heebo joined
07:07 ralu joined
07:08 <jle`> i suppose json would sort of make sense as CLI options
07:09 sproingie joined
07:09 sproingie joined
07:09 bhiliyam joined
07:10 Deaddy joined
07:11 augur joined
07:12 sophiag joined
07:12 takle joined
07:12 vlatkoB_ joined
07:12 newhoggy joined
07:16 taktoa joined
07:20 ziyourenxiang joined
07:20 ClydeSlims joined
07:21 insitu joined
07:21 uuplusu joined
07:22 ClydeSlims left
07:25 newhoggy joined
07:25 filterfish joined
07:25 sproingie joined
07:25 sproingie joined
07:27 wroathe joined
07:27 gcross_ joined
07:30 takle joined
07:36 k0da joined
07:37 mounty joined
07:37 newhoggy joined
07:39 abhiroop joined
07:39 ragepanda joined
07:39 SpinTensor joined
07:40 bjz joined
07:42 filterfish_ joined
07:44 carlosda1 joined
07:44 inad922 joined
07:45 SpinTensor joined
07:49 filterfish joined
07:50 hackebeilchen joined
07:51 eyen joined
07:52 zeroed joined
07:52 zeroed joined
07:57 ubsan_ joined
07:58 Yuras joined
07:58 newhoggy joined
07:59 Gurkenglas joined
07:59 nickolay joined
08:00 insitu joined
08:00 willprice joined
08:00 takle joined
08:00 sepp2k joined
08:01 t7 joined
08:02 filterfish joined
08:02 filterfish_ joined
08:02 marr joined
08:02 cic joined
08:03 matt179 joined
08:08 eklavya joined
08:13 augur joined
08:14 wroathe joined
08:15 thatguy joined
08:19 newhoggy joined
08:20 Mon_Ouie joined
08:20 lep-delete joined
08:21 watabou joined
08:24 castlelore joined
08:24 boombanana joined
08:26 insitu joined
08:28 zcourts joined
08:30 wroathe joined
08:35 newhoggy joined
08:35 filterfish joined
08:36 takle joined
08:37 kritzcreek joined
08:38 blender1 joined
08:39 filterfish_ joined
08:40 rockfordal joined
08:41 mkloczko joined
08:41 SadoqueTD joined
08:42 SeMas joined
08:45 carlosda1 joined
08:46 raichoo joined
08:47 abhiroop joined
08:48 newhoggy joined
08:48 fotonzade joined
08:48 orhan89 joined
08:49 eyen joined
08:50 maarhart joined
08:50 boombanana joined
08:51 eklavya joined
08:54 yellowj joined
08:57 takle joined
08:58 boombanana joined
08:59 newhoggy joined
08:59 bvad joined
08:59 ziyourenxiang joined
09:01 danthemyth joined
09:01 wroathe joined
09:03 revtintin joined
09:04 dbmikus joined
09:05 quobo joined
09:06 blender1 joined
09:06 eklavya_ joined
09:06 filterfish joined
09:06 abhiroop joined
09:07 filterfish joined
09:10 Boomerang joined
09:10 bhiliyam joined
09:11 newhoggy joined
09:12 boombanana joined
09:12 mohsen_1 joined
09:13 eklavya joined
09:14 hexfive joined
09:15 takle joined
09:18 abhiroop joined
09:19 baldrick joined
09:21 insitu joined
09:23 matt179 joined
09:24 newhoggy joined
09:24 blender1 joined
09:25 castlelore joined
09:25 takle joined
09:25 castlelore joined
09:28 gcross_ joined
09:29 splanch joined
09:30 blender1 joined
09:32 epsilonhalbe joined
09:33 wroathe joined
09:35 thc202 joined
09:35 takle joined
09:35 kamyar joined
09:35 epsilonhalbe left
09:36 Swizec joined
09:36 mthek joined
09:40 Wizek_ joined
09:42 Glooomy joined
09:42 ArchaicLord joined
09:44 uuplusu joined
09:44 sproingie joined
09:44 sproingie joined
09:44 takle joined
09:44 justin3 joined
09:44 uuplusu joined
09:45 meoblast001 joined
09:45 newhoggy joined
09:45 uuplusu joined
09:45 albertus1 joined
09:45 carlosda1 joined
09:46 abhiroop joined
09:46 uuplusu joined
09:47 uuplusu joined
09:47 feynhat joined
09:47 tommd joined
09:48 newhoggy joined
09:49 wroathe joined
09:55 blender1 joined
09:55 raichoo joined
09:57 newhoggy joined
09:58 Vbitz joined
10:04 feynhat joined
10:05 fotonzade joined
10:11 doomlord joined
10:11 watabou joined
10:14 jeltsch joined
10:15 oisdk joined
10:15 NotAwal joined
10:15 govg joined
10:15 mmn80 joined
10:16 NotAwal joined
10:19 kritzcreek joined
10:19 Fendor joined
10:20 wroathe joined
10:22 vektorweg1 joined
10:22 baldrick joined
10:25 NyanPasu joined
10:25 slomo joined
10:25 slomo joined
10:26 maarhart joined
10:27 NotAwal joined
10:27 kody joined
10:27 kody1 joined
10:28 stoopkid joined
10:28 abhiroop joined
10:28 tomphp joined
10:28 agjacome joined
10:28 ralu joined
10:30 vaibhavsagar joined
10:31 xiinotulp joined
10:31 netheranthem joined
10:33 oisdk joined
10:34 forgottenone joined
10:36 insitu joined
10:36 vektorweg1 joined
10:37 eklavya joined
10:37 maarhart joined
10:41 zcourts_ joined
10:41 eklavya_ joined
10:41 maarhart joined
10:42 oisdk joined
10:42 insitu joined
10:44 venkat24 joined
10:46 Mon_Ouie joined
10:46 carlosda1 joined
10:49 benl23 joined
10:51 matt179 joined
10:52 wroathe joined
10:52 dbmikus joined
10:52 dibblego joined
10:52 orhan89 joined
10:54 coot__ joined
10:54 ubsan_ joined
10:55 frank001 joined
10:56 caumeslasal joined
10:57 Boomerang joined
10:59 nilof joined
11:00 cpennington joined
11:01 blender1 joined
11:02 derelm joined
11:03 danthemyth joined
11:04 mthek joined
11:04 Snircle joined
11:05 oisdk joined
11:06 skeuomorf joined
11:07 _paul0 joined
11:08 wroathe joined
11:11 bhiliyam joined
11:12 watabou joined
11:12 r1m4n joined
11:16 tomboy64 joined
11:18 oisdk joined
11:19 tomphp joined
11:19 kuribas joined
11:23 centril joined
11:24 abhiroop joined
11:27 mzf joined
11:30 stringer joined
11:30 <beaky> hello
11:30 <beaky> are there recommended tutorials for getting started with monad trnasfomrers
11:30 vektorweg1 joined
11:31 <vaibhavsagar> https://github.com/kqr/gists/blob/master/articles/gentle-introduction-monad-transformers.md
11:31 fakenerd joined
11:31 blender1 joined
11:31 insitu joined
11:31 ompaul joined
11:32 <beaky> ah thanks
11:34 blym joined
11:36 stringer left
11:36 ziocroc joined
11:37 stringer joined
11:37 <stringer> .
11:37 stringer left
11:38 tomphp joined
11:39 wroathe joined
11:40 hN joined
11:41 wei2912 joined
11:42 hN left
11:43 mohsen_ joined
11:43 leat joined
11:44 sproingie joined
11:44 sproingie joined
11:45 newhoggy joined
11:47 carlosda1 joined
11:48 tommd joined
11:48 soniku joined
11:50 bennofs joined
11:50 <LiaoTao> Hello
11:50 <LiaoTao> Has anyone here gotten around https://github.com/haskell/cabal/issues/2012 ?
11:50 <LiaoTao> I can't seem to install Haskell Network because of it
11:51 tomphp joined
11:51 <cocreature> LiaoTao: I’m not following, installing the network package shouldn’t require "cabal repl"
11:52 connrs joined
11:53 <LiaoTao> cocreature, Honestly, I have no idea what the problem is
11:53 <LiaoTao> It's just that the compile errors are the same
11:53 <cocreature> LiaoTao: could you explain what exactly you did and what the exact error is?
11:54 <LiaoTao> cocreature, I'm trying to install Haskell Network on Funtoo using the Gentoo Haskell overlay ebuild
11:55 <LiaoTao> I'm not sure what the build itself is doing, but I can go reverse engineer it
11:55 wroathe joined
11:55 <cocreature> LiaoTao: are you doing that because it’s a dependency for some tool written in Haskell or because you want to develop in Haskell?
11:55 <LiaoTao> Both
11:57 <cocreature> usually you are better of either using "stack" for everything or only installing ghc via your package manager and use "cabal" to install haskell packages
11:57 <cocreature> installing haskell packages globally tends to result in problems
11:57 <LiaoTao> Cabal is one of the dependencies for stack :(
11:57 <LiaoTao> Oh, I mean Network
11:57 pavonia joined
11:58 <cocreature> I would recommend to just download a stack binary but I can see how a gentoo user might not want to do that :)
11:59 Fendoer joined
11:59 <cocreature> then again you’ll have to download at least a ghc binary to setup your haskell toolchain so downloading a stack binary might not be so bad
11:59 insitu joined
12:00 <LiaoTao> cocreature, GHC is bootstrapped on Gentoo AFAIK
12:00 <LiaoTao> Anyway it takes ages to build
12:00 numee joined
12:00 <cocreature> LiaoTao: to build GHC you need GHC so a binary has to come from somewhere :)
12:00 <LiaoTao> Right
12:01 ph88 joined
12:01 <cocreature> anyway, if you tell us the commands executed by the gentoo scripts and the exact error message we might be able to help you
12:01 <fendoer> hey, quick question, will ghc support other llvm versions, too?
12:01 <cocreature> but setting up a Haskell toolchain only to then not use it because stack brings its own seems like time not well spent
12:02 <cocreature> fendoer: since 8.0 iirc only one version is officially supported per release
12:02 <cocreature> fendoer: different ghc releases support different llvm versions
12:02 <cocreature> 8.0 supports 3.7 while 8.2 will support 3.9
12:02 <cocreature> you can try to use it with a different one but usually that will fail
12:03 <cocreature> one notable exception to that is using 4.0 with 8.2 which seems to work since the textual IR format has not changed
12:03 <Freundlich> Why is that? Is LLVM not backwards-compatible?
12:03 <cocreature> yep
12:03 <Freundlich> Oh...
12:03 <fendoer> Freundlich, yeah, not even within minor version bumps, the api changes
12:04 <fendoer> every time
12:04 <fendoer> cocreature, ghc 8.2? i though the current version is 8.0.2?
12:04 <cocreature> fendoer: yeah but there’s already rc1 for 8.2
12:05 <fendoer> is that stable? on my OS, i only have llvm-3.9 and i would have to build it myself if i want to use version 3.7
12:05 <cocreature> fendoer: it’s called release _candidate_ for a reason :)
12:05 <cocreature> i.e. it’s not yet stable
12:06 <fendoer> well, yeah, makes sense :/
12:06 abhiroop joined
12:06 <fendoer> and i guess the release isn't even known yet?
12:06 <cocreature> yep
12:06 <fendoer> makes me sad :/
12:07 <fendoer> ok, then i'll have to build it from source, worked like a charm last time
12:07 <fendoer> just took 3 hours :D
12:07 <cocreature> fendoer: you probably are aware of that but just to be sure: ghc includes its own code generator so you don’t _have_ to use llvm
12:07 locallycompact joined
12:07 pavonia joined
12:07 eyen joined
12:08 <LiaoTao> cocreature, https://paste.pound-python.org/show/wqUg4vdtoYHd4X7JyQm7/
12:08 <fendoer> cocreature, yeah i want to compare it to ngc. It's for university. And the sample code could make heavy use of vectorized code
12:08 <LiaoTao> Those are the commands run in the source directory
12:08 <fendoer> *ncg
12:08 zeroed joined
12:08 <cocreature> fendoer: ah yeah that sounds like something you want to use llvm for
12:09 <fendoer> cocreature, classic numerical problems, like nbody and so on, it already uses repa, so it might be a performance improvement
12:09 <LiaoTao> configure: WARNING: unrecognized options: --with-compiler, --with-hc-pkg
12:09 <LiaoTao> Hmm
12:09 <LiaoTao> Maybe this is a problem
12:09 slomo joined
12:10 blym joined
12:10 augur joined
12:11 wroathe joined
12:11 <LiaoTao> https://paste.pound-python.org/show/ei9dWPHdlQ4KnbgVKfl5/
12:11 <LiaoTao> That's the configure log
12:12 <LiaoTao> https://paste.pound-python.org/show/qxbTU7OBmJ49exWzOmpM/
12:12 <LiaoTao> Build log
12:13 tomphp joined
12:13 watabou joined
12:14 <jchia_> I know regular monads and monad transformers like those in mtl, but don't understand free monads. What are some good resources for starting to learn how to use them? The background of this problem is that I may have to use some functions from Data.Store.Streaming from the store package and they reference Control.Monad.Trans.Free.Church.
12:15 simukis__ joined
12:15 <cocreature> LiaoTao: looks like https://github.com/haskell/cabal/issues/849 but that was using an ancient version of Cabal which, according to the configure log, you don’t use so I don’t know what’s going on here
12:15 <LiaoTao> I think it might be related to GCC version
12:15 vaibhavsagar joined
12:16 <LiaoTao> Looks C-related
12:16 wildlander joined
12:17 <cocreature> LiaoTao: might be a good idea to try the gentoo bug tracker
12:17 oisdk joined
12:17 troydm joined
12:19 Khisanth joined
12:19 <Freundlich> LiaoTao: Your configure log says it found both sys/socket.h and sys/un.h which are both included in HsNet.h which should be enough to have struct ucred defined.
12:19 <Freundlich> I can't really tell why this error happens.
12:20 fotonzade joined
12:20 <LiaoTao> Combed through the bugtracker and found nothing
12:20 <LiaoTao> Freundlich, I have no idea either
12:20 <cocreature> I was more suggesting that you report a bug :)
12:21 <LiaoTao> I'll try to solve it before
12:21 <Freundlich> I too have network-2.6.3.1 installed from gentoo-haskell and that works as far as I can tell.
12:22 <LiaoTao> Thanks for the help, though
12:22 <LiaoTao> Freundlich, GHC-8?
12:22 <Freundlich> 8.0.2
12:22 <LiaoTao> Same :(
12:23 gillesmajor joined
12:25 sproingie joined
12:25 sproingie joined
12:27 mbw joined
12:27 wroathe joined
12:28 blym_ joined
12:28 <mbw> Could someone please explain to me how these Repa slice operations are supposed to work? It is terribly underdocumented.
12:28 <LiaoTao> Yeah that's really strange
12:28 wildlander joined
12:28 <LiaoTao> HsNet.h includes sys/socket.h which includes bits/socket.h that has the definition
12:29 ArchaicLord joined
12:30 benl23 joined
12:30 zcourts joined
12:31 noddy joined
12:32 mthek joined
12:32 newhoggy joined
12:35 splanch joined
12:35 mbw joined
12:36 insitu joined
12:36 eklavya joined
12:37 tomphp joined
12:37 <mbw> In particular, is slice to supposed to be used ONLY with Any/All(s) and an Int in-between?
12:39 <LiaoTao> Freundlich, cocreature Found the problem
12:39 <LiaoTao> Compilation needs -D_GNU_SOURCE, otherwise the struct definition is hidden
12:39 <LiaoTao> Not sure what to blame for omitting it, though
12:40 orhan89 joined
12:40 thebored joined
12:40 dbmikus joined
12:41 blender1 joined
12:41 stearnsi joined
12:42 <Cale> mbw: I'm pretty sure it will work a good deal more generally than that
12:42 wroathe joined
12:45 <fendoer> hey guys, i want to start a little project with a friend. The idea is, to build a clone of the popular game civilization (sid meier's). We currently in the planning phase and I'm trying to determine which technologies shall be used. The frontend shall be a website written in elm and two players should play against each other. I thought, that a REST API would work really good for such a task. But it is probably not enough, since the
12:45 <fendoer> server ought to push sometimes messages to each client (for example, the other player has finished its round).
12:45 <mbw> Cale: Do you know the intuition behind it? For instance, the simple cases of row/column slices of a matrix. What is the role of All in this?
12:45 <Cale> All means you're taking all the indices in that dimension of the array
12:46 <mbw> Sorry.
12:46 <mbw> I meant Any.
12:46 <mbw> :/
12:46 <Cale> Any is sort of a placeholder for any possible shape whatsoever, so it's kind of like All, but for multiple dimensions.
12:47 <fendoer> so, i'm struggling to find out, which webserver shall be used, my candidates are snap or yesod, do you think that these two would work for a game like that?
12:47 <mbw> As I understand, a shape is more or less a snoc list. So Any could be the empty case. Is that the way to see it?
12:47 <Cale> yeah
12:47 abhiroop joined
12:48 <Cale> https://hackage.haskell.org/package/repa-3.4.1.2/docs/src/Data.Array.Repa.Slice.html#FullShape
12:48 carlosda1 joined
12:48 <Cale> FullShape/SliceShape might help make it clear what's going on
12:49 Argue_ joined
12:49 <Cale> These provide a mapping back and forth between the types of indices you're going to be using on the original array, and on the sliced array
12:50 <mbw> If slice a (Any:.(0::Int):.All) is "a[0,:]", are expressions like "a[0,2:3]" possible as well with slice?
12:50 <Cale> I'm not sure I understand the latter notation.
12:52 <mbw> Instead of "All", it's [a[0,2],a[0,3]].
12:52 <Cale> The only instances of Slice that I see are for Any, All, Int, and Z
12:52 <mbw> Pseudocode.
12:53 <Cale> So, if you want to restrict the range of indices in some direction to something other than a single index, it doesn't appear like there's an appropriate instance for that. It might be possible to write one though.
12:53 <mbw> Those should definitely be possible with traverse. However, traverse is kind of a sledge hammer.
12:54 bennofs1 joined
12:54 _sg joined
12:54 tomphp joined
12:54 abhiroop joined
12:55 locallycompact joined
12:58 bertschneider joined
12:58 wroathe joined
12:59 ziocroc joined
13:00 gawen joined
13:00 gugah joined
13:01 zcourts joined
13:01 shainer left
13:01 <mbw> Cale: Thanks for your help. Looking at the examples again, things seem clearer now
13:03 fizbin joined
13:03 newhoggy joined
13:04 mbw joined
13:04 danthemyth joined
13:05 binaryplease joined
13:07 albel727 joined
13:07 abhiroop joined
13:12 newhoggy joined
13:12 bhiliyam joined
13:14 watabou joined
13:14 whiteline joined
13:16 insitu joined
13:20 oisdk joined
13:21 Glooomy joined
13:22 newhoggy joined
13:23 takle joined
13:24 anuxivm joined
13:24 m0cesta joined
13:25 <m0cesta> Hi all. I'm new in Haskell. What does "s -> a" mean in this class definition:
13:25 <m0cesta> class Coll s a | s -> a where
13:25 <m0cesta> empty :: s
13:25 <m0cesta> insert :: s -> a -> s
13:27 wroathe joined
13:27 benl23 joined
13:28 Spondyl joined
13:28 benl23 joined
13:29 tomphp joined
13:30 TheLemonMan joined
13:30 oisdk joined
13:30 <hexagoxel> m0cesta: keyword is "functional dependency", e.g. see https://wiki.haskell.org/Functional_dependency
13:31 bjz joined
13:31 <m0cesta> Thanks
13:34 takle joined
13:34 newhoggy joined
13:34 HoierM joined
13:34 feynhat joined
13:35 m0cesta joined
13:35 abhiroop joined
13:39 m3adi3c joined
13:41 phale joined
13:41 oisdk joined
13:41 m0cesta joined
13:41 <phale> hi, in the "syntax in functions - pattern matching" part of LYAH there is this excerpt `lucky :: (Integral a) => a -> String` but running it in ghci gives me this error: `Variable not in scope: lucky :: a1 -> String`
13:41 blender1 joined
13:43 <MarcelineVQ> are you trying to paste the 3 line defintion into ghci?
13:43 <m0cesta> Of course, try do it without function signature
13:43 <m0cesta> Or run it from source fiile
13:44 <phale> oh wait, its all 3 lines ?
13:44 <m0cesta> Yes
13:44 eacameron joined
13:44 <byorgey> phale: the ghci prompt is just for evaluating expressions, not really for entering definitions
13:44 <MarcelineVQ> yes, and you'll need to use :{ :} or ; to enter it into ghci, like lucky :: (Integral a) => a -> String; lucky 7 = "LUCKY NUMBER SEVEN!"; lucky x = "Sorry, you're out of luck, pal!"
13:44 <byorgey> try putting the definition of lucky into a .hs file and then :load it at the ghci prompt
13:45 <MarcelineVQ> a source file like m0cesta and byorgey suggest is also a great idea
13:46 uuplusu joined
13:46 sellout- joined
13:46 Kreest__ joined
13:47 benl23 joined
13:47 <phale> oh okay, also wanted to ask what is the Integral type ?
13:47 physicalist joined
13:48 tommd joined
13:48 <byorgey> phale: Integral is a type class, not a type.
13:48 <byorgey> Integral a => ... means 'a' can be any type as long as it is an Integral type
13:49 carlosda1 joined
13:50 <phale> oh i see
13:50 <phale> thank you
13:50 e14 joined
13:50 m` joined
13:53 takle joined
13:53 Gurkenglas joined
13:55 e14 joined
13:55 newhoggy joined
13:57 Destol joined
13:59 wroathe joined
14:01 takle joined
14:03 Micamo left
14:03 roconnor joined
14:04 newhoggy joined
14:05 exferenceBot joined
14:05 pavonia joined
14:07 wroathe joined
14:08 baxim joined
14:08 insitu joined
14:10 baxim left
14:11 soniku joined
14:12 blym joined
14:12 _sg joined
14:12 insitu joined
14:12 ArchaicLord joined
14:13 grayjoc joined
14:13 e14 joined
14:13 nicknovitski joined
14:13 erizawa joined
14:14 takle joined
14:15 magneticduck joined
14:15 watabou joined
14:16 orhan89 joined
14:16 insitu joined
14:17 numee joined
14:17 oisdk joined
14:18 mekeor joined
14:20 Noldorin joined
14:20 takle joined
14:21 jmcarthur joined
14:22 ralu joined
14:23 <piyush-kurur> byorgey: hey how are you?
14:24 jeltsch joined
14:24 caumeslasal joined
14:26 augur joined
14:26 <ezyang> MarcelineVQ: no sorry
14:28 edmundsecho joined
14:28 zeroed joined
14:28 zeroed joined
14:28 ompaul joined
14:28 dbmikus joined
14:30 abhiroop joined
14:31 oish joined
14:31 newhoggy joined
14:34 takle joined
14:34 splanch joined
14:36 stef204 joined
14:37 PennyNeko joined
14:39 theelous3 joined
14:42 e14 joined
14:42 blender1 joined
14:43 tomskel joined
14:43 grayjoc joined
14:44 pavonia joined
14:47 balor joined
14:49 carlosda1 joined
14:50 okuu joined
14:51 takle joined
14:53 ccomb joined
14:54 locallycompact joined
14:56 <sproingie> trying to understand rank-N and impredicative types... the wiki says "(forall a. [a] -> Int) -> Int really is different from forall a. ([a] -> Int) -> Int"
14:56 <sproingie> how are those different?
14:57 zeroed joined
14:57 zeroed joined
14:57 marfoldi joined
14:57 <hpc> sproingie: the latter will accept a parameter of type [String] -> Int, the former will not
14:58 <hpc> the former will only accept parameters with the type (forall a. [a] -> Int) - as in, they have to be polymorphic
14:58 <sproingie> ahhh
14:58 <hpc> what you get out of this is that, suppose you wrote
14:58 descender joined
14:58 <hpc> foo :: (forall a. [a] -> Int) -> Int
14:58 <sproingie> oh, now it makes more sense when i leave out the forall in the second version
14:58 conal joined
14:59 <hpc> foo f = f "string" + f ["list", "of", "strings"]
14:59 ubsan_ joined
14:59 {emptyset} joined
14:59 <hpc> that would typecheck because f is polymorphic
14:59 orhan89 joined
14:59 <hpc> and specifically with the higher-rank polymorphism, you don't have to pick any one type parameter for it
14:59 ScRaMbLe left
15:00 <hpc> so the type variable a there is being used as Char for the first case and String for the second
15:00 sentientsearch joined
15:00 <hpc> but now it /has/ to be a polymorphic argument, or you wouldn't be able to use it on both
15:00 m3adi3c joined
15:00 <hpc> you can't just give it something of type [Boolean] -> Int, it wouldn't work in either case
15:01 <Tuplanolla> One example of this I like is `apply p f x = (p f) (p x)`, sproingie.
15:01 <hpc> @let foo :: (forall a. [a] -> Int) -> Int; foo f = f "string" + f ["list", "of", "strings"]
15:01 <lambdabot> Defined.
15:01 <hpc> > foo length
15:01 <lambdabot> 9
15:01 <Tuplanolla> It works in Scheme just like that, but in Haskell it is a bit trickier.
15:02 <sproingie> scheme of course doesn't have to worry about types most of the time
15:02 <hpc> :t sum . filter id
15:02 <lambdabot> error:
15:02 <lambdabot> • No instance for (Num Bool) arising from a use of ‘sum’
15:02 <lambdabot> • In the first argument of ‘(.)’, namely ‘sum’
15:02 <hpc> :t length . filter id
15:02 <lambdabot> [Bool] -> Int
15:02 <hpc> > foo (length . filter id) -- this is the sort of type error you get when a parameter is too monomorphic
15:02 <lambdabot> error:
15:02 <lambdabot> • Couldn't match type ‘a’ with ‘Bool’
15:02 <lambdabot> ‘a’ is a rigid type variable bound by
15:03 newhoggy joined
15:03 <hpc> this whole thing is just RankNTypes btw
15:03 <hpc> the distinction between RankNTypes and ImpredicativeTypes is
15:03 freechips joined
15:04 <hpc> with neither, you can only put foralls outside or to the right of (->)
15:04 <hpc> with RankNTypes, you can put foralls to the left of (->)
15:04 <hpc> with ImpredicativeTypes, you can put foralls in data definitions as well
15:04 <hpc> ImpredicativeTypes are a lot rarer to need, in practice
15:05 <c_wraith> I run into cases where I want them all the time.
15:05 <c_wraith> But they don't actually work...
15:06 <c_wraith> So the workaround is hiding your forall inside a newtype
15:06 <sproingie> the example on the wiki looks a lot like an existential type (but using a plain func instead of a type constructor)
15:06 <sproingie> er *data constructor
15:08 <sproingie> existential types being what got me started on this, though i'm now told it's mostly an antipattern?
15:09 <c_wraith> Existentials are fine. existential + class constraint is usually an antipattern
15:09 armyriad joined
15:09 <c_wraith> But see things like Coyoneda for uses of existentials without class constraints
15:09 danthemyth joined
15:09 <Cale> There are cases where existential types are just fine, but you should usually consider other options, like just plain records of functions
15:10 <sproingie> Yoneda and such are probably a little over my head ATM 8-/
15:10 eacameron joined
15:10 <c_wraith> data Coyoneda f a where Coyoneda :: (b -> a) -> f b -> Coyoneda f a
15:10 <Cale> sproingie: So what are you trying to do?
15:10 <c_wraith> It's not really that complex of a type. :)
15:10 <sproingie> Cale: i'm just poking around, trying to find something to do actually
15:11 <c_wraith> It's got an existential type variable in b
15:11 <sproingie> coming back to haskell after years away, a lot of it makes more sense than before
15:12 sellout- joined
15:12 <c_wraith> I thought your name looked familiar
15:12 Welkin joined
15:13 bhiliyam joined
15:14 oisdk_ joined
15:17 magneticduck joined
15:17 augur joined
15:17 watabou joined
15:17 synt_ joined
15:18 newhoggy joined
15:20 cloudhead joined
15:20 abhiroop joined
15:22 oisdk joined
15:22 nbro joined
15:23 feynhat left
15:23 bananagram joined
15:24 benl23 joined
15:25 Lord_of_Life joined
15:30 gawen joined
15:31 mavihs joined
15:31 meandi joined
15:31 paolino joined
15:32 fizbin joined
15:34 Wuzzy joined
15:34 <paolino> Hi, I'm having hard times showing a GADT
15:34 <paolino> https://pastebin.com/NfMztHTq
15:34 orion joined
15:34 orion joined
15:35 <paolino> I extract it from a more complex one but the recursion schema is the same
15:37 zcourts_ joined
15:37 raichoo joined
15:37 <glguy> paolino, you should only need 1 instance
15:37 <paolino> I tried with one single instance
15:37 fragamus joined
15:38 <paolino> I try again then
15:38 Guest48456 joined
15:39 <cocreature> paolino: note that in "D :: Char -> A b -> A Char" the b is unrelated to the b in "data A b where". (try changing it to a c to see that). You are introducing an existential here which is causing the problem
15:39 connrs joined
15:39 <paolino> cocreature, I see that
15:40 <glguy> the problem is just that there are two instances
15:40 <glguy> the existential doesn't really matter
15:40 <glguy> it's not used for anything
15:41 erizawa left
15:41 lordofthetards joined
15:41 <paolino> glguy, you are right, I oversimplified the starting example
15:41 <cocreature> glguy: are you sure? it looks to me like the problem is that GHC doesn’t find a Show instance for the existential "A c"
15:41 <lordofthetards> What are some big/nice features Haskell has that OCaml does not have?
15:42 <glguy> cocreature: That's an artifact of the two instances
15:42 <cocreature> glguy: right
15:42 urodna joined
15:42 <sproingie> lordofthetards: type classes
15:42 meoblast001 joined
15:42 <lordofthetards> sproingie: thanks, anything else?
15:42 <sproingie> laziness
15:43 <cocreature> purity
15:43 <sproingie> (sometimes a feature, sometimes not)
15:43 <lordofthetards> cocreature: ocaml is not pure like haskell?
15:43 blender1 joined
15:43 arawack joined
15:44 <sproingie> lots of ocaml is written pure, but ocaml itself isn't
15:44 <lordofthetards> ah I see
15:44 <lordofthetards> So you can modify global state within a function like (Int -> Int) ?
15:44 <cocreature> yep
15:44 <lordofthetards> ah
15:45 <lordofthetards> Do you guys think its reasonable to write a modern web browser in haskell?
15:45 <sproingie> generally, you don't, but the fact that you can means you can't reason about code from types alone
15:45 meoblast001 joined
15:45 <sproingie> or well, do as much reasoning anyway
15:45 <Tuplanolla> I don't think it's reasonable to write a modern web browser at all.
15:46 <lordofthetards> sproingie: is there like a compiler option or pragma or something that forces purity in ocaml?
15:46 <cocreature> at least not as a single-person-project in a reasonable time frame
15:46 <Welkin> Tuplanolla: what abou web browsers??
15:46 <lordofthetards> cocreature: well you could reuse stuff like webkit
15:46 <sproingie> lordofthetards: i doubt it, but i haven't looked at ocaml in 15+ years
15:46 <lordofthetards> not from scratch
15:46 <Welkin> oh
15:46 <Welkin> why would you want to write a web browser though?
15:46 <sproingie> there are existing haskell webkit bindings iirc
15:46 <cocreature> lordofthetards: well if you reuse webkit you basically have a web browser
15:46 nbro left
15:46 trism joined
15:46 <cocreature> I guess it depends on what you consider a web browser
15:47 <Welkin> it's been done so many times already and they are nearly as coplex as a modern operating system at this point
15:47 <cocreature> if you care about the user interface on top of web rendering then that might be doable
15:47 <Welkin> complex*
15:47 <lordofthetards> cocreature: but webkit doesnt provide a lot of stuff like tabs, history, syncinc, developer tools, ad blocking, etc
15:47 <cocreature> if you want to implement actual html/css/… rendering
15:47 <cocreature> then you need a lot of time :)
15:47 fieldsofgold joined
15:47 <Welkin> electron uses webkit right?
15:48 <Welkin> and I assume webkit-gtk does too
15:48 <Athas> lordofthetards: sure, if you use some other engine, Haskell is probably efficient enough for the UI.
15:48 <Welkin> it just renders in a single tab/window
15:48 <sproingie> lordofthetards: webkit includes a http user agent, html+css parser, renderer, and JS engine, which makes it pretty full-stack. those other features are just extras
15:49 ragepandemic joined
15:49 <sproingie> most of which are actually implemented in javascript on modern browsers
15:49 <lordofthetards> so from an efficiency point of view is it reasonable to implement something like webkit in haskell?
15:49 <lordofthetards> I would imaging it being hard because of garbage collection and lazyness
15:50 <Athas> lordofthetards: probably not. For a browser engine, it seems that you need very high performance. Haskell is not slow by any means, but it may not be fast enough.
15:50 meoblast001 joined
15:50 <lordofthetards> ah ok
15:50 <Tuplanolla> I have different ideas of "high performance".
15:50 <sproingie> some parts would be easier, the parsers for example. could probably even do a pretty good JS engine
15:50 <MarcelineVQ> hmm, I can't imagine why it would be insufficient
15:50 <sproingie> i wouldn't want to reinvent video codecs in haskell tho
15:50 carlosda1 joined
15:50 <sproingie> (might close off a lot of security bugs if you did)
15:50 wroathe_ joined
15:51 <Tuplanolla> Web browsers are not run on supercomputers and the load average is rather low.
15:51 <Athas> sproingie: they do all kinds of insane tricks in the parsers to get them to run fast. It's not very principled at all.
15:51 <sproingie> Athas: haskell, or at least GHC, is not above dirty tricks when needed.
15:51 <Axman6> I can guarantee you that web browsers are run on supercomputers sadly :(
15:51 <monochrom> Pretty sure webkit does its own garbage collection.
15:51 benl23 joined
15:51 <sproingie> yeah you'd be writing a new runtime in haskell
15:51 <Athas> sproingie: sure, you can just write everything in IO with low-level memory operations (like so many of the language benchmarks game benchmarks are written), but then it's not very nice Haskell anymore.
15:52 <Welkin> why would you *want* to write something like this in haskell?
15:52 <Welkin> Just to write it in haskell?
15:52 <sproingie> Athas: oh not every part would be *nice* haskell, no
15:52 <lordofthetards> Welkin: ya :D
15:52 <sproingie> not every part of webkit is nice c++ either
15:52 <cocreature> Welkin: s/in haskell//
15:52 abhiroop joined
15:52 <lordofthetards> C++ is such an ugly language blegh
15:53 <Athas> V8 does a lot of code generation at compile-time (for their Javascript interpreter, for example). *That* code is extremely nasty and would be much nicer in Haskell.
15:53 <lordofthetards> I'd rather write C than C++
15:53 <Welkin> code that works and is already written doesn't matter if you never need to look at it
15:53 <sproingie> what makes haskell impractical for such a thing is that it (GHC at least) has a fairly heavy runtime
15:53 <Athas> The GHC runtime isn't really big compared to all the stuff you need in a browser anyway.
15:54 <Axman6> Welkin: that's just ignoring hidden costs which you'll probably have to pay for later :)
15:54 <MarcelineVQ> For the demoscene it has a heavy runtime, for a browser though I'm not sure what the issue would be :>
15:54 newhoggy joined
15:54 <lordofthetards> hmm, I wonder if it might be a good project to try and write a virtual machine (think jvm) for haskell?
15:54 <monochrom> "never need to look" is a self-fulfilling vicious cycle. Recall all those 100-year-old COBOL code that people don't dare to look, and therefore they euphemize it as don't "need" to look.
15:54 <Axman6> (but I would still use WebKit without auditing the code because enough of us are testing it in prod already)
15:55 <Axman6> lordofthetards: sure, you could even make a JIT using LLVM if you really wanted
15:56 <Athas> Web standards are changing/"improving" quickly enough that there's a lot of new browser code getting written all the time.
15:56 <sproingie> Axman6: until last year, that's precisely what webkit used
15:56 caumeslasal joined
15:56 <Axman6> I know :)
15:56 <Athas> I think V8 by itself has three compilers and at least one interpreter.
15:56 <Axman6> WebKit has 4 IIRC
15:56 <sproingie> well one of those *is* V8
15:57 <Axman6> isn't that Chrome (blink?) only?
15:57 zeroed joined
15:57 abhiroop joined
15:57 <Axman6> Google's and Apple's JS engines are pretty separate afaik
15:57 <sproingie> nowadays, sure. the old webkit branch probably still works
15:58 <sproingie> but i guess we're not counting historical versions
16:01 <sproingie> more interesting would be replacing JS with haskell
16:02 <sproingie> wouldn't want to do it with today's libs, but it's getting easier to do "dynamic" idioms, and JS is embracing more static stuff
16:02 venkat24 joined
16:04 BartAdv joined
16:10 newhoggy joined
16:12 maarhart joined
16:12 meandi_2 joined
16:12 mszczygiel joined
16:13 blym_ joined
16:13 watabou joined
16:13 afarmer joined
16:14 <jackhill> now that WebAssembly is more of a thing, I wonder when GHC will grow a backend for that as an alternative to ghcjs
16:14 tommd joined
16:14 atomi joined
16:15 <Athas> Does WebAssembly support interrupt handlers now?
16:15 <Athas> Last I looked it wasn't a nice fit for GC'd languages.
16:15 <jackhill> Athas: I have no idea
16:16 dbmikus joined
16:21 theology joined
16:24 codesoup joined
16:25 yogsototh joined
16:26 systemfault joined
16:28 albertus1 joined
16:28 OnkelTem_ joined
16:29 dan_f joined
16:29 nut joined
16:30 <nut> how to declare type signatures for several types on the same line? func1,func2 :: int->int ?
16:30 <nut> doesnt work
16:31 <Welkin> :t f, g :: Int
16:31 <lambdabot> error: parse error on input ‘,’
16:32 <Welkin> I usally don't do that
16:32 <Welkin> use separate lines
16:32 <Welkin> but I know it can be done
16:33 <nut> ive seen it somewhere
16:33 <geekosaur> actually that works fine
16:33 <cocreature> “f, g :: Int -> Int” works fine
16:34 <Zemyla> Ooh, kitty http://i.imgur.com/XXpj4R4.gifv
16:34 <Zemyla> Wait, wrong channel.
16:34 <nut> i got the same error with the parse error
16:34 <cocreature> nut: are you trying that in ghci or in a haskell file?
16:34 <cocreature> ghci tends to behave in weird ways
16:34 <dmj`> Zemlya: is that in japan ?
16:34 <nut> haskell file
16:34 <dmj`> Zemyla: *
16:34 <Welkin> dmj`: looks like it
16:35 <cocreature> nut: can you show us the complete file?
16:35 <Welkin> tatami mats on the floor, sliding wooden doors
16:35 miscyb joined
16:35 bennofs joined
16:36 <miscyb> is there a special way to import pattern synonyms?
16:36 <geekosaur> lpaste seems a bit buggy thouygh...
16:36 darjeeling_ joined
16:36 <miscyb> i'm trying to pull in a constant from gi-glib, and it's giving me an import error
16:37 <geekosaur> https://bpaste.net/show/82d96be18d11 syntax works fine. will not work typed into ghci though
16:37 anuxivm joined
16:38 <geekosaur> miscyb, afaik it should just work although there is a syntax for specifically importing synonyms
16:38 jason85 joined
16:38 <dmj`> miscyb: import Module (pattern PatternSyn)
16:38 <miscyb> geekosaur: yeah i'm doing an "import GI.GLib (MY_PATTERN)
16:38 <miscyb> oh
16:38 <miscyb> thanks
16:38 <geekosaur> with rspect to gi, iirc it will customize itself to your instakled glib so you might make sure the ine you have installed supports that symbol
16:39 ixxie joined
16:39 <miscyb> it's a priority symbol so it's probably there
16:39 <nut> https://bpaste.net/show/85cd6b97edc3
16:40 <nut> cocreature:
16:40 anuxivm joined
16:40 <monochrom> Very likely you need to capitalize expr to Expr
16:40 sleffy joined
16:40 <monochrom> Err, no.
16:41 <geekosaur> wha's the full error message?
16:41 <monochrom> You will need to show more complete code.
16:41 <cocreature> lowercase EarlierThan and LaterThan
16:41 <monochrom> Ah, that.
16:41 <miscyb> "import GI.GLib.Constants (pattern PRIORITY_DEFAULT_IDLE)" is giving me a parse error on "PRIORITY_DEFAULT_IDLE"
16:41 <miscyb> would that likely be from a missing symbol or something else?
16:41 newhoggy joined
16:41 <nut> oh yes, stupid me
16:43 <geekosaur> miscyb, I am pretty sure that import syntax needs {-# LANGUAGE ExplicitNamespaces #-}
16:43 <miscyb> geekosaur: that didn't seem to change anything sadly
16:44 <paolino> glguy, https://pastebin.com/ySWrPKj9 , sorry for confusion, this was the original error that I tried to solve splitting the instance
16:44 blender1 joined
16:44 <geekosaur> the other thing is I suspect it needs to be pRIORITY_DEFAULT_IDLE or something, since it seems unlikely that they translate it to a constructor
16:44 abhiroop joined
16:45 <geekosaur> hm, but their docs say they do. fun
16:46 <paolino> glguy, splitting the instance should take away the R recursion leading to the previous problem, or, that was the path I followed
16:46 <miscyb> geekosaur: i just imported constants as qualified and it seems to be importing correctly
16:46 edmundsecho joined
16:46 pierrot joined
16:46 <miscyb> at least i think so i have other errors i need to fix now
16:49 steeze joined
16:50 robotroll joined
16:50 newhoggy joined
16:51 carlosda1 joined
16:51 msks joined
16:52 atomi joined
16:52 kotangent joined
16:53 <fizbin> Has someone here already emailed whoever maintains http://ircbrowse.net/browse/haskell about its non-working status?
16:57 benl23 joined
16:57 dbmikus joined
16:57 BlueRavenGT joined
16:58 <Gurkenglas> '<akegalj> hey guys. Are we maintainers of ircbrowse.net ? Seems like its down. Visiting http://ircbrowse.net/browse/haskell for example throws "libpq: failed (another command is already in progress)"' '<akegalj> ok, I contacted maintener. Thanks'
16:58 newhoggy joined
16:58 <Gurkenglas> Also '<peterbecich> this alternative to ircbrowse seems to work: http://irclogger.com/.haskell-beginners/2017-04-16'
16:59 bennofs joined
17:00 prophile joined
17:00 bennofs joined
17:01 <cloudhead> anyone familiar with Spock?
17:02 <EvanR> doesnt anyone have opinions on DSP libs for haskell, the one called DSP seems obvious but not sure if its overly presumptuous with that name
17:03 bennofs joined
17:04 alx741_ joined
17:04 <glguy> paolino: The solution here is going to be to make this type less of a mess
17:05 bennofs joined
17:06 <paolino> ok, I will rethink the original model and see if I get better
17:09 newhoggy joined
17:10 zcourts joined
17:11 danthemyth joined
17:12 abhiroop joined
17:13 abhiroop joined
17:14 bhiliyam joined
17:15 <sproingie> EvanR: maybe the fft library?
17:15 <glguy> paolino: {-# language TypeFamilies #-}
17:15 <glguy> paolino: https://paste.fedoraproject.org/paste/yELgrrQTDVmku1~kVmZ1Fl5M1UNdIGYhyRLivL9gydE=
17:16 <glguy> wow, that's quite a URL for a paste
17:17 <sproingie> helps for private pastes i suppose
17:17 dustmote joined
17:19 insitu joined
17:20 <glguy> paolino: Or if we enable UndecidablesuperClasses, we can do this https://paste.fedoraproject.org/paste/zZo8slN8waybb8FqyKGQlV5M1UNdIGYhyRLivL9gydE=
17:20 peterbecich joined
17:22 XorSwap joined
17:22 sagax joined
17:23 xormor joined
17:23 newhoggy joined
17:24 swiss1 joined
17:24 miscyb joined
17:24 Glooomy joined
17:25 Glooomy joined
17:26 <paolino> glguy, where is proxy function coming from ?
17:26 Glooomy joined
17:26 <glguy> it's a variable
17:26 Glooomy joined
17:26 <paolino> mh, a lot of concepts I don't know
17:27 <glguy> 'proxy' comes from the same place as 'o'
17:27 <glguy> all type variables are implicitly universally quantified by their type signatures
17:27 Glooomy joined
17:27 ChaiTRex joined
17:28 frankpf joined
17:28 ralu joined
17:28 <monochrom> The same way you sometimes say "Applicative f => f ()"
17:28 guillaum2 joined
17:28 <glguy> Well, in this case 'o' comes from the instance head, but it's just a normal type variable
17:28 frankpf_ joined
17:29 osa1 joined
17:29 osa1 joined
17:29 <paolino> why it's not Proxy o ?
17:29 <glguy> because it doesn't need to be
17:30 newhoggy joined
17:30 <monochrom> "Nothing :: Maybe o" and "[] :: [] o" work just as well.
17:30 <glguy> accepting any type at all is more general than requiring the particular type 'Proxy'
17:30 <glguy> (any type at all with kind A -> *)
17:30 <monochrom> Anything that phantomly carries the type o
17:31 <paolino> ok, we don't use it
17:31 <paolino> so why not just o ?
17:31 <glguy> Because o has kind A
17:32 <glguy> but (->) has kind: * -> * -> *
17:32 <glguy> so you can't apply (->) to o
17:32 <monochrom> Oh! Then I guess Maybe and [] aren't good for this one.
17:32 eklavya joined
17:33 <glguy> monochrom: but you know what is??
17:33 <glguy> I!
17:34 oish joined
17:34 <glguy> https://paste.fedoraproject.org/paste/IhgWpX9EMvVRQgdVAj2M3l5M1UNdIGYhyRLivL9gydE=
17:34 <glguy> Now we don't need scoped type variables
17:34 wroathe joined
17:34 mada joined
17:34 <glguy> When you have a proxy hammer everything looks like a proxy nail...
17:34 <paolino> ah I see you need to pass a * to showPA, right ?
17:34 trolling joined
17:36 felixsch_ joined
17:36 <paolino> so Proxy is polymorphic in the kind ?
17:36 <monochrom> Yes.
17:36 <glguy> Yes, the Proxy type is "polykinded"
17:36 <glguy> and you can only apply functions to values, and all values have types that have kind *
17:36 blym joined
17:36 <paolino> while Maybe and [] not
17:36 <monochrom> Right, Maybe and [] want *
17:37 <glguy> Something doesn't have to be poly-kinded to have kind A -> *
17:37 <glguy> but having a kind like k -> * certainly helps for having that kind
17:37 sentientsearch joined
17:37 sproingie joined
17:37 torgdor joined
17:37 <glguy> We could have had a non poly-kinded data AProxy :: A -> * where AProxy :: AProxy o
17:37 <paolino> I should have written one
17:37 <paolino> ok
17:37 jason85 joined
17:38 <EvanR> to understand haskells type system, first understand dependent types, then smash it
17:38 <monochrom> When you're a manucare professional, everything looks like a finger nail. :)
17:38 <paolino> ok, now what is Dict ?
17:39 <glguy> monochrom: That sounds like a nightmare
17:39 <EvanR> when all the men and horses put it back together again, we will have -XDependentTypes
17:39 <glguy> paolino: start here http://hackage.haskell.org/package/constraints-0.9.1/docs/Data-Constraint.html#t:Dict
17:39 <paolino> bringing the constraint into the type
17:40 treehaqr joined
17:40 epsilonhalbe joined
17:42 newhoggy joined
17:42 mavihs joined
17:42 mavihs joined
17:43 <paolino> so you separated the instance in the end
17:43 iomonad joined
17:43 robertkennedy joined
17:44 sssilver joined
17:44 <paolino> at the right level
17:44 srbaker joined
17:44 msks joined
17:44 wroathe joined
17:45 blender1 joined
17:45 <paolino> pattern matching on Dict bring the Helper (R o) in scope
17:45 <robertkennedy> > take 11$ (\x y -> x * 10 + y) <$> [0..9] <*> [0..9]
17:45 <lambdabot> [0,1,2,3,4,5,6,7,8,9,10]
17:45 msks joined
17:46 <robertkennedy> What is ekmett taking about here: concat :: [[a]] -> [a]
17:46 <robertkennedy> requires more power than ...
17:46 <robertkennedy> https://www.reddit.com/r/haskell/comments/66q5ez/why_is_list_a_monad/
17:46 msks joined
17:46 <robertkennedy> Sorry I guess it copy pasted more than the link mb
17:47 <cocreature> robertkennedy: you can implement concat using >>= but you can’t implement it using <$>,<*> and return
17:48 <robertkennedy> His last example doesn't seem to illustrate that, as you can write what I put above
17:48 <MarcelineVQ> hmm? take 11 isn't in his example
17:48 <robertkennedy> I took 11 to limit the output
17:49 <MarcelineVQ> oh I see you wer ejust shortening it hehe
17:49 msks joined
17:50 <lyxia> robertkennedy: [x..9], not [0..9]
17:50 <monochrom> You are right, that example still stays within Applicative. In fact if you turn on ApplicativeDo, that do-block just uses <$> and <*>
17:51 <monochrom> Err, oops, yeah, what lyxia said.
17:51 <MarcelineVQ> > (do x <- [0..9]; y <- [x..9]; return $ x*10 + y) == ((\x y -> x * 10 + y) <$> [0..9] <*> [0..9])
17:51 <lambdabot> False
17:51 noddy joined
17:51 <robertkennedy> Oh I didn't see the x, my bad, you are right
17:51 winter1 joined
17:52 <lyxia> It seems pretty easy to miss :)
17:52 <MarcelineVQ> ye
17:52 insitu joined
17:53 newhoggy joined
17:54 wroathe joined
17:55 physicalist joined
17:57 jophish joined
17:59 lifter joined
18:01 insitu joined
18:01 ubsan_ joined
18:01 robotroll joined
18:03 gibbers joined
18:03 phale joined
18:04 <phale> when should I use [a] ++ [] over a : [] or vice versa ?
18:05 pmade joined
18:05 newhoggy joined
18:06 epsilonhalbe left
18:06 jason85 joined
18:06 Wamanuz joined
18:07 tobiasBora joined
18:07 <sproingie> just plain [a] ought to do, no?
18:07 oisdk joined
18:07 <sproingie> or were you looking for a binary op?
18:07 <phale> I was just reading the spring haskell guide
18:07 <phale> And they mentioned ":" being the cons operator for lists
18:08 <phale> And then I recall in LYAH they used ++ for concatenation
18:09 <sproingie> right, ++ concatenates two lists, : conses onto a list. which you use depends on whether you want concat or cons
18:09 <Tuplanolla> > shows (42 :: Int) . shows (13 :: Int) $ "" -- The third option, phale.
18:09 <lambdabot> "4213"
18:09 featherlessbiped joined
18:09 <Sornaensis> :t (:)
18:09 <lambdabot> a -> [a] -> [a]
18:09 <Sornaensis> :t (++)
18:09 <lambdabot> [a] -> [a] -> [a]
18:09 <MarcelineVQ> you can also call : prepend
18:10 <ChaiTRex> phale: In general, with one element to put on the front of the list, you use (:).
18:10 <ChaiTRex> phale: You use (++) to put an element on the end of the list.
18:10 <ChaiTRex> phale: Like xs ++ [a]
18:10 <phale> Oh, I see
18:10 <sproingie> or mappend if you want it really generic
18:10 <sproingie> :t mappend
18:10 <lambdabot> Monoid a => a -> a -> a
18:11 cyborg-one joined
18:11 danthemyth joined
18:12 <sproingie> (which conicides nicely with that video just posted on /r/haskell)
18:12 bennofs1 joined
18:14 nakal joined
18:15 msks joined
18:15 Beelsebob joined
18:16 <Beelsebob> so, I saw this... https://aphyr.com/posts/342-typing-the-technical-interview and I feel like whoever wrote it should be pleased to know that it inspired this horror https://gist.github.com/beelsebob/18e144d95aa7cd19161e387ec2ee8147
18:16 newbie46 joined
18:16 <Beelsebob> aside - clang manages to solve this for a 32x32 board in 2 seconds on my machine, so it's not as horribly inefficient as you might expect
18:16 msks joined
18:17 abhiroop joined
18:17 <lolisa> Hi, a question purely on design taste
18:17 dedicated joined
18:18 <lolisa> why does most function in https://hackage.haskell.org/package/base-4.9.1.0/docs/Data-List.html take [a] as the last parameter (instead of the zeroth parameter?)
18:18 msks joined
18:18 <Beelsebob> lolisa: generally functions have their parameters ordered in such a way that you can partially apply them and get something useful
18:18 m3adi3c joined
18:19 <sproingie> doesn't c++17 let you omit 'typename'?
18:19 <XorSwap> so that you can stack them nicely: map f $ filter g $ takeWhile h [...]
18:19 <Beelsebob> which generally means you put the parameter you're most likely to "default" as the first
18:19 <sproingie> (not that it would make it much easier to read)
18:19 sleffy joined
18:19 wroathe joined
18:19 <Beelsebob> sproingie: plausible - I'm still in C++11 land
18:20 <lolisa> I mean, is there any heuristic I can use to figure out which parameter can get partially applied?
18:20 <Beelsebob> sproingie: if it does' that seems like a valid reason for me to update - missing out typename is my most common pointless error message
18:20 tobiasBora joined
18:20 <Beelsebob> lolisa: mostly just think "how would most people use this"
18:20 <sproingie> ah i'd be on c++14 at least, it makes 'auto' a lot more useful
18:20 <Beelsebob> that's about the best you can do
18:21 alx741 joined
18:21 <Beelsebob> sproingie: much like in Haskell, I *can* infer types, but I mostly write : X, purely for documentation; in C++, I tend not to use auto
18:21 <sproingie> might be you can only omit it if you don't actually use it in the expansion
18:21 <Beelsebob> although, doesn't C++14 allow you to omit template parameters on the right hand side when they're inferable?
18:21 <Beelsebob> because *that* would be useful
18:22 <Beelsebob> std::vector<SomeComplexType> x = std::vector<SomeComplexType>(...) is frustrating to write
18:22 <sproingie> get thee to auto
18:23 Uakh joined
18:23 <sproingie> auto x = vector { 1, 2, 3 }
18:23 <sproingie> something like that
18:23 <Beelsebob> yeh - but again - I *like* having the type on the left
18:23 <Beelsebob> for documentation
18:24 <sproingie> sure, but it's nice when it's optional
18:24 <Beelsebob> it's the constructor I want to simplify, not the type
18:24 nakal joined
18:24 <sproingie> tho there are a few WTFs with initializer lists, usually only bite you when you're writing new types tho
18:25 <sproingie> initializer lists in the presence of overloaded constructors are ... yeah, i'm happy to be out of that swamp right now :)
18:25 <c_wraith> Yeah, I saw a blog post on that topic a while back. The whole thing was nearly incomprehensibly complex for "correct" behavior. :)
18:25 <Beelsebob> sproingie: yeh, C++ has a *lot* of weird shit going on around initializer lists in general
18:25 <Beelsebob> I've met several bizare bugs there
18:25 <sproingie> the amount of bookkeeping you have to do by hand when making new C++ APIs is ... yeah
18:25 <Beelsebob> (in my code, that "obviously" did one thing)
18:25 <sproingie> it's getting better. slowly.
18:26 <sproingie> 'default' and 'delete' keywords were a big help
18:26 <Beelsebob> unfortunately, C++ is the only language that outputs predictably fast code reliably that has a "real" type system
18:26 <Beelsebob> so, I'm stuck there for a while
18:26 nakal joined
18:26 newhoggy joined
18:26 descender joined
18:26 <sproingie> FSVO "real"
18:27 srbaker joined
18:27 <rightfold> Rust
18:28 <Beelsebob> sproingie: yarp
18:28 nepiktaz joined
18:28 <sproingie> from reading about "ownership", rust seems to trade one headache for another
18:28 <XorSwap> I wonder how crazy a c++ parser would get if type names were mostly optional
18:28 <Beelsebob> XorSwap: you mean if you could simply omit auto?
18:28 <XorSwap> yeah
18:28 <Beelsebob> given how crazy C++ parsers already are, probably not much more crazy :P
18:29 <Beelsebob> I mean, in terms of absolute craziness increase, probably a large amount, but relatively... pffft
18:29 <sproingie> probably simplify things greatly if you converted everything to use postfix type syntax
18:29 wroathe joined
18:29 <sproingie> keeping it compatible tho ... pretty awful
18:30 <XorSwap> c++ with postfix syntax would be neigh unreadable though
18:30 splanch joined
18:30 sleffy joined
18:30 <Beelsebob> C++ already *has* some postfix type syntax
18:30 <Beelsebob> (for closures)
18:30 <sproingie> it already has it, you actually need it in some places
18:30 <Beelsebob> because they couldn't figure out how to make the syntax not horrible having dug themselves the prefix hole
18:30 <sproingie> "-> decltype(foo)" is pretty nice to have
18:30 <Tuplanolla> The committee should add templates to the preprocessor too.
18:31 dimitrovskif joined
18:31 <Beelsebob> Tuplanolla: I mean, no one using C++ really uses the preprocessor for anything other than #include
18:31 <Beelsebob> so... *shrug*?
18:31 <sproingie> the preprocessor is the crazy old uncle they keep locked in the basement, far as the committee is concerned
18:31 <XorSwap> there's an idea, haskell with c preprocessor
18:31 <sproingie> XorSwap: already a thing
18:31 <XorSwap> !
18:31 <Sornaensis> ghc has that extension
18:31 <sproingie> {-# LANGUAGE CPP #-}
18:31 <dimitrovskif> Is Prelude written in Haskell? Can you implement map without Prelude functions like folds
18:32 <sproingie> prelude is pure haskell
18:32 <Sornaensis> yes the prelude is written in haskell
18:32 <ChaiTRex> @src map
18:32 <lambdabot> map _ [] = []
18:32 <lambdabot> map f (x:xs) = f x : map f xs
18:32 <dimitrovskif> Oh. That's nice
18:32 <sproingie> the compiler makes some assumptions about prelude stuff afaik. tho maybe that's all in rules too, i dunno
18:32 <Sornaensis> using #include in C++ is kind of bad already
18:32 <Tuplanolla> The only parts you can't implement is `Bool` and `GHC.Prim` stuff, dimitrovskif.
18:32 <dimitrovskif> Tuplanolla: Thanks
18:33 <dimitrovskif> So what parts are needed to be able to fully express any program / be Turing Complete?
18:33 <sproingie> c++ is getting real modules, so maybe #include will become legacy too
18:33 <Sornaensis> why can't you implement Bool
18:33 <glguy> many of the definitions exported by the prelude are implementable in standard haskell
18:33 <Sornaensis> data Bool = True | False
18:33 <Tuplanolla> You'd need `RebindableSyntax` for `if` et al, Sornaensis.
18:33 <Beelsebob> Tuplanolla: what's the problem with data Bool = True | False?
18:33 <sproingie> to be turing complete? brainfuck is fairly minimal. you want functional, S and K
18:33 <glguy> but other parts of it have to be primitives provided by the compiler
18:33 <Sornaensis> oh you mean if then else
18:33 <Tuplanolla> Yes.
18:34 <XorSwap> I think S and K are already in haskell
18:34 <sproingie> in several forms, i imagine
18:34 <XorSwap> s is ap?
18:34 <Athas> dimitrovskif: the Prelude cheats a little to get number types, I think.
18:34 <XorSwap> yeah, ap and const
18:35 newhoggy joined
18:35 <sproingie> unlambda would be the closest thing to functional brainfuck i suppose. no one talks about unlambda anymore.
18:35 <dimitrovskif> I mean like what parts of Haskell (not the opposite, what do you need to have lambda calculus) can you throw out and still have turing complete lang/
18:35 iomonad joined
18:36 <sproingie> well, start with Core and pare it down
18:36 <sproingie> Core is well outside of my wheelhouse tho
18:36 <XorSwap> unlambda isn't very functional though
18:36 <Cale> dimitrovskif: Perhaps a more interesting question is what little you can throw out to ensure that all programs terminate.
18:36 <sproingie> XorSwap: sure it is, every tick is "apply"
18:37 <Tuplanolla> All you need is iota or jot, but I don't know how well those fit in with Haskell's type system.
18:37 <XorSwap> unlambda relies on evaluation order though
18:38 <sproingie> sure, that doesn't keep it from being complete tho
18:38 hurkan joined
18:39 <sproingie> me, i'm more a fan of befunge :)
18:39 <XorSwap> it is complete, I'm just saying it's not realy in the spirit of functional
18:39 <sproingie> there's another language out there where every instruction has a random chance of failure. you program it stochastically
18:39 <sproingie> i wish i could remember the name of it
18:39 <XorSwap> java2k?
18:39 wroathe joined
18:40 <sproingie> aside from PHP that is
18:40 <XorSwap> yeah, it's java2k
18:40 <sproingie> oh awesome :)
18:40 <dimitrovskif> And another question... Is partial evaluation a consequence of currying?
18:40 <Beelsebob> partial *application* and currying are related
18:40 <Athas> No partial evaluation is a program transformation technique.
18:40 <EvanR> no its a separate feature
18:40 <Cale> Partial evaluation is separate from currying, but not entirely unrelated
18:40 dsgsgdfg joined
18:41 <sproingie> i'd love to see an actual serious non-esolang version of java2k
18:41 <Beelsebob> currying is what allows you to partially apply functions
18:41 <c_wraith> Cale: it's pretty unrelated. :) Partial evaluation is things like supercompilation
18:41 <sproingie> but i suppose some bytecode hacking could do it for arbitrary java
18:41 <EvanR> javascript libraries like to give you partial application (-ish) but doesnt have currying
18:41 <dimitrovskif> Beelsebob: Yeah that's my question
18:41 <Cale> You can have one without the other
18:41 SeMas joined
18:41 <dimitrovskif> Does Haskell explicitly implement partial evaluation
18:41 <c_wraith> only trivial things
18:41 <dimitrovskif> Or is the fact that functions are curried enough
18:42 <Cale> But you can get some effects of partial evaluation from partial application.
18:42 <EvanR> the main feature is partial application
18:42 <Cale> However, you kind of need to make it happen explicitly
18:42 <Cale> You'll end up writing things like:
18:42 pierrot joined
18:42 <Cale> f x = let ... some stuff which uses x ... in \y -> ...
18:43 <phale> also i wanted to ask
18:43 <phale> how come in ghci variables are mutable ?
18:43 <sproingie> it's faking it
18:43 <Cale> (with possibly some seq's occurring ahead of that \y -> ...)
18:43 <EvanR> variables arent mutable
18:43 <EvanR> they are rebindable
18:43 <EvanR> and its not just in ghci
18:43 <geekosaur> they're not mutable, they're shadowed
18:43 bobakk3r joined
18:43 <Cale> The idea being that you can expose some of the work that the function has to do after having been applied to a single argument
18:44 <Cale> and it can do that work before giving you a resulting function
18:44 <geekosaur> which means something referring to the old bin ding still refers to that old binding
18:44 newhoggy joined
18:44 <Cale> e.g. if you were implementing a regular expression matching function, you'd take the regular expression first, and then possibly compile that into a finite state machine before resulting in a function which uses that FSM to test if strings match
18:44 bobakk3r left
18:45 bobakk3r joined
18:45 Snircle joined
18:45 fragamus joined
18:45 <Cale> Which is kind of similar to partial evaluation
18:46 blender1 joined
18:46 msks joined
18:46 <ChaiTRex> phale: See https://pastebin.com/EagTAHzB
18:47 sellout- joined
18:48 jaziz joined
18:48 connrs joined
18:48 <sproingie> istr ghci used to actually make you type 'let'
18:49 <monochrom> It is actually pretty hard to distinguish, observationally, between mutation and shadowing.
18:49 <geekosaur> before 8.0, yes
18:49 <dimitrovskif> Shouldn
18:49 <dimitrovskif> this work (uncurry map) ((\f x-> x), [1,2,3])
18:49 Goplat joined
18:49 <EvanR> by hard you mean totally possible?
18:49 <dimitrovskif> Nvm, extra 'f'
18:50 <EvanR> therefore theoretically easy
18:50 <sproingie> basically, 'x = foo' in ghci implies a leading 'let', which is why it works. basically it's "let foo = bar in <rest of ghci session>"
18:50 carlosda1 joined
18:50 wroathe joined
18:50 eacameron joined
18:50 <sproingie> or something like that
18:50 des joined
18:50 <EvanR> yes
18:50 <monochrom> A value that was defined under the old binding can be explained in the mutation narrative as taking its snapshot back then and so will be unaffected by the new binding.
18:50 <XorSwap> huh, so will more and more rebindings increase memory usage?
18:51 msks joined
18:51 <EvanR> heh. a "deep copy" ?
18:51 <EvanR> i.e. immutation
18:51 <phale> oh i see
18:51 <phale> i also wanted to ask about what identation should i use for haskell ? 2 spaces ?
18:51 <XorSwap> tabs
18:51 <EvanR> XorSwap: immutable data can use more memory yes
18:51 <phale> i do tabs and then ghc gives me warning
18:51 <sproingie> it should free any unused environments, otherwise recursive code would also be in trouble
18:52 <XorSwap> phale: ghc is wrong about the tabs
18:52 <sproingie> immutable data can also use less memory due to structure sharing. depends how you use it.
18:52 maarhart joined
18:52 <EvanR> sharing is an optimization though
18:52 <MarcelineVQ> phale: for general structure 4 for the most part, 2 for where, an example here: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
18:52 <monochrom> I recommend 4 spaces but it is really up to you.
18:53 <EvanR> the deep copy narrative would have you believe otherwise
18:53 nut joined
18:53 <sproingie> ahh spring in colorado, the hail season is starting
18:53 <monochrom> All hail Colorado?!
18:53 <EvanR> all hail naw
18:53 <Tuplanolla> My observation has been that two spaces work the best when you have to deal with two dozen different languages and keep forgetting which style to use, phale.
18:53 <MarcelineVQ> the prevailing opinion is that spaces result in happier coding sessions with haskell
18:54 <EvanR> i wish tabs were illegal in haskell
18:54 <Sornaensis> they aren't?
18:54 <sproingie> i wish tabs were sane in general
18:54 phyrex1an joined
18:55 <glguy> No, tabs are defined to advance to the next tabstop, and tabstops are defined to be multiples of 8 columns
18:55 <EvanR> tabs work but probably not how you think
18:55 <monochrom> A lot of other programming communities like tabs. They have a good reason. But that same reason turns against Haskell (generally any layout languages).
18:55 nut left
18:55 <sproingie> only language i know that standardizes on tabs for indent is go
18:55 <XorSwap> they should make {} and ; manditory
18:55 <EvanR> also Makefiles
18:55 <sproingie> well that and make but let's not talk about make as a "language"
18:55 <Tuplanolla> Don't forget GNU Make, sproingie.
18:55 <XorSwap> lol
18:55 <sproingie> (i've written way too much turing complete make)
18:55 <Tuplanolla> It's Turing complete and has io...
18:56 <MarcelineVQ> modern editors can turn your tab button into whatever number of spaces you like, or even adaptively, so I'm not sure what the advantage of tab is these days. bit of a dead-horse type opinion though
18:56 <tomskel> does anyone know much about atom-haskell?
18:56 tobiasBora joined
18:56 <MarcelineVQ> tomskel: ide-haskell? having an issue?
18:56 newhoggy joined
18:57 dpn` joined
18:57 <sproingie> go's approach is to make the reformatter part of the language distribution, so use whatever style you like, it'll all end up gofmt-style in the end
18:57 <sproingie> bit unusual approach but i guess it works for go
18:57 <tomskel> MarcelineVQ: yup ide-haskell. I am indeed having an issue, it's having problems with ghc-mod. After playing about with the commands it's executing, I worked out it's running ghc-mod with the wrong cwd ... so the commands are failing.
18:57 <EvanR> im glad haskell doesnt reformat my code to look terrible
18:57 <monochrom> MarcelineVQ: The advantage is that if you like to indent by 7 spaces and I like to indent by 3.14159 spaces, then we agree to put tabs in the file, you set your editor to display tabs as multiples of 7, I set my editor to display tabs as multiples of 3.14159, then we will not have a whitespace commit war.
18:57 <EvanR> or force me to write like everyone elses terrible formatting ;)
18:57 <sproingie> i don't think there's a way to make golang pretty
18:58 nut joined
18:58 NextHendrix joined
18:58 <MarcelineVQ> tomskel: is your project using stack?
18:58 <EvanR> lambdamoo is pretty funny, your source code is reconstructed from the compiled virtual machine code
18:58 KunoMark joined
18:58 <monochrom> Exactly the reason why, for example, tab works great for Java. And exactly the same reason why it completely breaks down with Haskell.
18:58 <tomskel> MarcelineVQ: I'm playing with the GHC codebase, so I don't think so :-)
18:58 <EvanR> so the formatting becomes standardized
18:58 <EvanR> and your comments dont survive
18:59 <hexagoxel> EvanR: and your variables become register names?
18:59 <EvanR> they survive
18:59 <sproingie> EvanR: which ruled out a whole lot of optimizations
18:59 <EvanR> well its based on C, so optimizations are not that happening
18:59 <sproingie> tho i suppose nothing stops it from just storing intermediate opcode
18:59 <hexagoxel> EvanR: there, i can comment. :D
18:59 <sproingie> MOO needed JIT anyway
18:59 msks joined
19:00 <EvanR> hexagoxel: conventional comments are statements consisting of a string literal
19:00 <EvanR> which survives
19:00 <hexagoxel> yeah yeah :)
19:00 <sproingie> only JIT i can think of that MOO did was peephole optimizations to reduce copies
19:00 <EvanR> all in all kind of goofy
19:00 <MarcelineVQ> tomskel: hehe alright, in that case I probably don't have anything to add that would be helpful since you've likely already tried editing the paths in the haskell-ghc-mod plugin settings
19:00 <sproingie> since MOO primitives are also immutable
19:01 <sproingie> FP came easy to me after MOO
19:01 <tomskel> MarcelineVQ: ah no I haven't, didn't know that was a thing :-)
19:01 <MarcelineVQ> oop, well have a look :>
19:01 <EvanR> FOO, functional moo, still on my list of things to do
19:01 nwf joined
19:02 <sproingie> etamoo is a MOO server in haskell
19:02 <Sornaensis> lambmoo
19:02 <sproingie> docs say it's not complete, looks like it's pretty close tho
19:02 <MarcelineVQ> that being said ghc-mod might not play nice with the GHC codebase anyway given how it's layed out, but I'm not certain of that
19:02 nut joined
19:03 <NextHendrix> i have a Double, its a big one, and its being printed out in the form 2.234523423452353e10
19:03 <Sornaensis> :t printf
19:03 <lambdabot> PrintfType r => String -> r
19:03 <sproingie> Sornaensis: no instance for (Cow t0) arising from a use of "moo"
19:03 <monochrom> Look into the Numeric module for tools to format Double in some other forms.
19:03 <NextHendrix> cheers
19:03 <NextHendrix> can't wrap my head around printf
19:03 <Sornaensis> λamoo
19:04 freeside joined
19:04 skeuomorf joined
19:04 <Sornaensis> printf is a weird one
19:04 <EvanR> printf is more of a "look what haskell can do" rather than a good way to format doubles
19:04 <phale> when should i use $ over () ?
19:05 <monochrom> Never.
19:05 <sproingie> i had MOO doing garbage collection on objects as one of the last hacks i did
19:05 <sproingie> and the moo server in general using boehm gc
19:05 <phale> monochrom, y not?
19:05 <EvanR> do (
19:05 <EvanR> ...
19:05 <EvanR> )
19:05 <phale> does it make it more unreadable
19:05 <EvanR> *error*
19:05 <sproingie> still had to keep refcounts tho, so it didn't gain much from the gc runtime
19:05 <EvanR> forever (do ... ) i mean
19:05 <monochrom> Parentheses tell me what the parse tree looks like. $ does not.
19:06 <MarcelineVQ> ehe, well it's good to learn how $ works because it'll teach you about precidence and fixity and other things but you do use it less and less as time goes on
19:06 {emptyset} joined
19:06 <MarcelineVQ> s/you/I/
19:06 <Sornaensis> $ is ♥
19:06 fXl joined
19:06 <Sornaensis> im allergic to parentheses
19:06 dsgsgdfg left
19:06 <monochrom> Yes, most programmers are.
19:07 <EvanR> "haskell has a lot of parentheses" someone said to me
19:07 <monochrom> Most programmers chose to be programmers because they hated algebra, which is where parentheses came from.
19:07 splanch joined
19:07 <sproingie> "foo . bar . baz $ mumble frotz" was the prevailing style last i was doing haskell
19:07 <XorSwap> "if you hate math, you'll *love* haskell!"
19:07 <monochrom> It was a wonder that Fortran actually became more popular than its predecessors.
19:08 <EvanR> sproingie: gross
19:08 <sproingie> what's the current opinion then?
19:08 <Cale> monochrom: lol
19:08 <monochrom> "I can now write algebra formulas as-is!" You would think that programmers would revolt against that.
19:09 <sproingie> i was a math-o-phobe for the longest time. i've recently decided i actually love math, i just hate numbers
19:09 newhoggy joined
19:09 <monochrom> If you loved math you would have become a Wall Street quant now and earn 10 times more money than programming.
19:09 <sproingie> having a soul might preclude that
19:09 <monochrom> If you loved read, writing, and reasoning about documentation you would have become a lawyer now, likewise.
19:10 <sproingie> again
19:10 <* EvanR> agrees with monochrom
19:10 conal joined
19:10 <monochrom> The conclusion is that the programming community is drained of any skill of math or documentation.
19:10 <MarcelineVQ> sproingie: to be on topic again, depending on other factors, that's just foo . bar . baz . mumble
19:11 <sproingie> i see stuff like http://worrydream.com/LadderOfAbstraction/ and think "damn why wasn't i learning to think like this back when i was in school"
19:11 <EvanR> monochrom: as "coding" crash courses become the new norm, it will get even devoid of programming skill
19:11 <EvanR> the "everyone should be able to do maintenance on their car" of RMS is backfiring
19:12 <sproingie> i bet you a million dollars RMS hasn't the faintest idea how to fix a car
19:12 <EvanR> because theyre not learning lisp, theyre learning HTML5
19:12 <sproingie> (er wait, he probably knows a lot about fixing cars and cdrs)
19:13 <fXl> hello guys, i am trying to read yaml file but gettin error like "Non-exashutive ..." the list returns empty, can anybody help? here what i did. https://hastebin.com/ukayuwusuf.hs
19:13 <sproingie> it'd be nice if brendan eich got his way and implemented scheme like he wanted
19:13 Netwolf joined
19:13 Netwolf joined
19:13 <monochrom> On the bright side, I can fix my HTML5 files too.
19:14 <EvanR> dont worry plenty of ways to make scheme suck too
19:14 <KunoMark> Hello peeps.
19:14 <sproingie> but aside from the awful 'new' operator semantics, the prototype OO trick of JS was actually a pretty neat addition
19:14 <KunoMark> I'm trying to do something which I feel is a little bit crazy, but I think aught to be possible.
19:15 bhiliyam joined
19:15 maarhart joined
19:15 msks joined
19:15 sellout- joined
19:15 <sproingie> haskell's the ideal language for crazy-but-possible
19:16 <KunoMark> I wanna see if I can use existentials, or something, to create a hashmap which doesn't know before-hand the types of its keys and values.
19:16 <monochrom> Yeah, JS taught me prototype OO.
19:16 <EvanR> KunoMark: check out "dependent map"
19:16 <monochrom> Previously I only saw prototype OO described handwavingly in books.
19:17 jeltsch joined
19:17 <EvanR> it wont be a hashmap, but youve already set it up for that not to be possible
19:17 <sproingie> was MOO that taught me prototype OO. JS does it very differently tho.
19:17 <KunoMark> Let me take a look, EvanR.
19:17 <monochrom> Yes, I'm aware. JS is a leaky abstraction of OO.
19:17 <KunoMark> Hmm...
19:18 <KunoMark> I would like to use an existing data structure though, EvanR. That provided by LRUCaching library.
19:18 <sproingie> Self's prototype OO is different still. much more powerful, since there's no single "parent" type, it's all delegated slots
19:18 <EvanR> the one im talking about exists
19:18 <sproingie> *"parent" slot
19:18 <EvanR> but sounds like yours already exists too
19:18 <KunoMark> I can already do something by converting my data to someserialisation format, but asking for the data to be instances of Store is too much...
19:19 <EvanR> KunoMark: this kind of thing requires step 0 to be "what sort of guarantees do i want the final thing to provide"
19:19 <KunoMark> Yeah. LRUCaching needs Hashable data. I'm trying to put a generic layer on top of it somehow, if that makes any sense EvanR...
19:19 alqatari joined
19:20 newhoggy joined
19:20 <KunoMark> Guarantees? Well, the consumer will ask for a value giving a key, but the TYPE EXPECTED BY THE CONSUMER will be the type of the key returned. Normal Existentials stuff, I believe.
19:21 <EvanR> you can parameterize the value type in the key type
19:21 <sproingie> for caching arbitrary stuff locally, there's memoization
19:21 <EvanR> that will help make your API make sense
19:21 <KunoMark> I wanna use an LRU, sproingie
19:21 <sproingie> if it's serving some other process, i'd say just serialize all the things
19:22 <EvanR> for example https://hackage.haskell.org/package/vault-0.3.0.7/docs/Data-Vault-Lazy.html but this is a uniform key type, not an arbitrary key type
19:22 <monochrom> Hashing does not spare you from needing to know the type. You will have to perform ==, which requires types.
19:22 <EvanR> so falls short of your vague requirement that you dont know what the type of keys are
19:22 <KunoMark> Serialisation is too much, as I ave little control over some of the types. In particular, I can't seem to serialise Persistent's Key * type family...
19:22 <paolino> you hade Dynamic also
19:22 <fXl> hello guys, i am trying to read yaml file but gettin error like "Non-exashutive ..." the list returns empty, can anybody help? here what i did. https://hastebin.com/ukayuwusuf.hs
19:23 <KunoMark> I'm taking a look at Vault, EvanR.
19:23 <sproingie> not sure why one cache would have wildly disparate types. imagine an uncached version, you wouldn't have a single function return a type like that, would you?
19:23 <sproingie> if you need to cache different things, you probably need different caches
19:24 <EvanR> that would be easier to pull off yes
19:24 <EvanR> but it sounds like theres some legacy systems that need integration
19:24 connrs joined
19:24 <KunoMark> paolino Dynamic requires a Typeable instance. I literally can't seem to add any instances to my key types.
19:24 grayjoc joined
19:24 <EvanR> Typeable is automatically derived, or not possible
19:24 <KunoMark> But let me think over it a little mor, and maybe provide a better way to explain it...
19:25 abhiroop joined
19:26 <sproingie> stupid question, but how performant is Dynamic, if say, i wanted to write a slapdash little EDSL with it?
19:26 <monochrom> Turn on DeriveDataTypeable and write "data MyType = .... deriving Typeable"
19:27 <EvanR> sproingie: i havent seen Dynamic used for that purpose
19:27 lifter joined
19:27 Wamanuz joined
19:27 <monochrom> Dynamic is a record of two fields, one for type and one for value.
19:27 <EvanR> wouldnt you want an EDSL to be well typed
19:28 <sproingie> let's say i wanted to demonstrate how haskell is the best duck-typed imperative language :)
19:28 <EvanR> i suspect youll fail miserably at that
19:28 <monochrom> I think it really is the most compact representation possible.
19:29 <sproingie> i guess it all depends on how many typechecks and casts i do
19:29 <EvanR> you cant cast, but with Dynamic you can check that a thing is the type you are expecting
19:29 <XorSwap> hey, so is there still an obfuscated haskell contest kicking around?
19:29 <monochrom> When it comes to duck typing, there are two opposite opinions on "best".
19:30 <EvanR> which is constantly happening (in more complex form) in other languages
19:30 newhoggy joined
19:31 <EvanR> sproingie: with ghc defer type errors, you get all the performance with none of the pesky type safety
19:31 perebor joined
19:31 <EvanR> might be a better angle for bragging
19:32 connrs joined
19:32 <paolino> defer type errors is producing executables ?
19:32 <sproingie> and if i was doing an actual scripting runtime ... well, i guess i'd be storing something like (tag,val) anyway
19:32 <EvanR> yeah
19:32 <EvanR> sproingie: with defer type errors, you dont even need to do that! :P
19:33 <monochrom> hugs defers type errors to interpret time. you get your freedom and also no more dependency hell. :)
19:33 <EvanR> more seriously, if you were doing a "dnyamic" DSL you d write your own sum type for that (tag, val) object
19:33 <sproingie> waaaay back i remember hugs having better error messages
19:33 <Cale> XorSwap: There was a long while ago, with some pretty nice entries
19:33 <EvanR> with the 7 magic primitive types everyone wants
19:33 <Cale> XorSwap: the IOHCC
19:34 <XorSwap> it's not on anymore?
19:34 aarvar joined
19:34 <Cale> I think it only ran a couple times
19:34 <perebor> has anyone installed hmatrix on nixos with stack? I'm having trouble with the gfortran .so dependency
19:34 afarmer joined
19:35 <sproingie> seven, eh? bool, num, string, function, list, map ... what am i missing?
19:35 <EvanR> null of course
19:35 <EvanR> or nil
19:35 <sproingie> eh, every type can contain null, whaddya need another type for?
19:35 <sproingie> that's what everyone seems to want
19:35 <EvanR> i think weve lost contact with the subject
19:36 <fXl> hello guys, i am trying to read yaml file but gettin error like "Non-exashutive ..." the list returns empty, can anybody help? here what i did. https://hastebin.com/ukayuwusuf.hs :D
19:36 <EvanR> Nil | MyBool Bool | MyString String | MyInt Integer | ...
19:36 <EvanR> without Nil ... you cant do nil
19:36 <sproingie> there's void, but you make that magical, not a real type. (note: talking about how to design a crap language here)
19:36 vimto joined
19:36 <EvanR> me too
19:36 <EvanR> nil is not a bool
19:37 <monochrom> fXl: I can't see why it has that error. Perhaps your yaml file is bad?
19:37 <lpaste> K pasted “No title” at http://lpaste.net/354824
19:37 tobiasBora joined
19:37 <sproingie> i think perl just has an "undef" bit in every SV
19:37 <EvanR> undefined could be yet another thing
19:37 <fXl> monochrom: what do you mean by yaml file is bad ?
19:37 <paolino> fXl can you paste the error ?
19:38 <fXl> okey
19:38 kylepotts joined
19:38 <EvanR> i have a FHIR standard here for like 39 different kinds of null, all different
19:38 <sproingie> but then again, perl SV's represent a lot of types under the covers
19:38 <EvanR> http://www.hl7.org/fhir/v3/NullFlavor/cs.html
19:38 <monochrom> That beats the IEEE 9-value logic I read about.
19:38 <sproingie> True, False, FileNotFound, Chocolate, Vanilla ...
19:38 Beelsebob joined
19:38 <EvanR> hmm seems less than i remember
19:38 <monochrom> By a multiple of 4, no less.
19:39 <KunoMark> EvanR and sprongie, please consider the following, if you will: 
19:39 <EvanR> sproingie: so in retrospect, youd save that one bit of space by just rolling null into the tag, and thus null is born
19:39 <sproingie> i ought to get around to writing this language. i think i'll call it Crap
19:39 <KunoMark> That's as far as I can get. But I wanna get rid of the Store dependency. I'm just using it to store everything as ByteStrings...
19:40 lifter joined
19:41 newhoggy joined
19:42 sillyotter joined
19:42 <sproingie> it'll be like python's wildly popular "flask" framework. it grew out of an april fools joke to make a web framework entirely out of antipatterns
19:42 hurkan left
19:43 <fXl> monochrom, paolino, https://hastebin.com/etemihefed.js
19:44 <monochrom> OK so it is not "Non-exashutive"
19:44 <fXl> https://hastebin.com/inefepobol.hs
19:45 <fXl> because, i did error "Error"
19:45 <fXl> :D
19:45 <monochrom> You need to be more self-consistent.
19:45 <EvanR> hmm
19:46 <fXl> monochrom, i added the other things to be precise for you
19:46 ryantrinkle joined
19:46 ryantrinkle left
19:46 <fXl> *** Exception: Pe.hs:(20,10)-(21,26): Non-exhaustive patterns in function parseJSON
19:46 <monochrom> I don't actually know the YAML format, but this error is saying the program cannot find an object where it expects one.
19:46 blender1 joined
19:47 <paolino> which is the all file content
19:47 <paolino> but it looks like it parsed it
19:47 <fXl> you mean, it cant read the file ?
19:47 darjeeling_ joined
19:47 <fXl> when i do Y.Value, it parses and shows values
19:47 alqatari joined
19:47 <fXl> instead of IO (Maybe Point)
19:48 <monochrom> Not all values are objects.
19:48 <paolino> try to match the sibilings constructors of Object
19:48 <KunoMark> You know what? I think I'll just do a bunch of unsafePerformIO and be done with it. :-D Now to find all those references about how unsafePerformIO can be used to do unsafe coersions..
19:48 <monochrom> I don't know YAML but I actually know enough JSON to say this.
19:48 <EvanR> KunoMark: what on earth
19:49 ADG joined
19:49 iomonad joined
19:49 <Cale> KunoMark: Looking back at the past conversation: are you aware of DMap?
19:49 vimto joined
19:50 <ADG> can anybody tell about what is probably the best setup for haskell on linux? atom? eclipse? vim(I hate vim/emacs)?
19:50 <Cale> (it's not quite what you're asking for, but depending on the reason you're asking, it might be what you want)
19:50 <dmj`> ADG: emacs / vim
19:50 <Cale> ADG: It doesn't really matter what editor you use
19:50 carlosda1 joined
19:50 Dr8128 joined
19:50 <Cale> Just don't worry about it. As long as it has the option to convert tabs to spaces.
19:51 <ADG> i like autocomplete, on-the-fly lint checking & stuff
19:51 <fXl> paolino, sibling cunstructors ?
19:51 <paolino> fXl , where is Object defined ?
19:51 Itkovian joined
19:51 initiumdoeslinux joined
19:52 <fXl> when using Y.Value, returns this Just (Array [Object (fromList [("point",String "/home/user/file"),("point2",String "/home/user/file2")])])
19:52 <KunoMark> That might just be it, Cale. I'll see if I can make it work, and hopefully even add LRU functionaility to it. :-)
19:52 <fXl> i think i should do pattern matchin "D
19:52 <fXl> or i dont know
19:52 <paolino> so it's an Array
19:52 <monochrom> There, it's an array not an object.
19:53 biglama joined
19:53 <fXl> parseJSON Array then ?
19:56 <fXl> Array returned this, Just [Object (fromList [("point",String "/home/user/file"),("point2",String "/home/user/file2")])]
19:56 <sproingie> intellij idea has a haskell plugin that might be ok. it's stack enabled, so it's at least that much maintained.
19:56 <monochrom> Is it even legit YAML to have a top-level array?
19:56 <sproingie> oh he's gone. silly me.
19:56 okuu joined
19:56 roger__ joined
19:57 <fXl> monochrom, i found this https://stackoverflow.com/questions/13059806/reading-yaml-in-haskell, the last answered guy says i did it 3 liner but his code is too complicated for me :D https://github.com/jwiegley/pushme/blob/master/Main.hs
19:58 a3Dman joined
19:58 <johnw> 1. you need to define FromJSON instances for your types (which can be generated automatically for many types)
19:58 <fragamus> OK, I am trying to use Pipes and Turtle together
19:58 <johnw> 2. maybeObj <- Data.Yaml.decode <$> B.readFile (encodeString p)
19:58 <fragamus> i have this: scrounge :: MonadIO m => Filesystem.Path.CurrentOS.FilePath -> Pipe a a m ()
19:59 <roger__> Anyone know of a way to represent an AST with associative operators (say + and *) without allowing a ton of redundant representations of the same expression?
19:59 <monochrom> johnw, I think 1 is done. What is p in 2?
19:59 <fragamus> i want something like this: scrounge :: Shell m => Filesystem.Path.CurrentOS.FilePath -> Pipe a a m ()
19:59 <johnw> sorry, p should just be the name of the file
19:59 <johnw> ignore the encodeString
19:59 <monochrom> 2 is also done
19:59 <monochrom> Therefore I blame the input file.
19:59 <johnw> ok, we're good then
20:00 newhoggy joined
20:00 <fragamus> but I get errors and I am blocked
20:00 <fXl> i can read file i guess but it doesnt seem to work like the way on github there
20:00 mac10688 joined
20:01 <monochrom> johnw: Actually the actual code is Y.decodeFile "points.yml" :: IO (Maybe Pointer). Does it make a difference?
20:01 <monochrom> Y = Data.Yaml
20:01 magneticduck joined
20:01 <johnw> I don't think it does
20:01 magneticduck joined
20:02 <monochrom> The FromJSON instance assumes Object (rightfully, I would think). parseJSON (Object e) = Pointer <$> e .: "point"
20:02 <fragamus> it says Shell has kind *
20:02 <monochrom> ("Pointer" is a data constructor and has one field of type [String])
20:03 <johnw> I really just use TH to generate the parser
20:03 <johnw> deriveJSON ''Pointer
20:05 insitu joined
20:05 <fragamus> Expected a constraint, but Shell m has kind *
20:06 Gurkenglas_ joined
20:06 <fXl> johnw, whats the wrong thing in my code there ?
20:06 <johnw> can you link me to code that I can paste and try here?
20:07 vaibhavsagar joined
20:07 <fXl> okey
20:07 <monochrom> This is really down the road of more recipes, less scientific method, and hell. There is evidence that the input file reads like [point: "xxx", point2: "yyy"] and nothing says why the program code should have any relation with the input file at all.
20:08 <fragamus> : |
20:08 <monochrom> We are basically looking for more and more automagical way to write code without even asking "do you actually know your file format?"
20:08 <paolino> fragamus: where is Shell defined ?
20:08 noddy joined
20:08 <geekosaur> fragamus, looks to me like it's telling you Shell is a type, not a typeclass
20:08 <geekosaur> also it reports Shell m is kind *, not Shell is kind *
20:08 <fXl> johnw, https://hastebin.com/ferorumuro.hs
20:09 <geekosaur> that said, ... I am afraid to ask if this relates to the Type <=> Constraint silliness
20:10 <geekosaur> but I will echo paolino's question: where is Shell defined?
20:10 <johnw> what a badly behaved website is hastebin.com
20:10 fowlslegs joined
20:10 <fXl> monochrom, :D
20:10 <fXl> haha kinda yes
20:10 <jle`> fragamus: do you know the difference between a typeclass and a type?
20:10 MrWoohoo joined
20:10 <fragamus> i dont now
20:10 <fXl> i am used to it, why using sorry jonhw :D
20:10 <Cale> geekosaur: Maybe in turtle? https://hackage.haskell.org/package/turtle-1.3.2/docs/Turtle-Shell.html
20:11 newhoggy joined
20:11 <jle`> fragamus: a typeclass is sort of like an 'interface', which many types may implement
20:11 <geekosaur> Cale, this relates to fragamus's question
20:11 grayjoc joined
20:11 <jle`> fragamus: so something like sort :: Ord a => [a] -> [a]
20:11 <jle`> fragamus: means that sort works for any type, as long as that type implements the Ord typeclass
20:12 <Cale> Oh, a Shell type class?
20:12 <Cale> I have no idea.
20:12 <fragamus> right i remember
20:12 <jle`> fragamus: if i wanted to have a function that takes an int and returns an int
20:12 <fragamus> yeah
20:12 <jle`> i'd write foo :: Int -> Int
20:12 <jle`> i wouldn't write foo :: Int a => a -> a
20:12 <jle`> because Int isn't a typeclass
20:12 <geekosaur> well, we don;t know yet, fragamus should be telling us instead of making us guess
20:13 <fragamus> ok i will tell you
20:13 <geekosaur> oh, guess they mentioned turtle earlier
20:13 <geekosaur> which means it's a type, not a typeclass
20:13 <jle`> fragamus: so the error is saying that (Shell m) is not a typeclass constraint, but actually a type
20:13 <Cale> yeah
20:13 <geekosaur> and indeed should not be where you used it
20:13 <jle`> ie, it's like you're trying to do Int a => a -> a
20:14 <jle`> instead of just Int -> Int
20:14 <geekosaur> ghc used to let you do that :)
20:14 Itkovian joined
20:14 <jle`> or Maybe a => a -> a, instead of (Maybe a -> Maybe a)
20:15 <fragamus> Shell is defined here: https://hackage.haskell.org/package/turtle-1.3.2/docs/src/Turtle-Shell.html#Shell
20:15 <fragamus> it is indeed a type
20:15 <jle`> mhm, and not a typeclass constraint
20:15 terrorjack joined
20:15 <jle`> have you tried maybe FilePath -> Pipe a a Shell () ?
20:16 <jle`> not sure if the 'a' and 'a' are correct
20:16 <fragamus> il'll try that
20:16 butterthebuddha joined
20:16 <jle`> it's kind of like converting the silly `Maybe a => a` into `Maybe a`
20:16 <jle`> since Maybe isn't a typeclass
20:17 <fragamus> that worked
20:17 <fragamus> thanks all
20:17 <jle`> hooray!
20:17 Beelsebob joined
20:17 <fragamus> you guys saved my weekend no kidding
20:17 <butterthebuddha> Hey peeps, I'm writing a function that takes a string as input. I wanna pattern match something like 'SINGLE_CHAR_HERE':' ':"String":' ':"String":' ':"String"
20:17 <butterthebuddha> I know how to match single characters, but I'm not sure how take extract the strings
20:17 <jle`> butterthebuddha: you should already be able to pattern match on that
20:18 <jle`> oh
20:18 <jle`> you don't mean to actually pattern match literally on the string "String"
20:18 <butterthebuddha> No
20:18 <jle`> what is an example of a string you want to see
20:18 <jle`> and what it would match on?
20:18 <butterthebuddha> 'E':' ':x:' ':y:' ':s
20:18 <butterthebuddha> ^ that's what I'm doing; x, y and s must be strings
20:18 <butterthebuddha> Example string: "E 2 148 #56k istereadeat lo d200ff] BOOTMEM"
20:18 splanch joined
20:19 <jle`> can x y and s contain spaces?
20:19 <butterthebuddha> Nope
20:19 <jle`> what would that match as
20:19 <fXl> johnw, is there any progress ?
20:19 lukky513 joined
20:19 <johnw> no, I still haven't seen the code
20:19 <jle`> 'E', '2', '148', and '#56k istereadeat lo d..." ?
20:19 <butterthebuddha> Yep
20:19 abhiroop joined
20:19 <paolino> butterthebuddha, x y tare Char there
20:19 <butterthebuddha> From the match I posted above, I know that s is a string but x and y are Chars
20:20 <fXl> johnw, i can paste somewhere else if you want.
20:20 <jle`> > case "E 2 148 #56k istereadeat lo d200ff] BOOTMEM" of x:xs -> (x, words xs)
20:20 <lambdabot> ('E',["2","148","#56k","istereadeat","lo","d200ff]","BOOTMEM"])
20:20 <johnw> lpaste is fine, or gist, or anywhere else really
20:20 <MarcelineVQ> mmm, that's week2 of cis194 sping13
20:20 <johnw> the fact that even turning off all protections doesn't make hpaste work is troubling
20:20 <johnw> or hastebin, rather
20:20 <butterthebuddha> Can I do a case inside a function?
20:20 des joined
20:21 <jle`> you can but i'm just showing the pattern match
20:21 <jle`> the pattern match is the important part
20:21 <jle`> you can pattern match on (x:xs), and then use 'words xs'
20:21 <jle`> `x:xs` gives x as the first Char
20:21 <jle`> and words splits the remaining string on spaces
20:21 <fXl> johnw, http://lpaste.net/354826
20:21 <jle`> > let e:es = "E 2 148 #56k istereadeat lo d200ff] BOOTMEM"; x:y:s = words es in (e,x,y)
20:21 <lambdabot> ('E',"2","148")
20:22 <jle`> > let e:es = "E 2 148 #56k istereadeat lo d200ff] BOOTMEM"; x:y:s = words es in (e,x,y,s)
20:22 <lambdabot> ('E',"2","148",["#56k","istereadeat","lo","d200ff]","BOOTMEM"])
20:22 <jle`> hm, sorry
20:22 <jle`> > let e:es = "E 2 148 #56k istereadeat lo d200ff] BOOTMEM"; x:y:s = words es in (e,x,y,unwords s)
20:22 oisdk joined
20:22 <lambdabot> ('E',"2","148","#56k istereadeat lo d200ff] BOOTMEM")
20:22 <fXl> > print "lambda"
20:22 <EvanR> hax
20:22 <lambdabot> <IO ()>
20:22 <johnw> ah, there we go
20:22 <fXl> :D
20:22 <jle`> be aware that this compresses spaces in the "leftovers"
20:22 torgdor joined
20:22 gibbers joined
20:23 <fXl> hmm
20:23 newhoggy joined
20:24 <EvanR> heh, doing putStrLn from two threads is literally "randomly interleaving" the characters
20:24 <EvanR> for short strings
20:24 <geekosaur> yep
20:24 <EvanR> i am impressed
20:24 <butterthebuddha> jle` So I'm trying to do this: "x:(words xs)"
20:24 <butterthebuddha> And that isn't working :/
20:24 <jle`> that's not how pattern matches work
20:25 <jle`> did you see what i wrote earlier?
20:25 <butterthebuddha> Yea I'm trying to parse that
20:25 <jle`> so do x:xs
20:25 <jle`> to get 'E':"2 128 ..."
20:25 <jle`> and then use 'words' on xs
20:25 <jle`> in like a 'where' clause or something maybe?
20:26 <johnw> fXl: your data types do not correspond to your data
20:26 <johnw> your data is a list of objects with two fields, point and point2
20:26 <johnw> your program is trying to read in a single object with only one field, point
20:26 <johnw> https://gist.github.com/d07bd481f6d527df4c9bdbe58302d4fa
20:26 <johnw> change that accordingly, and you'll be fine
20:27 <fXl> woaw, are you the guy of that answer :D
20:27 <jle`> butterthebuddha: if you match on x:xs, then x will be 'E' and xs will be "2 148 ..." etc.
20:27 <jle`> butterthebuddha: then you can use the 'words' function on xs to get ["2", "148", "#56k", "istrereadeat", ...]
20:27 <jle`> are you familiar with using functions?
20:28 <butterthebuddha> Yeeaa
20:28 moth joined
20:28 <butterthebuddha> But I'm not sure how to assign the words function call to a variable
20:28 <jle`> you can name it
20:28 <butterthebuddha> without using something like a do
20:28 <johnw> fXl: I have to run now, good luck!
20:28 <jle`> using let, or where
20:28 tapirus joined
20:28 <jle`> look up 'where' clauses, maybe? or 'let ... in ...'
20:28 <johnw> is the webpage linked here broken for anyone else: https://www.reddit.com/r/haskell/comments/66xqro/putting_lenses_to_work_talk_and_slides/
20:28 <fXl> johnw, thank you so much for your time, appreciated sir
20:29 <johnw> I've been having a heck of a time with DNS
20:29 <jle`> butterthebuddha: where clauses should hopefully be one of the first things covered in any haskell course :)
20:29 <fXl> johnw, it works for me
20:30 <johnw> fXl: thanks! it might be a localized issue then
20:30 <jle`> butterthebuddha: see http://learnyouahaskell.com/syntax-in-functions for a quick reference if you're unfamiliar
20:30 <geekosaur> johnw, works for me
20:30 <johnw> Gurkenglas_ was having the problem
20:30 <fXl> https://github.com/jwiegley/putting-lenses-to-work
20:30 newhoggy joined
20:30 Beelsebob joined
20:31 <Gurkenglas_> johnw, works now, didn't work then
20:31 <johnw> ok
20:31 <EvanR> in ghci i can reload and loose my variables, but forkIO threads are still running
20:31 <johnw> maybe you hit it right when I was refreshing to fix a spelling error or something
20:31 <butterthebuddha> jle` Yea I was going through this course (https://www.seas.upenn.edu/~cis194/spring13) and they don't seem to cover it; at least not in the first two lectures
20:31 <jle`> ah
20:31 dsh joined
20:32 <jle`> that's a bit odd
20:32 <fXl> johnw, i just want to ask this if you have time, is this better way then saying instance FromJSON etc.. ?
20:32 <fXl> or you just made it worked :D
20:32 <jle`> 'let .. in ..' is one of the most fundamental parts of haskell, kind of weird that they'd skip thorugh it
20:32 <Gurkenglas> johnw, (?~ mx) makes it look like mx has type (Maybe _)
20:33 <jle`> i am perplexed :)
20:36 Destol left
20:36 <Gurkenglas> johnw, 'prisms address some part of a "structure" that may exist' <- they adress the whole of the structure, not a part of it - prisms say that a structure might have some form. lenses do the part part
20:37 newhoggy joined
20:37 kylepotts joined
20:37 <fXl> johnw, your code didnt work for me, returns Nothing
20:37 <MarcelineVQ> jle` butterthebuddha: I'm surprised it's not covered in the lectures directly as well, however it is covered in the suggested reading at the top of the lectures one should be reading
20:38 <butterthebuddha> Ah, right
20:38 <tomskel> MarcelineVQ: sorry got dragged away. Yeah I don't think ghc-mod can cope with GHC's weird directory layout, there doesn't seem to be any option you can pass it that allows it to use a different cwd. From what I can tell it tries to infer the cwd itself, and the for the GHC codebase it infers wrong.
20:39 splanch joined
20:42 <MarcelineVQ> someone in ghc might have a workflow that you could adopt, due to the version shenanigans that happen with these sorts of things ghc-mod will be fairly brittle even if you do find a way to get it going
20:42 abhiroop joined
20:43 <tomskel> Cool, thanks for your help :-)
20:43 <MarcelineVQ> *someone in #ghc
20:44 blym_ joined
20:46 frankpf joined
20:47 hackebeilchen1 joined
20:47 blender1 joined
20:47 wroathe_ joined
20:48 oisdk joined
20:49 <monochrom> ghc-mod on GHC itself is funnily self-referential, because ghc-mod uses the GHC API.
20:50 <mpickering> I doubt that you can use ghc-mod with #ghc
20:51 <mpickering> Is there a way to get happy parsers to tell you which tokens they were expecting to find rather than which token they unexpectedly found (on a parse error)
20:51 hackebeilchen joined
20:51 <monochrom> Oh, yeah, there can be a way GHC source code can confuse GHC API.
20:51 carlosda1 joined
20:52 a3Dman joined
20:53 yellowj joined
20:54 vektorweg1 joined
20:55 {emptyset} joined
20:56 <perebor> has anyone installed hmatrix with stack?
20:56 newhoggy joined
20:57 <johnw> Gurkenglas: good point
20:57 <johnw> fXl: that's because of what I said above: your data is a list of objects with two fields, point and point2, and your program is trying to read in a single object with only one field, point
20:58 <fXl> johnw, okey i fixed it, what if i want to read dictionary then ?
20:58 ertesx joined
20:59 ublubu joined
21:00 <lyxia> perebor: I have
21:01 <lyxia> perebor: it's more efficient for you to just ask your question BTW
21:02 <phale> should i always explicitly set type for functions ?
21:02 <mpickering> yes you should always write type signatures for top level definitions
21:03 <phale> alright
21:03 <phale> im also failing to undestand what are Just ? wha does this mean
21:03 <phale> Just and Maybe
21:03 <EvanR> data Maybe a = Nothing | Just a
21:04 <phale> yes but whats the purpose of it ?
21:04 hackebeilchen joined
21:04 <EvanR> Maybe is a type, Just is one of its two constructors
21:04 <m0cesta> Just somevalue
21:04 <EvanR> it takes the place of "null" from other languages
21:04 <m0cesta> or Nothing
21:04 <fXl> there are lots of lots of concepts in Haskell and lots of them are hard to understand :D
21:04 newhoggy joined
21:04 <m0cesta> The idea is very simple
21:04 <EvanR> you wont find variables randomly holding the value "null" in haskell, but you can get the same result using a Maybe
21:05 a3Dman joined
21:05 <EvanR> its actually more useful than null, because you can tell the difference between Nothing, Just Nothing, and Just (Just something)
21:06 <dolio> And once you check you get a value that tells you you never need to check again.
21:06 ludat joined
21:06 <EvanR> when youre using null for two different purposes, that often explodes in your face in other languages
21:07 <rotaerk> phale, what languages do you know?
21:07 srbaker_ joined
21:08 <rotaerk> (if any)
21:08 muesli4 joined
21:09 lifter joined
21:10 <perebor> lyxia: I'm getting either totally inscrutable errors or segfaults if I link hmatrix with openblas. do you know if openblas is supported? or should I stick to trying to install with blas
21:10 Sampuka joined
21:12 kritzcreek joined
21:13 butterthebuddha joined
21:13 Wuzzy joined
21:14 <phale> rotaerk, programming languages?
21:14 <rotaerk> yea
21:14 <phale> C
21:14 <fXl> segmentation fault then :D
21:15 <rotaerk> hmm C has null but I'm not sure if it makes a good analogy
21:15 bhiliyam joined
21:15 <rotaerk> since it's really just (T*)0
21:16 <rotaerk> phale, is there still any confusion regarding what Maybe and Just do?
21:17 newhoggy joined
21:17 darjeeling_ joined
21:18 <phale> so it basically tests if something is null?
21:18 aer[m] joined
21:19 <Cale> Nah, it's used in place of the cases where you might allow for something to possibly be null and test for that condition
21:19 |DM| joined
21:19 <Cale> Or for example, in C sometimes people writing a function which produces an int that would normally be positive, might use -1 in the case that the function failed.
21:20 <|DM|> how would I repeatedly call a function that has no arguments in haskell ?
21:20 mou joined
21:20 <|DM|> Map expects input, so does iterate. Im lost
21:20 <Cale> We would never do that in Haskell, such a function would instead produce a Maybe Int
21:20 jrm joined
21:20 <Cale> and give Nothing in the "failure" case
21:20 <Cale> and Just n in the case that it was successful
21:20 butterthebuddha joined
21:20 <Cale> |DM|: A function with no arguments is not a function.
21:20 blender1 joined
21:21 <Cale> |DM|: What are you trying to accomplish?
21:21 <Cale> (every function in Haskell really has exactly one parameter)
21:21 <rotaerk> phale, the purpose of Maybe is to represent optionality or unreliability of a value
21:21 <|DM|> I want to repeatedly print hello world
21:21 <|DM|> I made a function that prints hello world, and takes no arguments
21:21 <Cale> main = do
21:22 <Cale> putStrLn "Hello World!"
21:22 <Cale> main
21:22 <|DM|> Oh, I see. If it has do its not a function ?
21:22 <|DM|> That loops forever.
21:22 <Cale> main isn't a function
21:22 <Cale> It's an IO action
21:22 <Cale> main :: IO ()
21:22 <rotaerk> phale, for instance if you had a simple int-parsing function, your first attempt may have a signature like: String -> Int
21:22 <rotaerk> but if the string is "aoeu" what do you do in that case?
21:22 <tsani> |DM|: main is a value :)
21:22 buttbutter joined
21:22 <|DM|> Yes, but my hello world "function was foo = prtStrLn "Hello" , so I guess its not actually a function ?
21:23 <tsani> foo :: IO ()
21:23 <Cale> |DM|: You can also write main = forever (putStrLn "Hello!")
21:23 andyo joined
21:23 <tsani> foo is also a value.
21:23 <rotaerk> phale, the fact that it can't *always* return an integer means you might want to use this signature instead: String -> Maybe Int
21:23 <Cale> |DM|: Right, it's type is not of the form A -> B for some types A and B
21:23 <Cale> its*
21:23 <rotaerk> phale, and if the input string is not actually an integer, return Nothing
21:23 <|DM|> Oh I see now. Though im confused how IO actions are values
21:24 <rotaerk> you can also take Maybe as an *input* to your function if the value is optional
21:24 <glguy> |DM| Suppose you had: sayHi = putStrLn "Hello,world". 'sayHi' is an action that when executed prints hello world to the screen once. Now that we have that we can make more actions like: sayHiTwice = sayHi >> sayHi
21:24 <|DM|> I guess the haskelly way to limit the iterations is like scheme, recursive function with a stop condition ?
21:24 <Cale> Well, they can be passed around like anything else, put in data structures, and manipulated in all the usual way values can
21:24 <fragamus> hi Im using pipes and I have a pipe that calls take such that I limit the number of items provided downstream. DOES MY UPSTREAM producer run to completion producing stuff that gets ignored?
21:24 <Cale> Functions are also values, so it's not saying all that much.
21:24 <Cale> |DM|: You can also use mapM, replicateM
21:25 <Cale> replicateM 10 (putStrLn "Hello!")
21:25 <Cale> mapM print [1..10]
21:25 bobakk3r joined
21:25 <Cale> forM [1..10] $ \n ->
21:25 <rotaerk> |DM|, think of an IO value as just being an immutable set of instructions, a plan or description for an IO action
21:25 <Cale> print n
21:25 <|DM|> I see.
21:25 <lyxia> perebor: is it related to https://github.com/albertoruiz/hmatrix/issues/211
21:25 <glguy> An interesting aspect of Cale's example is that you can write: replicateM 0 (putStrLn "Hello"), and no printing happens
21:25 systemhalted joined
21:25 <glguy> applying putStrLn to "Hello" isn't what actuall prints, it's just building an action that could print if executed
21:26 <Cale> |DM|: because IO actions are values which merely describe things to be done, we can write functions which take them as arguments and do things with them before they get executed
21:26 <Cale> |DM|: For example, let's write the function replicateM which repeats something a given number of times
21:26 <Cale> (and collects the results in a list)
21:27 <fragamus> because if it does i want to cry
21:28 <Cale> replicateM n x | n <= 0 = return [] -- if the number of times to run x is not positive, just produce the action which does nothing except to result in an empty list when executed
21:28 <Cale> (return v is a no-op which produces v as its result)
21:28 <Cale> replicateM n x = do -- otherwise...
21:28 Gloomy joined
21:28 <Cale> v <- x -- first run x, getting some result v
21:29 <perebor> lyxia: omg I'm been through all sorts of other issues all morning with openblas segfaults that have been resolved, and the documentation I've found has used the openblas flag. thank you so much for finding that
21:29 <Cale> vs <- replicateM (n-1) x -- then run x again (n-1) more times, getting a list vs
21:29 <rotaerk> |DM|, the reason anything gets executed is because GHC expects you to produce an IO value (a plan of action) and call it main... it then compiles a program that executes this plan
21:29 <Cale> return (v:vs) -- and return (v:vs) as the result
21:30 steeze joined
21:30 hegge joined
21:30 <|DM|> I see. Man this clears up haskell a lot
21:30 <Cale> |DM|: A more fundamentally useful function, similar to this, is sequence
21:30 <Cale> sequence :: [IO a] -> IO [a]
21:30 <|DM|> If I understand this right, replicateM isnt a function either in this case
21:30 <rotaerk> it is a function because it takes arguments
21:30 <Cale> replicateM actually does count as a function, because it takes an Int
21:30 <EvanR> functions have type A -> B
21:30 fragamus joined
21:30 <|DM|> Though the various pieces under guards ARE ?
21:30 <EvanR> :t replicateM
21:30 <lambdabot> Applicative m => Int -> m a -> m [a]
21:31 <EvanR> Int -> (m a -> m [a])
21:31 <Cale> that's a type for a more general version than I implemented
21:31 <Cale> but still :)
21:31 <Cale> I was just hoping for Int -> IO a -> IO [a]
21:31 <EvanR> Int -> (IO a -> IO [a])
21:31 <EvanR> thus its a function
21:32 <|DM|> So guards dont count as parameters at all?
21:32 <Cale> guards don't... the actual parameters do...
21:32 <|DM|> alright
21:32 <Cale> In this case, n and x are parameters to the function
21:32 <EvanR> convince yourself guards would not make sense as arguments
21:32 <Cale> Actually, let's do sequence as well
21:32 newhoggy joined
21:33 <Cale> sequence :: [IO a] -> IO [a]
21:33 <rotaerk> |DM|, in C and many other procedural languages, a "function" is a packet of steps to execute. thus no-parameter "functions" make sense. in haskell this is the role of an IO action. in C, this procedure itself takes parameters. in haskell, you just make a function that takes parameters and produces a different IO action based on them. (the IO itself doesn't take args)
21:33 <Cale> It's a function which takes a list of IO actions, and turns them into a single action, whose result will be a list of their results
21:33 Amadiro joined
21:34 <Cale> sequence [] = return [] -- here, if the list is empty, we produce an action which does nothing except to result in an empty list
21:34 <rotaerk> so "function" doesn't correspond to functionality in haskell like it does in other languages... it just means parameterization
21:34 <Cale> sequence (x:xs) = do v <- x; ... -- if the list is nonempty, we first run the first action in it...
21:34 <rotaerk> any functionality would be encoded in the result of the function
21:34 <Cale> sequence (x:xs) = do v <- x; vs <- sequence xs; ... -- then we run all the others (recursively) getting a list of their results
21:35 <EvanR> function corresponds to a mathematical function
21:35 kylepotts joined
21:35 <Cale> sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs) -- and produce a complete list of the results
21:35 <Cale> Make sense?
21:35 lifter joined
21:36 <|DM|> I think so
21:36 <Cale> So this sequence function is basically a primordial sort of loop: if we can decide ahead of times what each iteration of our loop will do, and construct a list of the actions, then it will stitch them all together
21:36 <Cale> Using it, we can rewrite replicateM more simply:
21:36 <Cale> replicateM n x = sequence (replicate n x)
21:36 andyoqqq joined
21:36 <Cale> Here, replicate is just the function which produces a list of n copies of x
21:37 <Cale> mapM f xs = sequence (map f xs)
21:37 a3Dman joined
21:38 andyo__ joined
21:38 <Cale> This is like a for-each loop. Given a function which says what to do, given an element, and a list of elements, it will iterate over the list and perform all the actions
21:38 nicknovitski joined
21:38 <|DM|> Im familiar with map yeah
21:38 <Cale> There's also forM which is mapM with the arguments in the opposite order for convenience (since usually the function is the longer bit and might span several lines)
21:39 physicalist joined
21:39 splanch joined
21:39 <Cale> But yeah, you can also just write recursive things. Usually if the termination condition is anything more subtle than what's covered here, you'll see people go for direct recursion.
21:40 <|DM|> Alright
21:40 <|DM|> Thanks for the great intro.
21:41 newhoggy joined
21:42 sellout- joined
21:42 enitiz joined
21:43 splanch_ joined
21:43 darlan joined
21:43 freeside joined
21:44 splanch__ joined
21:45 <EvanR> i am kind of amazed that after install sdl2, i can ghc Main and get an executable without anything special
21:45 <EvanR> no linker shenanigans, telling it where sdl2 includes are
21:46 <EvanR> etc
21:46 weinzwang joined
21:49 shesek joined
21:51 fXl joined
21:52 carlosda1 joined
21:52 hiratara joined
21:53 butterthebuddha joined
21:54 newhoggy joined
21:54 <phale> what is a good haskell book with exercises ?
21:55 <tommd> I'm trying to remember if the "Craft of functional Programming" has exercises.
21:56 dixie_ joined
21:56 fowlslegs joined
21:56 <phale> imo exercises seem to be better to learn from
21:56 <phale> im reading LYAH though, just wondering if there were any with exrcises
21:57 <tommd> Yes, it does.
21:57 <phale> is it a good read ?
21:57 <tommd> I read it back around 2007, but as I recall, yes.
21:57 <Cale> phale: There's http://www.cis.upenn.edu/~cis194/spring13/lectures.html
21:58 <phale> ok ill chek it out tommd, oh sweet Cale i was reading this earlier, looks like i overlooked the homework heh
22:03 abhiroop joined
22:04 splanch joined
22:05 anuxivm joined
22:05 a3Dman joined
22:05 newhoggy joined
22:06 tobiasBora joined
22:06 watabou joined
22:07 JagaJaga joined
22:07 wroathe joined
22:08 <sproingie> EvanR: i found i had to help sdl2-ttf to build, but yeah sdl2 was pleasant
22:09 Kreest__ joined
22:12 gibbers joined
22:12 phale left
22:13 newhoggy joined
22:13 ania123 joined
22:13 <ania123> I am interested whether following is true: If f(a,b) R f(c,d) then a R c and b R d where R is a congurence relation.
22:16 erisco joined
22:16 <erisco> can Mealy machines halt?
22:17 <EvanR> you can designate a particular state as the halt state
22:17 Goplat joined
22:17 <EvanR> with no way out
22:17 lifter joined
22:18 <erisco> a partial transition function?
22:18 ckubrak joined
22:18 splanch_ joined
22:19 <EvanR> all roads lead back here
22:19 <EvanR> you could call it the STUCK state
22:19 <erisco> the translation is Mealy :: a -> (b, Mealy a b) but I am thinking Machine :: a -> Maybe (b, Mealy a b)
22:19 <EvanR> youd have no idea what its final state was
22:20 <EvanR> if you want to detect if it is in the stuck state, you can provide a Mealy a b -> Bool
22:21 <EvanR> im using something like this right now with my HTTP server in C
22:21 bobakk3r joined
22:21 <EvanR> theres a stuck state which is after it finishes outputting the response
22:21 <erisco> I was thinking Machine :: a -> Maybe (a, Machine a)
22:21 hackebeilchen1 joined
22:22 <erisco> think this is more like a Moore machine, or something
22:22 <EvanR> since you get outputs upon transitions, you just made it impossible to output something right before halting
22:22 bjz joined
22:22 <EvanR> and you made the final state undefined
22:23 <erisco> maybe it doesn't make sense in context of "machines", alright
22:23 <EvanR> mealy and moore are almos the same thing, just one gets input
22:23 newhoggy joined
22:24 ixxie joined
22:24 gibbers_ joined
22:25 <erisco> yes, I am just thinking of something which goes through states
22:25 <erisco> but my context isn't machines... I thought it looked similar though
22:25 blym_ joined
22:25 <EvanR> if you were to build a state machine out of metal, then it can always accept another input or time step. it doesnt go poof when you would halt
22:26 <EvanR> but you definitely use certain states for getting stuck or going permanently to sleep
22:26 <EvanR> when the machine becomes unreponsible
22:26 a3Dman joined
22:26 <EvanR> unresponsive
22:27 Gredu joined
22:27 peterbec` joined
22:28 <EvanR> to stop it from bricking completely, youd put a reset path out of the stuck state
22:28 <EvanR> which requires mealy
22:29 <perebor> I'm getting this problem with hmatrix: https://stackoverflow.com/questions/35335947/duplicate-library-linking-with-stack-and-nix has anyone encountered it?
22:30 butterthebuddha joined
22:31 JagaJaga joined
22:31 hiratara joined
22:32 vtomole joined
22:33 DillyD joined
22:33 <DillyD> Hey
22:34 newhoggy joined
22:37 kylepotts joined
22:38 blym_ joined
22:39 tobiasBora joined
22:40 a3Dman joined
22:40 fXl joined
22:41 roconnor joined
22:41 peterbecich joined
22:41 <erisco> forall a. f (Maybe a) -> Maybe (f a) impredicative types nooo
22:42 splanch_ joined
22:44 peterbecich joined
22:44 abhiroop joined
22:45 newhoggy joined
22:49 blym_ joined
22:50 ubsan_ joined
22:51 <Cale> erisco: I don't know what we're talking about, but that doesn't look like an impredicative type to me
22:52 <erisco> I cut it out of a larger type
22:52 <erisco> I am going to instead cobble it together with Traversable... not exactly what I wanted (only one instance) but w/e
22:52 carlosda1 joined
22:53 typedrat joined
22:54 steshaw_ joined
22:54 newhoggy joined
22:55 <typedrat> Does anyone know how to do a partial match based on timestamps in Opaleye? Is it possible? That is, to say "filter to things where the PGTimestamp has this day component"?
23:00 blym_ joined
23:00 <typedrat> never mind lol, just a mental mismatch from being used to types making sense
23:01 <Cale> lol
23:04 Renard_Chase joined
23:04 theDon_ joined
23:06 justin3 joined
23:07 <Renard_Chase> So, I have a list of tens of thousands of boolean, how would I go about checking if "false" appears a certain number of times in a row in that list?
23:07 freusque joined
23:07 Beelsebob joined
23:07 newhoggy joined
23:09 <EvanR> well to get the thing-to-test in the proper shape you can do this
23:09 <EvanR> map (take 3) (tails [1,2,3,4,5,6,7,8,9])
23:09 <EvanR> > map (take 3) (tails [1,2,3,4,5,6,7,8,9])
23:09 <lambdabot> [[1,2,3],[2,3,4],[3,4,5],[4,5,6],[5,6,7],[6,7,8],[7,8,9],[8,9],[9],[]]
23:09 gienah joined
23:10 <Cale> I would say start with group
23:11 <EvanR> group [0,0,1,0,1,0,0,0,1,1,1,1,0,1,1]
23:11 <EvanR> > group [0,0,1,0,1,0,0,0,1,1,1,1,0,1,1]
23:11 <lambdabot> [[0,0],[1],[0],[1],[0,0,0],[1,1,1,1],[0],[1,1]]
23:11 <Renard_Chase> Oh, then I can use map length
23:12 <Cale> or map (drop n)
23:12 <muesli4> Renard_Chase: How is that list produced? Why not pattern match on: drop (n - 1) . filter not
23:12 <Cale> and check if the result is null or not
23:12 <Cale> yeah
23:12 <Cale> other way around
23:12 <Renard_Chase> drop n-1?
23:12 <EvanR> > find (\xs -> head xs == 0 && length xs == 3)
23:12 <lambdabot> <[[Integer]] -> Maybe [Integer]>
23:12 <Cale> oh, filter not, yeah
23:12 <EvanR> > find (\xs -> head xs == 0 && length xs == 3) (group [0,0,1,0,1,0,0,0,1,1,1,1,0,1,1])
23:12 <lambdabot> Just [0,0,0]
23:12 <muesli4> Renard_Chase: If it appears n times then it is a cons, otherwise it is a nil
23:12 <Cale> well, right idea, but that won't typecheck :)
23:13 <Cale> > filter (not . head) . group $ [True, False, False, True, False, False, False, True]
23:13 <lambdabot> [[False,False],[False,False,False]]
23:13 <Cale> > map (drop 2) . filter (not . head) . group $ [True, False, False, True, False, False, False, True]
23:13 <lambdabot> [[],[False]]
23:13 <Cale> > any (not . null) . map (drop 2) . filter (not . head) . group $ [True, False, False, True, False, False, False, True]
23:13 <lambdabot> True
23:14 peterbec` joined
23:14 taktoa joined
23:15 newhoggy joined
23:16 bhiliyam joined
23:16 <Renard_Chase> Thanks
23:18 <Renard_Chase> I still find Haskell hard, especially with lists since my first instinct is to try and write a foreach loop
23:18 <EvanR> loops and mutable accumulating data structures?
23:18 <Renard_Chase> Yah
23:19 frankc joined
23:19 cemd_ joined
23:19 <EvanR> an issue i have is the sneaking suspicion that if i could figure out how to write a complicated algorithm that way, it will be super fast. and if not, it will be super slow
23:20 <muesli4> Renard_Chase: Most of those "loop" situations can be solved with higher order functions. And in every other case you can just simulate a loop by recursion.
23:20 <EvanR> if you dont learn to think that way in the first place, you might be better off!
23:20 <frankc> I've now come to understand and love the currying of functions. I have a question regarding the compiler and run time treatment: If I've defined a function taking 4 arguments and call it with 3 of the four, is the implementation a sort of 'fold' or 'reduce' based on the passed arguments?
23:21 splanch joined
23:21 <muesli4> Renard_Chase: https://www.codewars.com is really nice to learn Haskell. In particular because you can view solutions of other users after you solved a task.
23:22 <Renard_Chase> muesli4: I know, it's just that when I try to say, use foldr, it feels like I'm trying to write it like a foreach function rather than taking what should be the "correct" solution, if that makes sense
23:22 <Renard_Chase> (Err, that was in response to your other statement)
23:23 <Renard_Chase> codewars seems useful
23:24 <EvanR> if you treat the accumulating parameter as the accumulating data structure, youre doing it right
23:24 grayjoc joined
23:24 <EvanR> on the other hand, you might be using the wrong fold
23:25 <Renard_Chase> EvanR: When my accumulator is in the form (Bool,Int,[(Bool,Int)]) I'm probably taking the wrong approach
23:25 newhoggy joined
23:25 <EvanR> hmm yeah
23:26 <EvanR> you might want to break up the problem into smaller bits
23:26 ckubrak joined
23:26 <EvanR> instead of trying to do all the work inside the fold
23:26 <Renard_Chase> Well the group function was basically the piece I was missing
23:26 <EvanR> yeah
23:27 grayjoc joined
23:27 <EvanR> functional algorithms ftw
23:27 <Renard_Chase> Indeed
23:28 <Renard_Chase> What I did learn of Haskell basically made me hate any language that doesn't support higher order functions
23:28 <EvanR> many that do still dont do it in a way that is conducive
23:28 <EvanR> one of the missing ingredients in laziness
23:28 <EvanR> er, is laziness
23:29 <frankc> if I create: multFour :: (Num a) => a -> a -> a -> a ->
23:29 <frankc> multFour w x y z = w * x * y * z
23:29 soLucien joined
23:30 <Renard_Chase> Laziness is nice, but I don't think I've ever longed for it when using, say, Java
23:30 <EvanR> java clouds the mind
23:30 <EvanR> lots of distractions
23:30 <Renard_Chase> Where as the lack of being able to pass functions around (without using convoluted methods) made me want to bash my head into my desk
23:30 <frankc> let multThreeOfFour = multFour 1 2 3
23:31 <monochrom> You have Iterator which is equivalent to lazy list.
23:31 <EvanR> iterators in lua did not inspire me
23:31 fizbin joined
23:31 <frankc> does it use 'fold' (for example) to iterate through calling multFour for each argument
23:31 <EvanR> the main thing, not being able to just combine them
23:31 <monochrom> You also have for-loops which relieves some nostagia for lazy list.
23:32 <Renard_Chase> For Lua I did write a function that lets me Curry other functions
23:32 kylepotts joined
23:32 newhoggy joined
23:33 <EvanR> so many loops
23:33 <frankc> or is there some internal 'trampoline' or iterate implementation?
23:34 <EvanR> multiFour x y z has type Num a => a -> a, its a function with some context
23:34 <EvanR> namely the x y and z
23:34 <EvanR> its not really folding or iterating
23:34 blender1 joined
23:34 nut joined
23:35 <tsani> frankc: it's more complicated than that. The GHC paper from way back describes the implementation of function application as using a technique called push-enter. You can check out the paper if you want the nitty gritty.
23:35 <tsani> frankc: How to Make a Fast Curry
23:35 <monochrom> frankc: I don't entirely understand the question. But multThreeOfFour is merely \z -> multFour 1 2 3. This form is preserved down to pretty low levels when compiled.
23:35 <EvanR> nothing is computed until you have all the arguments, at least
23:36 <EvanR> (and even then you dont necessarily compute it, becaue laziness)
23:36 <monochrom> Err, \z -> multFour 1 2 3 z
23:36 ublubu joined
23:36 <frankc> I've seen the "How to Make a Fast.." and will dig deeper into it. I'm curious if the compiler emits "optimized" resolution when calling with more than 1 argument or the full signature
23:37 <EvanR> thats the simple case, having all the arguments up front
23:37 bobakk3r joined
23:37 <frankc> I understand that providing the final argument (to the final 'returned' function) will compute it
23:38 <EvanR> well, if necessary
23:38 bubinomab joined
23:38 <frankc> right
23:38 <frankc> I grok laziness as well
23:38 <EvanR> > fst ((), 1 * 2 * undefined * 4)
23:38 <lambdabot> ()
23:41 <frankc> to illustrate to a 'clojure' friend I did the nested returns and used reduce with the function as the accumulator and the argument list as the collection and when asked how Haskell implemented I drew a blank. Good thing it is a rainy night, I can read that paper!
23:41 fowlslegs joined
23:41 MP2E joined
23:42 <EvanR> now your question makes more sense
23:42 <frankc> sorry I wasn't being clearer
23:42 <EvanR> > foldl' (+) 0 [1,2,3,4,5]
23:42 <monochrom> What you'll really miss when you have for-loops but not lazy lists is when you want several levels of nested for-loops, but the number of levels is variable.
23:42 <lambdabot> 15
23:42 <frankc> yes
23:42 <sproingie> haskell sends it to Oleg who computes it in his head :)
23:42 <monochrom> In Haskell it is simply:
23:42 <monochrom> @src sequence
23:42 <lambdabot> sequence [] = return []
23:42 <lambdabot> sequence (x:xs) = do v <- x; vs <- sequence xs; return (v:vs)
23:42 <lambdabot> --OR
23:42 <lambdabot> sequence xs = foldr (liftM2 (:)) (return []) xs
23:43 roconnor joined
23:43 newhoggy joined
23:44 <monochrom> Before you learned about Haskell's "sequence" function, you had had no idea how to do this in Java sanely. (You might be able to think up a not-so-sane solution.)
23:44 <frankc> EvanR: am I to infer that foldl' is what the compiler emits?
23:44 <EvanR> that is regular code
23:45 <EvanR> i assumed something like that is what you showed the clojure dude
23:45 <frankc> ahhh, yes...
23:45 <sproingie> @src foldl'
23:45 <lambdabot> foldl' f a [] = a
23:45 <lambdabot> foldl' f a (x:xs) = let a' = f a x in a' `seq` foldl' f a' xs
23:45 <EvanR> > foldl' (+) 0 [1..100000]
23:45 <lambdabot> 5000050000
23:46 <sproingie> seq is where things start getting magic
23:46 <EvanR> things start getting operationally semantic
23:46 <frankc> (reduce multFour 0 [1 2 3]) ; which returns the final function (partial application)
23:47 <EvanR> ah well that wont type check in haskell. it only works thats to clojure being loose with the dynamic types
23:47 codesoup joined
23:47 <frankc> true
23:47 <EvanR> thanks to
23:47 <EvanR> btw multFour has a sane thing in haskell
23:47 <EvanR> > product [1,2,3,4]
23:47 <lambdabot> 24
23:47 <EvanR> now you can multFour Five and however many
23:48 <monochrom> multFour is a fine-tuned example that is susceptible to reduce. In reality you are more likely to encounter \x y z t -> (x + y*z)^(sin t)
23:48 <frankc> but I was trying to illustrate currying and what the compiler may emit when seeing that there is a partial application
23:48 <EvanR> ehhu...
23:49 <EvanR> well you need a better example, and bringin in Num instances of functions is likely to confuse everybody
23:49 <frankc> that paper may do me good to read first
23:49 moth joined
23:50 <frankc> after 4 weeks of Haskell learning I can't believe I've wasted 10 years looking at everything else :)
23:51 <monochrom> Numbers and strings are the top two things people think of when they think of data and types.
23:51 <frankc> thanks for the help EvanR
23:51 <EvanR> comparisons of haskell and clojure are interesting, its a good puzzle trying to figure out where the two worlds were coming from and where they meet and differ
23:51 lambda-11235 joined
23:51 <monochrom> Booleans is the second to last and functions is the last.
23:52 newhoggy joined
23:52 <frankc> Yes, when it comes to currying functions, in clojure, it is a do-it-yourself proposition
23:53 <frankc> and I can see why
23:53 <frankc> with the variadic signatures
23:53 <monochrom> @quote monochrom download
23:53 <lambdabot> monochrom says: I was trying to design a sensible language... then I downloaded ghc.
23:53 carlosda1 joined
23:54 <frankc> are variable arity as well
23:54 <EvanR> and variable meanings of the word "arity"
23:54 <frankc> yes
23:54 <frankc> I have a mathematician friend who labelled it "insanity"
23:55 <frankc> and he pointed me to Haskell
23:55 <monochrom> Ah yes, OCaml also wants you to write "\z -> f x y z" when f supports "optional parameters" because otherwise great ambiguity.
23:55 <monochrom> I wouldn't call it insanity but it's certainly a disappointment.
23:56 systemfault joined
23:56 orphean joined
23:56 infinity0_ joined
23:56 <frankc> I did see some examples at attempting the var-arity. in Haskell... polyvariadic ?
23:56 infinity0_ joined
23:56 <EvanR> every function takes exactly one argument
23:56 <c_wraith> yeah, "polyvariadic" is the term.
23:56 <monochrom> Yes, Text.Printf does this. Suffers the exact same problem.
23:56 nakal_ joined
23:56 <frankc> I am too green to wrap my head around that yet
23:57 systemfault joined
23:57 <monochrom> (\x -> printf "%d %d" 5 x) is alright, (printf "%d %d" 5) is not.
23:57 <EvanR> thats why you want to internalize every function takes exactly one argument ;)
23:57 <c_wraith> I've got almost a decade in Haskell, and I've determined that I'd rather not understand how printf works. If I knew, I'd be tempted to use it. :)
23:58 markus1189 joined
23:58 <c_wraith> I'll wait for dependent haskell to introduce type-safe printf instead
23:58 markus1199 joined
23:58 splanch joined
23:58 <monochrom> Cale has a category-theoretic printf that doesn't use tricks. You may like it.
23:58 <frankc> I'll make note of that, my next deep dive would be Monads
23:59 <monochrom> But Text.Printf today has one more generalization so it's harder to see its core idea. Look for an old version, it's simpler and it's plain as day.
23:59 <frankc> will do