<     May 2017     >
Su Mo Tu We Th Fr Sa  
    1  2  3  4  5  6  
 7  8  9 10 11 12 13  
14 15 16 17 18 19 20  
21 22 23 24 25 26 27  
28 29 30 31
00:00 dejanr_ joined
00:00 Koterpillar joined
00:01 infinity0 joined
00:01 xcmw joined
00:02 balor joined
00:03 joelburget joined
00:03 infinity0 joined
00:05 ploop joined
00:05 Dance_ joined
00:06 infinity0 joined
00:07 extra- joined
00:07 cpup joined
00:09 infinity0 joined
00:11 Dance_ joined
00:12 soniku joined
00:12 lambda-11235 joined
00:12 infinity0 joined
00:12 balor joined
00:13 jleon joined
00:15 northfurr joined
00:17 joelburget joined
00:17 aarvar joined
00:18 JeanCarloMachado joined
00:23 northfurr joined
00:28 balor joined
00:28 YongJoon joined
00:29 Tharbakim joined
00:29 Tharbakim joined
00:29 geekounet joined
00:30 Welkin joined
00:33 andyhuzhill joined
00:35 systadmin joined
00:36 aarvar joined
00:37 ridho joined
00:38 northfurr joined
00:42 arquebus joined
00:44 joelburget joined
00:44 ludat joined
00:44 cschneid_ joined
00:45 cschnei__ joined
00:47 ziyourenxiang joined
00:48 c4r50nz joined
00:48 justin2 joined
00:51 matthewbauer joined
00:54 noxd joined
00:57 cschneid_ joined
00:58 joelburget joined
00:58 lpaste joined
00:58 dmiles joined
00:59 <Myrl-saki> Is it guaranteed that `m >>= const (pure x)` --> `pure (const x) <*> m` --> `pure x <* m` --> `x <$ m`?
01:00 <Myrl-saki> :t (<*)
01:00 <lambdabot> Applicative f => f a -> f b -> f a
01:01 na_th_an joined
01:01 <lyxia> yes
01:02 JeanCarloMachado joined
01:02 tzh joined
01:02 ploop joined
01:04 flatmap13 joined
01:04 lambdamu_ joined
01:04 Koterpillar joined
01:05 <lyxia> pure (const x) <*> m = pure (const x) >>= \f -> m >>= \a -> pure (f a) = m >>= \a -> pure (const x a) = m >>= \_ -> pure x = m >>= const (pure x)
01:06 joelburget joined
01:07 cereal_killer_ joined
01:08 jleon joined
01:11 nighty-- joined
01:11 joelburget_ joined
01:11 <erisco> in school using equational reasoning was grating
01:12 <erisco> now it is a fun pass-time... what happened
01:12 systadmin joined
01:13 sigmundv joined
01:13 extra- joined
01:14 <Myrl-saki> erisco: lol
01:14 Welkin joined
01:15 <dmwit> Gurkenglas: It was a mistake. I should have written a pattern that forced `x`, but didn't because I wasn't thinking carefully.
01:15 <Myrl-saki> lyxia: Thanks. c:
01:15 alx741 joined
01:15 Supersonic112_ joined
01:15 hkailahi joined
01:16 Dance_ joined
01:16 gugah joined
01:17 rblaze1 joined
01:17 revprez_atlanta joined
01:19 filterfish joined
01:20 <dmwit> :t \x _ -> pure x
01:20 <lambdabot> Applicative f => a -> t -> f a
01:20 <dmwit> :t \x a -> pure (const x a)
01:20 <lambdabot> Applicative f => a -> b -> f a
01:20 <dmwit> ah yes
01:20 crobbins_ joined
01:21 <erisco> how did I not find recursion schemes until now, wow
01:22 takle joined
01:22 mattn joined
01:22 <dmwit> x <$ m ={def} fmap (const x) m ={monad law} m >>= return . const x ={calculation} m >>= const (return x)
01:22 <Welkin> erisco: recustion schemes?
01:22 <Welkin> recursion schemes*
01:23 eyck joined
01:23 <dmwit> ?free const
01:23 <lambdabot> f . const x = const (f x) . g
01:23 <erisco> an excellent explanation of the paper (or some parts of) is right here http://blog.sumtypeofway.com/
01:23 <erisco> perfect for morons like me :P
01:24 <dmwit> Neat, you can even replace {calculation} with {free}. =) (Take g = id.)
01:25 <mnoonan_> So I’m working on this Haskell wrapper of a C++ API, and I want to call a foreign function that expects a uint64_t. On the Haskell side, I have it modeled as “newtype EA = EA CULong” and have provided a Storable instance; all is well. But if I replace “newtype” with “data”, I get “Unacceptable argument type in foreign declaration; ‘EA’ cannot be marshalled in a foreign call.”
01:25 Immune joined
01:25 <mnoonan_> is there some other bit of machinery I need to supply, or what?
01:26 <EvanR> i dont see what the problem is there, but wouldnt you want Word64
01:26 fkurkows1 joined
01:26 <EvanR> oh you replaced newtype with data
01:26 <EvanR> newtypes of marshallable types are marshallable, data is not
01:27 arcsin joined
01:27 Jesin joined
01:28 <dmwit> mnoonan_: Why do you want to replace `newtype` with `data`?
01:28 <mnoonan_> EvanR: hmm, interesting. I don’t suppose there is a typeclass that I can use to specify how to do the marshalling?
01:28 <mnoonan_> dmwit: some of the values are actually error values, so on the Haskell side I’d like to have “data EA = EA CULong | BadEA”
01:29 <EvanR> well that EA certainly wont go to C
01:29 <EvanR> its a sum type with structure
01:29 <mnoonan_> Sure, but the Storable instance tells how to splat it out to bits and read it back
01:29 <mnoonan_> I figured that would be sufficient
01:29 <EvanR> you can write a ffi wrapper which decides what marshallable type to use, accepting such an EA
01:30 <EvanR> but the raw calls have to match up with the C side
01:30 <dmwit> mnoonan_: I wonder whether you might prefer the `newtype` with some pattern synonyms.
01:30 flatmap13 joined
01:30 sellout- joined
01:30 <mnoonan_> dmwit: oh, that might be workable..
01:31 <dmwit> mnoonan_: But yeah, the standard way is to write very thin wrappers on the Haskell side.
01:31 northfurr joined
01:31 cereal_killer_ joined
01:32 JeanCarloMachado joined
01:32 <mnoonan_> dmwit: you just mean manually wrapping the ffi call with code that unpacks the Haskell values to something marshallable?
01:32 <dmwit> yes
01:32 <EvanR> Storable is for writing binary data to a region of memory pointed to be a pointer
01:32 <dmwit> mnoonan_: I think the c2hs/hsc2hs tools may have some machinery for making it a bit less painful. YOu might want to look into them.
01:33 PlasmaStar joined
01:33 <EvanR> not for generating word-sized single values to go through the ffi
01:33 <mnoonan_> ok, I can live with that. All of the FFI calls are done through TH splices in my case, so I can probably just make the TH more clever
01:33 gothos joined
01:33 YongJoon joined
01:33 <mnoonan_> EvanR: I see, that makes sense.
01:34 <dmwit> mnoonan_: To see an example, check out the X11 library, which does this all over the place: import a function via the FFI, then write a wrapper with more idiomatic Haskell types. e.g. https://github.com/xmonad/X11/blob/master/Graphics/X11/Xlib/Atom.hsc#L109
01:35 castlelore joined
01:35 castlelore joined
01:36 <mnoonan_> thanks dmwit, EvanR. I think I see the way forward now.
01:36 ContessaTP joined
01:38 revprez_1tlanta joined
01:39 <erisco> I am reading about free and cofree lasagnas right now
01:40 xcmw joined
01:40 <erisco> functional programming makes people hungry for some reason
01:41 <EvanR> Filename extension for executable files (including the dot if any) (usually "" on POSIX systems and ".exe" on Windows or OS/2).
01:41 jer1 joined
01:41 <EvanR> wait. OS/2 ???
01:41 lpaste joined
01:41 <Myrl-saki> erisco: Cofree Coffee when?
01:41 <* EvanR> writes down to mention OS/2 support whenever listing the short list of platforms haskell runs on
01:42 sproingie joined
01:43 <erisco> it takes a lot of effort to understand most academic papers
01:43 <erisco> they're sometimes written in a made-up language for Pete's sake
01:43 <mnoonan_> Myrl-saki: Do you know the definition of a co-mathematician?
01:44 <Myrl-saki> mnoonan_: Do they eat mathematicians?
01:44 tromp joined
01:44 <erisco> and so it is difficult to rationalise giving effort required to only maybe reap some useful knowledge
01:44 <Myrl-saki> mnoonan_: Because that sounds scary.
01:44 <erisco> countless papers, finite time, and who knows if it is ultimately going to be of interest
01:44 <EvanR> it might take sometime to learn that made up language
01:44 <mnoonan_> Myrl-saki: nah, merely “a machine for turning cotheorems into ffee”
01:44 cereal_killer_ joined
01:44 <Myrl-saki> mnoonan_: lmao
01:45 <Myrl-saki> mnoonan_: I'm glad I understand that now. :D
01:45 <erisco> which sucks because there are is probably knowledge vitally important to what you're trying to do and it is lost
01:45 <EvanR> now imagine all the vitally import knowledge that was never even published
01:45 <Myrl-saki> Talking about this stuff, what's the significance of contravariant/covariant argument positions in Haskell again?
01:46 <EvanR> and the contrast ratio between that and what you cant understand in a paper written in english in front of you
01:46 brynedwards joined
01:46 castlelore joined
01:46 castlelore joined
01:46 mkoenig joined
01:46 <erisco> "written in English" is a stretch
01:47 <Myrl-saki> erisco: Written in pseudo-English.
01:48 <EvanR> and the universe of other papers written in french or german
01:49 ernestob joined
01:50 <Myrl-saki> erisco: "The reason for the name will be explained later," *explains* *gets more confused*
01:51 <erisco> I am just concerned of the tall order to breach these subjects when their benefit to your work is unclear and may be nonexistent
01:52 <glguy> Myrl-saki: what're you reading?
01:52 <Myrl-saki> glguy: Not me. :P
01:52 joelburget joined
01:52 <Myrl-saki> glguy: I actually haven't read a "the reason for the name will be explained later" tbh.
01:52 extra- joined
01:52 pwnz0r joined
01:52 <erisco> if you're doing it because it sounds interesting that is one thing, but when you're actively looking for solutions it is frankly ridiculous to study for a month or many unless you're dead certain the answer you are looking for is contained within
01:55 justin2 joined
01:55 mizu_no_oto joined
01:57 <erisco> the people simplifying and decoding academic papers are providing a vital service
01:58 xcmw joined
01:58 <erisco> both formats are needed, really, and one person cannot do it all
01:58 <erisco> people who are specialised enough to understand the academic source and then apply it to an area, like Haskell, which we can readily understand
01:58 <erisco> that is invaluable
01:59 jer1 joined
01:59 <mniip> from my experience
01:59 <mniip> you don't need to know all to understand academic papers
02:00 <mniip> there is an entry bar, but it's not as high as you might think
02:00 hucksy joined
02:02 jleon joined
02:02 hvr joined
02:02 hvr joined
02:04 stldd joined
02:04 takle joined
02:04 gothos joined
02:06 chrzyki joined
02:06 <Welkin> academic papers do not need to be indecipherable
02:06 <Welkin> simon peyton jones writes the easiest to understand papers I have seen
02:06 <Welkin> anyone with little to no knowledge of haskell or category theory could easily understand them
02:07 Shock_ joined
02:07 <Welkin> the problem is academia
02:07 <Welkin> I have friends who have had papers rejected from conferences because "they don't use enough math" or "it's too practical, not enough theory"
02:08 <glguy> Or just different conferences are looking for different things
02:08 JeanCarloMachado joined
02:09 plutoniix joined
02:10 jzeus joined
02:11 balor joined
02:13 codesoup joined
02:14 luckymerlin joined
02:15 uglyfigurine joined
02:15 takle joined
02:19 joelburget joined
02:20 uglyfigu_ joined
02:20 systadmin joined
02:22 balor joined
02:23 aarvar joined
02:24 pera joined
02:25 takle joined
02:32 joelburget joined
02:33 exferenceBot joined
02:34 <monochrom> With academic papers sometimes you have to learn what to skip.
02:36 <mniip> definitely
02:36 <monochrom> In grad school one of the first things they train new grad students is how to speed-read a paper. To decide whether to read in depth.
02:36 JeanCarloMachado joined
02:37 hexagoxel joined
02:37 <monochrom> It amounts to spending more time on the abstract and the introduction, and only sampling time on the rest.
02:38 <mniip> I usually just seek the answers to my questions
02:38 <mniip> recursively
02:39 uglyfigurine joined
02:39 ericsagnes joined
02:40 foofighterbar joined
02:40 sssilver joined
02:40 rcschm joined
02:41 Koterpillar joined
02:41 <monochrom> As for how to read a paper in depth, it is mostly training you how to write a paper that on the flip side dawns on you how to read one.
02:42 pera joined
02:42 ddere joined
02:43 <mniip> is the converse true
02:44 darjeeling_ joined
02:44 cyborg-one joined
02:44 louispan joined
02:44 <monochrom> I think yes.
02:45 northfurr joined
02:45 takle joined
02:46 chao-tic joined
02:46 macrover joined
02:47 <monochrom> To a large extent this training about papers is implicit by osmosis. But I did attend a class that made it explicit and explained both at the same time. (The class was ultimately about writing, but the teacher told us how readers read in order to justify why we write this way, so there.)
02:48 tromp joined
02:49 <c_wraith> I often skip to conclusions.
02:52 uglyfigurine joined
02:53 Xanather joined
02:54 etehtsea joined
02:54 macrover joined
02:54 Argue joined
02:55 lpaste joined
02:55 kgadek joined
02:55 noexcept joined
02:55 malthe joined
02:56 gregoire joined
02:57 macrover joined
02:57 indi_ joined
02:58 matthewbauer joined
02:59 joelburget joined
03:00 <MarcelineVQ> I'm not sure how relevant this comment is to points made earlier but I've noticed, in the particular papers I've been reading, that compared to haskell papers people repeat themselves a lot.
03:02 Trioxin joined
03:02 Trioxin left
03:02 SoupEvil joined
03:03 JeanCarloMachado joined
03:03 ChaiTRex joined
03:03 gregoire joined
03:04 zipper joined
03:04 luckymerlin joined
03:07 extra- joined
03:08 takle joined
03:11 ehsanullahjan joined
03:11 nighty-- joined
03:11 govg joined
03:12 WhiskyRyan joined
03:13 joelburget joined
03:14 xcmw joined
03:16 chrzyki joined
03:16 mjora7 joined
03:17 JeanCarloMachado joined
03:18 ^bschafer1 joined
03:18 joelburget joined
03:19 dooml0rd joined
03:20 raynold joined
03:22 Stuart joined
03:24 balor joined
03:26 JeanCarloMachado joined
03:27 joelburget joined
03:28 <ab9rf> yeah, there's a talent to usefully structuring a paper
03:28 <ab9rf> it's actually a lot like hw you write a business memo
03:29 <ab9rf> my training is in legal writing, but the same strategies apply there too
03:30 vlatkoB joined
03:33 robertkennedy joined
03:36 pwnz0r joined
03:36 jmcarthur joined
03:37 flatmap13 joined
03:37 takle joined
03:37 oaao joined
03:38 insitu joined
03:38 dual joined
03:39 fosterite joined
03:39 fosterite joined
03:40 northfurr joined
03:41 joelburget joined
03:41 markasoftware joined
03:42 JeanCarloMachado joined
03:42 louispan joined
03:44 robkennedy joined
03:45 sproingie joined
03:45 sproingie joined
03:45 kody joined
03:46 balor joined
03:48 Jesin joined
03:49 spoonm joined
03:50 geekosaur joined
03:54 balor joined
03:55 matthewbauer joined
03:55 juhp__ joined
03:56 reventlov_ joined
03:56 felixsch__ joined
03:56 Koterpillar joined
03:58 takle joined
03:58 dual joined
03:59 kreshnik joined
04:00 luckymer` joined
04:01 JeanCarloMachado joined
04:07 JeanCarloMachado joined
04:07 dan_f joined
04:08 louispan joined
04:11 wei2912 joined
04:11 tromp joined
04:12 Guest66855 joined
04:12 eklavya joined
04:14 shangxiao joined
04:15 infinity0 joined
04:15 pavonia joined
04:15 Costar joined
04:18 govg joined
04:20 mooseKnuck joined
04:20 JeanCarloMachado joined
04:21 afarmer joined
04:22 takle joined
04:23 Welkin joined
04:23 gentoo_ joined
04:25 mjora7 joined
04:27 thunderrd joined
04:28 fosterite joined
04:29 fosterite joined
04:29 takle joined
04:30 robotroll joined
04:33 LordBrain joined
04:33 filterfish joined
04:38 hybrid joined
04:39 Koterpillar joined
04:41 kadoban joined
04:43 featherlessbiped joined
04:43 ironhide00_ joined
04:44 JeanCarloMachado joined
04:44 path[l] joined
04:45 jleon joined
04:45 takle joined
04:50 mjora7 joined
04:51 JeanCarloMachado joined
04:55 <ReinH> The best thing to do with a paper is to read the abstract and the conclusion, then decide if you want to read the rest
04:55 dual joined
04:55 <ReinH> if you don't, you'll at least have indexed it in your brain in case it becomes useful later
04:55 <thang1> That's my method for sure
04:59 treaki joined
05:00 rcschm joined
05:01 revprez_atlanta joined
05:01 JeanCarloMachado joined
05:02 takle joined
05:02 joelburget joined
05:02 chocopuff joined
05:02 danvet joined
05:03 Mutter joined
05:06 armyriad joined
05:07 balor joined
05:13 takle joined
05:14 vektorweg1 joined
05:14 JeanCarloMachado joined
05:16 mmachenry1 joined
05:18 dec0n joined
05:19 systadmin joined
05:20 dual joined
05:23 mohsen_1 joined
05:24 filterfish joined
05:26 JeanCarloMachado joined
05:27 soLucien joined
05:28 macrover joined
05:31 <qmm> x = IO [Foobar] -- and i want to count the number of items in the list
05:31 <qmm> maybe i need to use liftIO
05:31 <qmm> fmap works
05:32 <pacak> qmm: length <$> x
05:33 <pacak> That'll give IO Int
05:33 osa1 joined
05:33 osa1 joined
05:34 Kuros` joined
05:34 extra- joined
05:36 pwnz0r joined
05:37 jbgi joined
05:38 JeanCarloMachado joined
05:39 takle joined
05:39 filterfish joined
05:39 mbuf joined
05:40 systadmin joined
05:43 mjora7 joined
05:44 filterfish joined
05:45 ThomasLocke joined
05:45 ThomasLocke joined
05:46 cranej joined
05:46 rkazak joined
05:46 ali_bush joined
05:46 ali_bush joined
05:46 takle joined
05:47 cur8or joined
05:48 darjeeling_ joined
05:48 caumeslasal joined
05:52 razi1 joined
05:52 geekosaur joined
05:52 montag451___ joined
05:54 jhrcek joined
05:59 cschneid_ joined
06:00 ogrady joined
06:00 balor joined
06:01 hurkan joined
06:02 eatman joined
06:03 dec0n joined
06:03 JeanCarloMachado joined
06:06 MP2E joined
06:07 zeroed joined
06:07 takle joined
06:08 aloiscochard joined
06:08 path[l] joined
06:09 JeanCarloMachado joined
06:09 quchen joined
06:11 Maxdamantus joined
06:12 tromp joined
06:12 insitu joined
06:15 <Lokathor> imagine I'm going to be writing several operations that result in IO (Either String a)
06:15 govg joined
06:15 <Lokathor> what's the easiest way to link them along so that the first failed one cancels the rest? There seemms to be a few transformer options
06:15 Mortomes|Work joined
06:16 <quchen> ExceptT.
06:17 <quchen> Most importantly, not ErrorT.
06:17 <opqdonut> @unmtl ErrorT String IO a
06:17 <lambdabot> IO (Either String a)
06:17 <opqdonut> @unmtl ExceptT String IO a
06:17 <lambdabot> ExceptT String IO a
06:17 <opqdonut> well it desugars to the same
06:18 <quchen> Yes, but ErrorT has silly instances.
06:18 <opqdonut> yeah
06:18 xall_ joined
06:19 <quchen> ?unmtl EitherT String IO a
06:19 <lambdabot> EitherT String IO a
06:19 <pikajude> well depends on your personal instance silliness preference
06:20 <quchen> Just like hammering nails into the wall with your fist depends on your personal pain preference.
06:20 <pikajude> might be a soft wall
06:20 <quchen> Might not be.
06:21 <Lokathor> ExceptT
06:21 <Lokathor> okay
06:21 <quchen> Anyway, to give a motivational example why not all errors should be stringly, imagine having 125 discrete error states (like Unix exit codes). Your error type is simply an Int.
06:22 <quchen> What should »String -> Int« be to write an instance for the Error class?
06:22 <quchen> :t strMsg
06:22 <lambdabot> error: Variable not in scope: strMsg
06:22 <Lokathor> so I can write each sub-action as its own IO (Either String a) and then chain them just once at the end with a function that runs them as an ExceptT ?
06:22 <quchen> Not even in scope, excellent :-)
06:22 jgertm joined
06:22 <quchen> Lokathor: Exactly.
06:23 <Lokathor> quchen, in my case the errors are all Strings because they're all coming in via FFI, "getGLError" and those sorts of calls
06:23 splanch joined
06:23 <quchen> runExceptT (ExceptT (foo :: IO (Either String a) >>= doStuff >>= moreStuff)
06:23 joelburget joined
06:23 <quchen> runExceptT (ExceptT (foo :: IO (Either String a)) >>= doStuff >>= moreStuff)
06:23 <quchen> Woops.
06:23 mulk__ joined
06:24 <Lokathor> runExceptT $ ExceptT $ do \n a <- foo \n etc
06:24 <Lokathor> :3
06:24 <quchen> That’s what the parenthesis is for ;-)
06:25 qwertyzxcvbn joined
06:25 <quchen> ExceptT wraps an IO (Either a b). The result chains nicely and short-circuits.
06:25 <quchen> runExceptT gets you the result.
06:25 <Lokathor> neato
06:25 <Lokathor> I want to compile one shader, then compile another, and then link them all up into a program
06:25 <Lokathor> each stage of which might fail, so this seems like a good fit
06:26 <Lokathor> hide away all those nasty malloc calls and stuff too
06:26 ixxie joined
06:26 Dance_ joined
06:28 <quchen> Lokathor: Does one shader need the result of the other?
06:28 <quchen> Asked differently, could you compile them in parallel?
06:28 joelburget joined
06:28 <quchen> If so, there is something better you can do: run all of them, and collect the errors of all failing ones.
06:28 <Lokathor> the "link them into a program" depends on both having been compiled correctly. I would be very dubious about making two FFI calls to a giant FFI state machine in parallel
06:29 <quchen> The problem with ExceptT (and all Either monads, really) is that the first error cancels the entire rest
06:29 <quchen> But sometimes you’d like to run all actions and return all the errors instead of just the first one
06:29 <Lokathor> I'm not an expert, but I think exactly one thread is allowed to touch OpenGL things at once, or bad stuff happens.
06:29 Swizec joined
06:30 <quchen> Hm, I didn’t phrase that well.
06:30 <quchen> Disregard OpenGL shenanigans.
06:30 <Lokathor> well of course you can run them all async if you want them to all attempt in any order :P
06:30 <quchen> Anyway, there’s the Validation Applicative.
06:30 <quchen> It’s also a wrapper around (Either e a), but it will collect all errors, instead of just returning the first one.
06:31 <quchen> Like GHC does: it gives you lots of type errors, not just one. Because fixing them one at a time is annoying.
06:31 <Lokathor> but quchen, i think you've got a solution in search of a problem right now :3
06:31 <Lokathor> I precisely want the "stop at the first error" version of things
06:31 xtreak joined
06:31 <quchen> »No« then.
06:32 <quchen> I have lots of solutions, none of them search a problem, but that doesn’t mean there is no point in suggesting them.
06:32 <Lokathor> if you wanted them all to happen, sounds like a job for parMap or some such
06:33 Dance_ joined
06:33 <quchen> You can’t actually parallelize them because OpenGL, as you mentioned.
06:33 <quchen> But you could still try to create as many errors as possible.
06:33 <quchen> … in case there is an error.
06:34 <quchen> If there is no error, it’s best to create as little errors as possible. :-)
06:34 <Lokathor> in theory, you could compile both shaders async and look for an error with either, and then if that passes link them
06:34 <Lokathor> if opengl was smarter
06:35 <Lokathor> maybe vulkan or whatever can do that, dunno. opengl is the tutorial series i have though, so oh well
06:37 qwertyzxcvbn joined
06:37 joelburget joined
06:38 synProgrammer joined
06:38 connrs joined
06:38 alfredo joined
06:40 Itkovian joined
06:40 WF-BATCH joined
06:40 sword865 joined
06:40 dejanr_ joined
06:40 JeanCarloMachado joined
06:42 Hjulle joined
06:42 <sshine> can anyone recommend a way to express immutable, undirected graphs somewhat efficiently?
06:42 <sshine> I don't have Okasaki's book at hand, and I don't even know if it's in there.
06:43 <opqdonut> I know there's Data.Graph
06:44 <opqdonut> and https://hackage.haskell.org/package/fgl
06:44 <opqdonut> I guess the standard adjacency table and adjacency list approaches apply too
06:45 systadmin joined
06:47 systadmin joined
06:47 <sshine> so the table approach isn't sparse, and lists have linear lookup. I was thinking maybe something with trees?
06:47 <eklavya> is there a lib method to remove text between two markers ?
06:48 systadmin joined
06:48 <opqdonut> sshine: something like IntMap IntSet might work
06:48 coot joined
06:48 <Cale> sshine: Usually something like Map Vertex (Set Vertex) works well
06:48 <Cale> yeah
06:48 cranej joined
06:49 primal joined
06:49 <sshine> and making it undirected you'd just add both directed edges?
06:49 <Cale> yeah
06:49 <opqdonut> yeah
06:49 <sshine> ok, thanks :)
06:49 <opqdonut> if you only need to query edges, you can just use Set (Int,Int) I guess
06:50 castlelore joined
06:51 takle joined
06:51 joelburget joined
06:52 Swizec joined
06:52 <lpaste> Hjulle pasted “Coverage condition fails” at http://lpaste.net/355373
06:53 yoneda joined
06:53 <quchen> eklavya: I don’t think there’s one in Text, but you can easily write one in terms of find or partition.
06:54 <Hjulle> What am I missing? The information should be enough to uniquely determine the parameter t.
06:54 <eklavya> quchen: ok, just wanted to make sure I wan't reinventing the wheel :)
06:54 unK_ joined
06:55 Xanather joined
06:57 ertes-w joined
06:57 <lpaste> Hjulle revised “Coverage condition fails”: “Coverage condition fails” at http://lpaste.net/355373
06:59 primal_ joined
07:00 splanch joined
07:00 JeanCarloMachado joined
07:01 dfeuer joined
07:02 ventonegro joined
07:03 refold joined
07:04 joelburget joined
07:05 <Hjulle> Are type level functions not invertable?
07:06 augur joined
07:06 guiben joined
07:07 <Cale> Hjulle: Not always
07:07 lipkab joined
07:07 <Hjulle> How can I tell the compiler that this one is?
07:08 <Cale> I would just turn on UndecidableInstances here
07:08 jutaro joined
07:08 <Hjulle> Since I'm pattern matching on it in the instance header, it should realise that I'm trying to invert it.
07:08 primal joined
07:09 takle joined
07:10 <Hjulle> Cale: Why is it needed? It doesn't seem undecidable to me?
07:11 JeanCarloMachado joined
07:12 <Cale> Well, let's see
07:12 cur8or joined
07:12 <Cale> Due to the functional dependency, we ought to have that if we know f, f s, a, and b, then we ought to be able to uniquely determine f t
07:13 <Cale> Given f, s, a and b, we would be able to determine t, but actually we don't know s
07:14 <osa1> what's the correct lens expression for this: `x ^? _Constr ^. _1 :: Maybe FirstFieldOfConstr` ?
07:14 vlatkoB_ joined
07:15 <glguy> change ^. to .
07:15 <osa1> glguy: awesome, thanks
07:15 CurryWurst joined
07:16 ilyaigpetrov joined
07:16 JeanCarloMachado joined
07:16 bvad joined
07:17 matthewbauer joined
07:18 fluffystub joined
07:18 <Cale> Hjulle: wait, that's not the error message that I get while compiling this
07:18 <Cale> Hjulle: I just get a complaint about ambiguity
07:18 <Cale> (also KindSignatures wasn't switched on)
07:19 gmcabrita joined
07:19 primal_ joined
07:19 <glguy> Hjulle: undecidable instances ate required to use fun dep deps from your instance's context
07:19 <lpaste> Hjulle revised “Coverage condition fails”: “Coverage condition fails” at http://lpaste.net/355373
07:20 <Hjulle> glguy: Aha, that explains it, thanks.
07:20 <Cale> Right, that's what I get
07:20 <Hjulle> Cale: And that makes even less sense :S
07:20 <Cale> I didn't need UndecidableInstances to get the complaint about it being ambiguous which f is involved.
07:20 <Cale> Hjulle: Write the explicit type that you want deepFmap to have there
07:20 <Cale> What is it?
07:21 dm3 joined
07:21 <Hjulle> (There is only ever one f involved.)
07:21 <Cale> Hjulle: In fact, this is intrinsically ambiguous
07:21 <Cale> class DeepFmap (f :: * -> *) s t a b | f s a b -> t where
07:21 <Cale> deepFmap :: (a -> b) -> s -> t
07:21 <Cale> look at your class declaration
07:21 <glguy> you forgot to use f in your method's type?
07:21 coot joined
07:21 <Cale> f isn't mentioned in the method's type, right
07:22 <Hjulle> Aha, right.
07:22 takuan joined
07:23 mattyw joined
07:23 sproingie joined
07:24 <lpaste> Cale annotated “Coverage condition fails” with “Coverage condition fails (annotation)” at http://lpaste.net/355373#a355376
07:24 <Hjulle> Cale: A concrete example would be: deepFmap :: DeepFmap Maybe (Maybe (Maybe a)) (Maybe (Maybe b)) a b => (a -> b) -> Maybe (Maybe a) -> (Maybe (Maybe b)
07:25 <Cale> ^^ my paste works
07:26 benl23 joined
07:26 indi_ joined
07:26 <Cale> Well, for some definition of "works"
07:26 <Cale> This also still requires overlapping instances
07:26 takle joined
07:26 Argue_ joined
07:26 guillaum2 joined
07:26 dfeuer joined
07:27 <Hjulle> Aha, right, by mentioning f in deepFmap, the typechecker can know more.
07:27 <Cale> oh, maybe not...
07:27 <Hjulle> Cale: But I still don't get why f0 is a ambigous?
07:27 <Cale> You can get away with monomorphic usages
07:28 <Cale> There are two f's which are different and might not match
07:28 <Hjulle> Also I lose the "feature" of deepFmap = id. :P
07:28 Levex joined
07:28 zargoertzel joined
07:28 primal joined
07:28 <Cale> Because each usage of deepFmap with your original definition would introduce a new f which didn't have anything to do with the actual type of the method.
07:28 <Hjulle> Cale: Which are the two different fs?
07:29 <Cale> So there would be no way to confirm that they matched, because they weren't mentioned elsewhere
07:30 soLucien joined
07:30 Aruro joined
07:30 <Cale> When you go and use deepFmap there, it knows that it's got to have type (DeepFmap f0 s0 t0 a0 b0) => (a0 -> b0) -> (s0 -> t0) for some f0, s0, t0, a0, and b0
07:30 <Hjulle> Ah, right. So, if I explicitly mention f in the type signature of the deepFmap that is used in deepFmap = fmap . deepFmap, then it wouldn't be ambigous?
07:30 <Cale> yeah, not immediately anyway
07:30 mounty joined
07:31 marr joined
07:31 <Cale> Well, I mean, if you change the type of deepFmap so that it actually mentions f
07:31 Swizec joined
07:31 <Hjulle> Maybe a phantom argument would solve the problem?
07:31 <Cale> You can't just give a type annotation to that deepFmap in-place which would do any good there.
07:31 <Cale> You could also use a Proxy, sure.
07:32 <Cale> This whole class is a pretty silly idea though -- it's not going to be all that easy to use it.
07:32 freusque joined
07:32 <Cale> deepFmap :: (a -> b) -> Maybe (Maybe a) -> Maybe (Maybe b) -- note that this will still be a type error
07:32 <Hjulle> The Proxy would also help with making the class less unsuable
07:32 <Cale> Even with my version
07:32 thc202 joined
07:33 angelos joined
07:33 <Cale> Because a and b are yet to be determined -- we can't know if they're of the form Maybe s and Maybe t yet
07:33 <Cale> So the instances overlap, and you get an error
07:33 ZuluKing joined
07:33 Swizec joined
07:33 Hunter1_ joined
07:33 splanch joined
07:34 <Cale> deepFmap :: (Int -> Char) -> Maybe (Maybe Int) -> Maybe (Maybe Char) -- this will work fine with my version though
07:34 <ZuluKing> can someone tell me why I keep getting Ilegal Tuple section error for the following:
07:34 Gurkenglas joined
07:34 <Hjulle> Cale: Thanks
07:34 mstruebing joined
07:34 merijn joined
07:34 <ZuluKing> x :: [(String, [String])]
07:35 <ZuluKing> x = [ ("Monday", ["ssfew", "sffwqefwe"])
07:36 <Cale> You're missing a ]
07:36 <Cale> I can't see why you'd get that error though
07:36 <ZuluKing> I just missed it right now
07:36 bollu joined
07:36 <ZuluKing> it's there in the code
07:36 <Cale> A tuple section looks like (foo,) or (,bar)
07:36 <Cale> :t ("hello",)
07:36 <lambdabot> t -> ([Char], t)
07:37 comerijn joined
07:37 <Cale> > map ("hello",) ["there", "world"]
07:37 <ZuluKing> So, is this illegal [(String, [String])] ?
07:37 <lambdabot> [("hello","there"),("hello","world")]
07:37 connrs joined
07:37 <Cale> no, that's fine.
07:37 <ZuluKing> I want a list as the second component of each tuple
07:37 <Cale> sure
07:37 <Cale> That's not a problem
07:38 <Cale> Can you post the exact source on lpaste.net?
07:38 <ZuluKing> sure, one second
07:38 takle joined
07:38 primal_ joined
07:39 <lpaste> ZuluKing pasted “TupleError” at http://lpaste.net/355377
07:39 <lpaste> ZuluKing pasted “TupleError” at http://lpaste.net/355378
07:39 <lpaste> ZuluKing pasted “TupleError” at http://lpaste.net/355379
07:40 <ZuluKing> Cale can you check?
07:40 oish joined
07:41 <Cale> ZuluKing: I put that code in a file and loaded it and it's fine.
07:41 Dance_ joined
07:41 <Cale> ZuluKing: Put the actual code which you are having trouble compiling on lpaste.net
07:42 <ZuluKing> Cale, thanks, I think haskero has some issues then
07:42 user123123123 joined
07:43 <Cale> Oh, try just loading it in ghci
07:44 rockfordal joined
07:44 splanch joined
07:44 <ZuluKing> Cale, works fine, thanks!
07:45 Koterpillar joined
07:45 joelburget joined
07:46 <Hjulle> Cale: It worked with the proxy. :) Thanks.
07:46 <Cale> Hjulle: You're not actually going to use that thing, are you?
07:46 <Hjulle> No, not for real code. Only toy projects. :)
07:47 magneticduck joined
07:47 raichoo joined
07:47 JeanCarloMachado joined
07:48 acidjnk22 joined
07:48 lemonxah joined
07:50 takle joined
07:52 a3Dman joined
07:53 JeanCarloMachado joined
07:54 Zekka joined
07:56 augur joined
07:56 pja joined
07:56 Elhamer joined
07:57 wolfsif joined
08:00 mfukar joined
08:00 ragepanda joined
08:01 <wolfsif> Hi everyone
08:01 <lpaste> Hjulle annotated “Coverage condition fails” with “Coverage condition fails (working version)” at http://lpaste.net/355373#a355380
08:02 uiop joined
08:02 <wolfsif> I'm watching Evan Czaplicki's talk from Strange Loop on different types of FRP, but I'm a little confused by his claim that in arrowized FRP, "signals aren't connected to the world"
08:02 nickolay joined
08:03 <wolfsif> My understanding was that arrowized FRP libraries (ie yampa, netwire) are intended for writing interactive programs -- so they must be connected to the world somehow
08:04 <wolfsif> Can anyone offer some insight?
08:04 ccomb joined
08:04 <ertes-w> i'm positively surprised by the 'jq' program written in C… its interface docs basically say: "mooonad… i'm a mooooonad!"… i would be interested if the author was aware of that
08:04 bollu joined
08:05 <ertes-w> wolfsif: yes, they are connected to the world, but there is a clear separation between the real world and the FRP system
08:05 <comerijn> wolfsif: I'm not familiar with this talk, but I'm assuming he means that you don't *directly* connect to the world, there's usually primitives for converting regular "IO" into signals that FRP system works with
08:05 <ertes-w> wolfsif: not just a semantical separation, but an actual technical separation, because every time frame of the FRP system needs to run as a "transaction"
08:06 <ertes-w> wolfsif: however, it's not strictly true… wires, the successor of netwire, dispenses with this separation, coming much closer to non-A FRP
08:06 cranej joined
08:07 <ertes-w> wolfsif: in wires it is not only allowed but the standard approach to create events *within* the reactive part of the application
08:07 <bollu> is there a way to encode an "imperative-ish" DSL within haskell such that it is fully inspectable? in the sense of, I don't want functions in the DSL, since I can't inspect / pattern match them at compile time
08:07 JeanCarloMachado joined
08:08 <ertes-w> bollu: there are free Applicatives
08:08 <bollu> I want to to create something like compile :: DSL -> <whatever>. The DSL can't have a haskell function if I wish to be able to inspect it
08:08 <bollu> ertes-w: less powerful, I take it?
08:08 <wolfsif> I see, thanks for the responses
08:08 <ertes-w> bollu: but there are still functions… the main difference to free monads is that you can see the full program, but you can't see how it transforms its results
08:09 takle joined
08:09 <ertes-w> bollu: if you really want to see everything, you have to come up with an expression type
08:09 <bollu> ertes-w: could you elaborate on that?
08:09 <bollu> ertes-w: do you mean like, an actual ASTR?
08:09 <bollu> AST*
08:09 <ertes-w> bollu: pure (5 +) <*> pure 5
08:10 <ertes-w> bollu: you can't see the 10, until you actually run it
08:10 <bollu> right
08:10 <ertes-w> yeah, like an AST
08:10 <ertes-w> of course then it gets complicated
08:10 <bollu> hm, unfortunate
08:10 <bollu> yeah
08:11 <ertes-w> bollu: also you have the usual caveat that Applicative is far less expressive than Monad
08:11 <bollu> can TH see things across modules? I think not, yes?
08:12 joelburget joined
08:12 JagaJaga joined
08:13 <primal_> /join ##security
08:13 <primal_> oups sry
08:13 tromp joined
08:13 <wolfsif> ertes-w: so if a clear separation between the world and the FRP system is not strictly true in A FRP, what is the real distinction that defines A FRP?
08:13 balor joined
08:14 fendor joined
08:14 primal joined
08:16 <ertes-w> wolfsif: its awkward interface =)
08:16 <wolfsif> hahah
08:16 <bollu> what's AFRP?
08:16 <wolfsif> arrowized frp
08:16 <bollu> ah
08:16 laz joined
08:17 <ertes-w> wolfsif: it can manage everything as implicit state using an automaton-based approach to state by not allowing first-class events and behaviours
08:17 mjora7 joined
08:18 <ertes-w> it actually manages to make certain things even simpler that way: everything is a behaviour, so you don't even have a Behaviour wrapper type… if you have to time-varying integers x and y, the sum is just x + y, and the result is just Integer
08:18 mrijkeboer joined
08:18 <wolfsif> ertes-w: also, NOT having a clear distinction between the world and the FRP system sounds like giving up on purity. I thought that the whole idea of FRP was to be able to write interactive programs with pure functions -- am I misunderstanding?
08:18 <merijn> Once again, the ridiculous Monoid instance of Map ruins my day :\
08:18 <ertes-w> but not having first-class behaviours and events is a major drawback
08:19 <ertes-w> wolfsif: no, the semantics is still pure… it just allows the system to be more dynamic
08:19 DocWinter joined
08:19 dm3 joined
08:19 <ertes-w> you can create new events whenever you need… imagine a user creates a new window
08:20 jutaro joined
08:20 <bollu> merijn: left absorbing?
08:20 <liste> is there a nice way to clear the screen with vty?
08:20 <merijn> bollu: Left union, rather than "instance Monoid v => Monoid (Map k v)"
08:21 JeanCarloMachado joined
08:21 <merijn> Number of times that Monoid would've simplified my code: 20+
08:21 <merijn> Number of times I've used the actual Monoid of Map: 0
08:22 systadmin joined
08:23 <Cale> merijn: Do you have any opinion as to where we ought to put a newtype of Map that has the correct instance?
08:23 <bollu> merijn: wait what?
08:23 <bollu> merijn: isn't the monoid on map based on the keys?
08:23 tomphp joined
08:23 zero_byte joined
08:23 <Cale> The monoid on Map just picks the value from the left Map on a collision.
08:24 <merijn> Cale: I've proposed adding a newtype to containers, but very little useful response. Mostly people complaining "that such a newtype would be useless without duplicating the entire Map interface"
08:24 sproingie joined
08:24 sproingie joined
08:24 <Cale> You'd usually want the instance Semigroup a => Monoid (Map k a) which uses the Semigroup instance to combine the values at colliding keys.
08:24 <bollu> Cale: yes, I wanted right absorbing based on keys
08:24 <bollu> Cale: ah
08:24 <bollu> Cale: I see what you mean
08:24 twanvl joined
08:24 aarvar joined
08:25 <merijn> Cale: At this point I might simply write my own containers wrapper, put that on hackage and be done with it
08:25 <Cale> merijn: Well, that's what we've done at Obsidian. We have a module Data.AppendMap which has a newtype wrapper and then the entire interface
08:25 <ertes-w> that's how stupid the existing Monoid instance is
08:25 primal_ joined
08:25 <merijn> Cale: I'm leaning towards Monoid rather than Semigroup, since as yet I think there's more instance of Monoid?
08:26 joelburget joined
08:26 <merijn> If semigroup ever becomes a superclass of Monoid that goes away, but until then
08:26 <mrijkeboer> QuickCheck question: How can I combine `ioProperty` with `forAll`? I have a function that throws exceptions on invalid input and would like to make a QuickCheck test to validate that the correct exception is thrown.
08:27 slomo joined
08:27 slomo joined
08:28 <Cale> forAll gen (\v -> ioProperty (something v))
08:28 <merijn> Right now I have a bunch of functions producing "[Foo -> [Bar]]" as output, but I'd like to change that to "[(String, Foo -> [Bar])]" and then after running a buch of those merge based on the String key
08:28 <Cale> or you can do it the other way around
08:28 xtreak joined
08:29 <merijn> So I either group via Map or annoying list work
08:30 <Cale> merijn: Well, we're going to end up open sourcing what we've done one way or another, but we'd like to figure out where the code should go so that people can actually find it and use it.
08:30 <Cale> (but I think Semigroup is required in our case)
08:30 <merijn> Cale: See, that's why I'm sad that hackagebot is gone
08:30 <merijn> I liked discovering neat libraries like this that way
08:31 oisdk joined
08:31 lep-delete joined
08:31 <Hjulle> How do you destruct a DataKinds Nat? If I defined it myself I would just pattern match for S(n) or Z in the type signature, but how do you do it with the builtins?
08:31 <mrijkeboer> Cale: Thanks that worked.
08:31 <Cale> mrijkeboer: Note that Property is an instance of Testable
08:33 CoderPuppy joined
08:33 bkboggy joined
08:33 <mrijkeboer> Cale: I noticed, but didn't put the pieces together...
08:33 <Cale> Hjulle: usually pattern matching with type class instances? Or by defining a type family.
08:34 oisdk joined
08:34 <Hjulle> I mean the built in kind Nat. What do I pattern match for in the instances?
08:36 sfcg joined
08:36 <Cale> Are you talking about the TypeLits one?
08:36 <Hjulle> Yes
08:36 <Cale> I don't think you can pattern match on that
08:36 <Hjulle> aha, ok
08:37 <Cale> There's some built in arithmetic you can do
08:37 shurick joined
08:37 ali_bush joined
08:38 jpll joined
08:39 JeanCarloMachado joined
08:39 joelburget joined
08:39 sproingie joined
08:39 sproingie joined
08:42 takle joined
08:43 ericsagnes joined
08:44 entuland joined
08:45 takle joined
08:45 primal joined
08:48 meandi joined
08:48 Beetny joined
08:48 Levex joined
08:48 takle joined
08:48 ksamak joined
08:51 <Hjulle> "KnownNat (n-1) => do something with (n-1)" seems do do the job
08:52 JeanCarloMachado joined
08:52 mmn80 joined
08:53 joelburget joined
08:55 filterfish joined
08:55 primal_ joined
08:56 sproingie joined
08:56 sproingie joined
08:58 Silox| joined
09:00 <Hjulle> Is there any sugar for Proxy? "Proxy :: Proxy 3" is a very long way to write "3".
09:02 revprez_atlanta joined
09:02 <osa1> you could use TypeApplications if you're designing the API (as opposed to using an existing one that uses Proxy)
09:05 <merijn> Quick question: What happens when I run setNumCapabilities without the threaded runtime? Is it a no-op?
09:05 tv1 joined
09:06 primal joined
09:06 joelburget joined
09:07 oish joined
09:09 Swizec joined
09:09 Swizec joined
09:10 Swizec joined
09:11 Swizec joined
09:12 Swizec joined
09:12 hpc_ joined
09:14 <jle`> Hjulle: Proxy @3
09:14 tv joined
09:14 <Hjulle> aha, nice
09:15 <jle`> Hjulle: that's not sugar for Proxy, btw
09:15 <jle`> it's just type application syntax
09:15 <wolfsif> I'm having trouble picking which FRP library to learn, with the intent of writing interactive sound and graphics applications (ie games, sound synths, etc). Anyone have advice?
09:16 cloudhead joined
09:17 primal_ joined
09:19 Wizek joined
09:20 Wizek__ joined
09:20 Coldblackice joined
09:22 Ring0` joined
09:22 <merijn> wolfsif: ertes-w's wires, maybe? It kinda depends on what kinda latency/jitter you're willing to tolerate, I think
09:25 primal joined
09:25 augur joined
09:26 <wolfsif> thanks, I'm checking out wires
09:26 electrocat joined
09:27 bollu joined
09:29 mjora7 joined
09:32 kuribas joined
09:33 psychicist__ joined
09:33 <kuribas> Everytime a thunk is encountered, it must be checked if it is already evaluated, right?
09:33 <kuribas> Doesn't that give a lot of overhead?
09:34 JeanCarloMachado joined
09:35 joelburget joined
09:35 bollu joined
09:35 <bollu> kuribas: no, a thunk evaluation is just a function pointer call
09:35 balor joined
09:35 <merijn> kuribas: Why does it have to be checked?
09:36 <bollu> kuribas: it gets rewritten with the computed value upon execution
09:36 <kuribas> bollu: oh, right
09:36 <bollu> kuribas: at least, that's what the STG paper says. Not a GHC dev so this may not be the truth
09:36 <kuribas> merijn: so it doesn't get evaluated twice?
09:37 <merijn> kuribas: That assumes the representation of the thunk and it's result are not uniform :)
09:37 jer1 joined
09:38 govg joined
09:39 <bollu> kuribas: no, a think has a field that tells whether it is updatable or not. If it is marked as updatable, then the thunk is overwritten with the updated value (again, in theory)
09:39 <bollu> thunk*
09:39 <merijn> Also, nothing says a thunk cannot be evaluated twice
09:39 <kuribas> wouldn't it be like "case thunk of UnEvaluated fun -> evalute fun; Evaluated expr -> expr"
09:39 kritzcreek joined
09:39 <merijn> In fact, GHC sometimes does that
09:39 <bollu> merijn: really?
09:39 <bollu> merijn: why?
09:40 <bollu> the STG paper does not talk about this, interesting
09:40 <merijn> bollu: Because recomputing can be cheaper than, e.g. locking when you run multithreaded
09:40 <bollu> merijn: ah, I se
09:40 <bollu> see*
09:40 <kuribas> I suppose ghc can infer if it is evaluated before in the same function.
09:43 nullifidian joined
09:43 fotonzade joined
09:46 <mniip> kuribas, in STG, the evaluated and unevaluated thunks have the same interface
09:47 <mniip> you just enter a pointer
09:47 <mniip> an unevaluated thunk evaluates and replaces the values
09:47 <mniip> and evaluated thunk returns immediately
09:47 <mniip> fsvo returns
09:48 <mniip> there's also pointer tagging involved
09:48 joelburget joined
09:49 <mniip> it's cool how it manages to be *nothing* like the C runtime
09:49 Elhamer_ joined
09:50 nullifidian joined
09:51 Dance joined
09:51 nullifidian joined
09:51 vegai joined
09:52 nullifidian joined
09:53 doomlord_ joined
09:54 <merijn> mniip: :)
09:57 JeanCarloMachado joined
09:59 viralstitch joined
09:59 xanadu_ joined
09:59 LKoen joined
10:01 Matajon joined
10:04 lipkab joined
10:04 jer1 joined
10:08 tomphp joined
10:09 jgertm joined
10:10 JeanCarloMachado joined
10:11 bennofs joined
10:11 mohsen_1 joined
10:11 ortmage joined
10:12 filterfish joined
10:13 Argue__ joined
10:14 takle joined
10:14 tromp joined
10:15 mohsen_12 joined
10:16 mohsen_1 joined
10:16 nilof joined
10:19 chrisM_1 joined
10:20 mjora7 joined
10:23 jer1 joined
10:23 slomo joined
10:23 slomo joined
10:23 JeanCarloMachado joined
10:24 takle joined
10:25 takle joined
10:30 hurkan left
10:34 romank joined
10:34 Argue joined
10:39 conal joined
10:41 soLucien joined
10:42 torgdor joined
10:43 joelburget joined
10:43 <vegai> Hey
10:44 <vegai> Would it be possible to form a bridge between this channel and the corresponding channel in Matrix?
10:44 <vegai> I haven't done it myself ever, but I understand it requires a channel admin to do something
10:44 jer1 joined
10:47 <bennofs> vegai: matrix.org already bridges all of freenode: https://matrix.org/blog/2015/06/22/the-matrix-org-irc-bridge-now-bridges-all-of-freenode/
10:47 <bennofs> vegai: (including this channel)
10:50 <vegai> yeah, that's something different. In fact, what I'm using right now
10:51 <vegai> ... I think :) I'm on several "native" channels on Matrix which contain bridges to various places
10:51 <vegai> one of which is a Haskell channel
10:52 <vegai> , which does not contain a bridge to here
10:52 <vegai> but I don't claim to know if there's any benefit to adding that. There are 115 people there currently
10:52 Wizek__ joined
10:54 netheranthem joined
10:54 eacameron joined
10:54 conal joined
10:54 systadmin joined
10:54 xtreak joined
10:56 joelburget joined
10:57 soniku joined
10:57 splanch joined
10:59 Argue_ joined
11:00 bollu joined
11:00 cschneid_ joined
11:02 <ertes-w> aren't those the people with the "[m]" suffix in their nick?
11:03 peterhil joined
11:03 darlan joined
11:03 Snircle joined
11:04 nighty-- joined
11:04 Lambda__ joined
11:04 jer1 joined
11:06 <Lambda__> Hey
11:06 mmn80 joined
11:09 _paul0 joined
11:09 Wizek_ joined
11:10 Elhamer joined
11:11 xtreak joined
11:11 Kreest__ joined
11:13 sdothum joined
11:13 sproingie joined
11:14 eacameron joined
11:15 JeanCarloMachado joined
11:16 HoierM joined
11:20 JeanCarloMachado joined
11:20 <quchen> mniip: Pointer tagging is an optimization though, not something the STG *needs*
11:21 <quchen> In fact, pointer tagging is something that makes the »T« in STG wrong ;-)
11:21 Wuzzy joined
11:21 netheranthem joined
11:21 <quchen> kuribas: Check out my STGi program if you want to see the STG work! :-)
11:21 <quchen> ?google quchen stgi
11:21 <lambdabot> https://github.com/quchen/stgi
11:22 zargoertzel joined
11:23 splanch joined
11:23 ericsagnes joined
11:24 nulquen joined
11:24 joelburget joined
11:24 ysangkok joined
11:24 <ysangkok> i remember reading a paper of someone implementing java-like subtyping in haskell, probably even with Null.. i can't seem to find it... any hints?
11:25 jer1 joined
11:26 beanbagu1 joined
11:26 prophile joined
11:26 guardianJ joined
11:27 ertes joined
11:27 refold joined
11:28 fbergmann joined
11:28 guest423 joined
11:28 <merijn> Wow, I already suspected it, but TMVars are *terribad* under contention
11:29 bennofs1 joined
11:29 <merijn> like, 3 orders of magnitude terribad
11:29 <guest423> How can I convert [Shape] to [Double] where double is area from this example https://wiki.haskell.org/Existential_type#Dynamic_dispatch_mechanism_of_OOP ?
11:30 splanch_ joined
11:30 Boomerang joined
11:31 matrium joined
11:31 Boomeran1 joined
11:31 takle joined
11:32 TallerGhostWalt joined
11:33 JeanCarloMachado joined
11:33 splanch joined
11:33 takle joined
11:34 takle joined
11:36 <matrium> hi, can I somehow "unlift" a moniadic function, when I'm in the right context?
11:36 <byorgey> guest423: you could define getArea :: Shape -> Double; getArea (Shape s) = area s
11:36 <byorgey> guest423: then map getArea shapes
11:36 Yuras joined
11:36 <byorgey> matrium: I'm not sure what you are asking, can you give an example?
11:36 <matrium> I have a sorting function that runs in a Reader context
11:37 <byorgey> matrium: what is the actual type of your sorting function?
11:37 joelburget joined
11:37 <matrium> but there's no such thing like a sortM :: (a -> m Ord) -> t a -> m (t a)
11:38 cpennington joined
11:38 <Philonous> guest423, When you pattern-match on the Shape type you get a value which is an instance of the Shape_ class, so you can call area on it
11:38 <Philonous> so for example: getArea (Shape s) = area s
11:38 <Philonous> Errr, byorgey already answered, never mind then
11:39 xtreak joined
11:39 <matrium> byorgey: sortObjects :: [Obj] -> MonadReader FormattingContext m => m [Obj]
11:39 <byorgey> Philonous: I think your extra explanation was probably helpful =)
11:39 flatmap13 joined
11:39 fizruk joined
11:40 <byorgey> matrium: OK, and when you say "unlift", what type would you like it to have instead? [Obj] -> [Obj] ?
11:40 <Philonous> guest423, You could also make Shape an instance of Shape_, so you could call area directly on it.
11:40 <* byorgey> likes Philonous's idea
11:41 <Philonous> guest423, It's generally a pretty bad idea, though. You're better off just defining a recoird type with perimeter and area accessors.
11:41 <implementation> :t runReader
11:41 <lambdabot> Reader r a -> r -> a
11:41 <Philonous> s/accessors/fields
11:41 <implementation> this might help
11:42 <guest423> byorgey: thanks, is it possible to do something like this unwrap :: (Shape_ a) => Shape -> a;unwrap (Shape s) = s ?
11:42 <matrium> byorgey: sortBy :: (a -> a -> Ordering) -> [a] -> [a] only takes a non-moniadic ordering function
11:42 Boomerang joined
11:42 <byorgey> guest423: no, it is not
11:42 <matrium> but my ordering function is moniadic
11:42 <byorgey> guest423: because once you have a Shape you no longer know the type of the thing inside it.
11:43 eacameron joined
11:43 <byorgey> guest423: notice that the type (Shape_ a) => Shape -> a means that given a Shape, it can produce *any* type that the caller of the function chooses!
11:43 <Philonous> You can have Shape -> (forall a. Shape_ a => a -> r) -> r though
11:43 <byorgey> guest423: but obviously it can't do that. It could only produce the actual type of the thing that is inside the Shape wrapper.
11:43 <ventonegro> funny, was reading about that today
11:44 <matrium> byorgey: I would need something like "unlift :: (a -> m b) -> m (a -> b)
11:44 <implementation> matrium: that doesn't exist in general, but for Reader you can use runReader.
11:44 bollu joined
11:44 <byorgey> matrium: it is not possible to have such an unlift function in general. It is possible for some specific m, though (e.g. Reader)
11:45 takle joined
11:45 <matrium> Ok, thanks :-)
11:45 <guest423> thanks all
11:45 <byorgey> matrium: If fc :: FormattingContext, then (\objs -> runReader (sortObjects objs) fc) :: [Obj] -> [Obj]
11:46 jer1 joined
11:46 scientism joined
11:46 fbergmann joined
11:47 xtreak joined
11:47 entuland_ joined
11:47 <byorgey> more generally, (ask >>= \fc -> return (\objs -> runReader (sortObjects objs) fc)) :: MonadReader FormattingContext m => m ([Obj] -> [Obj])
11:47 Khisanth joined
11:48 gawen joined
11:49 rashmirathi joined
11:51 joelburget joined
11:51 bollu joined
11:51 takle joined
11:52 xtreak joined
11:52 redpoppies joined
11:53 tomphp joined
11:53 nullifidian joined
11:53 jdnavarro joined
11:53 soniku joined
11:55 splanch_ joined
11:56 nuclx joined
11:57 xtreak_ joined
11:58 <nuclx> hey, where are packages installed to on windows when using 'stack install <pkg>'?
11:58 mulk__ joined
11:59 indi_ joined
12:00 <quchen> nuclx: Check `stack path`
12:00 <quchen> It lists most (all?) directories Stack uses
12:00 chlong joined
12:00 lipkab joined
12:01 nullifidian joined
12:03 nullifidian joined
12:03 <nuclx> quchen: ah, thanks for the tip
12:06 exferenceBot joined
12:06 jer1 joined
12:06 hc joined
12:10 eacameron joined
12:11 govg joined
12:12 rashmirathi joined
12:14 Dance joined
12:15 eacameron joined
12:15 Dookie12 joined
12:15 tromp joined
12:15 indi_ joined
12:17 exarkun joined
12:21 <exarkun> This is basically the example from the Data.Aeson docs, http://codepad.org/c4f6ADOz - but it fails to compile: ‘toEncoding’ is not a (visible) method of class ‘ToJSON’. Yet it would certainly _appear_ to be a visible method of the class: https://hackage.haskell.org/package/aeson-1.2.0.0/docs/Data-Aeson.html#t:ToJSON
12:21 <exarkun> I wonder what I'm missing.
12:21 jer1 joined
12:21 perrier-jouet joined
12:22 takle joined
12:22 <byorgey> exarkun: there is an explicit import list which imports the name of the class but not any of the methods.
12:23 <byorgey> toEncoding is not visible because it is not imported. Try changing it to import Data.Aeson (ToJSON(..), ...)
12:24 Elhamer joined
12:24 <byorgey> sorry, to be clear, the first two dots are actual syntax, and the last three dots are metasyntax meaning I didn't want to write out the rest of the imports =)
12:25 Big_G joined
12:25 Elhamer_ joined
12:26 rashmirathi joined
12:27 JeanCarloMachado joined
12:28 oisdk joined
12:28 lipkab joined
12:28 <exarkun> byorgey: ah thank you
12:30 firef1y left
12:30 AntiSpamMeta joined
12:30 asmyers joined
12:31 dual joined
12:31 Plasma joined
12:32 TCZ joined
12:33 mivael joined
12:35 systadmin joined
12:36 mbp joined
12:37 Dance joined
12:38 fosterite joined
12:39 <merijn> Interesting...
12:39 <merijn> I seem to have managed to overflow Criterion's statistics, getting a negative runtime xD
12:40 rashmirathi joined
12:41 rashmira_ joined
12:41 mulk__ joined
12:42 rcschm joined
12:44 kiltzman joined
12:44 rashmir__ joined
12:45 rashmirathi joined
12:45 yoneda joined
12:46 mulk_ joined
12:47 pie_ joined
12:48 dunx joined
12:48 dunx joined
12:48 beanbagu1 joined
12:48 eacameron joined
12:48 bollu joined
12:49 govg joined
12:50 jer1 joined
12:50 bollu joined
12:50 <merijn> ok...I'm really confused how the hell criterion ends up benchmarking negative times...
12:51 bennofs joined
12:52 <c_wraith> does it use the high-performance counter? Because that counter rolls over really fast.
12:52 <merijn> I have no idea
12:53 <merijn> c_wraith: But these are runtimes in milliseconds and it's reliably measuring negative times
12:53 bigos_ joined
12:53 <exarkun> How do I do anything useful with a Data.ByteString.Lazy.Internal.ByteString (as returned by Data.Aeson.encode)
12:53 <merijn> Whereas I have experiments that are measured in multiple seconds which don't go negative
12:53 <c_wraith> Hmm. maybe your code is just magical?
12:54 <merijn> c_wraith: Actually, I suspect one of the machines might just be broken..
12:54 northfurr joined
12:54 <rightfold> exarkun: this is just a lazy ByteString
12:54 <c_wraith> that does seem more likely. But even then, bizarre
12:55 <rightfold> exarkun: there are many operations on them, and you can turn them into strict ones. See the Data.ByteString.Lazy module.
12:55 <exarkun> rightfold: So .. I can use APIs from Data.ByteString.Lazy on it?
12:55 mada joined
12:55 <exarkun> okay, thanks
12:55 <rightfold> Pretty sure yes
12:55 <* exarkun> tries that
12:55 <rightfold> It's the same type
12:55 <rightfold> Exported by multiple modules
12:56 <exarkun> confusing, but yea Data.ByteString.Lazy.putStr is working with this. thanks.
12:56 bollu joined
12:58 <merijn> c_wraith: Usually I get runtimes between 2-5ms, but sometimes several microseconds or negative 2-20 ms >.<
12:59 eacameron joined
12:59 indi_ joined
12:59 <byorgey> merijn: perhaps you are travelling at a speed greater than the speed of light relative to your computer.
13:00 <byorgey> you know, one has to consider these things.
13:00 paolino joined
13:00 bollu joined
13:02 e14 joined
13:02 rashmira_ joined
13:02 dunx joined
13:02 dunx joined
13:03 peterhil joined
13:03 <Philonous> merijn, That just means the acausal compute engine is working properly :>
13:04 revprez_atlanta joined
13:05 hc_ joined
13:06 eacameron joined
13:07 eyck_ joined
13:07 jathan joined
13:07 mstruebing joined
13:09 jer1 joined
13:09 systadmin joined
13:11 cpennington joined
13:11 fendor joined
13:12 guampa joined
13:12 brynedwards joined
13:14 mizu_no_oto joined
13:14 jgertm_ joined
13:15 Filip_ joined
13:16 statusfailed joined
13:18 Maxdamantus joined
13:19 nikolah joined
13:19 beanbagu1 joined
13:19 CrazedProgrammer joined
13:19 cpup joined
13:19 wei2912 joined
13:20 ChristopherBurg joined
13:20 Guest37310 joined
13:20 dschoepe joined
13:21 iAmerikan joined
13:23 cschneid_ joined
13:23 `micro joined
13:24 eschnett joined
13:26 petermw joined
13:26 ogrady_ joined
13:27 entuland joined
13:28 iAmerikan joined
13:28 ub joined
13:28 carlomagno1 joined
13:29 jer1 joined
13:32 snowalpaca joined
13:34 northfurr joined
13:34 petermw joined
13:34 cloudhead joined
13:34 roconnor_ joined
13:34 geekosaur joined
13:34 mmachenry joined
13:34 jangsutsr joined
13:35 eklavya joined
13:36 `^_^v joined
13:37 Filip_ joined
13:37 ziocroc joined
13:37 <merijn> Not getting great R^2 values either...
13:37 na_th_an left
13:38 joelburget joined
13:41 phaji joined
13:41 zargoertzel joined
13:42 <merijn> The code that's acting up is: https://github.com/merijn/broadcast-chan/blob/master/benchmarks/Sync.hs#L78-L87
13:43 StoneToad joined
13:43 rashmirathi joined
13:43 takle joined
13:43 ystael joined
13:43 <merijn> Since it's a spinloop it might just be nasty outliers, but I'm not sure how to get a more reliable spinloop
13:44 PennyNeko joined
13:44 <merijn> oh!
13:44 <merijn> Idea!
13:45 psychicist__ joined
13:46 takle joined
13:48 danthemyth joined
13:48 <merijn> Any linux experts here? Does anyone know if clock_gettime with CLOCK_MONOTONIC is threadsafe?
13:48 rashmirathi joined
13:48 meba joined
13:48 <mfukar> via POSIX, it's thread-safe unless explicitly stated otherwise
13:49 <mfukar> and there's no exception as far as i can see
13:49 crave joined
13:49 jer1 joined
13:49 <merijn> hmmm
13:49 guampa joined
13:51 NyanPasu joined
13:53 obihann joined
13:53 takle_ joined
13:53 splanch_ joined
13:55 Dance joined
13:56 jgertm joined
13:59 theelous3 joined
13:59 takle joined
14:00 <ertes-w> is there a portable library for file locking? i specifically need shared and exclusive locks
14:01 <merijn> ertes-w: Good luck :)
14:01 justin2 joined
14:01 magneticduck joined
14:02 <ertes-w> well, using 'unix' doesn't bother me too much, but if i ever release this library, people with questionable OS choices might benefit from it, too =)
14:02 sfcg joined
14:02 <merijn> ertes-w: Even on unix you're fucked
14:02 <ertes-w> merijn: why?
14:02 <merijn> ertes-w: If the filesystem happens to be NFS it'll *look* like locking works, but it subtly and silently won't
14:03 osa1 joined
14:03 <ertes-w> yeah, that's a fairly common caveat
14:03 <merijn> If anything, windows will give you better odds of sane locking
14:03 <ertes-w> but i can't really do anything about it, so i'll just document it
14:04 xall_ joined
14:05 cfricke joined
14:06 gmcabrita joined
14:06 matthewbauer joined
14:07 vikings joined
14:08 coot joined
14:08 <vikings> join
14:08 dsh joined
14:08 <ertes-w> and BTW, that's why you don't use NFS =)
14:09 <vikings> i use NFS
14:09 joelburget joined
14:10 antoine9298 joined
14:10 cereal_killer_ joined
14:11 pja joined
14:11 xanadu_ joined
14:11 etehtsea joined
14:12 <lambdamu_> Is there any lens machinery for references (IORef, TVar, etc.)?
14:13 jathan joined
14:13 jer1 joined
14:14 <merijn> lambdamu_: To do what?
14:14 <ertes-w> lambdamu_: modifyIORef' (myLens +~ 15)
14:14 <ertes-w> modifyIORef' ref (myLens +~ 15)
14:14 <ertes-w> view myLens <$> readIORef' ref
14:15 descender joined
14:16 <lambdamu_> hm yeah that's what I'm doing I thought about something, like: var & fromTVar . foo .~ True
14:16 mohsen_ joined
14:16 <lambdamu_> but I see that this can't work with the lens signatures
14:17 <byorgey> lambdamu_: if you make an infix operator alias for modifyIORef you can even use it like & : ioRef &# foo .~ True
14:17 northfurr joined
14:17 <joelburget> splits
14:18 tzh joined
14:18 <lambdamu_> byorgey: that's nice, similiar to the monadstate operators
14:18 <byorgey> yep
14:18 <byorgey> I made up the name (&#), you can paint that bikeshed whatever color you want =)
14:19 <lambdamu_> now i just to pick one of the reference abstractions out there :D
14:19 <merijn> ugh
14:20 <merijn> I think it's part of the statistics/regression stuff breaking my measurements, but I don't understand that voodoo well enough to see what's fucking up
14:22 seangrove joined
14:23 bigos_ joined
14:23 systadmin joined
14:23 chlong joined
14:24 yellowj joined
14:26 <merijn> Timing of NaN seconds...definitely something wrong...
14:27 anRch joined
14:31 soniku joined
14:32 jer1 joined
14:33 govg joined
14:35 StoneToad joined
14:38 tabaqui joined
14:38 coot joined
14:38 beanbagula joined
14:38 oish_ joined
14:39 matthewbauer joined
14:41 rkazak joined
14:41 northfurr joined
14:42 Filip joined
14:42 mikecaruso joined
14:43 torstein joined
14:44 JagaJaga joined
14:44 etehtsea joined
14:45 MDA2 joined
14:47 Maxdamantus joined
14:48 fotonzade joined
14:51 StoneToad joined
14:51 uglyfigurine joined
14:52 SpinTensor joined
14:53 xanadu_ joined
14:53 MindlessDrone joined
14:53 jer1 joined
14:53 Guest17370 joined
14:56 xall_ joined
14:57 mmachenry left
14:58 jgertm joined
14:58 <ertes-w> computers get slower, too, as they get older, so they charge less for cookies… when their speed and cookie price matches your grandmothers', you experience nan seconds
15:01 al-damiri joined
15:03 nullifidian joined
15:03 alx741 joined
15:04 cschneid_ joined
15:05 zargoertzel joined
15:08 c4r50nz joined
15:08 mrkgnao joined
15:09 angelos joined
15:10 eklavya joined
15:10 flatmap13 joined
15:10 crobbins_ joined
15:11 govg joined
15:12 pie_ joined
15:12 modal joined
15:12 cdg joined
15:13 sproingie joined
15:13 sproingie joined
15:13 Sh4rPEYE joined
15:14 <Sh4rPEYE> Could somebody here help me understand what's going on here?
15:14 <Sh4rPEYE> http://lpaste.net/1677977249338359808
15:14 jer1 joined
15:14 macrover joined
15:14 <Sh4rPEYE> It is a simple example of using the State Monad.
15:14 sssilver joined
15:16 sampuka joined
15:17 <Sh4rPEYE> generator should be of type (s -> (a,s)) and I don't get why RandomR then works with that as a generator
15:18 <byorgey> Sh4rPEYE: no, generator is of type Int.
15:19 <byorgey> er, sorry, I mean type StdGen
15:19 fendor joined
15:19 <Sh4rPEYE> In the code there is generator <- get, and because get is State f, generator should be of type f, no? And that is (s -> (a,s))
15:20 <geekosaur> Sh4rPEYE, a thing of type State s a is not a simple valuer, it is an action. "get" is such an action
15:20 <geekosaur> "generator" is the result of that action
15:20 <geekosaur> :t get
15:20 <lambdabot> MonadState s m => m s
15:20 <Sh4rPEYE> Oh, I though generator will be still the action. How come it is the result when I'm not passing anything to get?
15:21 <byorgey> Sh4rPEYE: because the do-block gets desugared into calls to >>= and so on, and behind the scenes the implementation of >>= for State is passing the current state to get
15:21 fizruk joined
15:21 freusque joined
15:22 <bartavelle> Sh4rPEYE: "get" is the action of retrieving the state, it doesn't require any argument to be passed to, as can be seen in its type signature
15:22 Tesseraction joined
15:22 <geekosaur> also don't confuse <- with =
15:22 <Sh4rPEYE> It was in the text that get = state $ \st -> (st, st)
15:23 <geekosaur> <- is not just "oh, that's = for monads", it's "perform the action"
15:23 <geekosaur> in some sense
15:23 <Sh4rPEYE> That'd put me on the wrong track I guess
15:23 <byorgey> there are two levels going on here. At the abstract level, 'get' is a State action which does not require any argument. It simply returns the current state. The other level is the way the State monad is actually implemented, with s -> (a,s) functions.
15:23 <Lokathor> Sh4rPEYE, yes, and one side of the (st,st) tuple becomes the result of "get"
15:23 <Lokathor> that you see in your own function
15:24 <byorgey> Sh4rPEYE: I think the biggest problem is that you are confusing these two levels. When working with do-notation you do not need to think at all about how State is actually implemented "under the hood"
15:24 <byorgey> Sh4rPEYE: I cannot tell, but you may also be confused about what <- means
15:25 <Sh4rPEYE> byorgey: That might be the case, too, as I'm not really familiar with monads and do-notation
15:26 Itkovian joined
15:26 revprez_atlanta joined
15:27 <bartavelle> Sh4rPEYE: you might get started without really understanding what is going on, as long as you understand that when you have "a <- foo", foo is of type 'm x', where 'm' is the monad you are working with (here State StdGen), and 'a' is of type x
15:27 <bartavelle> and that the <- only works in do-notation
15:28 <bartavelle> :t get
15:28 <lambdabot> MonadState s m => m s
15:28 <bartavelle> so here, 'get' has type 'State StdGen StdGen'
15:28 <Sh4rPEYE> bartavelle: That's how I think about it... Almost as a way to strip themonad off of something, in a monad-specific way
15:29 cyborg-one joined
15:29 <bartavelle> so generator has type 'StdGen'
15:29 erikm joined
15:29 <bartavelle> Sh4rPEYE: just look at the type of your functions, and forget for now how they are implemented
15:30 dan_f joined
15:30 <bartavelle> Sh4rPEYE: my first real haskell program was a large parsec-parser, and I had no clue about monads, yet I managed to write it, after brute-forcing the type checker for a long time), so it is quite possible
15:31 urodna joined
15:32 soniku joined
15:32 teggi joined
15:32 gcross joined
15:32 dsfox1 joined
15:33 descender joined
15:33 Maxdamantus joined
15:34 importantshock joined
15:34 mohsen_ joined
15:38 jer1 joined
15:38 <Jinxit> ^same
15:39 kmels joined
15:39 sproingie joined
15:40 <Sh4rPEYE> Ok, I think I understand the basic things. Get is State StdGen StdGen, so generator is StdGen and it works.
15:41 snowalpaca joined
15:41 afarmer joined
15:41 Elhamer__ joined
15:42 dustmote joined
15:43 mizu_no_oto_work joined
15:43 dsfox1 joined
15:44 <byorgey> Sh4rPEYE: right
15:44 dustmote joined
15:45 pera joined
15:46 <Sh4rPEYE> So it makes sense considering types... But what does it mean to "get current state" I don't yet understand. Especially when I haven't yet set any.
15:46 cranej joined
15:46 <hexagoxel> :t runState
15:46 <lambdabot> State s a -> s -> (a, s)
15:47 jmelesky joined
15:47 <geekosaur> a computation of type State s a doesn't need to set state, it receives the state. runState is what injects an initial state value into a State computation
15:48 Hunter1_ joined
15:48 umib0zu joined
15:50 nick8325 joined
15:50 bollu joined
15:51 <Sh4rPEYE> I just need a break, I think. This is supposed to be simple stuff and I'm gazing into the monitor for an hour straight and haven't yet figured out five lines of code. I'll try in the evening.
15:51 <Sh4rPEYE> Thanks everyone for help :-)
15:51 <bartavelle> gl!
15:52 eazar001 joined
15:52 <glguy> yes?
15:52 robotroll joined
15:53 ski joined
15:53 kiltzman joined
15:54 FreeBirdLjj joined
15:55 modal joined
15:56 sssilver_ joined
15:56 <geekosaur> heh
15:57 jer1 joined
15:58 <glguy> If I don't protect gl™, it might slip into common use and ruin my trademark :-p
15:58 <bartavelle> haha, I am pretty sure others have it protected already ;)
15:58 <bartavelle> you can relax
15:59 <Lokathor> glguy, i've always wondered if you rose to power as the top GL progammer in the world
15:59 <Lokathor> I'll just assume that's true
15:59 osa1 joined
16:00 Argue joined
16:00 matthewbauer joined
16:02 hackebeilchen joined
16:02 iAmerikan joined
16:02 Sonolin joined
16:03 dm3 joined
16:03 dsfox joined
16:03 panosk joined
16:03 dsfox1 joined
16:03 panoskk joined
16:04 dustmote joined
16:04 LKoen joined
16:05 kiltzman joined
16:05 kiltzman joined
16:07 kiltzman joined
16:08 johnw joined
16:08 kiltzman joined
16:08 trism joined
16:09 Yuras joined
16:10 matthewbauer joined
16:10 ski joined
16:11 dsfox1 joined
16:12 raichoo joined
16:13 meandi_2 joined
16:14 jg_ joined
16:14 Elhamer joined
16:14 splanch joined
16:15 sleffy joined
16:17 tromp joined
16:17 Luke joined
16:17 kiltzman joined
16:18 jer1 joined
16:19 Swizec joined
16:19 beanbagula joined
16:19 WhereIsMySpoon joined
16:20 <WhereIsMySpoon> Hey, anyone use intellij here would like to tell me which plugin I should use? HaskForce or Intellij-Haskell?
16:20 <WhereIsMySpoon> haskforce has loads more downloads but intellij-haskell seems to have been updated much more recently
16:22 ludat joined
16:24 freeside joined
16:26 Argue joined
16:27 Hunter1_ joined
16:28 glamas joined
16:29 Filip joined
16:29 <antoine9298> ping
16:30 jgertm joined
16:30 <bollu> pong?
16:30 pera joined
16:31 flatmap13 joined
16:31 coot joined
16:31 path[l] joined
16:31 <WhereIsMySpoon> also whats the difference between building with stack and with cabal
16:32 Dookie12 joined
16:32 flatmap13 joined
16:33 flatmap13 joined
16:33 carlomagno joined
16:33 ragepanda joined
16:34 FreeBirdLjj joined
16:38 pwnz0r joined
16:39 jer1 joined
16:39 path[l] joined
16:39 hc joined
16:41 dunx joined
16:43 t7 joined
16:45 Hunter1_ joined
16:46 dm3 joined
16:48 <electrocat> WhereIsMySpoon: stack build your project including the dependencies using a stable snapshot of versions, while cabal has, ... issues. just use stack :p
16:48 <sproingie> WhereIsMySpoon: stack uses cabal
16:48 <WhereIsMySpoon> oki
16:48 <electrocat> sproingie: depends if you mean Cabal or cabal-install
16:48 <sproingie> cabal builds, stack solves dependencies. mostly. there's some overlap.
16:48 <WhereIsMySpoon> i tried learning some haskell a while ago and got some way but forgot it all :P
16:48 <WhereIsMySpoon> so now im gonna try again
16:48 <sproingie> WhereIsMySpoon: it's a lot faster the second or third time
16:49 <WhereIsMySpoon> gonna use learnyouahaskell again :)
16:49 <sproingie> this is like my third with haskell
16:49 <WhereIsMySpoon> i remember it being great last time
16:49 <torstein> How can I deserialize a Map String (String Int Int) from a file, given that it was written with 'show'?
16:49 <sproingie> LYAH is a bit out of date, some of it has functions in the wrong type classes now
16:49 <electrocat> torstein: 'read'
16:49 <WhereIsMySpoon> i see
16:49 <sproingie> LYAH is generally good imho til it gets all wall-of-text on you
16:50 <WhereIsMySpoon> would you rather recommend another one?
16:50 yqt joined
16:50 <sproingie> haskell from first principles is good
16:50 Gurkenglas joined
16:50 <sproingie> (not free tho)
16:50 <glguy> Hutton's Programming in Haskell is a good place to start
16:51 dual joined
16:51 Swizec joined
16:51 <WhereIsMySpoon> also not free it seems
16:51 <sproingie> bouncing between various haskell blogs was my approach, works ok when you have some basics down
16:51 <shapr> glguy: I just bought the 2nd edition, I'll compare it to my 1st edition.
16:51 <shapr> Dunno why I never got my 1st edition signed, maybe hutton will be at ICFP 2017
16:51 <shapr> edwardk: when will you write a book so I can get it autographed?
16:51 <sproingie> for learning features like GADTs and type families, just read the GHC docs
16:52 northfurr joined
16:52 <WhereIsMySpoon> ill just use lyah for now and if it starts being really wrong ill switch
16:52 <WhereIsMySpoon> i dont even know what a gadt and type family is :P
16:52 <glguy> WhereIsMySpoon: You won't know if it's wrong until you know what's right though
16:52 acarrico joined
16:52 <WhereIsMySpoon> i will if i type stuff in and it doesnt run
16:52 <WhereIsMySpoon> :P
16:52 <glguy> That's just he most extreme form of wrong
16:52 <electrocat> i learned the basics in college, and for a little more advanced stuff i used Real World Haskell, not sure if it's actually good though compared to other things available
16:52 <torstein> electrocat, yeah I get errors when trying in GHCi.. Assume I have: type SomeMap = Map ...; then doing (readFile "myfile" >>= read) :: IO SomeMap yields "No Instance for (Read (IO SomeMap))"
16:52 <sproingie> type families are good when you're making your own type classes. GADTs are pretty good to learn early.
16:53 <glguy> You can get a LOT done and never need to worry about GADTs
16:53 <sproingie> or type families. or your own typeclasses for that matter.
16:54 <glguy> They're good to learn eventually, but not necessary to program productively
16:54 <sproingie> but once you start wanting existential types and fundeps, you probably want GADTs
16:54 <electrocat> torstein: 'read' isn't an IO function, try (read <$> readFile "myfile"), that's the same as writing (readFile "myfile" >>= return . read) but better
16:54 <torstein> gracias
16:56 tomphp joined
16:59 iAmerikan joined
16:59 jer1 joined
17:02 fotonzade joined
17:05 Swizec joined
17:05 xall_ joined
17:05 rashmirathi joined
17:06 doomlord_ joined
17:06 Swizec joined
17:10 <frew> I am trying to configure taffybar, which is haskell and gtk, to distinguish buttons on a click event
17:10 <frew> I wrote the following code, which I thought was close to correct: https://github.com/frioux/dotfiles/commit/34127e2eac9b09d1a37fce58f801efe3174d9b83
17:10 <frew> but it fails to typecheck
17:10 <frew> it looks similar to some other cases I found on github that are doing the same thing, I think
17:11 <frew> anyone see any obvious mistakes? I am pretty sure the _ -> _ is totally wrong, that's just because I want to ignore all other cases
17:11 tomphp joined
17:11 hsk3 joined
17:11 <hsk3> This just worked: import Heist.Compiled (Splice, yieldPureText)
17:11 <hsk3> Since when it is possible to put types into imports?
17:11 <hsk3> Was this possible before GHC 8?
17:11 eklavya_ joined
17:12 FreeBirdLjj joined
17:12 <kadoban> I don't know what _ -> _ would do, probably nothing sensical. _ -> return () might work, I don't know the type of "unsafeSpawn"
17:12 <frew> kadoban: I don't either, but I'm trying to discard it (note the return True afterwards)
17:13 <frew> but I guess the _ block needs to match
17:13 <kadoban> The branches of a case all need to match in type, yeah
17:15 slomo joined
17:15 slomo joined
17:15 Argue_ joined
17:15 sizeofchar joined
17:15 <frew> kadoban: unsafeSpawn is from https://hackage.haskell.org/package/xmonad-contrib-0.11.1/docs/XMonad-Util-Run.html
17:15 spacecadetbrown joined
17:16 <pie_> what are the key parts of modern functional langauges? expressive type systems, higher order functions, immutabiliyt, ...?
17:16 <kadoban> frew: It appears that I guessed correctly then
17:16 <frew> yeah I thoght so too.
17:17 <frew> so that fixes the hole.
17:17 matuszak joined
17:17 danthemyth joined
17:17 <frew> but I still get: https://gist.github.com/frioux/a52a9fe6fc4907099296f7e6aa7966b9
17:17 ski joined
17:17 <frew> *something* is wrong with my case but I'm not sure what or why
17:19 <pie_> *immutability
17:19 path[l] joined
17:19 <frew> I think I need return or something like it to fix the type of Gtk.RightButton etc
17:19 mounty joined
17:19 connrs joined
17:20 <kadoban> frew: What's the type of Gtk.eventButton ?
17:20 jer1 joined
17:20 <kadoban> https://www.stackage.org/haddock/lts-8.13/gtk-0.14.6/Graphics-UI-Gtk-Gdk-EventM.html#v:eventButton this one probably?
17:20 <frew> yeah I thnk so
17:20 <frew> which it looks like the error message matches, but my code doesn't
17:21 <kadoban> So you likely need to do something like butt <- Gtk.eventButton and then case butt of [...]
17:21 phyrex1an joined
17:21 <frew> ok so why is that diff from `case Gtk.eventButton` ?
17:22 <kadoban> Because eventButton isn't a MouseButton, it's an action that lets you query the MouseButton. Or something, I don't know Gtk or this code
17:22 <frew> sure I get it
17:23 <frew> I just assumed foo <- bar assigned the result of bar to foo
17:23 <frew> so they could be substitutable
17:23 Kreest_ joined
17:23 bennofs joined
17:23 codesoup joined
17:23 <kadoban> In one sense it assigns the result of bar to foo, but I don't think they're ever substitutable
17:23 <frew> ok
17:23 <frew> let me try it
17:23 Luke joined
17:23 <frew> I almost did that but it seemed silly
17:23 nuclx joined
17:23 ragepanda joined
17:24 iAmerikan joined
17:24 <frew> wow that did it
17:24 <frew> thanks kadoban, I've been wrestling with this for too long :)
17:24 athan joined
17:24 tuco_ joined
17:24 <kadoban> Anytime
17:24 macrover joined
17:25 <seequ_> (b <- Gtk.eventButton; stuff) is the same as (Gtk.eventButton >>= \b -> stuff) - not quite just assignment
17:25 <frew> so basically the problem here is htat I assumed a function in place of a value would be called
17:25 <frew> but that's not really true
17:25 <frew> and makes sense when I write it out
17:26 <seequ_> Understanding monads would be helpful.
17:26 <kadoban> I think of monadic actions, like Gtk.eventButton as "procedures" I think, though that's not quite correct. I would try to avoid thinking of them as functions, because functions are pure in haskell
17:27 <frew> good point
17:27 <frew> I am not even close to understanding haskell or monads
17:27 <frew> I'm cargo culting for now and picking up information as I go
17:28 <nshepperd> a function maps input values to output values. an IO action.. doesn't do that
17:28 <nshepperd> 'procedure' is a perfectly good term for IO actions, I think
17:28 <frew> yeah I understand the concept of pure functions
17:28 <frew> it's the Haskell specific stuff (ie I mostly understand ML) that is new to me
17:28 <kadoban> seequ_: I mostly think of it as "run this thing and then assign the value to this binding" (though that's not quite correct I'm aware). But it works for IO and IO-ish monads pretty well
17:29 <nuclx> can anyone explain why i encounter this error when trying to downgrade parsec from 3.1.11 to 3.1.3? 'stack build interim-demo' fails with: Error: While constructing the build plan, the following exceptions were encountered: In the dependencies for intero-demo-0.1.0.0: parsec-3.1.11 must match ==3.1.3 (latest applicable is 3.1.3) Plan construction failed.
17:29 <kadoban> nuclx: What did you do to downgrade parsec?
17:29 <cocreature> nuclx: have you added parsec-3.1.3 to extra-deps?
17:29 gienah joined
17:29 <kadoban> (why do you want to downgrade a library anyway? Did they add a bug?)
17:29 <nuclx> kadoban: trying to run some tutorials which apparently dont build with 3.1.11
17:29 <kadoban> Ah
17:30 <kadoban> That's ... weird. I wouldn't expect much to work with version 3.1.3 that doesn't with 3.1.11, in general.
17:30 <nuclx> cocreature: only to build-deps
17:30 <cocreature> nuclx: then add it to the extra-deps section in your stack.yaml file
17:31 <kadoban> Yeah, that should take care of it
17:31 tefter joined
17:31 <nuclx> kadoban: that's what was stated in the tutorial as well, anyways gonna try adding it to extra-deps and see if it works
17:31 balor joined
17:32 drcode joined
17:33 tromp joined
17:33 macrover left
17:33 kiltzman joined
17:33 <seequ_> kadoban: Instead of procedures, i recommend thinking of monads as opaque actions. (do x <- getLine; putStrLn x) is just a single action, or value if you prefer, that represents the action of reading a line and printing it. It itself does no such thing, but the handler that reads it will if given to it.
17:34 mmn80 joined
17:34 <nuclx> stack build fails now with: In the dependencies for parsec-3.1.3: / text-1.2.2.1 must match >=0.2 && <0.12 (latest applicable is 0.11.3.1) / needed due to intero-demo-0.1.0.0 -> parsec-3.1.3
17:34 catsup joined
17:35 <kadoban> nuclx: Sounds like that's just not going to work. Perhaps you can try moving stack.yaml elsewhere (to a new name) and then stack init and see if it can find a better resolver for you. Can try with --solver as well
17:35 <cocreature> nuclx: you need to add text-0.11.3.1 to extra-deps. alternatively you can try "stack solver" which should figure that out automatically
17:35 LordBrain joined
17:36 <cocreature> nuclx: or just show us the build error with parsec 3.1.11. I doubt that it’s hard to fix so that might be the easiest route
17:36 <kadoban> Both of those sound like good ideas too
17:36 jcjf joined
17:36 Filip joined
17:36 <nuclx> cocreature: going back to 3.1.11, one sec
17:38 eazar001 joined
17:38 strykerkkd joined
17:40 jcjf joined
17:40 <nuclx> it's probably just some renamed imports: https://paste.ofcode.org/aEybAYDKNG4x2c8eSyAGZt
17:40 jer1 joined
17:41 replay joined
17:41 felixsch_ joined
17:41 <nuclx> it tried to use the proposed names, but not all of them worked
17:42 ski joined
17:42 <cocreature> nuclx: are you using this project? https://github.com/JakeWheat/intro_to_parsing
17:42 jcjf joined
17:42 <nuclx> yeah
17:42 balor joined
17:43 <cocreature> how are you trying to build it? it doesn’t seem to contain a cabal file
17:44 BlueRavenGT joined
17:44 <nuclx> i put it into a project i created with stack new, based on the lts-8.13 resolver
17:45 mizu_no_oto joined
17:45 <cocreature> the first two imports should probably work if you change them as suggested. the third means that you need to add FunctionsAndTypesForParsing to exposed-modules in your cabal file
17:46 hc_ joined
17:46 pgiarrusso joined
17:48 eklavya joined
17:50 eklavya__ joined
17:51 electrostat joined
17:52 Boomerang joined
17:52 <nuclx> cocreature: ok, great. got it to build.
17:52 <cocreature> nice
17:52 drcode joined
17:53 kfish joined
17:54 ciniglio joined
17:56 unK_ joined
17:56 oisdk joined
17:56 dejanr_ joined
17:58 danthemyth joined
17:58 uglyfigurine joined
18:01 jer1 joined
18:02 fosterite joined
18:03 antoine9298 joined
18:04 <sproingie> is there a way to tell cabal to expose everything, or do I have to list every .hs file in exposed-modules?
18:04 <sproingie> b
18:04 <kadoban> You have to list them, AFAIK
18:04 <sproingie> whup
18:05 JuanMiguel joined
18:05 <sproingie> bleh. annoying when i forget a new file and get mysterious compile errors
18:05 <sproingie> well, usually not that mysterious
18:06 <kadoban> Yeah, it's pretty unfortunate. The worst is when you forget to add to other-modules and later get wacky errors. Though stack seems to warn me sometimes, or maybe that warning is from Cabal, dunno.
18:06 <sproingie> stack's default colors aren't helpful either. dark gray on a black background, whee
18:07 dominik joined
18:07 <kadoban> Stack has default colors?
18:08 <kadoban> Of what, the warning outputs or something? I don't know if I ever noticed them being colored differently from usual text.
18:08 <sproingie> it colorizes output, and i didn't change anything, so there's some kinda default
18:08 <kadoban> Huh, weird
18:08 <sproingie> all compiler output comes out in dark gray, errors or not. basically not useful.
18:09 mda1 joined
18:09 ragepandemic joined
18:10 <kadoban> That sounds bizarre. I don't think mine does that. Or maybe it's something to do with my terminal colors
18:11 fotonzade joined
18:11 <sproingie> huh i don't always get it either
18:12 <sproingie> ah "stack build" doesn't colorize, "stack run" does
18:12 sleffy joined
18:13 <cocreature> yeah that’s the primary reason why I’m still using stack build && stack exec over stack run
18:13 <cocreature> the colors really annoy me
18:13 <kadoban> I didn't know stack run was a thing. I wonder if anyone has complained about that on the bug tracker ... sounds awful
18:13 <sproingie> i don't mind muting the compiler noise when the output from run is what you're looking for anyway
18:13 Filip joined
18:13 <sproingie> but i'd like to see errors colorized a lot more prominently
18:13 <cocreature> kadoban: it’s a separate package
18:13 <kadoban> Oh
18:14 <cocreature> kadoban: but stack looks for executables called stack-* so you can just execute "stack run" instead of "stack-run"
18:14 Bassetts joined
18:14 cereal_killer_ joined
18:15 <sproingie> basically git's trick
18:15 <kadoban> Right, I think I remember that from back when it was just a couple of scripts to supplement cabal-install
18:15 ski joined
18:15 <sproingie> accounts for why git's commands have such a consistent look and feel and command set :^)
18:16 <kadoban> xD unfortunately I don't think that's actually why for git, I'm not sure why git's UI is so wacky. Maybe just lack of planning.
18:16 <sproingie> git was more grown than built
18:16 <sproingie> tho for the kind of thing git is, that makes sense
18:17 <sproingie> (i see "whither darcs" has come back up on /r/)
18:20 albertus1 joined
18:20 drcode joined
18:20 iAmerikan joined
18:21 rashmirathi joined
18:21 danthemy_ joined
18:22 jer1 joined
18:22 fizruk joined
18:23 mkoenig joined
18:24 Hunter1_ joined
18:24 paolino_ joined
18:24 {emptyset} joined
18:26 joelburget joined
18:26 jutaro joined
18:26 dcoutts joined
18:26 dcoutts joined
18:26 augur joined
18:28 splanch joined
18:30 noxd joined
18:32 ludat joined
18:32 cables joined
18:34 LHoT10820 joined
18:34 jsgrant_om joined
18:37 cyborg-one joined
18:40 pratch joined
18:42 ragepandemic joined
18:43 jer1 joined
18:43 JeanCarloMachado joined
18:43 nullifidian_ joined
18:44 ertes joined
18:45 revprez_atlanta joined
18:46 Itkovian joined
18:47 dm3 joined
18:48 ski joined
18:48 zargoertzel joined
18:52 montag451___ joined
18:59 iAmerikan joined
19:00 Guest67133 joined
19:01 BartAdv joined
19:02 mmachenry joined
19:03 connrs joined
19:03 mmachenry1 joined
19:03 jer1 joined
19:03 xcmw joined
19:03 tromp joined
19:04 BlueRavenGT joined
19:05 cannibalbob joined
19:07 jgertm joined
19:09 afarmer joined
19:11 dfeuer joined
19:13 mstruebing joined
19:13 dm3 joined
19:15 bennofs1 joined
19:15 augur joined
19:15 dm3 joined
19:16 niteria joined
19:16 flatmap13 joined
19:20 {emptyset} joined
19:20 dm3 joined
19:22 cranej joined
19:23 takle joined
19:23 ski joined
19:23 jsgrant_om joined
19:23 jer1 joined
19:26 soniku joined
19:26 matthewbauer joined
19:27 deank joined
19:27 bennofs joined
19:29 <frew> I'm trying to figure out how to call https://hackage.haskell.org/package/gtk-0.14.2/docs/Graphics-UI-Gtk-Abstract-Widget.html#v:widgetSetTooltipText; it calls for a GlibString, and I can't seem to find a constructor for that
19:29 takle joined
19:35 <verement> frew: GlibString is a class, of which both Text and String are instances
19:36 <frew> yeah that's what I thought
19:36 <frew> but
19:36 <frew> oh wait...
19:36 <frew> "Maybe text0" with [Char]
19:36 <frew> I need Just
19:37 jer1 joined
19:38 <frew> ugh and now I'm back in haskell land. (`Expected type: IO [Char], Actual type: Maybe [Char]`
19:38 <Rembane> frew: Welcome back
19:38 <frew> ;)
19:41 iAmerikan joined
19:41 revprez_atlanta joined
19:42 balor joined
19:43 Guest58807 joined
19:44 Guest87369 joined
19:44 Hunter1_ joined
19:44 cyborg-one joined
19:45 Guest75772 joined
19:45 oish joined
19:48 mjora7 joined
19:50 viralstitch joined
19:51 marr joined
19:51 <frew> hm ok so I figured out how to set the tooltip, and I was trying to set it from within a callback since I need some of the values in the callback in the tooltip, but because the callback is an IO (I guess?) it errors when it's called from there
19:53 paolino__ joined
19:54 {emptyset} joined
19:55 locallycompact joined
19:57 epsilonhalbe joined
19:58 ski joined
19:59 fnurglewitz joined
19:59 xcmw joined
20:01 mbp joined
20:01 Levex joined
20:02 Destol joined
20:02 Plasma joined
20:03 pgiarrusso joined
20:04 jer1 joined
20:04 Robert__ joined
20:05 ironhide00_ joined
20:05 balor joined
20:06 chaosmasttter joined
20:07 flatmap13 joined
20:07 Gurkenglas joined
20:08 flatmap13 joined
20:10 Hjulle joined
20:10 cdg joined
20:10 dm3 joined
20:11 mmn80 joined
20:11 dm3 joined
20:12 umib0zu left
20:12 osa1 joined
20:12 osa1 joined
20:13 {emptyset} joined
20:13 pera joined
20:13 balor joined
20:14 Luke joined
20:14 soLucien joined
20:16 flatmap13 joined
20:17 iAmerikan joined
20:18 afarmer joined
20:18 raichoo joined
20:19 Robert__ left
20:19 Robert__ joined
20:20 Robert__ left
20:20 {emptyset} joined
20:21 rashmirathi joined
20:22 jer1 joined
20:23 tomphp joined
20:23 Itkovian joined
20:26 kmels joined
20:27 matthewbauer joined
20:28 Snircle joined
20:30 xcmw joined
20:31 danthemyth joined
20:33 dfeuer joined
20:34 fresheyeball joined
20:34 <fresheyeball> hello out there
20:34 <fresheyeball> I am giving this one more shot before I give up
20:34 msks joined
20:34 <fresheyeball> is it possible to write a function like this
20:34 buttbutter joined
20:35 <fresheyeball> prepay :: Monad m => (a -> m b) -> m (a -> b)
20:35 <fresheyeball> cuz it sure seeeeems like it
20:35 <lyxia> no
20:36 <fresheyeball> Djinn says no
20:36 <mniip> no
20:36 <mniip> consider m ~ Maybe
20:36 <mniip> how do you turn (a -> Maybe b) into Maybe (a -> b)
20:36 dmiles joined
20:37 <fresheyeball> mniip: strong counter example
20:38 michaelw joined
20:38 simukis joined
20:40 <Squarism> if i want to do database transactions is "tsession" the package to use? It doesnt have a git repo or a homepage link.
20:41 ski joined
20:41 rashmirathi joined
20:43 replay joined
20:43 ^bschafer1 joined
20:44 jer1 joined
20:44 taksuyu joined
20:45 <fresheyeball> mniip: what if we specialize this function to IO?
20:45 oisdk joined
20:45 <fresheyeball> prepay :: (a -> IO b) -> IO (a -> b)
20:48 <kadoban> I don't think that one is sensical either. You'd have to be able to yield a pure function, but what if one of the IO effects in the original is printing something depending on the value of type "a". You don't even have an ``a`` yet, but you have to do the effect already and give up a pure function.
20:48 <mniip> fresheyeball, then it gets worse
20:49 <mniip> you definitely cannot write that
20:50 ragepanda joined
20:50 tomphp joined
20:51 insitu joined
20:51 <fresheyeball> mniip: prepay f = return $ unsafePerformIO . f
20:51 <fresheyeball> is there a way I can do that more properly?
20:51 <mniip> no
20:51 <mniip> if we imagine unsafePerformIO doesn't exist
20:51 <mniip> then no
20:51 mbuf joined
20:51 ystael joined
20:52 ChaiTRex joined
20:53 oisdk joined
20:53 msks joined
20:56 oisdk joined
20:56 juanpaucar joined
20:56 {emptyset} joined
20:58 <thang1> Is there a way to restructure the problem to avoid having an unsafePerformIO in the first place?
20:59 ertesx joined
21:03 flipflop joined
21:04 <flipflop> hi
21:04 balor joined
21:04 sfcg joined
21:04 jer1 joined
21:05 <flipflop> is anybody here
21:05 <Gurkenglas> You can see previous discussion in the logs
21:05 Mibaz joined
21:06 tomboy64 joined
21:06 simukis_ joined
21:07 scovit joined
21:07 Luke joined
21:07 danthemy_ joined
21:07 flatmap13 joined
21:07 tomphp joined
21:08 slack1256 joined
21:09 <slack1256> any package that does import statement organisation?
21:09 <slack1256> for emacs if possible
21:09 <ertes> slack1256: haskell-mode can sort and align your imports automatically
21:10 <Mibaz> Can anyone explain the point of >> ? The internet says it's for "ordering operations"; I'm not quite grasping that.
21:10 <ertes> slack1256: haskell-sort-imports, haskell-align-imports
21:10 <slack1256> really? maybe I haven't see such function nor set up a key
21:10 <Boomerang> slack1256: stylish-haskell
21:10 <ertes> Mibaz: are you familiar with (>>=)?
21:11 <Mibaz> ertes: yes, I think I have my head around that. (I understand how >> works, just wondering why it exists)
21:11 <ertes> Mibaz: as a shortcut
21:11 <ertes> Mibaz: and sometimes (>>) can also be implemented more efficiently than (>>=)
21:12 <Mibaz> ertes: Is there some kind of motivating situation that comes up often that requires x >>= \_ -> y ?
21:12 <MarcelineVQ> ertes: do you know of any in isntances particular that's true for?
21:13 <tsani> Mibaz: do blocks
21:13 <ertes> Mibaz: no, because that's just an uglier version of (x >> y)
21:13 <ertes> MarcelineVQ: i think IO is such an instance
21:14 <Mibaz> ertes: right right, I was using it synonymously. "Is there some kind of motivating situation that requires >> ?"
21:14 <ertes> but it's hard to observe, because GHC will most likely optimise the (>>=) to the equivalent (>>) automatically
21:14 <ertes> Mibaz: tons of them: forever, traverse, …
21:14 path[l] joined
21:14 <ertes> err
21:14 <tsani> Mibaz: whenever you have a statement in a do block that doesn't use <-, it desugars to >>
21:14 <ertes> Mibaz: tons of them: forever, traverse_, …
21:15 <slack1256> > putStrLn "hello" >> putStrLn "how are you"
21:15 <lambdabot> <IO ()>
21:15 <slack1256> vs
21:15 <slack1256> > putStrLn "hello" >>= \_ -> putStrLn "how are you"
21:15 <lambdabot> <IO ()>
21:15 <Mibaz> tsani: Hm, interesting
21:15 zero_byte joined
21:15 ChaiTRex joined
21:15 <ertes> Mibaz: it's quite common to sequence two effects while ignoring their results
21:15 jutaro joined
21:15 crobbins_ joined
21:16 <ertes> putStrLn "Hello ..." >> putStrLn "... world"
21:16 <Mibaz> ertes: slack1256: Ok, I'm close to understanding. Could you give an example using Maybe where that's useful? (Maybe is simple to understand)
21:17 <ertes> Mibaz: 'guard'
21:18 ski joined
21:18 <ertes> @let half x = guard (r == 0) >> pure q where (q, r) = divMod x 2
21:18 <lambdabot> Defined.
21:18 <ertes> > half 4 :: Maybe Integer
21:18 <lambdabot> Just 2
21:18 <ertes> > half 5 :: Maybe Integer
21:18 <lambdabot> Nothing
21:18 <slack1256> ertes is the new slack1256
21:18 <* slack1256> stars to fade away
21:19 augur joined
21:19 sellout- joined
21:19 <Mibaz> ertes: ah, so would 'x >> \_ -> y' essentially mean "If the value in our chain isn't nothing at this point, then it is y"?
21:19 <Mibaz> ertes: Just y, of course.
21:20 <Mibaz> ertes: In the maybe monad. Sorry that code example was not good ;)
21:20 coot joined
21:20 <Mibaz> ertes: I'm talking about my code example, of course.
21:20 <ertes> Mibaz: unless you're in the ((->) e) monad, your expression is a type error
21:20 <ertes> heh
21:21 <ertes> Just _ >> my = my
21:21 <ertes> Nothing >> _ = Nothing
21:21 <Mibaz> ertes: Alright, I think I'm on board now.
21:21 <Mibaz> Thank you guys so much! You all rock, as always
21:22 <monochrom> I think >> was typo for >>=
21:22 stphrolland joined
21:22 {emptyset} joined
21:23 <athan> Hey all, anyone here familiar with monad-control?
21:24 <athan> I'm wondering if anyone here has needed `StT t a -> a` or `StM m a -> a` functions
21:24 <stphrolland> in this video: https://begriffs.com/posts/2017-04-09-monad-tutorial-workshop.html at -52:21 , I have a problem, the speaker explain that join can be define like join mma = mma >>= id but according to me and to ghci the id function is not a kliesli arrow, but an effectless function. Could you confirm, I'm puzzled, I'm afraid I miss the point.
21:25 <athan> so you can use `runInBase` more usefully
21:25 jer1 joined
21:25 <stphrolland> Is the speaker wrong on this point like I think he is, we cannot bind with the id function as second parameter ?
21:25 <athan> I'm considering forking it, and exposing the `StT`/`StM` types as a multiparam type variable, then making an `Extract` typeclass which would allow someone to work with those expectations
21:26 <ertes> athan: what would the latter do for IO or for ((->) e)?
21:26 <athan> because I'm not sure if all monadic-trans states could have _exactly one_ `a` given a `m a`
21:26 <athan> ertes: it's a class, so only the StT's which support it would actually do so
21:26 <athan> but I'm pretty sure those instances are just `id`
21:27 <athan> `type StM IO a = a`
21:27 <ertes> athan: well, Writer could support it, too
21:27 <athan> `type StM (Reader r) a = a`
21:27 <athan> ertes: yeah I think you're right
21:27 <athan> I'm just not sure if there would always be exactly _one_ subject value in any monadic value
21:29 <lyxia> athan: MaybeT has StT MaybeT a = Maybe a
21:30 <athan> Ahh perfect, thank you lyxia
21:30 <athan> that's why the Extractable class needs to be optional
21:31 <ertes> athan: please don't call the function 'extract' =)
21:31 mckeankylej joined
21:31 <athan> yeah :\ I need to think of a better one
21:31 <ertes> just a different one
21:31 <athan> `takerOuter`
21:31 tomphp joined
21:32 <ertes> extract :: (Comonad w) => w a -> a -- because of this one
21:32 <athan> yeah I'm familiar
21:32 <mckeankylej> Does applicative do not work? When I turn it on it still gives me an error than my applicative isnt a monad when I use it in a do block. I am also sure my code doesnt have any data dependencys
21:32 <athan> I'll relate it to the "Monadic Value" term
21:32 <ertes> mckeankylej: you need -XApplicativeDo, if you want that
21:33 <mckeankylej> ertes: {-# LANGUAGE ApplicativeDo #-} is at the top of my file
21:33 <lyxia> mckeankylej: ApplicativeDo is overly restrictive about what it accepts, that may be the issue
21:33 <ertes> mckeankylej: be sure that you don't write something like this: pure $ …
21:34 <lyxia> show us your code
21:34 <kadoban> mckeankylej: Can you lpaste an example and the error message?
21:34 augur joined
21:34 <ertes> mckeankylej: pure $ x + y = ($) pure (x + y), which does not match the pattern that ApplicativeDo expects
21:34 <ertes> pure (x + y) -- this is fine
21:35 cannibal_ joined
21:36 <mckeankylej> ertes: kadoban: lyxia: http://lpaste.net/355408
21:36 rashmirathi joined
21:36 <mckeankylej> the thing inside that do is not a monad
21:37 <lyxia> use return
21:37 <ertes> 'pure' should work though
21:37 <mckeankylej> lyxia: that didnt help
21:38 <lyxia> mckeankylej: then also try rewriting the first statement to "_ <- Form.static ..."
21:38 <lyxia> it should but it currently doesn't.
21:38 <mckeankylej> lyxia: wooooooo
21:38 <mckeankylej> Thats crazy to me that applicative do cant figure that out but thanks lyxia that worked
21:38 <ertes> ah, so it wants explicit bindings? that's really weird
21:39 <frew> I have an `IO Gtk.Widget` and I want to "get the widget out." I thought that I should use `liftIO w` to do that, but that gives a type error; any ideas? Code and error here: https://gist.github.com/frioux/b09aecbfdb7a3b5f53e6f36f14de91c2
21:39 <lyxia> mckeankylej: ApplicativeDo needs a lot of polishing. It's still very experimental.
21:40 <ertes> lyxia: 'pure' does work, i've verified
21:40 dm3 joined
21:40 <ertes> it has worked for me in the past, too
21:42 <lyxia> oh, it does. My bad. I guess I was confused with another issue involving rebindable syntax.
21:42 SeMas joined
21:45 jer1 joined
21:46 theelous3 joined
21:47 uglyfigurine joined
21:48 Itkovian joined
21:48 <frew> ok so I'm trying to get this widget "out" of the IO, and I used `unsafeDupablePerformIO`; and everything typechecks and runs, but as far as I can tell the code is not running
21:49 <frew> https://gist.github.com/frioux/b09aecbfdb7a3b5f53e6f36f14de91c2#file-code-hs-L27-L31 <-- current code
21:51 fotonzade joined
21:52 <lyxia> why unsafe...PerformIO rather than w <- mem
21:52 hiratara joined
21:53 sfcg joined
21:53 <monochrom> XYX problem: Extract out of IO so you can later inject into IO again.
21:53 clamchowder joined
21:54 <frew> lyxia: I dunno, I just searched hoogle for :: IO a -> a
21:54 <frew> monochrom: I don't follow
21:54 <kadoban> frew: Anything with unsafe in the name you probably shouldn't be using unless you have a strong reason really.
21:54 <frew> I believe it
21:54 <thang1> I'm guessing it's a riff off of the XY problem. You ask for X instead of how to do Y? It's a common problem among beginners
21:55 <Tuplanolla> @where xy
21:55 <lambdabot> http://xyproblem.info/
21:55 <frew> thang1: I know what he means, but I thought he was implying a solution too
21:55 <frew> lyxia: https://www.haskell.org/hoogle/?hoogle=PerformIO ?
21:56 <lyxia> don't look for a IO a -> a
21:56 <clamchowder> Hello #haskell, I'm trying to understand the pandoc code because I want to write a new Reader. Does the pandoc deconstructed youtube video (https://www.youtube.com/watch?v=FEFETKhhq8w) describe the current version well? Or is outdated?
21:56 dan_f joined
21:56 <clamchowder> Or is *it outdated?
21:57 tomboy64 joined
21:58 patbecich joined
21:58 <jle`> frew: any 'IO a -> a' is a hack
21:58 <lyxia> frew: w <- mem is how you bind w to the widget.
21:58 <frew> jle`: so how do I do what I want to do?
21:58 <c_wraith> frew, the rule with any function with "unsafe" in the name is that you need to know what is unsafe about it before you can even consider using it. (and then you still need to consider it carefully)
21:58 <jle`> frew: what do you want to do with the widget?
21:58 <* frew> looks up w <- mem
21:59 <frew> jle`: set a tooltip in a callback where the data for the widget is being loaded
21:59 <jle`> frew: what function do you use to set the tool tip?
21:59 <jle`> if you're in an IO do block, you can bind the result of your widget-maker with <-
21:59 <frew> `Gtk.widgetSetTooltipText w str`
21:59 <jle`> are you familiar with how to work with IO in haskell?
21:59 <frew> I am not
21:59 <jle`> ah yeah, that might be a good first step
21:59 jmcarthur joined
21:59 <frew> I know :/
22:00 <frew> but I'm *soo* close ;)
22:00 <jle`> what is the type of widgetSetTooltipText w str?
22:00 <jle`> do you know how do blocks work?
22:00 <frew> I think so?
22:00 <monochrom> http://www.vex.net/~trebla/haskell/IO.xhtml
22:00 <jle`> an 'IO Widget' is not a widget
22:00 <frew> jle`: fwiw the code is here: https://gist.github.com/frioux/b09aecbfdb7a3b5f53e6f36f14de91c2#file-code-hs-L27-L31, the function is https://hackage.haskell.org/package/gtk-0.14.2/docs/Graphics-UI-Gtk-Abstract-Widget.html#v:widgetSetTooltipText
22:00 <frew> monochrom: thanks, loading
22:01 <frew> jle`: I know that, that's why I was doing this whole thing
22:01 <frew> (note: I am probably totally confused)
22:01 <jle`> it's ok :) it will all be clear shortly
22:01 romank joined
22:01 {emptyset} joined
22:03 twanvl joined
22:03 daniel-s joined
22:04 ski joined
22:05 <Tuplanolla> Should I expect `sum (replicate n dx) <= n * dx` to hold with IEEE 754?
22:06 <frew> hm
22:06 <frew> jle`: so this would make sense to me if setTooltipText wanted an IO
22:06 jer1 joined
22:07 <* frew> keeps reading
22:07 sproingie joined
22:07 sproingie joined
22:08 <monochrom> Tuplanolla: round-to-even is the default, but it means rounding up sometimes, and you may get >
22:08 chilli joined
22:08 <frew> huh ok
22:08 <c_wraith> frew, the big thing to learn is that there are ways to apply a function that takes a non-IO value to an IO value, and putting the result into IO.
22:08 <frew> so this makes more sense to me, but as far as I can tell nothing is happening, still
22:08 <Tuplanolla> How about with a little margin, monochrom?
22:09 <* frew> updates gist
22:09 <monochrom> Then it works. The hard part is setting a good margin. :)
22:09 <Tuplanolla> At least `==` may not hold even with a great margin.
22:10 <frew> so here's what I have now: https://gist.github.com/frioux/b09aecbfdb7a3b5f53e6f36f14de91c2#file-code-hs-L23-L30
22:10 <frew> it compiles and runs without errors
22:10 <frew> but the tooltip never shows up, making me think that something is not ever running
22:10 <frew> presumably something is too lazy
22:10 <monochrom> In general, floating-point-op(x, y) = round(ideal-math-op(x, y)). "round" depends on rounding mode, a config thing, but default is round-to-even and no one really bothers to change it behind your back.
22:10 <frew> guessing it has something to do with the _ <-
22:10 ski joined
22:11 <chilli> noob here, trying to read frames from a bytes stream, frames start with a Word32 length n and then n bytes .. i have a function that reads the length and then the data, how can i loop this over the bytestream to read a list of frames?
22:11 <Tuplanolla> Well...
22:12 <Tuplanolla> I don't really see how to construct a counterexample.
22:12 iAmerikan joined
22:12 litchblade joined
22:14 fosterite joined
22:15 <vimalloc> Haskell and funtional programming noob here, looking for feedback if anyone is feeling particularly bored at the moment :)
22:15 mmachenry joined
22:15 NoCreativity joined
22:15 <chilli> vimalloc: i'll take a look
22:15 <vimalloc> I'm building a solver for a bridges game. So far I just have how I am encoding the data, as well as a function to print it out in a nice readable manor. I would love any critiques of things I am doing stupidly or not in a very 'haskell-y' way. https://gist.github.com/vimalloc/369f979c8c9d5993694fcc5691d3efb4
22:15 <vimalloc> thx chilli :)
22:15 <chilli> vimalloc: but i'm also a noob
22:15 <vimalloc> hehe
22:16 JeanCarloMachado joined
22:17 LuckyRawApe joined
22:17 <Tuplanolla> Drop those aliases and look into `Enum` for `Value` things, vimalloc.
22:18 <vimalloc> Tuplanolla: Will do
22:18 Levex joined
22:18 <kadoban> chilli: type Islands = [Island] strikes me as probably not a great idea usually
22:18 <chilli> http://lpaste.net/355409 -- anyone got a minute?
22:18 <c_wraith> chilli, the general strategy is to split the bytestring before recursing.
22:19 <kadoban> Oh, that was to vimalloc, wrong person.
22:19 <vimalloc> :)
22:19 <Cale> vimalloc: getIslandAtPoint's case expression looks like it's the identity
22:19 Wizek_ joined
22:19 <chilli> c_wraith: i feel i could do this with a regular list, but using the Get reader is confusing me a lot
22:20 <mniip> vimalloc, bridges game?
22:21 <Cale> mniip: https://www.chiark.greenend.org.uk/~sgtatham/puzzles/js/bridges.html
22:21 <vimalloc> mniip: These http://www.puzzle-bridges.com/
22:21 <c_wraith> chilli, oh, you're using a serialization library? that simplifies things in some ways.
22:21 <mniip> ooh
22:21 <vimalloc> Play em all the time when I'm board at work :)
22:21 <mniip> I remember seeing those before
22:21 romank joined
22:22 <vimalloc> Cale: identity as in a == a?
22:22 <chilli> c_wraith: yeah, using Data.Binary .. it was all going well until I needed to loop
22:22 <chilli> vimalloc: identity as in `id`
22:22 <chilli> it always returns the input
22:22 <Cale> vimalloc: As in id x = x
22:23 <Cale> vimalloc: That is, you could also just write getIslandAtPoint islands p' = find (\(Island p _) -> p == p') islands
22:23 <vimalloc> Cale: Oooh. I get it. Thx
22:24 <Cale> You could also write pointBetweenBridges using find.
22:25 <Cale> pointBetweenBridges p = find (pointBetweenBridge p)
22:25 <c_wraith> chilli, how comfortable are you with the monad interface?
22:25 conal joined
22:26 <vimalloc> Ah ha! I could indeed.
22:26 <c_wraith> chilli, or in other terms, with using do notation?
22:26 <Cale> vimalloc: Your question about how to solve the problem of invalid bridges using types is interesting. Perhaps you could represent a bridge using a single starting point and a direction
22:27 albertus1 joined
22:27 jer1 joined
22:27 <chilli> c_wraith: just finding my way, i get the concept but the syntax often surprises me
22:27 <mniip> hum
22:27 <vimalloc> Cale: That's a very interesting idea, I didn't think of that. I'll ponder it some
22:27 <mniip> getting a deja-vu here
22:27 <thang1> Cale: I feel like representing valid bridges using types is a very slippery slope into full on type programming and dependent types
22:27 <Cale> But then you would either need to know where the islands are to know where the bridge ends, or the length of the bridge
22:28 <mniip> probably one of my british friends introduced me to that website before
22:28 <Cale> thang1: Nah, in this case, I think there's some fat in the representation that we could trim.
22:28 <thang1> Ah, okay.
22:28 <c_wraith> chilli, well, Get provides a helpful function - https://hackage.haskell.org/package/binary-0.8.5.1/docs/Data-Binary-Get.html#v:isEmpty
22:29 <Cale> mniip: I too am experiencing a little bit of deja vu -- I think someone else has asked about this very problem at some point in the past.
22:30 juanpauc_ joined
22:30 <chilli> c_wraith: thanks, i'll give that a go
22:30 acidjnk22 joined
22:31 <c_wraith> chilli, so readChunks will look basically like.. check to see if the stream is empty. if it is, return []. if it's not, read a chunk, recursively call readChunks, and return the combined result list.
22:31 <frew> ok so I think I understand monads, and I *think* my code makes sense wrt monads, but it looks like this line of my code (https://gist.github.com/frioux/b09aecbfdb7a3b5f53e6f36f14de91c2#file-code-hs-L37) is simply not running; it's hard to tell since I'm not sure how I could debug further, but the tooltip is not showing up and placing that line of code elsewhere (with a static string) works
22:31 <c_wraith> chilli, that description might actually be longer than the code. :)
22:32 patbecich joined
22:33 <Cale> frew: Do the other occurrences of 'pollingGraphNew' work?
22:33 <frew> I have none with tooltips yet
22:33 <frew> everything works except for the tooltip right now
22:33 <Cale> Maybe stick a putStrLn in there just so that you can be sure it's running.
22:34 <frew> I am pretty sure it is since the graph itself is showing values
22:34 <frew> but not a bad idea
22:34 <frew> sec
22:34 <Cale> ah, fair enough
22:34 <Cale> If it's running, then the reason for not seeing the tooltip probably has more to do with GTK than with anything on the Haskell side of things
22:35 matthewbauer joined
22:35 <frew> yeah added putStrLn tooltip and it's printing values every second.
22:36 <c_wraith> I wonder if you are just not allowed to change UI structures during a callback.
22:36 uglyfigurine joined
22:36 <c_wraith> or some limited form of that.
22:36 <frew> I just don't see how that could be implemented?
22:36 eschnett joined
22:36 afarmer joined
22:37 <c_wraith> frew, it could be a thread thing.
22:37 <frew> yeah...
22:37 <frew> that would make good sense actually
22:37 Koterpillar joined
22:37 <frew> because at least the weather widget could be really slow
22:37 <chilli> c_wraith: got it! thanks for the help
22:37 <c_wraith> chilli, nice.
22:38 <frew> ok, I'll take it to the author of the widgets, thanks folks
22:39 <vimalloc> This is the code with all your suggestions: https://gist.github.com/vimalloc/369f979c8c9d5993694fcc5691d3efb4
22:39 <vimalloc> Thanks guys :)
22:39 Koterpillar joined
22:39 <vimalloc> One last question, if you don't mind. Is having those nested case statements bad practice? I dunno what it is, but I don't really like looking at that code.
22:40 <kadoban> vimalloc: ``minimum [y1, y2]`` is a little funny. You can use ``min y1 y2`` for that
22:40 <vimalloc> kadoban: cool, thanks :)
22:40 <kadoban> It works, it's just a little roundabout looking
22:41 <vimalloc> ok
22:41 {emptyset} joined
22:42 <kadoban> vimalloc: One thing in the code that worries me is ...
22:42 <kadoban> > minimum []
22:42 <lambdabot> *Exception: Prelude.minimum: empty list
22:42 aarvar joined
22:42 <vimalloc> That's a nifty bot
22:42 <kadoban> vimalloc: So pprint and etc. will just crash if you have empty lists. I'm not sure if that's as it should be or if there's a better way to handle that (depends on what this all does I think, if empty lists are ever expected)
22:42 <c_wraith> vimalloc, I can understand your objection to that nested case, but the only way I'd consider changing that is pulling those pieces into helper functions.
22:42 Itkovian joined
22:43 <c_wraith> vimalloc, there's nothing inherently wrong with nested cases, but that example is pretty dense because of how much else is happening
22:44 <vimalloc> kadoban: Thanks for the heads up there. I'll think on that. An empty list mean an invalid puzzle, but having a better error message then just crashing would obviously be better
22:45 <vimalloc> c_wraith: Awesome, thanks for the feedback
22:45 <kadoban> Yeah, sometimes crashing is fine, sometimes it's not that great. Something in the 'safe' package could help (even if you just want to crash with a more specific error)
22:45 <Tuplanolla> One good approach would be to try to figure out how an empty puzzle would make sense, vimalloc.
22:46 umib0zu joined
22:46 Zialus joined
22:48 <Tuplanolla> For example it is completely reasonable to say that a zero-dimensional ball has a volume of one and a surface area of zero.
22:48 jer1 joined
22:48 mmachenry joined
22:49 <thang1> Is there any particular reason for the choice of all the symbols in this paper or did they just choose them 'cause they look pretty? https://pdfs.semanticscholar.org/fec6/b29569eac1a340990bb07e90355efd2434ec.pdf
22:49 romank joined
22:51 <dmwit> thang1: pretty
22:51 <entuland> thang1, what symbols do you refer to exactly?
22:51 tathougies joined
22:51 <dmwit> (the silly names are for aesthetics, too)
22:51 ski joined
22:52 <dmwit> But people will generally recognize the more formal names. Anamorphism, catamorphism, hylomorphism are all well-known here.
22:52 <jle`> frew: not sure if your question was answered, but regarding what you pinged me with earlier
22:52 <jle`> you can turn any function that takes an 'a' into a function that takes an 'IO a'
22:52 <thang1> On page 15, for example, "a simple calculation shows that average = DIV * (| ( O* downtriangle (+) * id|| weirdPi uptriangle .....
22:52 <jle`> using fmap/bind/etc. and friends
22:52 <dmwit> :t (=<<)
22:52 <lambdabot> Monad m => (a -> m b) -> m a -> m b
22:53 <thang1> dmwit: I have no issue with the names. I was just wondering if there was any prior mathematical precedent to the downtriangle, uptriangle, weird Pi variant, (| |) style brackets, etc
22:53 <dmwit> :t fmap -- or if your function doesn't already do IO...
22:53 <entuland> thang1, most of the symbols there are very precise mathematical symbols
22:53 <lambdabot> Functor f => (a -> b) -> f a -> f b
22:53 <entuland> I don't know if they added their own there thang1
22:54 <dmwit> thang1: The symbols have been around a long time. I don't think their connection with the various kinds of morphisms is a convention anywhere but this paper.
22:54 <entuland> but they surely serve a very precise purpose, perhaps they didn't "invent" any new symbol there
22:54 <dmwit> thang1: tl;dr: pretty =)
22:55 <thang1> Right. I knew they didn't invent any new symbols, I was just curious as to whether the symbols had a prior established connection to the *isms or if they just chose symbols and stuck them into the isms to get all their code to look like APL :p
22:55 e14 joined
22:55 splanch joined
22:55 <entuland> for sure they are using at least one symbol with a double meaning there
22:56 <entuland> the "cross" (so to say) symbol besides of Maarten Fokkinga at page 1
22:56 <entuland> is also used as the symbol for the bifunctor at chapter 3
22:56 <mniip> now I want to make a nonogram solver in haskell
22:57 <dmwit> mniip: Do you want to make it, or do you want it to exist?
22:58 <mniip> implementing it sounds like an interesting task
22:58 <dmwit> yeah =)
22:58 refold joined
22:58 cranej joined
22:59 <thang1> What's a nonogram solver?
23:00 <Tuplanolla> @google ioccc nonogram
23:00 <lambdabot> http://www.ioccc.org/2011/hamaji/hint.html
23:00 <lambdabot> Title: Best solved puzzle
23:02 juanpaucar joined
23:03 <thang1> oooh got it
23:04 alveric4 joined
23:05 louispan joined
23:07 <mniip> thang1, stuff like this http://tcpst.net/i3kx.png
23:09 jer1 joined
23:09 <thang1> that's pretty cool. I'd like to see a good solver for that in Haskell
23:09 <thang1> (I have to go before rush hour kicks in and totally messes up traffic)
23:10 matuszak joined
23:11 romank joined
23:11 patbecich joined
23:11 Taslem joined
23:15 soniku joined
23:16 <Cale> mniip: I'd really like to see a good nurikabe generator
23:18 meandi joined
23:19 carlomagno joined
23:19 mmachenry joined
23:19 rknLA1 joined
23:21 Ptival joined
23:23 Levex joined
23:24 conal joined
23:25 {emptyset} joined
23:26 romank joined
23:26 nakal_ joined
23:27 <entuland> well this is weird, the link there on ioccc pointing to codegolf.com doesn't work
23:27 <entuland> pinging it from the command line resolves to localhost :/
23:27 <entuland> and I don't have anything weird in my hosts file
23:28 <entuland> I must have a screwed up DNS
23:28 <Maxdamantus> fwiw, it resolves to 127.1 fo me too
23:28 <entuland> really?
23:29 <entuland> there must be something weird going on there
23:29 matthewbauer joined
23:29 <entuland> because I swear I opened that site sometimes in the past
23:29 jer1 joined
23:29 maambmb joined
23:30 <entuland> uhm... even some online tools return localhost for that domain...
23:32 revprez_atlanta joined
23:32 <Maxdamantus> Yes, it's quite definitely set to resolve to 127.1
23:33 e14 joined
23:33 <Maxdamantus> it's cached in the tld server things, and the nameservers it points to alsoreturn 127.1
23:34 <entuland> great
23:34 cables joined
23:36 wizwizwizwiz joined
23:37 ski joined
23:38 g0d355__ joined
23:38 markasoftware joined
23:38 fotonzade joined
23:38 path[l] joined
23:39 <wizwizwizwiz> i'm realizing that as i write a sql-backed web application that sql doesn't necessarily gracefully handle multiple simultaneous users trying to manipulate the database
23:39 Noldorin joined
23:39 <wizwizwizwiz> that and establishing ORM is redundant and kind of a waste of time
23:40 <wizwizwizwiz> so i am wondering whether it's a common thing to model data, especially in the style of relational databases in haskell
23:40 erisco joined
23:40 <wizwizwizwiz> and then have some kind of persistent storage and query system, sort of in the general style of sql
23:40 <koala_man> isn't that the CI in ACID?
23:41 <wizwizwizwiz> well, the problem is that the "types" which you use in your sql database may not be adequate
23:41 <koala_man> A and I I guess.
23:41 <koala_man> how do you mean?
23:42 <koala_man> are you building more complex types spanning multiple tables?
23:42 theDon_ joined
23:42 <wizwizwizwiz> i may not necessarily be able to represent my type adequately in sql
23:43 <mniip> noooooo
23:43 <mniip> I messed something up and got a conflict
23:43 <wizwizwizwiz> consider a database of students
23:43 <wizwizwizwiz> and classes and grades
23:43 <koala_man> ok
23:44 <wizwizwizwiz> with multiple users modifying each table simultaneously
23:44 <robkennedy> Has anyone looked into something like {-# language OverloadedStrings! #-} that would have compile time error for fromStrings that didn't parse? Is there a deeper reason for that?
23:44 <koala_man> wizwizwizwiz: seems right up sql's alley. go on
23:44 <wizwizwizwiz> it isn't hard to imagine various problems which resemble issues "multithreading"
23:44 <robkennedy> *is there a deeper reason for why that isn't true
23:44 <wizwizwizwiz> issues from "multithreading"
23:45 <wizwizwizwiz> for instance an administrator might need to add or remove students from a table
23:45 markus1209 joined
23:45 <wizwizwizwiz> and immediately simultaneously a professor might be adding or removing students from a class grade table
23:45 markus1219 joined
23:45 <wizwizwizwiz> (possibly with blank, unfilled grades)
23:46 <koala_man> wizwizwizwiz: I see. Your operations are not in the same transaction.
23:46 <wizwizwizwiz> now, the administrator could have a telephone call with the professor
23:46 <wizwizwizwiz> and coordinate
23:46 <robkennedy> The current implementation leads me to believe that OverloadedStrings comes at a cost. It seems like OverloadedStrings should be template haskell
23:47 <erisco> robkennedy, there isn't supposed to be parse errors
23:47 <wizwizwizwiz> but then we need lots of phone calls and soforth, and really if things are being handled well, the software should prevent screw-ups
23:47 louispan joined
23:47 <monochrom> Two conflicting administrators may be phoning the prof, and now the prof has a race condition. :)
23:47 <robkennedy> Ericso: life is tough, and then you die
23:47 <wizwizwizwiz> right :)
23:48 <erisco> robkennedy, if there is a parse error then your type isn't really a string
23:48 <robkennedy> "if it compiles" is a promise
23:48 <koala_man> wizwizwizwiz: in sql, all operations that should be performed as a unit needs to be in a transaction. that's tricky in a web interface because clicking buttons are not part of the transaction
23:48 <wizwizwizwiz> well nevermind the web aspect
23:49 <erisco> if you want to convert a string to some other type look at Read or other deserialisation libraries
23:49 <koala_man> wizwizwizwiz: it's not a problem on the sql side alone. if you look up a student and then add a grade for that student, that student is guaranteed not to be deleted in the mean time
23:50 jer1 joined
23:50 <monochrom> sql does have this "transaction" thing for atomicity of compound operations like this lookup-then-update.
23:51 <glguy> When did it get those?
23:51 <erisco> robkennedy, because the string is a constant I assume that it is evaluated aggressively. I am not sure, but it is certainly possible to do so
23:51 <monochrom> When it got "BEGIN TRANSACTION"?
23:51 patbecic` joined
23:52 <wizwizwizwiz> except that you might do something like
23:52 <wizwizwizwiz> grab some data from a sql database
23:52 <wizwizwizwiz> run a task which takes four hours
23:52 <wizwizwizwiz> then update that data in the sql database
23:53 alasi joined
23:53 <wizwizwizwiz> ... so that's a four hour transaction?
23:53 YongJoon joined
23:53 <monochrom> Yes.
23:54 <wizwizwizwiz> and it may be difficult to determine where in the database modifications occur
23:54 <monochrom> IIRC the catch is when you finally say "END TRANSACTION" the database is entitled to say "fail".
23:54 <wizwizwizwiz> i'm imagining that this ends up behaving like the entire db being locked
23:54 <wizwizwizwiz> so if, during that four hour period, if somebody tries to do something, they are out of luck
23:55 <monochrom> No, it's more funny than that.
23:55 <wizwizwizwiz> ok, what then?
23:55 <koala_man> wizwizwizwiz: determining where modifications occur is the DB's problem, and they do it very well.
23:56 <monochrom> During the lengthy transaction, the database can do a multiverse thing. When you end, the database tries to merge. But it can say "I don't know how to merge, I need a drink".
23:56 <wizwizwizwiz> haha
23:56 <wizwizwizwiz> ok
23:56 <koala_man> in that case, it'll be (to the state of the database) as if you never did anything. even if you deleted a bunch of stuff before you started this four hour process.
23:57 <monochrom> In fact IIUC the multiverse thing is why PostgreSQL needs you to run a GC command every once in a while.
23:57 umib0zu joined
23:57 rashmirathi joined
23:58 juhp joined
23:58 <monochrom> But yeah, it's still atomic. Atomically success, or atomically fail. All or nothing. Better than something.
23:58 infinity0_ joined
23:58 infinity0_ joined
23:59 <monochrom> Whereas Haskell's STM is a "failure is not an option" and it may keep retrying forever.