<    April 2017    >
Su Mo Tu We Th Fr Sa  
 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  
00:00 <Tuplanolla> :t let fap = fmap fmap fmap in ap fap fmap -- I prefer this form though.
00:00 <lambdabot> Functor f => (b -> b) -> f b -> f b
00:01 <Tuplanolla> It rolls right off the tongue.
00:01 infinity0 joined
00:02 <Welkin> : flip const fmap
00:02 <Welkin> :t flip const fmap
00:02 dfordivam joined
00:02 <lambdabot> error:
00:02 <lambdabot> • Ambiguous type variable ‘f0’ arising from a use of ‘fmap’
00:02 <lambdabot> prevents the constraint ‘(Functor f0)’ from being solved.
00:02 <Welkin> o.o
00:03 <Welkin> :t fmap (flip const)
00:03 <lambdabot> Functor f => f b -> f (c -> c)
00:03 <thang1> :t fmap $ flip const
00:03 <lambdabot> Functor f => f b -> f (c -> c)
00:03 <Welkin> :t fmap (flip const . (+1))
00:03 <lambdabot> (Num b, Functor f) => f b -> f (c -> c)
00:03 <thang1> :t fmap . flip const
00:03 <lambdabot> Functor f => b1 -> f b -> f b
00:04 infinity0 joined
00:06 sgronblo joined
00:07 infinity0 joined
00:07 blym_ joined
00:09 infinity0 joined
00:12 <MonadHendrix> > Just (3 / 0)
00:12 <lambdabot> Just Infinity
00:12 <MonadHendrix> heh
00:12 Achylles joined
00:13 <thang1> > Just (-3 / 0)
00:13 <lambdabot> Just (-Infinity)
00:13 <thang1> neat. Do we have NaN too?
00:13 <thang1> Just (0 / -0)
00:14 <thang1> > Just (0 / -0)
00:14 <lambdabot> error:
00:14 <lambdabot> Precedence parsing error
00:14 <lambdabot> cannot mix ‘/’ [infixl 7] and prefix `-' [infixl 6] in the same infi...
00:14 <ExpHP> ba dum tish
00:14 <MonadHendrix> > Just (0 / (-0))
00:14 <lambdabot> Just NaN
00:14 NeverDie joined
00:14 <thang1> Haskell is great
00:14 <Welkin> for great good
00:15 <thang1> Now I got a particular question I'm just curious about
00:15 <thang1> If I write a function "extend" which takes one string and repeats it over and over to the length of a second string
00:15 StoneToad joined
00:15 <Welkin> :t extend
00:15 <lambdabot> error: Variable not in scope: extend
00:15 Aruro_ joined
00:15 sgronblo joined
00:15 <Welkin> :t Control.Comonad.extend
00:15 <lambdabot> Control.Comonad.Comonad w => (w a -> b) -> w a -> w b
00:15 <Welkin> :D
00:16 <thang1> eg: "lmao" and "this is war!" -> "lmaolmaolmao"
00:16 <glguy> :t zipWith const . cycle
00:16 <lambdabot> [c] -> [b] -> [c]
00:16 <thang1> Yeah, I know that part
00:16 <thang1> (which I'm mostly familiar with how that works)
00:16 <thang1> But if I want it to be -> "lmao lm aolm"
00:16 <thang1> how do I do that?
00:16 mr_sm1th joined
00:17 <Welkin> check for spaces
00:17 <Welkin> and keep them
00:17 <thang1> I ended up writing a 4 line go function
00:17 mels joined
00:17 <Welkin> you can fold over the first string cycled infinitely
00:17 newhoggy joined
00:17 <thang1> I know you check for spaces and keep them, I was just wondering if I can avoid going from a very concise and elegant "zipWith const . cycle" -> 4 line recursive go function
00:17 <Welkin> > cycle "habari"
00:17 <lambdabot> "habarihabarihabarihabarihabarihabarihabarihabarihabarihabarihabarihabarihab...
00:18 <Welkin> you can write a fold
00:18 <glguy> first thought:
00:18 <glguy> > set (partsOf (traverse . filtered (not . isSpace))) (cycle "lmao") "this is war"
00:19 <lambdabot> "lmao lm aol"
00:19 <thang1> oooh
00:20 <ExpHP> :i partsOf
00:20 <ExpHP> :t partsOf --doh
00:20 <lambdabot> Functor f => Traversing (->) f s t a a -> LensLike f s t [a] [a]
00:20 <ExpHP> ohdear
00:20 vaibhavsagar joined
00:20 <thang1> lol
00:20 <thang1> that would explain why that was not my first thought
00:22 <Welkin> too much lens
00:22 <glguy> > snd $ mapAccumL (\ (x:xs) y -> if y == ' ' then (x:xs,y) else (xs,x)) (cycle "lmao") "this is war"
00:22 <lambdabot> "lmao lm aol"
00:22 <Welkin> aol!?!
00:22 <thang1> That's the correct output :p
00:24 Rodya_ joined
00:24 <Welkin> :t mapAccumL
00:24 <lambdabot> Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c)
00:25 <Welkin> kind of a fold
00:25 texasmynsted joined
00:25 <Welkin> I've never sen mapAccumL used though
00:25 <Welkin> seen*
00:27 <thang1> I didn't even know it existed
00:27 <glguy> > foldr (\x next (y:ys) -> if x == ' ' then x : next (y:ys) else y : next ys) (const "") "this is war" (cycle "lmao")
00:27 <lambdabot> "lmao lm aol"
00:27 Kampala joined
00:29 <thang1> :t next
00:29 <lambdabot> RandomGen g => g -> (Int, g)
00:29 <thang1> wut
00:30 hucksy joined
00:31 <glguy> > unfoldr (\(xs,y:ys) -> uncons xs <&> \(x,xs') -> if x == ' ' then (x,(xs',y:ys)) else (y,(xs',ys))) ("this is war", cycle "lmao")
00:31 <lambdabot> "lmao lm aol"
00:31 <glguy> that about does it
00:31 <glguy> thang1: next is locally bound by the anonymous function
00:32 beanbagula joined
00:32 <thang1> ooh so it's not actually the random generator function, it's just in the anonymous function. Got it. Got confused there for a second :p
00:33 athan joined
00:35 <ExpHP> y u no exist (Control.Monad.<<)
00:35 <ExpHP> <* is ugly
00:35 <Welkin> flip (>>)
00:35 <thang1> :i <&>
00:35 a3Dman joined
00:35 <Welkin> even though it's not the same as <*
00:35 <ExpHP> i was about to say...
00:36 <Welkin> it is similar
00:36 <thang1> shouldn't flip (>>) be (<<) ? /s
00:36 <Welkin> slightly different
00:36 <ExpHP> a >> b and b << a have quite different meanings for parsers
00:36 <thang1> (I know, it was a joke about semantic meaning of 'flip' in english)
00:37 <glguy> << isn't defined to mean anything, so if it's different or not is up to how you've decided to define <<
00:37 <ExpHP> goddamn invisible internet sarcasm tags
00:37 <thang1> What are ya talking about? I used /s. That's about as explicit as you can get
00:37 <Welkin> glguy: in this case (<<) = flip (>>)
00:38 andyhuzhill joined
00:38 <glguy> Right, but like you mentioned, that's different from (<*)
00:39 aarvar joined
00:39 <ExpHP> this is almost as crazy as 'unless' being defined in Control.Monad
00:39 <thang1> :t unless
00:39 <lambdabot> Applicative f => Bool -> f () -> f ()
00:39 <glguy> which is crazy?
00:39 <thang1> why the fuck is that in Control.Monad?
00:40 <ExpHP> ^
00:40 roconnor joined
00:40 <glguy> Because Monad is older than Applicative
00:40 <ExpHP> history schmistory
00:40 <thang1> move fast, break shit, avoid success at all costs
00:40 <thang1> "haskell's not really sorta kinda never mindish" motto
00:40 <MonadHendrix> shout out to Applicative for letting me do cool things
00:41 cheater joined
00:41 <Welkin> what about Arrow?
00:41 <thang1> I'll understand it eventually... I'm still on chapter 11 of Haskell from first principles
00:41 <ExpHP> shout out to Arrow for giving nice functions to use on regular functions
00:41 <ExpHP> and the other bit
00:42 muesli4 joined
00:42 <thang1> For me the biggest shoutout so far is actually to pattern matching
00:42 <MonadHendrix> yeah thats pretty great too
00:43 <thang1> being able to just define my different cases for things is amazing. Makes working in another language far uglier and more stupid after you're used to it
00:43 andyhuzhill joined
00:43 <thang1> if (this isn't zero) do stupid shit; if (that isn't wrong) do other stupid shit; while (things aren't fucked up) fuck shit up; if (not enough semicolons) maore semicolons;;;;;;;;;;
00:43 <thang1> so dumb. Just let me pattern matchings
00:44 mzabani joined
00:45 <MonadHendrix> sometimes ill go write something small in python because type coersion feels so naughty
00:45 <ExpHP> ooh la la
00:46 HoierM_ joined
00:46 LHoT joined
00:46 <MonadHendrix> bay area haskell vids just came out, shame the sound is so abysmal
00:46 <thang1> Do they have subtitles or any captioning for things?
00:47 <thang1> I'm pretty deaf so audio is always abysmal :p
00:47 <MonadHendrix> lol
00:47 ejay joined
00:48 <mzabani> Hi everyone! In Reflex/Reflex-Dom, how can I create a function f :: (a -> [b]) -> Dynamic t a -> [Dynamic t b] ?
00:49 ystael joined
00:49 <MonadHendrix> my calculator works woo https://ptpb.pw/1n1k/hs
00:49 <Lokathor> how do i tell stack to make a new project with a given name in the present working directory?
00:49 <Lokathor> "stack new packageName ." doens't seem to work
00:49 <MonadHendrix> stack new <name>
00:50 <MonadHendrix> no .
00:50 <Lokathor> right but that makes it in a subdirectory
00:50 <lyxia> stack new --bare
00:50 cheater joined
00:51 <Lokathor> nice
00:51 <lyxia> (you can find it under stack new --help)
00:51 <ExpHP> (cue 15 second wait as everybody tries it out and has to wait for fifteen indices to download)
00:51 <MonadHendrix> stack new <name> && mv <name>/* .
00:51 <MonadHendrix> :^
00:51 <MonadHendrix> smartparens-strict mode wont let me type smileys
00:52 <Welkin> ExpHP: or just use nix and you never need to compile libraries again :D
00:52 <ExpHP> Welkin: What if they update
00:52 <thang1> MonadHendrix: C-q <key>
00:52 <Lokathor> or you use windows have have all C library support break every single update :/
00:52 <thang1> C-q means "disable everything and let me type what I fucking wanna type"
00:52 <MonadHendrix> :^)
00:52 <Lokathor> rust looks good compared to haskell just because it has a good windows story :/
00:52 <MonadHendrix> nice
00:53 <Welkin> Lokathor: they are not meant for the same use case...
00:53 <thang1> Lokathor: Rust looks good compared to Haskell because it's designed to be successful as fast as possible and is backed by a lot more money than haskell is
00:53 <ExpHP> oh my god it's another gabriel thing
00:53 <MonadHendrix> haskell community > rust community
00:53 <MonadHendrix> -- True
00:53 soniku joined
00:53 <thang1> Also it's got 20+ years of experience to draw from in modern language design. Haskell has eons of backwards compatibiility and cruft to work through and fuck around with
00:53 <Lokathor> sure, sure, but just make the sdl2 package work on windows :P
00:53 <ExpHP> I swear, gabriel, edward kmett and yesod are the only thee people/organizations that write haskell libraries
00:54 <Welkin> ExpHP: correction: yesod -> snoyberg
00:54 cjwelborn joined
00:54 cjwelborn joined
00:54 cjwelborn joined
00:54 <ExpHP> ah right
00:54 <thang1> (read: lists are bad for everything, length shouldn't be foldable, etc...)
00:54 <Welkin> not really though
00:54 <ExpHP> okay wait there's also the hoogle/Shake guy
00:54 <MonadHendrix> most downloaded rust crate is LibC, pretty suspect for a language thats trying to replace it
00:54 <thang1> s/PEOPLE/genius overachievers who don't sleep/
00:54 <Welkin> take a look at servant and reflex-frp
00:54 <Welkin> they are written by other people
00:55 <thang1> MonadHendrix: The cannonical way to "replace" C is to incrementally rewrite
00:55 <thang1> So the goal is to be able to work with C 100% and then just replace single things as you go.
00:55 <Lokathor> MonadHendrix, naw, gotta bootstrap somehow
00:55 vaibhavsagar joined
00:55 <MonadHendrix> thang1: https://i.imgur.com/c111qqp.jpg
00:56 <thang1> That was basically my entire exchange with glguy, MonadHendrix lol
00:57 nighty-- joined
00:57 <MonadHendrix> my favourite thing about haskell is being able to refactor anything to unreadably terse
00:58 <MonadHendrix> the Monad Reader had a really good example
00:58 <ExpHP> MonadHendrix: I do this without even thinking
00:58 <MonadHendrix> also the random custom ascii operators
00:58 Stanley00 joined
00:58 <ExpHP> next thing I know I wake up with something like ((f .) . g <$>)
00:58 <MonadHendrix> those are great
00:58 <sproingie> yeah the ascii infix operators i am not fond of
00:59 jer1 joined
00:59 <MonadHendrix> reverse = foldl (flip (:)) []
00:59 <thang1> One of my bigger pet peeves with haskell is some of the really basic stuff
00:59 <MonadHendrix> parsing input
00:59 <thang1> : shouldn't be for lists, : should be for types. Goddamnit, Haskell
00:59 <sproingie> MonadHendrix: that's actually quite obvious and concise even to me
00:59 <Welkin> thang1: haskell is like perl in that you can write it however you want
00:59 <MonadHendrix> https://wiki.haskell.org/wikiupload/9/9d/TMR-Issue1.pdf
00:59 <MonadHendrix> page 6
00:59 <thang1> f : Int -> Int, not f :: Int -> Int
00:59 <Welkin> you can write it to be unreadable if you want
00:59 <sproingie> and i'm hardly one to go for obfuscated haskell
01:00 <Welkin> you can also write it to be very easy to read
01:00 <sproingie> TMTOWTDI
01:00 <MonadHendrix> `if it compiles, its right`
01:00 <MonadHendrix> tru
01:00 hucksy joined
01:00 <sproingie> FSVO "right"
01:00 <thang1> hahaha that's funny, Welkin, because that's literally what happened on a particular StackOverflow question
01:00 <ExpHP> I'm hardly ever trying to go for obfuscated, I'm just trying to eliminate variables whose names I could potentially mix up
01:01 <sproingie> if it compiles, you probably translated the idea right. your idea might still be dead wrong.
01:01 <Welkin> thang1: http://www.willamette.edu/~fruehr/haskell/evolution.html
01:01 <Welkin> related
01:01 <MonadHendrix> lol
01:01 <thang1> length :: [a] -> Int; length = 4 -- My favorite number
01:01 <Lokathor> I want an API that I can understand that also runs as fast as possible under the hood
01:02 <thang1> aka aggressive and insane rewriting rules :p
01:02 lavalike joined
01:02 <c_wraith> thang1, I disagree solely for reasons of improved lexical uniformity. making (:) a constructor means infix constructors all starting with : is a less jarring rule.
01:02 <Lokathor> thang1, you mean "length _ = 4" perhaps :3
01:03 <MonadHendrix> _ = 4
01:03 <thang1> eh, it gets the point across
01:03 biglambda joined
01:03 <sproingie> shame about other infix operators. lens-heavy code looks like APL to me
01:03 mels joined
01:03 <thang1> APL is more readable because it's unicode
01:03 <Welkin> sproingie: all lens functions have named versions
01:03 <thang1> goddamn I love the idea of APL. I need to learn it
01:03 <MonadHendrix> dont you need a special keyboard for that
01:04 <sproingie> J and K have the ideas of APL but use ascii
01:04 <thang1> No, APL always worked with a normal keyboard
01:05 <sproingie> just a different input method
01:05 uuplusu joined
01:05 boj joined
01:05 <thang1> The special keyboard had the symbols on the letters
01:05 <thang1> so the 'j' key was like (+) or something but you didn't need a special keyboard
01:06 <thang1> sproingie: I really like the non-ascii part of APL though. Otherwise what's the point? The meaning's in the symbols and notation. That's why math notation is so powerful
01:06 <biglambda> Is there any way to see how memory has been allocated by malloc. I’m getting weird memory errors with some FFI code. Errors appear inconsistently.
01:06 asmyers joined
01:06 <sproingie> thang1: there's a little more to it than notation
01:06 <MonadHendrix> space cadet keyboards had all those symbols
01:06 <sproingie> but yeah, the unicode symbol set does make it terse
01:07 <sproingie> well, wasn't really unicode at the time
01:07 xall joined
01:07 jaziz1 joined
01:08 JoshS joined
01:08 <MonadHendrix> btw that static haskell programmer one where he does it all with the types is pretty amazing
01:08 <thang1> The "typing the tech interview"?
01:08 Rodya_ joined
01:09 <thang1> or just the idea of brutally abusing the haskell type system to do depndent types in general?
01:10 <MonadHendrix> thang1: in the evolution of a haskell programmer page
01:10 <MonadHendrix> http://www.willamette.edu/~fruehr/haskell/evolution.html
01:10 <MonadHendrix> scroll down to "Static Haskell Programmer"
01:10 <thang1> oh right, that
01:10 <thang1> You'd like the "typing the tech interview" article then
01:10 <thang1> https://aphyr.com/posts/342-typing-the-technical-interview
01:10 <thang1> The entire series is great
01:10 brynedwards joined
01:12 <MonadHendrix> lol wtf am i reading
01:12 <sproingie> yeah that's aphyr for ya
01:12 <thang1> Keep going, it gets better
01:13 <sproingie> read his call-me-maybe series for more goofy goodness
01:13 pera joined
01:13 <thang1> c_wraith: I still like : for types because it's more consistent with mathematical notation. :: for lists is just fine imo
01:13 <MonadHendrix> aph<tab> -> No match
01:13 <MonadHendrix> :()
01:14 <MonadHendrix> uh
01:14 <MonadHendrix> :(
01:15 <MonadHendrix> "“You could do that,” you concur, but, so quietly he cannot hear you, continue to believe the exact opposite."
01:15 <MonadHendrix> brilliant
01:15 <* MonadHendrix> goes off to read
01:15 <thang1> sproingie: where's his call-me-maybe series?
01:15 lampam joined
01:15 <sproingie> https://aphyr.com/tags/jepsen
01:16 <sproingie> it's sorted most recent first, so it starts at the bottom right
01:16 <thang1> So just read all of them?
01:16 <sproingie> basically it's a deep dive into distributed databases and the CAP theorem
01:16 <ExpHP> (aside) huh, so there literally IS an M-x irc command...
01:16 <thang1> I also wish we could get rid of the grip that ascii and stupid shit like that has on writing things with keyboards
01:16 bananagram joined
01:17 <sproingie> ExpHP: oh there are several irc clients for emacs
01:17 <thang1> ExpHP: Didn't someone make a M-x butterfly as well?
01:17 <MonadHendrix> so: ah
01:17 <thang1> There's also several differnt terminals, several different games, a few web browsers, some reddit clients, ...
01:17 <ExpHP> there's probably a port of wine
01:17 roconnor joined
01:18 <Welkin> use a cangjie keyboard :D
01:18 <thang1> Welkin: hah, funny. Not quite what I meant :p
01:18 <thang1> I meant more like how we can't type \forall and other symbols nicely so everyone's scared to use math notation in programming languages even when it makes it more readable
01:18 <sproingie> hell there's a whole emacs power-user subculture of org-mode.el users
01:18 <Welkin> you can have your text editor do it for you
01:19 <Welkin> that's how people write agda/coq
01:19 <sproingie> i never did take a shine to org-mode, but my brain has stubbornly resisted all attempts to impose organization
01:19 <* EmacsHP> fiddles around trying to figure out how to get back to his code...
01:19 <thang1> Well sure, but that doesn't change the fact that needing the text editor to cope for a shitty keyboard means most languages aren't ever going to support unicode n shit
01:19 <sproingie> oh yeah, agda uses emacs ... i thought coq had its own editor?
01:19 <EmacsHP> evil is in some weird light blue state right now. Never seen that before...
01:20 <thang1> I like Agda a lot and wish notation like that was more accepted and easier to use in mainstream languages
01:20 jer1 joined
01:20 <sproingie> thang1: most languages that matter already support unicode
01:20 <sproingie> hell even c++ is dragging itself toward realizing that wchar_t is crap
01:21 <thang1> Not quite what I meant :p
01:21 <Welkin> javascript supports unicode even o.o
01:21 jordan_ joined
01:21 <jordan_> hi
01:21 <thang1> If I write ¬ instead of not, it won't compile in the vast majority of languages
01:21 <sproingie> sure, because those languages have hardwired operator sets
01:21 <thang1> even if it did, nobody would ever accept code in a codebase using ¬ instead of not
01:21 <ExpHP> #DEFINE BEGIN {
01:22 <thang1> Just try and get ¬ into any codebase for Haskell. Not gonna happen :p
01:22 <sproingie> hell i suspect even Haskell98 wouldn't let you use ¬ the way you want
01:22 ublubu joined
01:22 <sproingie> (ghc probably)
01:22 <geekosaur> who invited Steve Bourne into the channel? :p
01:22 <thang1> #DEFINE END ) /* pure evil */
01:22 mizu_no_oto joined
01:22 <MonadHendrix> in the 1st edition of that graham hutton book all his source had fancy symbols
01:23 <MonadHendrix> was quite hard to read tbh
01:23 <sproingie> as it is, input methods in OS's are so horribly anemic, i had to copy/paste ¬ using the mouse just to type it
01:23 <thang1> hah, same. I can use the compose key, but I need to program it in
01:23 <sproingie> so the unicode source problem ain't getting solved til input methods become at all freakin decent
01:23 <thang1> ಠ_ಠ <-- written with compose key
01:23 <MonadHendrix> uk keyboard has it on S-`
01:23 <thang1> ¯\_(ツ)_/¯
01:24 <thang1> sproingie: which was my original gripe. Input sucks balls
01:24 <sproingie> languages aren't gonna get hip to unicode til input methods do
01:24 <Welkin> you haven't even mentioned multi-language input
01:24 <Welkin> IME
01:24 <MonadHendrix> thanks for reminding me i havent set a fallback font for meme unicode
01:24 <Welkin> writing in russian is the worst
01:24 <thang1> ( ͡° ͜ʖ ͡°) orly?
01:24 <MonadHendrix>
01:24 <Welkin> japanese and chinese are at least usable because of romaji and pinyin
01:25 <Welkin> for russian you need a russian keyboard (or stickers)
01:25 <MonadHendrix> <compose> C C C P gives ☭
01:25 <thang1> Isn't the japanese writing system fucked up beyond all repair?
01:25 <ExpHP> why are we all talking about leopards all of a sudden
01:25 <Welkin> thang1: no....
01:25 <sproingie> katakana makes good emoji tho ¯\_(ツ)_/¯
01:25 <thang1> s/fubar/extremely complicated/
01:28 roboguy` joined
01:28 <ExpHP> it feels like I'm doing something silly when I write "a >=> pure . b" but I'm not sure what
01:28 <ExpHP> :t \a b -> a >=> pure . b
01:28 <lambdabot> Monad m => (a1 -> m a) -> (a -> c) -> a1 -> m c
01:28 blym_ joined
01:29 dan_f joined
01:29 muesli4 joined
01:29 <ExpHP> @djinn Monad m => (a1 -> m a) -> (a -> c) -> a1 -> m c
01:29 <lambdabot> -- f cannot be realized.
01:30 <ExpHP> the all-knowing
01:30 <thang1> is it something to do with your a1 vs a?
01:30 <c_wraith> djinn doesn't know about monads.
01:31 <thang1> http://stackoverflow.com/questions/28134149/why-does-djinn-fail-to-realize-common-monadic-functions
01:31 <ExpHP> oh oh
01:31 <ExpHP> I think I'm basically doing 'fmap (fmap f)', but flipped
01:32 <geekosaur> :exf "Monad m => (a1 -> m a) -> (a -> c) -> a1 -> m c"
01:32 <exferenceBot> \ f1 f2 -> fmap f2 . f1
01:32 <ExpHP> ...eh. sometimes this arises from me initially thinking I need >>=, so I already have things written in that order and it's a nuisance to flip...
01:32 <thang1> What does exf do?
01:32 <ExpHP> geekosaur :o
01:33 noan joined
01:33 <geekosaur> https://github.com/lspitzner/exference
01:33 <geekosaur> djinn on steroids
01:33 <thang1> nice. Just googled that after realizing it's probably common knowledge to nerds
01:33 <geekosaur> handles recursive types, handles typeclasses like Monad, etc.
01:34 <thang1> neat
01:34 <Welkin> so exf puts us all out of a job?
01:34 <Welkin> :exf a -> [a] -> [a]
01:34 <exferenceBot> parse error: more than one input
01:34 Supersonic112_ joined
01:34 <Welkin> :exf "a -> [a] -> [a]"
01:34 <exferenceBot> (:)
01:35 <rotaerk> thang1, that "typing the technical interview" is one of the most absurd haskell things I've ready :P
01:35 <ExpHP> :exf "forall a. a"
01:35 <ExpHP> uh oh
01:35 <rotaerk> read *
01:35 <geekosaur> exference also lets you have flags for that lookup, so if the type looks too much like it has a flag in it you need to qyote
01:35 <ExpHP> > are you okay lambdabot
01:35 <exferenceBot> could not find expression
01:35 <lambdabot> error:
01:35 <lambdabot> • Variable not in scope: are :: t0 -> t1 -> t2 -> t
01:35 <lambdabot> • Perhaps you meant one of these:
01:35 <geekosaur> it'll time out eventually
01:36 <geekosaur> also LB and exferenceBot are two different things
01:36 <ExpHP> holy crap I didn't even notice the second bot
01:36 roboguy`_ joined
01:37 <Welkin> :exf "forall a. a"
01:37 <Welkin> :exf "forall a. a -> b"
01:37 <Welkin> :exf "forall a. a -> a"
01:37 <Welkin> o.o
01:37 <exferenceBot> id
01:37 <Welkin> lol
01:37 newhoggy joined
01:37 <Welkin> it ignores you if it can't answer
01:37 <exferenceBot> could not find expression
01:37 <thang1> so it only answered the last one
01:37 <exferenceBot> could not find expression
01:37 <thang1> oh nvm
01:37 <Welkin> haha
01:38 <Welkin> is it looking these up somewhere?
01:38 <Welkin> that's cheating D:<
01:38 <thang1> anyway I'm gonna get off. I have to drive back home and then get started on some boring java homework
01:38 eschnett joined
01:38 <Welkin> thang1: driving back to 1999?
01:38 <thang1> Welkin: it's like Djinn so I assume it's using formal logic to walk backwards from a type to implementation
01:38 <geekosaur> ^
01:38 <* ExpHP> invents stackOverflowBot
01:38 <* thang1> invents StackSort algorithm
01:39 <ExpHP> :sob how do I sort a list
01:39 <thang1> https://gkoberger.github.io/stacksort/
01:39 <geekosaur> but because it supports typeclasses, it can get lost in the weeds and eventually time out
01:39 <MonadHendrix> > bot names in camelcase
01:39 <lambdabot> <hint>:1:11: error: parse error on input ‘in’
01:39 cschneid_ joined
01:40 <ExpHP> :exf "Functor f => Traversing (->) f s t a a -> LensLike f s t [a] [a]"
01:40 <exferenceBot> <<exception: no support for FunCon>>
01:40 yinn joined
01:40 <ExpHP> :exf "Functor f => Traversing (:) f s t a a -> LensLike f s t [a] [a]"
01:40 <exferenceBot> could not find expression
01:40 <jer1> q
01:41 <ExpHP> :exf "(:)"
01:41 <ExpHP> what on earth is that
01:41 <exferenceBot> could not find expression
01:41 jer1 joined
01:41 <peddie> :exf Monad m => (b -> m a) -> (a -> c) -> b -> m c
01:41 <exferenceBot> \ f1 f2 -> fmap f2 . f1
01:42 <thang1> Anywya, Welkin, nah my professor just loves Java and insists our "messenger app" (cough irc clone cough) be written in it for our term project
01:42 <thang1> I'm gonna use Java 8 so it's less terrible than it could be...
01:42 <MonadHendrix> >java
01:42 <thang1> yay University
01:42 <sproingie> one guess as to which single language the prof knows
01:42 <thang1> Oh he knows C++ too, that's why he likes Java so much
01:43 <MonadHendrix> OO is like wading through dog poo
01:43 <dyreshark> you should limit messages on this messaging app to ~100 characters. this way, you won't be able to discuss class naming over it.
01:43 <thang1> nvm I meant C. He's was a professor during the 90s "omg C++ is jesus" phase so he missed that
01:43 <sproingie> OO has plenty of things good about it when done right
01:43 Lord_of_Life joined
01:43 <MonadHendrix> dyreshark: lol
01:44 <thang1> "when it's done right" yeah that's the problem
01:44 <thang1> good paradigms make it easier to write good code. Bad paradigms require shooting yourself in the nuts to write good code
01:44 <sproingie> it hasn't really solidified as a formal discipline yet
01:44 wroathe joined
01:44 <thang1> OOP or programming? Because both are pretty fresh and wild still
01:45 <sproingie> OOP. scala's been doing some work on that. and yeah programming in general
01:45 <thang1> Although, fair warning, I'm more in the Dijkstra camp of things.
01:45 mavihs joined
01:45 <thang1> I always liked Erlang's version of OOP the most
01:45 darjeeling_ joined
01:45 <MonadHendrix> record syntax is enough OO for me
01:46 <sproingie> record syntax that doesn't make me stabby is enough for me too
01:46 <c_wraith> I've come to consider Haskell's approach to OOP to be as much as I need for problems I've encountered.
01:46 <thang1> s t a b a l l t h e t h i n g s
01:46 <MonadHendrix> typeclasses are sort of inheritance in reverse
01:47 <thang1> typeclasses are amazing. Learning about them really made me realize that I only ever want inheritence and composition when talking about types
01:47 <thang1> Subsequently all of my java programs have been written with all my classes being considered a type mentally in my head. It's helped a lot even though my teacher almost marked me off for not having enough inheritance
01:47 <c_wraith> Haskell OOP has nothing to do with type classes, though.
01:48 <thang1> what's Haskell OOP then? Lenses?
01:48 OnkelTem joined
01:49 <thang1> Now one style of OOP that I /really/ like is Rust's way of thinking about it
01:49 <c_wraith> the problem I find myself seeking to solve is "I need lots of values with different behavior and the same type". the solution is a record of functions.
01:49 <Lokathor> rust's style isn't OOP >_>
01:49 <thang1> (which is basically Haskell's). That is, you have traits ("interfaces") and implementations ("instances" in haskell or "X implements Y" in Java)
01:49 <thang1> Lokathor: exactly. It's what OOP should be :p
01:49 <Lokathor> http://lpaste.net/354899 is there some fancy haskell way to make these expressions more concise?
01:50 ystael joined
01:50 Netwolf joined
01:50 <Lokathor> (besides just taking out the newlines :P )
01:50 <sproingie> meh, it's 7 lines, that's pretty concise to me
01:50 <* MonadHendrix> waits for someone to pipe in with an unreadable one line answer
01:50 <c_wraith> Lokathor, nothing that will make it better.
01:50 <thang1> s/gen/g s/newGen/ng/ ...
01:51 <Lokathor> sproingie, yes i was mostly wondering what the unreadable oneliner version would look like
01:51 <MonadHendrix> substitute in some silly ascii symbols for sure
01:52 <c_wraith> :t runState
01:52 <lambdabot> State s a -> s -> (a, s)
01:52 <thang1> and some type aliases too
01:52 <sproingie> type-level befunge
01:52 <thang1> mkPCGen? That's 7 letters when it could just be 1-2
01:52 <thang1> Just tell people to read the types in the documentation; it'll suddenly become clear /s
01:53 newhoggy joined
01:54 bitrause1 joined
01:54 <c_wraith> :t runState $ state random -- Lokathor, you wanted dumb?
01:54 <lambdabot> (RandomGen s, Random a) => s -> (a, s)
01:55 soniku joined
01:55 <Lokathor> heh
01:55 <c_wraith> Lokathor, you can throw an fmap and join in to make it a one-liner
01:55 orhan89 joined
01:56 orhan89` joined
01:56 <c_wraith> something like..
01:56 pwnz0r joined
01:57 <c_wraith> runState . fmap (join mkPCGen) . state $ random
01:57 <c_wraith> not tested, not better. :)
01:57 watabou joined
01:57 <thang1> What are you talking about? That's one line. It's at least 75% more beautiful /s
01:58 <thang1> anyway I'm off for reals now
01:58 Goplat joined
01:58 <ExpHP> you cannot escape #haskell
01:59 descender joined
01:59 BlueRavenGT joined
01:59 <benzrf> :t mkPCGen
01:59 <lambdabot> error: Variable not in scope: mkPCGen
02:00 hucksy_ joined
02:00 sellout- joined
02:01 taksuyu joined
02:02 newhoggy joined
02:03 <roboguy`_> :t first (join _) . random
02:03 <lambdabot> error:
02:03 <lambdabot> • Found hole: _ :: a0 -> a0 -> c
02:03 <lambdabot> Where: ‘c’ is a rigid type variable bound by
02:03 <benzrf> :]
02:04 <c_wraith> I mean.. it's shorter, if you don't count the import.
02:04 <c_wraith> *imports
02:05 <ExpHP> quick! Convert an integer 23 into a padded 3-digit string "023"!
02:05 <c_wraith> f 23 = "023"
02:05 <c_wraith> bam!
02:05 {emptyset} joined
02:05 <ExpHP> 0 points
02:05 afarmer joined
02:05 <MonadHendrix> > "0" : (show 23)
02:05 <lambdabot> error:
02:05 <lambdabot> • Couldn't match type ‘Char’ with ‘[Char]’
02:05 <lambdabot> Expected type: [[Char]]
02:05 uuplusu joined
02:06 <MonadHendrix> dam
02:06 dan_f joined
02:06 <c_wraith> ExpHP, I don't see the problem. I implemented the specification exactly.
02:06 <MonadHendrix> > '0' : (show 23)
02:06 <lambdabot> "023"
02:06 <MonadHendrix> ayy
02:06 <ExpHP> c_wraith: the specification was buggy, apparently there are other numbers less than 1000 as well
02:07 <ExpHP> in fact there are 998 of them. who knew
02:07 <c_wraith> whoever wrote that spec should be fired.
02:07 <MonadHendrix> there are more than that
02:07 <roboguy`_> there are even a few more than that!
02:07 <MonadHendrix> infinitely many
02:07 <ExpHP> nonnegative integers*
02:07 <MonadHendrix> 999 then
02:07 <ExpHP> shoot
02:08 <* ExpHP> is fired
02:08 newhoggy joined
02:09 mizu_no_oto joined
02:09 <ExpHP> hmmm
02:09 <ExpHP> :t reverse . take 3 . (: cycle '0') . reverse . show
02:09 <lambdabot> error:
02:09 <lambdabot> • Couldn't match expected type ‘[[Char]]’ with actual type ‘Char’
02:09 <lambdabot> • In the first argument of ‘cycle’, namely ‘'0'’
02:09 <ExpHP> :t reverse . take 3 . (: repeat '0') . reverse . show
02:09 <lambdabot> error:
02:09 <lambdabot> • Couldn't match type ‘[Char]’ with ‘Char’
02:09 <lambdabot> Expected type: a -> Char
02:09 <ExpHP> :t reverse . take 3 . (++ repeat '0') . reverse . show
02:09 <lambdabot> Show a => a -> [Char]
02:09 <MonadHendrix> : and , in strange places always makes me suspicious
02:10 <ExpHP> :t (reverse . take 3 . (++ repeat '0') . reverse . show) 23
02:10 <lambdabot> [Char]
02:10 <ExpHP> > (reverse . take 3 . (++ repeat '0') . reverse . show) <$> [9, 23, 104]
02:10 <lambdabot> ["009","023","104"]
02:11 Warrigal joined
02:11 <MonadHendrix> are you trying to write an nodejs module
02:11 <ExpHP> lol
02:12 <ExpHP> locating files created by csplit
02:12 <geekosaur> [0-9][0-9][0-9] :p
02:13 <ExpHP> problem is I did csplit kind of recursively
02:13 jer1 joined
02:13 <ExpHP> I have stuff-[0-9][0-9][0-9]-[0-9][0-9][0-9] and I want to get all the stuff-001s first, etc
02:13 <MonadHendrix> lol
02:13 <MonadHendrix> nuke and pave
02:14 Costar joined
02:14 <glguy> > printf "%03d" 42 :: String
02:14 <lambdabot> "042"
02:14 <ExpHP> tell me that's not in prelude
02:14 <ExpHP> TELL ME
02:14 <MonadHendrix> lmao
02:14 <geekosaur> Text.Printf
02:15 <ExpHP> oh whew
02:15 ianleeclark joined
02:15 <geekosaur> but showFFloat isn't in Prelude either (it's in Numeric)
02:15 <geekosaur> and showInt doesn't take a precedemce
02:15 <MonadHendrix> yesterday i found readMaybe and it was a good day
02:16 <geekosaur> and printf is something of a hack, showing off typeclass abuse more than anything else
02:16 blender2 joined
02:16 butterthebuddha joined
02:17 <butterthebuddha> Is there a more abridged Real World Haskell like book out there? I really don't need to read paragraphs about why static types > dynamic types; I'd like a comprehensive, but to the point description of the language's features.
02:17 <glguy> butterthebuddha: Have you found the Haskell Report yet?
02:18 <butterthebuddha> Never heard of that, but I'll definitely check that out
02:18 sleffy joined
02:19 <butterthebuddha> Ah, I didn't really mean I want to read the language's standard
02:19 <glguy> You should
02:23 godfreygyz joined
02:24 conal joined
02:24 mada joined
02:24 noddy joined
02:26 thimoteus joined
02:31 jer1 joined
02:31 <ExpHP> :exf IO [a] -> IO ()
02:31 <exferenceBot> fmap (\ es -> fold (es, mempty))
02:31 kau joined
02:32 <ExpHP> hurrr
02:32 <geekosaur> it can't reason about IO, really
02:32 <ExpHP> :exf (a -> IO ()) -> IO [a] -> IO ()
02:33 <exferenceBot> could not find expression
02:33 <ExpHP> :t join . mapM
02:33 <lambdabot> Traversable t => (a -> t a -> b) -> t a -> t b
02:33 <ExpHP> :t (join .) . mapM
02:33 <lambdabot> (Traversable m, Monad m) => (a1 -> m a) -> m a1 -> m a
02:34 <ExpHP> :t \f as -> join $ fmap mapM f as
02:34 <lambdabot> Traversable t => (t1 -> a -> t a -> b) -> t1 -> t a -> t b
02:35 bjz joined
02:36 biglambda joined
02:37 Argue__ joined
02:38 <ExpHP> join $ (mapM_ removeFile) . filter ("edit.yaml-" `isPrefixOf`) <$> listDirectory "."
02:38 <ExpHP> boom
02:38 <glguy> ExpHP: You can replace your join/fmap with one =<<
02:39 <ExpHP> aw yisss
02:40 <ExpHP> I... wonder if I should just replace this with "do" and "guard"
02:40 <ExpHP> ah, wait, nope, wouldn't work. Was thikning of the Shell monad
02:40 geekosaur joined
02:41 danza joined
02:42 vicfred joined
02:44 tripped joined
02:45 blym_ joined
02:46 tommd joined
02:46 dfordivam joined
02:47 yuze joined
02:47 permagreen joined
02:47 kattak joined
02:47 wroathe joined
02:49 exferenceBot joined
02:50 andyhuzhill joined
02:50 ublubu joined
02:51 Coldblackice joined
02:52 ystael joined
02:53 jer1 joined
02:53 hexagoxel joined
02:57 k__ joined
02:57 <k__> hi all!
02:58 <ExpHP> hey, it's my favorite letter of the alphabet!
02:58 <Lokathor> data PCGen = PCGen !Word64 !Word64
02:58 <Lokathor> do i need to declare BangPatterns for this to be strict?
02:59 <Lokathor> or is that just for strict args in a funciton declaration or something?
02:59 <glguy> No, that's not part of the BangPatterns extension
02:59 <glguy> That's just part of Haskell
02:59 <Lokathor> okay cool
02:59 <k__> quick question: is there any way to coerce a value of type "Floating a => a" to a value of any concrete numeric type? (Float, Double)
03:00 <Lokathor> do you mean of any type? or of a specific type?
03:00 Argue joined
03:00 <Lokathor> you can just say (val :: Float) and it'll force it into being a Float for example
03:01 <roboguy`_> k__: I think you might be thinking of it backwards. 'Floating a => a' can take on any floating point type already, including Float and Double
03:01 <roboguy`_> since those types are instances of Floating
03:02 wagle joined
03:02 <roboguy`_> :t let x = 3.2 :: Floating a => a in (x :: Double) -- Note that this is not casting
03:02 <lambdabot> Double
03:02 Destol joined
03:03 <k__> ok, got it
03:03 <k__> can you help me understand why this function def doesn't compile?
03:03 afarmer joined
03:03 <k__> f :: (Floating a) => a -> Float
03:03 <geekosaur> @paste
03:03 <lambdabot> Haskell pastebin: http://lpaste.net/
03:04 <k__> http://lpaste.net/354900
03:04 <roboguy`_> k__: well, like I said, it's not type casting. "Floating a => a -> ..." means that argument must be able to be *any* Floating type
03:04 <geekosaur> this is what people were trying to tell you
03:05 <geekosaur> you are lookng for a cast
03:05 <glguy> No, you can't write a function with type Floating a => a -> Float
03:05 <geekosaur> :: is a specification. if a type can conform with the specification, it will; otherwise it is a compile error
03:05 <geekosaur> in this case, the Floating instance was picked by the caller, so there is no guarantee that it can conform with Float
03:06 sproingie joined
03:07 <Lokathor> k__, saying (x :: Type) is just for when you have an expression that's very generic, and you want to specify that you intend for it to be a more specific type (which can sometimes help the optimzer for example).
03:08 dunx joined
03:08 <k__> hm, ok, thanks all
03:09 <Lokathor> or it can clear up confusion when you think an expression is one type and GHC is inferring another type, GHC will tell you where the mismatch happened instead of letting the inference go to far in a bad state
03:09 petermw joined
03:10 <roboguy`_> k__: if there's a larger context to this problem, maybe we can help with that?
03:10 <k__> yep, the larger context is that i'm having trouble with the polymorphic types in the haskell `ad` (autodiff) library
03:11 <k__> thanks for the offer, by the way :)
03:11 <Lokathor> you can make an lpaste of the larger example and the error message and we might be able to help
03:11 electrostat joined
03:11 <jchia> I have a question about a compilation error. How can I make foo compile properly? bar works but I need to pass in a Proxy, which is undesirable. http://lpaste.net/354901
03:12 <roboguy`_> k__: hmm, in that case, I wouldn't be surprised if you maybe wanted something more like '(forall a. TypeClass a => a) -> ...', but lets see
03:12 <k__> Lokathor: there's no specific error message; i'm just trying to get around this polymorphic `ad` type
03:12 <k__> so it can only take the gradient of a polymorphic function f :: Floating a => [a] -> a
03:12 <glguy> I'd be surprised if a Rank-2 type was the solution
03:12 <roboguy`_> glguy: for ad stuff?
03:13 jer1 joined
03:13 <glguy> yeah
03:13 <roboguy`_> hmm
03:13 <glguy> Who knows, maybe I'll be surprised :)
03:14 <k__> but i'm also using this library `gloss` that requires everything to be floats, and i don't see how to make them cooperate nicely
03:15 xall joined
03:15 frew joined
03:15 torgdor joined
03:16 <roboguy`_> k__: maybe you could give an example of the part causing an issue?
03:16 <k__> roboguy`_: yeah, i'm trying to think of a good minimal example
03:18 flatmap13 joined
03:18 wroathe joined
03:19 <k__> for example, i have a complicated type of an object `data Obj = Obj { xcoord :: Float ... (other omitted fields that are floats) }`,
03:19 <k__> and want to take the gradient of some complicated function of all the object's parameters
03:19 otto_s_ joined
03:20 <roboguy`_> k__: you could use `data Obj0 a = Obj { xcoord :: a ... (everything else is type a) }; type Obj = Obj0 a`
03:20 <k__> in order to take this gradient automatically, i need to use autodiff's `grad` function, which requires me to extract all the objects' coordinates into a giant list of `Floating a`
03:20 <roboguy`_> er, type Obj = Obj0 Float
03:20 Rodya_ joined
03:20 <frew> I find myself in the deep end of haskell because I am trying to configure TaffyBar (gtk thing) so pardon me for asking a few basic questions; first off: what does this mean: `foo :: bar baz biff` (I know the right of :: is types and the left is a function I'm declaring)
03:21 <roboguy`_> try to keep it as Floating a as long as possible and only attempt to turn it into Float when you absolutely have to
03:21 <roboguy`_> frew: so, something like 'x :: Maybe Int'?
03:21 <k__> roboguy`_: is dealing with polymorphism in record fields doable? i tried for a few minutes and got compile errors, googled and saw a lot of scary posts about how you had to turn on existential types
03:21 sleffy joined
03:21 <roboguy`_> k__: yep, it's possible
03:22 <roboguy`_> especially if you add a type argument
03:22 jaziz1 joined
03:22 <frew> roboguy`_: well precisely it's: `weaCallback :: Gtk.EventM Gtk.EButton Bool`
03:22 <frew> is it really all wrapper types?
03:22 <roboguy`_> frew: do you understand stuff like Maybe Int, though (because its the same idea, essentially)
03:22 <frew> ues
03:22 <frew> yes*
03:22 systemfault joined
03:22 <frew> huh
03:22 <frew> very weird
03:23 <roboguy`_> frew: so, in 'Maybe Int', the type constructor 'Maybe' is being applied to the type 'Int' to get a type
03:23 <roboguy`_> in your example the type constructor Gtk.EventM is applied to two types to get back a type
03:23 felixsch__ joined
03:23 <frew> I found an example of usage of the call and it simply seems to return a bool (https://github.com/travitch/taffybar/blob/e9b9c39540d77eb8f3e0e723ddfd033456f61364/src/System/Taffybar/LayoutSwitcher.hs#L93-L100) and it looks like it's just returning a bool
03:23 <frew> ok
03:23 kattak joined
03:23 <frew> thanks
03:23 <roboguy`_> (well, it could also be a type family, but I imagine its a standard type constructor)
03:23 <roboguy`_> np!
03:23 taktoa joined
03:23 danthemyth joined
03:24 <roboguy`_> frew: well, 'return' is a (badly named) function
03:24 <roboguy`_> :t return
03:24 <lambdabot> Monad m => a -> m a
03:24 Argue_ joined
03:24 <roboguy`_> frew: so, in this case, that return takes in a Bool and gives back a 'Gtk.EventM Gtk.EButton Bool'
03:24 <frew> ok weird
03:24 <frew> thanks a lot
03:24 <frew> that helps a lot
03:24 <Lokathor> so, are Typable and Data important classes for my data type to implement if I'm trying to write it as a long term library that i'll use over and over?
03:25 <Lokathor> also, Storable?
03:25 bjz joined
03:26 <geekosaur> depends on what you will be doing with it
03:27 <geekosaur> seeing Data there makes me thing generics
03:27 <geekosaur> *think
03:27 <Lokathor> it's an RNG, holds two Word64 values, basically a suped up newtyped tuple
03:27 andyhuzhill joined
03:27 <roboguy`_> Lokathor: if its an actual newtype, you could get away with a lot in the future just by using 'coerce'
03:27 <glguy> k__: Your job using 'ad' is to define functions that *only* use floating operations with types like: Floating a => a -> a; or Floating a => [a] -> a
03:28 <k__> roboguy`_: ok, i'll try it, thanks for the suggestion
03:28 sgronblo joined
03:28 <glguy> k__: then grad can process such a function to give you back one that also has a similar type
03:28 <Lokathor> it's not an actual newtype. There's a Boxed version with two strict Word64, and an unboxed version I'll be making with two Word# values (but which will obviously only work with Word# is 64 bit wide, hense the Boxed fallback)
03:28 <glguy> and then you can use *that* result where you pick 'a' to be Float
03:29 iqubic joined
03:29 <Lokathor> most of the time I'll be using the unboxed version, but i'd also like it to be operable on my raspberry pi, so there's a slow fallback option when needed
03:29 <k__> glguy: yeah, the problem is that the lists of objects can be very complex/structured and i'd like to operate on objects inside a function, not a giant list of floats
03:30 <iqubic> Anyone have a guide for emacs haskell mode. I want to be able to open up a REPL with my Stack deps already pulled in.
03:30 <k__> glguy: er, giant list of `Floating a`. so i was trying to "reserialize" the `Floating a` back into the list of objects, which required "casting"' to Float
03:30 <glguy> k__: OK, then you'll have to parameterize your objects
03:30 <k__> but maybe using roboguy`_'s suggestion will help WRT parametrization
03:30 <k__> yeah
03:30 <iqubic> Also, isn't there a way to get the infered type signature of a function from Haskell Mode?
03:31 <iqubic> Anyone able to dig up a tutorial for emacs Haskell Mode for me?
03:31 <MonadHendrix> i read that as `infrared`
03:31 <iqubic> Yeah, I misspelled that.
03:31 <k__> iqubic: i have also been looking for one for a while...
03:32 <iqubic> *inferred.
03:32 eklavya joined
03:32 <MonadHendrix> iqubic: flycheck and ghc-mod
03:32 <k__> https://github.com/serras/emacs-haskell-tutorial/blob/master/tutorial.md ?
03:32 <MonadHendrix> install ghc-mod on your system then package-install ghc
03:32 <MonadHendrix> and enable ghc minor mode
03:32 minimalism joined
03:33 <MonadHendrix> shows type sig of thing at point in minibuffer
03:33 <iqubic> How do I check if I have ghc-mod installed?
03:33 <k__> https://haskell.github.io/haskell-mode/manual/latest/
03:33 forgottenone joined
03:34 jer1 joined
03:34 wroathe joined
03:36 armyriad joined
03:37 conal joined
03:38 <iqubic> MonadHendrix: I know what ghc-mod is. I just don't know *if* I have it installed
03:38 {emptyset} joined
03:38 flatmap13 joined
03:38 dan_f joined
03:39 ericw joined
03:39 <iqubic> Looks like I didn't have that installed.
03:39 Lord_of_Life joined
03:39 <iqubic> But I'm installing it now.
03:40 <Lokathor> https://hackage.haskell.org/package/random-1.1/docs/src/System-Random.html#randomIvalInteger is this actually a function that will generate all possible results in the range equally probably?
03:40 <Lokathor> I don't know enough math to be able to tell :(
03:41 <iqubic> Looks complex
03:41 <iqubic> I think it's right.
03:41 sgronblo joined
03:41 <iqubic> Not sure though
03:42 <iqubic> What's the @ symbol I sometimes see in pattern matches: foo list@(x:xs) = ...
03:43 <iqubic> Where foo is a function.
03:43 <alx741> iqubic: to let you match the whole thing with the name 'list' in that case
03:43 <alx741> so 'list' is the whole list, 'x' the first element, and 'xs' the rest of the list
03:44 <MarcelineVQ> > let foo list@(x:xs) = list ++ xs in foo "abcd"
03:44 <lambdabot> "abcdbcd"
03:45 lawrencedark joined
03:46 <MarcelineVQ> Lokathor: hard to say but have a look at random-fu as it provides various distributions and it should plug in nicely, for testing, if you're already defining things over MonadRandom
03:47 timmm0 joined
03:48 <Lokathor> if random-fu still uses the Random typeclass, it might be hard to measure :P
03:48 <Lokathor> that function is how most of the Random instances are defined
03:48 <timmm0> hello guys
03:48 <timmm0> im a newb
03:48 <timmm0> tons of questions might come your way
03:48 ditadi joined
03:48 <timmm0> and i do rtfm
03:48 <Lokathor> timmm0, got a particular project you're working on?
03:49 <timmm0> just training with basic commands
03:49 <k__> iqubic: it's called an as-pattern
03:52 sleffy joined
03:52 <Lokathor> > uses the "at" symbol, but calls it an "as" pattern.
03:52 ystael joined
03:53 <lambdabot> <hint>:1:21: error: parse error on input ‘,’
03:53 <Lokathor> http://lpaste.net/354904 whee, version one organized. Mostly just grabbing from old code, not much new here, but nice to get it put in a place.
03:54 conal joined
03:54 sgronblo joined
03:54 jer1 joined
03:55 soniku joined
03:56 kattak joined
03:56 orhan89 joined
03:57 pwnz0r joined
03:58 cschneid_ joined
04:01 jsgrant__ joined
04:01 Argue__ joined
04:03 jsgrant__ joined
04:05 wroathe joined
04:08 enitiz joined
04:09 leafgreen joined
04:09 <leafgreen> I'm wondering, is there a reason why infinite recursion in Haskell may not use any apparent CPU?
04:09 <leafgreen> I've been googling about this and not finding anything.
04:10 <leafgreen> Is it a compiler optimization that checks if the stack memory isn't changing with each recursion, and it just does nothing?
04:10 boj joined
04:11 jsgrant joined
04:11 <pacak> leafgreen: Depends. Infinite recursion might even terminate
04:11 <pacak> > let ones = 1:ones in take 3 ones
04:11 <leafgreen> well apparently it isn't
04:11 <lambdabot> [1,1,1]
04:11 _reed_ joined
04:11 blym joined
04:11 <leafgreen> ah I'm aware of the lazy evaluation cases
04:12 <leafgreen> the situation is one of my students apparently made a mistake and performed infinite recursion without changing the parameters passed in the call
04:12 edsko joined
04:12 <leafgreen> But they were convinced it wasn't an infinite recursion hang because the cpu showed 0% usage for the thread.
04:12 <iqubic> Is (:) a valid data constructor??
04:12 <iqubic> :t :)
04:12 <lambdabot> error: parse error on input ‘:’
04:12 <iqubic> :t (:)
04:12 <lambdabot> a -> [a] -> [a]
04:12 hastell joined
04:12 <iqubic> So it is.
04:13 <iqubic> > 1:2
04:13 <lambdabot> error:
04:13 <lambdabot> • Ambiguous type variable ‘a0’ arising from a use of ‘show_M727745955427...
04:13 <lambdabot> prevents the constraint ‘(Show a0)’ from being solved.
04:13 infinity0 joined
04:13 <iqubic> > 1:2 :: [Integer]
04:13 <lambdabot> error:
04:13 <lambdabot> • No instance for (Num [Integer]) arising from the literal ‘2’
04:13 <lambdabot> • In the second argument of ‘(:)’, namely ‘2’
04:13 <iqubic> Why doesn't that work?
04:13 <iqubic> > 1:2:[] :: [Integer]
04:13 <leafgreen> You can't cons an int onto an int. Only onto an int list.
04:13 <lambdabot> [1,2]
04:13 <iqubic> So cons is Right assosiative?
04:13 <leafgreen> That one is okay because you are consing onto an empty int list
04:14 <iqubic> That's what my test seems to show.
04:14 {emptyset} joined
04:14 <iqubic> > 1:2:[]
04:14 <lambdabot> [1,2]
04:14 <leafgreen> > (0$0 :)
04:14 <lambdabot> error:
04:14 <lambdabot> The operator ‘:’ [infixr 5] of a section
04:14 <lambdabot> must have lower precedence than that of the operand,
04:14 <pacak> Prelude> :info (:)
04:14 <pacak> data [] a = ... | a : [a] -- Defined in ‘GHC.Types’
04:14 <pacak> infixr 5 :
04:14 <leafgreen> infixr -> it is right associative
04:15 <leafgreen> lol the info command is nice. I didn't know that.
04:15 <iqubic> Question: If a function is looking for a Rational, and I give it 1 :: Integer, will that pass type checking?
04:15 <leafgreen> the 0$0 hack seems to show the info for some things that :info does not, strangely.
04:16 <iqubic> What does th 0$0 even do?
04:17 <iqubic> Does a greater infix number mean the operater is evaluated first, or last?
04:17 gallais joined
04:17 <roboguy`_> iqubic: no. But it is pretty easy to convert to a Rational from an Integer
04:18 <iqubic> roboguy`_: How?
04:18 <roboguy`_> :t fromIntegral (3 :: Int) :: Rational
04:18 <lambdabot> Rational
04:18 <iqubic> Ah, I see.
04:18 <roboguy`_> I use fromIntegral quite a bit
04:18 <roboguy`_> it's fairly general
04:18 <roboguy`_> :t fromIntegral
04:18 <lambdabot> (Num b, Integral a) => a -> b
04:18 dfeuer joined
04:18 jer1 joined
04:18 afarmer joined
04:19 <iqubic> Yeah, but that goes the wrong way.
04:19 plutoniix joined
04:19 <roboguy`_> oh, I thought you wanted to give an Integer to a function that takes a Rational
04:19 <iqubic> I do.
04:19 <roboguy`_> that should go the right way then...
04:19 <iqubic> or rather other way around.
04:20 plutoniix joined
04:20 <roboguy`_> for the other way...
04:20 <roboguy`_> :t fromRational
04:20 <lambdabot> Fractional a => Rational -> a
04:20 <roboguy`_> :t (ceiling, floor, round)
04:20 <lambdabot> (Integral b, Integral b1, Integral b2, RealFrac a, RealFrac a1, RealFrac a2) => (a2 -> b2, a1 -> b1, a -> b)
04:20 <iqubic> I want to have a function of the type (Num a, Integral b) => a -> b
04:20 <roboguy`_> it depends on the rounding behavior you want
04:20 <iqubic> Is it possible to take the ceiling of 1 % 2?
04:21 <glguy> what happened when you tried?
04:21 <roboguy`_> > ceiling (1 % 2)
04:21 <lambdabot> 1
04:21 Rodya_ joined
04:21 <iqubic> for me percent is not in scope.
04:21 <leafgreen> > 2 :: Rational
04:21 <lambdabot> 2 % 1
04:21 <roboguy`_> iqubic: import Data.Ratio
04:21 <leafgreen> See, that works automatically.
04:21 plutoniix joined
04:21 <leafgreen> Because of this. http://stackoverflow.com/a/22637684
04:22 MP2E joined
04:22 <leafgreen> the 0%0 hack forces an error message that is very revealing about the parse and operator precedence and associativity. It works because of something it does that can never parse in Haskell.
04:23 <leafgreen> See http://stackoverflow.com/a/23587308
04:23 plutoniix joined
04:24 danthemyth joined
04:25 fakenerd joined
04:25 <iqubic> > (0$0 !!)
04:25 <lambdabot> error:
04:25 <lambdabot> The operator ‘!!’ [infixl 9] of a section
04:25 <lambdabot> must have lower precedence than that of the operand,
04:25 <iqubic> I don't get that error
04:25 <leafgreen> It just showed above...
04:25 <leafgreen> I see it in ghci too, which version are you using?
04:26 <iqubic> I can see it in GHCi too.
04:26 <leafgreen> don't get = don't understand?
04:26 <iqubic> Yeah
04:26 <iqubic> I don't understand it.
04:26 <leafgreen> The info you want to glean from that is the [infixl 9] part. The rest is just complaining about the parse error.
04:27 <leafgreen> The parse error was done on purpose to get the message to show.
04:27 <iqubic> Oh. I see.
04:27 <leafgreen> :info (:)
04:27 <iqubic> Cool little hack.
04:28 <thang1> > (0:0 !!)
04:28 <iqubic> leafgreen: I have seen the info command. It's rather cool.
04:28 <lambdabot> error:
04:28 <lambdabot> The operator ‘!!’ [infixl 9] of a section
04:28 <lambdabot> must have lower precedence than that of the operand,
04:28 <thang1> see?/ neat :p
04:28 <leafgreen> > :info (!!)
04:28 <iqubic> Yeah, I get what going on.
04:28 <lambdabot> <hint>:1:1: error: parse error on input ‘:’
04:28 a3Dman joined
04:29 <thang1> wait, why does info work for !! but not for :
04:29 <iqubic> So we can use any infixl 0 function between the zeros?
04:29 <thang1> nvm, leafgreen and lambdabot are the same color in my terminal and I had a brainfart
04:29 <leafgreen> Haha.
04:29 <leafgreen> Yeah info seems not to work in here.
04:29 <iqubic> lambdabot don't do info
04:30 <leafgreen> interestingly :info (!!) doesn't show the assoc info, but the 0$0 hack does.
04:30 <thang1> Which is pretty funny. You'd think info would be... informative
04:30 <iqubic> Yeah, when not specified, assume infixl 9
04:30 <iqubic> Did you read those stack overflow answers you posted? Answer was in there.
04:31 <thang1> Or... :info can specify it?
04:31 <leafgreen> iqubic I read them back when I bookmarked them. I didn't memorize the contents
04:31 <thang1> I hate it when informative commands leave out "defaults"
04:31 <thang1> if I'm asking for the info, there's a good chance I don't know it, so don't leave out implied defaults...
04:32 <iqubic> Why do you have those bookmarked???
04:32 unK_ joined
04:33 <leafgreen> I bookmark anything I find interesting... and sure enough I had reason to pull up the bookmark in this convo
04:33 <thang1> hah, I'm the same way except I use Pocket
04:33 ericw joined
04:33 <thang1> Literally hundreds of links in Pocket. Far easier to remember small metadata about something than the actual thing. I liken it to a table cache in my brain
04:34 jhrcek joined
04:34 <leafgreen> if I lost my bookmarks my productivity would drop by a lot. it's my own personal search engine at this point
04:34 <iqubic> What's Pocket?
04:35 <rotaerk> hmm I don't really use bookmarks... I've bookmarked things but I never go back actually revisit it
04:35 <leafgreen> You never know when something might be useful. That's why I bookmark and tag almost anything remotely interesting
04:35 <leafgreen> saved me a bunch of times
04:35 <thang1> Pocket is similar to "bookmarks in the cloud" concept
04:36 <thang1> You have an account and it allows you to save links and tag them
04:36 <leafgreen> most browsers have a built-in concept like that now
04:36 smillmorel joined
04:36 <thang1> so I have links tagged "programming", "haskell", "cooking", etc. But I can access them on my phone, laptop, or even some random webbrowser in a library
04:36 wroathe joined
04:36 <thang1> I prefer pocket because it doesn't depend on using a certain browser :) I switch between chrome and firefox a lot
04:37 <leafgreen> I see
04:37 <leafgreen> I've been partial to ff for a long time
04:38 <thang1> I love firefox solely for its vimperator plugin. Muh keyboard bindingz
04:38 jer1 joined
04:38 <thang1> Chrome, however, I use on Android because it's baked so thoroughly in at this point that it has a gazillion neat features that come in handy a lot
04:39 <leafgreen> Well, I gotta run. Interesting talking to you all
04:40 m0cesta joined
04:40 <thang1> see ya
04:41 <m0cesta> Why pure (Left 10) returns Left 10?
04:41 <c_wraith> m0cesta: ghci lies to you
04:41 darjeeling_ joined
04:41 <c_wraith> m0cesta: ghci is defaulting to to IO
04:42 <c_wraith> m0cesta: so.. pure (Left 10) :: IO (Either Integer a)
04:42 <c_wraith> m0cesta: and when you give ghci an IO action, it runs it and prints the result if it's something in Show other than ()
04:42 <m0cesta> I see, thanks
04:42 <c_wraith> > pure (Left 10) :: Maybe (Either Integer String)
04:43 <lambdabot> Just (Left 10)
04:46 hyPiRion joined
04:46 LuckyRawApe joined
04:46 blym_ joined
04:48 vaibhavsagar joined
04:49 orhan89 joined
04:50 eklavya joined
04:50 Levex joined
04:50 sgronblo joined
04:52 wroathe joined
04:52 biglambda joined
04:52 SadoqueTD joined
04:52 lassemaster joined
04:53 ystael joined
04:55 Levex joined
04:58 BartAdv joined
04:58 <frew> I am trying to apply a callback to a Gtk widget, the code is https://github.com/frioux/dotfiles/blob/taffybar-advance/taffybar/taffybar.hs#L34-L37 and I'm getting this as an error: http://paste.scsys.co.uk/559024 . Reading various things on the internet about that error it sounds like a constraint ( => I think
04:58 <frew> ) would at least make this more clear, though likely not resolve the problem
04:58 <frew> anyone have any ideas or tips?
04:58 markus_ joined
04:59 jer1 joined
05:00 <thang1> Spawn is unsafe and then you just blindly return true
05:00 <thang1> How do you know you actually, ah, made the widget?
05:00 bjz joined
05:01 <lpaste> glguy pasted “for frew” at http://lpaste.net/5174934910162436096
05:01 <frew> I think I'm just attaching a callback?
05:01 <frew> that's what I'm trying to do anyway
05:01 <glguy> frew: That would probably typecheck. I don't know if it's how you're supposed to use this tool
05:01 <iqubic> What does spown do?
05:01 <frew> it's supposed to just run a program, if I understand correctly
05:01 caumeslasal joined
05:01 <iqubic> Yeah, it does.
05:02 <frew> it's from https://hackage.haskell.org/package/xmonad-contrib-0.11.1/docs/XMonad-Util-Run.html
05:02 <iqubic> I use spawn in my XMonad config to get keybindings to work.
05:02 <frew> right
05:02 <frew> so I'm trying to use spawn in TaffyBar, a GTK bar for XMonad basically
05:02 <iqubic> I can post my config if you'd like. It's nothing too fancy.
05:03 <iqubic> It uses dzen though.
05:03 Xanather joined
05:03 <frew> nah, thanks though
05:03 <iqubic> You want me to help you with taffybar?
05:03 <frew> I had dzen for a while but I wanted to kinda go further, with graphs and such
05:03 <frew> that'd be great, if you don't mind
05:04 <frew> fwiw I have Xmonad working perfectly; I just am trying to get TaffyBar working how I had awesomewm working
05:04 <iqubic> What isn't working in your taffybar set-up?
05:04 <frew> well I wanted to start by making my widgets clickable
05:04 <frew> so if I click a weather widget, open a browser to a page about that weather
05:04 <iqubic> Is that possible with taffybar?
05:04 <lpaste> glguy annotated “for frew” with “or maybe you're supposed to do this?” at http://lpaste.net/5174934910162436096#a5904117509736366080
05:05 <frew> iqubic: I don't see why not, it's just gtk widgets
05:05 <iqubic> Why are you using unsafeSpawn, over spawn?
05:05 <frew> glguy: lemme see; someone said something like that on github but I didn't nuderstand it
05:05 <frew> iqubic: it's the same thing, don't I need to use unsafeSpawn to pass args?
05:06 <iqubic> Yes.
05:06 <frew> glguy: well that passes type constraints
05:07 dfeuer joined
05:07 <iqubic> I mean you can get the same functionality if you use spawn instead of unsafeSpawn.
05:07 <frew> doesn't launch the program but that's some kind of progress
05:07 <frew> iqubic: ok, yeah I just must have misread or something
05:07 a3Dman joined
05:08 biglambda joined
05:08 <frew> I wonder if I need to wrap the widgets in an ebox to make events actually work
05:09 alqatari joined
05:09 <frew> this is what makes me think that: https://github.com/travitch/taffybar/blob/e9b9c39540d77eb8f3e0e723ddfd033456f61364/src/System/Taffybar/LayoutSwitcher.hs#L93-L100
05:09 <iqubic> frew, what happens when you use your current set-up?
05:10 <iqubic> What happens when you click on the weather widget?
05:10 JoshS joined
05:10 <frew> nothing at all, no new tab in firefox, nothing logged to the console
05:10 <iqubic> Alright, I'll try and see if I can see what's wrong.
05:11 <frew> thanks!
05:12 <iqubic> Have you tried wrapping the widget in an ebox?
05:12 afarmer joined
05:12 <frew> no, that was my next idea, but I'm honestly not sure how; might try doing it in the new do block I have that was recommended by glguy
05:13 <iqubic> Sounds good.
05:13 <frew> trying now
05:14 <frew> !!!
05:14 <frew> it worked!
05:14 <iqubic> Cool.
05:15 <frew> thanks for your help iqubic, glguy
05:15 <iqubic> Can I see the final config. I'm rather curious about what you did now.
05:15 <iqubic> ??
05:15 <frew> yeah totes
05:15 <frew> just a sec
05:15 <frew> https://github.com/frioux/dotfiles/blob/taffybar-advance/taffybar/taffybar.hs#L60-L65
05:17 <iqubic> Cool, that looks great.
05:18 <frew> alright, now to make some pull requests as examples for TaffyBar :)
05:19 jer1 joined
05:20 <iqubic> Why? Why do you need to make a pull request
05:20 abhiroop joined
05:21 <frew> only to improve the docs
05:21 <frew> I figure that with something as powerful as Gtk people will be bound to want to do this kind of thing
05:21 <frew> so making it obvious how to do it seems worthwhile
05:23 Rodya_ joined
05:23 <thang1> frew: what's your actual setup look like?
05:24 xtreak joined
05:24 <frew> thang1: not sure what you are asking; I use XMonad as a window manager and TaffyBar (was using AwesomeWM but the break in backcompat was just too frustrating)
05:25 <thang1> I was just curious how your actual bar and windows look
05:25 <frew> ah
05:25 <frew> sec I can take a screenshot
05:26 dfeuer joined
05:26 <iqubic> How do you make it so that the window don't cover up the status bar?
05:26 <frew> that's called "struts"
05:26 <frew> it's a thing that most bars do for you
05:26 <frew> basically they tell the WM (or X11?) "I take up this much space" and you tell XMonad to honor it
05:27 <thang1> lemonbar doesn't (or bspwm doesn't give a shit). I configure mine manually :p
05:27 <iqubic> With my config, Dzen always gets covered up, and I have no idea how to fix that.
05:27 mbuf joined
05:27 <frew> sec I can show you
05:27 <frew> I did it with Dzen
05:27 osa1 joined
05:27 osa1 joined
05:27 <frew> iqubic: https://github.com/frioux/dotfiles/blob/master/xmonad/xmonad.hs#L19
05:28 afarmer joined
05:28 <frew> I think that comes from ManageDocks
05:28 <biglambda> Is there a way to determine if malloc or realloc is failing?
05:28 ploop joined
05:29 <iqubic> What does SendMessage ToggleStruts do?
05:29 <frew> ToggleStruts lets you turn them off and on
05:29 <frew> I never do it but I'm trying it out
05:29 <frew> you can leave it out
05:29 <frew> thang1: https://imgur.com/a/6SuYk
05:29 <thang1> nice
05:29 Shawn joined
05:30 <thang1> butt ugly, but functional
05:30 <frew> the blank graph is going to be a battery graph but that's broken, green is cpu, blue is memory, two temps are different geographic locations that I'll add labels to eventually
05:30 <frew> yeah I don't care about how it looks honestly :)
05:32 <iqubic> Weird. I wonder why my config covers up my dzen status bar. I also have avoidStruts.
05:32 <frew> ok I also was using Tasker
05:32 <frew> it's possible that was advertising the struts
05:32 <thang1> Mine: http://i.imgur.com/F0kDvmG.jpg
05:32 pungi-man joined
05:32 <iqubic> What does Tasker do?
05:32 Guest68946 left
05:32 Costar joined
05:32 <frew> shows the icons that some programs require, like dropbox etc
05:32 cobreadmonster joined
05:32 <iqubic> So it's like "trayer"
05:32 wroathe joined
05:32 <frew> oh sorry
05:32 <frew> I meant trayer
05:32 <* frew> can't think
05:32 nickager joined
05:33 <thang1> lol we've all been there
05:33 Argue_ joined
05:33 <frew> thang1: your chat is gorgeous
05:33 shawn_lu joined
05:33 <thang1> I take my ricing seriously
05:33 <frew> lol
05:33 <thang1> (semi seriously)**
05:34 <frew> yeah I have let that part of my brain rot
05:34 <frew> I'm purely functional (ha ha ha)
05:34 <iqubic> LOL
05:34 <iqubic> So does dzen not have struts?
05:34 <frew> I could have swore it did
05:34 fakenerd joined
05:34 <iqubic> And if not, is there a way to make it so that dzen is not covered up?
05:35 <frew> you could do what iqubic did and just tell it not to go over the top 24 (or w/e) pixels
05:35 <frew> iqubic: when you run tasker, try running with --SetPartialStrut true
05:35 <iqubic> I don't use tasker.
05:35 <frew> sorry, trayer
05:36 <iqubic> I don't even use trayer
05:36 <frew> or do you not use that either?
05:36 <frew> huh
05:36 <iqubic> I use just dzen
05:36 <frew> hardcore.
05:36 <iqubic> Nothing else but dzen
05:36 iomonad joined
05:36 <iqubic> And I don't want dzen to be covered up
05:36 abhiroop joined
05:36 <frew> I had the feel that dzen might not be doing it because it looked like it was a couple pixels off
05:36 <Lokathor> they just imagine the bits that they want to have written directly written into RAM
05:36 <frew> thang1: how did you tell xmonad not to overlay dzen, or are you *just* using trayer?
05:37 <iqubic> frew uses bspwm
05:37 <iqubic> Or rather thang1 does.
05:37 a3Dman joined
05:37 <iqubic> thang1: Do you use bspwm?
05:37 insitu joined
05:37 <iqubic> http://termbin.com/dgyx
05:37 abhiroop joined
05:37 <iqubic> That's my XMonad config.
05:38 <iqubic> https://mail.haskell.org/pipermail/xmonad/2010-December/010913.html
05:38 <iqubic> Also see that related thing.
05:39 <iqubic> https://mail.haskell.org/pipermail/xmonad/2010-December/010913.html
05:39 <iqubic> https://github.com/xmonad/xmonad/issues/21
05:39 <iqubic> And that second thing.
05:39 albel727 joined
05:40 jer1 joined
05:40 mp22 joined
05:40 <frew> huh, I'm on 0.12 fwiw
05:40 <frew> (which isn't much, since I'm not using dzen anymore
05:40 fizruk joined
05:41 <iqubic> I switched to 0.13 about 2 weeks ago.
05:41 <frew> iqubic: have you asked in #xmonad?
05:41 <frew> yeah I just use what's shipped by the package manager unless I have a really compelling reason not to
05:41 fakenerd_ joined
05:41 electrostat joined
05:41 shawn_lu_ joined
05:42 <iqubic> frew: I have not done that.
05:42 <frew> might be worth a shot; I got some help setting up some more basic things there I think
05:42 cgfbee joined
05:42 Levex joined
05:42 fkurkowski joined
05:44 <iqubic> I just asked in there. Now we wait.
05:44 <frew> if you don't get a response, it might be worth asking again in about 8 hours
05:44 <frew> not sure what TZ the channel is mostly you know?
05:44 quchen joined
05:45 <iqubic> No.
05:45 blym_ joined
05:45 sproingie joined
05:45 <iqubic> I'm not sure what the TZ is in #xmonad
05:47 takuan joined
05:47 biglambda joined
05:47 mstruebing joined
05:49 caumeslasal joined
05:50 <frew> well it's late here; thanks again for your help!
05:50 <frew> & zzz
05:51 fakenerd joined
05:54 ystael joined
05:55 ThomasLocke joined
05:56 bertschneider joined
05:57 soniku joined
05:57 pwnz0r joined
05:58 magthe joined
05:58 sgronblo joined
05:59 <thang1> sorry, yes I use bspwm. My bar is lemonbar
05:59 shawn_lu_ left
05:59 <thang1> the text editor is emacs running spacemacs. The web browser is firefox with vimperator and a few plugins to hide all the useless shit
06:00 jer1 joined
06:02 Gurkenglas joined
06:02 moet joined
06:02 raichoo joined
06:04 <iqubic> thang1: Do you have a list of all the spacemacs commands for interacting with Haskell Mode? I have been looking for that for a while.
06:05 ogrady joined
06:05 <iqubic> I use spacemacs, but I don't know how to use spacemacs *and* Haskell Mode
06:05 sproingie joined
06:05 sproingie joined
06:06 abinr joined
06:08 Argue__ joined
06:08 dfeuer joined
06:09 <thang1> I use spacemacs + Intero
06:09 <thang1> So in your dotspacemacs-configuration-layers setting
06:10 <magthe> iqubic: I guess you've already checked the layer's docs via `SPC h l`, right?
06:10 <thang1> haskell-completion-backend 'intero is what I have set
06:10 Argue_ joined
06:12 seangrove joined
06:13 fotonzade joined
06:14 Mortomes|Work joined
06:14 <iqubic> magthe: I haven't actually looked at that.
06:15 <cobreadmonster> What's up peeps?
06:15 <iqubic> thang1: Can't I use auto-completer?
06:16 ploop joined
06:17 sgronblo joined
06:17 wilkie1 joined
06:18 seangrove joined
06:18 insitu joined
06:19 eatman joined
06:19 <moet> does haddock generate docs for associated data families' constructors and parameters?
06:20 <moet> it seems documented "yes" https://www.haskell.org/haddock/doc/html/markup.html ... but it seems to not work
06:21 nepiktaz joined
06:21 jer1 joined
06:21 <thang1> Sure, auto completion is fine in Haskell
06:22 <thang1> I've never really needed it when writing haskell because it's so terse in general... The autocomplete setup that I have right now isn't IDE level, though
06:22 thunderrd_ joined
06:24 <cocreature> moet: do you have some minimal examples that doesn’t work? I know it works for associated types, e.g. https://hackage.haskell.org/package/supermonad-0.1/candidate/docs/Control-Supermonad-Constrained-Functor.html, but I don’t think I’ve tried associated data families
06:24 <Lokathor> the thing about auto complete, and editor features in genral, is that an editor will seemingly never know what i really want
06:24 <Lokathor> it will always do the wrong thing
06:25 <cocreature> moet: http://lpaste.net/354908 works just fine
06:26 seangrove joined
06:27 <moet> cocreature: i'll try to make a repro
06:27 <moet> i'm referring to the `-- | prose` in the documentation no showing up for me
06:28 <cocreature> oh ok
06:28 <zomg> Super monads?
06:28 <zomg> Do you guys never have enough?
06:28 <zomg> :D
06:28 <thang1> Ever seen the Tardis monad?
06:28 <cocreature> zomg: I was just randomly looking for a package with associated types :)
06:29 <cocreature> moet: http://lpaste.net/354909 works as well for me
06:29 a3Dman joined
06:30 magneticduck joined
06:30 robatosan joined
06:31 <lpaste> moet revised “No title”: “no haddock prose on data family intance” at http://lpaste.net/354909
06:32 <moet> cocreature: uh, that overwrote your paste? but.. anyhow, i meant on the instance..
06:32 <cocreature> np
06:32 yellowj joined
06:32 <cocreature> moet: I can reproduze that
06:33 <moet> cocreature: sad to hear that :P
06:34 freusque joined
06:35 <cocreature> moet: well now you know you need to fix it :P
06:36 yuze joined
06:37 <iqubic> What is the tardis monad? As a Doctor Who fan, I need to kno what that is.
06:37 <cocreature> https://hackage.haskell.org/package/tardis
06:37 <jle`> @hackage tardis
06:37 <lambdabot> http://hackage.haskell.org/package/tardis
06:37 <thang1> It's literally a time traveling monad
06:37 <moet> cocreature: yes, er. just let me fire up my trusty ghc build environment.. then i can submit a patch with the trac account i totally have ;)
06:37 <iqubic> thang1: How does it work?
06:38 <cocreature> moet: haddock is just a cabal package, no need to set up a ghc build environment :P
06:38 <thang1> I, uhh, have not a good understanding of monads. So the answer to me is "black magic"
06:38 <moet> cocreature: OH
06:38 <moet> cool.
06:38 <jle`> thang1: understanding monads isn't relevant here
06:38 <moet> thank you :)
06:38 <jle`> it's just a specific instance :)
06:38 <cocreature> moet: and I think you can submit patches on github, so you’re out of excuses :P
06:38 <moet> cocreature: yes, yes i am. hmm..
06:38 <moet> it's bedtime!
06:38 <thang1> https://github.com/DanBurton/tardis
06:38 <jle`> iqubic: it helps if you are familiar with State, but it's basically just State but the state propagates backwards instead of forwards
06:39 <iqubic> How does that work?
06:39 <thang1> "It is isomorphic to a StateT on top of a ReverseStateT"
06:39 <jle`> that's how it works
06:39 <iqubic> Alright then.
06:39 <jle`> you just switch where you get the state from :)
06:39 <iqubic> What is a ReverseStateT?
06:39 <jle`> and which direction the state moves in
06:39 <thang1> k so if I say that x = x + 5 I just changed the state of x
06:39 alqatari joined
06:39 cschneid_ joined
06:40 <thang1> if you think about it in terms of "time", I went from x ......-> x+5
06:40 <thang1> since haskell is referentially transparent, all changes in state are reproducable**, so you can go backwards from x+5 -------> x
06:40 <iqubic> Sure. I get that.
06:40 <jle`> for State, *> sequences changes in state. so `x *> y`, where x and y are state actions, becomes a new state action where 'x' is done, then 'y'
06:40 <thang1> hence, traveling back in time
06:41 <jle`> but for ReverseState, if x and y are reverse state actions, then 'x *> y' is a new reverse state action that does 'y', then does 'x'
06:41 <jle`> it's basically kind of like flipping (*>)
06:41 <jle`> if x *> y is "do x then do y" for State, then x *> y is "do y then do x" for reverse state. they're just the flipped implementation
06:41 jer1 joined
06:42 a3Dman joined
06:42 <jle`> if you write <*> for State, then you can write <*> for ReverseState. just flip everything :)
06:42 <iqubic> Why is that useful?
06:42 <thang1> It's not, it's just cool
06:42 <jle`> it's mostly novel
06:42 <thang1> However it does provide a super elegant (and really fucking slow) implementation of the water bucket area problem (or whatever that problem is actually called)
06:43 <iqubic> What is that??
06:43 <jle`> thang1: being referentially transparent doesn't mean that changes in state are invertible
06:43 <jle`> it doesn't actually invert any state changes
06:43 <jle`> all it does is just flip the parameters to <*>/>>=, more or less
06:43 <thang1> http://chrisdone.com/posts/twitter-problem-loeb
06:44 <thang1> jle`: my bad. Told ya I didn't understand shit :p
06:44 baldrick joined
06:44 <thang1> The ** was to signify I was talking out my ass and was probably wrong but I forgot to actually write the disclaimer
06:45 sproingie joined
06:46 zalun joined
06:46 <zalun> hey - anyone here worked on phabricator integration for haskell-infra ?
06:47 <zalun> https://github.com/haskell-infra/libphutil-haskell/tree/master/src/extensions/differential/customfield
06:47 bjz joined
06:49 <Axman6> the #haskell-infrastructure channel might be a better place to ask
06:50 govg joined
06:50 detrumi joined
06:50 coot__ joined
06:51 ploop joined
06:51 laplacian joined
06:51 monochrom joined
06:53 mmn80 joined
06:54 seveg joined
06:55 raichoo joined
06:55 ystael joined
06:55 guiben joined
06:56 pavonia joined
06:56 selthas joined
06:57 insitu joined
06:57 dfeuer joined
06:58 bvad joined
07:00 crave joined
07:01 zeroed joined
07:01 zeroed joined
07:01 fakenerd joined
07:01 mavihs joined
07:01 mavihs joined
07:01 seveg joined
07:01 sproingie joined
07:01 sproingie joined
07:02 hastell joined
07:02 nut joined
07:03 <iqubic> So, if haskell was *NOT* lazy then the tardis monad would be impossble to create
07:03 blender3 joined
07:03 <jle`> i don't think i'd say impossible
07:03 <jle`> but it might be a bit more complicated to implement
07:04 <jle`> since right now its implementation is like silly simple
07:04 <iqubic> I think the backwards traveling stream would be impossible in a non-lazy language.
07:05 kattak joined
07:05 <jle`> have you considered the fact that it's possible to implement lazy algorithms in a strict language
07:05 <iqubic> no.
07:05 <iqubic> It's not possible.
07:05 <jle`> http://danieltao.com/lazy.js/, for instance
07:05 <jle`> the language just makes it simpler to do
07:05 jer1 joined
07:06 <jle`> https://bartoszmilewski.com/2014/04/21/getting-lazy-with-c/
07:06 dm3 joined
07:06 <jle`> heck, even python has generators, which can be thought of as lazy lists
07:07 <jle`> laziness is just semantics, and it can be implemented in any language
07:07 kattak_ joined
07:07 <jle`> the only role a programming language has is making it easier or harder to write lazy algorithms
07:08 c0smo joined
07:08 sz0 joined
07:09 <LiaoTao> jle`: But isn't that just semantics? You would just be implementing another (lazy) language in terms of your strict language?
07:09 <LiaoTao> woudln't*
07:09 <LiaoTao> wouldn't* dammit
07:09 <jle`> yes, you could go about it by implementing thunks in whatever language you are using
07:10 zalun left
07:10 oish joined
07:10 <jle`> the language wouldn't become a lazy language
07:10 <jle`> but it lets you implement algorithms that rely on laziness
07:10 <jle`> and get similar operational complexities
07:10 a3Dman joined
07:10 a3Dman joined
07:11 albertid joined
07:11 <jle`> you can implement algorithms that rely on laziness (and data structures that rely on laziness) in any language, it just is easier in some than others
07:11 MoALTz joined
07:11 <LiaoTao> jle`: Which makes the distinction less poignant?
07:12 <jle`> yeah, this was in response to saying "X can't be implemented in a language without laziness"
07:12 juhp joined
07:12 <yushyin> iqubic: yup, implemented lazy eval in java once for an assignment
07:13 <jle`> or rather, the statement was "if haskell was not lazy, it would be impossible to implement X"
07:13 ogkloo joined
07:14 <thang1> lazy eval in java? good lord
07:14 <nshepper1> The TARDIS monad in a strict language would probably be gross and not as impressive though
07:15 <thang1> The key thing about laziness for me (personally) is that if you design a language/compiler/etc toolchain around laziness
07:15 <thang1> It's far easier to include an opt-in strictness evaluation model
07:15 <jle`> nshepper1: it's definitely not something i would want to be put in charge of :)
07:15 <thang1> However with a strict-model toolchain, it's almost always 10x uglier and ridicuous to try and strap in a lazy model on top of that
07:16 <thang1> So... lazy > strict ;)
07:16 theelous3 joined
07:16 <thang1> Also, I really like things like cycle and [1..]
07:17 taktoa joined
07:17 guiben joined
07:19 <jle`> thang1: btw, is your username a reference to the nonstandard spelling of 'thing', or to one of the many potential vietnamese words it is? :o
07:19 jer1 joined
07:19 fakenerd joined
07:20 jrslepak joined
07:20 Bashmetim joined
07:20 jaspervdj joined
07:21 _flow_ joined
07:21 <moet> hmm.. i'm having trouble exporting the field names of an associated data constructor .. https://downloads.haskell.org/~ghc/7.6.2/docs/html/users_guide/type-families.html#data-family-import-export this link seems to indicate that i must explicitly mention the field names
07:23 fakenerd_ joined
07:23 a3Dman joined
07:24 <moet> naming them explicitly works
07:24 insitu joined
07:25 Rodya_ joined
07:26 noark9 joined
07:26 aarvar joined
07:28 govg joined
07:28 bennofs joined
07:31 Maxou joined
07:32 marr joined
07:32 Sampuka joined
07:33 thc202 joined
07:33 crave joined
07:34 Reisen joined
07:35 cdidd_ joined
07:37 sophiag` joined
07:38 osa1 joined
07:38 osa1 joined
07:39 <thang1> jle`: It's a really obtuse reference to doctor seuss
07:39 mattyw joined
07:39 connrs joined
07:39 <thang1> It used to be thang1thang2 (my reddit username) but I shortened it to thang1 on irc because shortnames are nicer
07:40 <thang1> thang1 and thang2 really being the characters "thing 1" and "thing 2" of doctor seuss's books
07:40 Dykam_ joined
07:40 adarqui joined
07:40 ogre joined
07:40 robogoat_ joined
07:40 revprez_ joined
07:40 edejong_ joined
07:40 Matajon_ joined
07:40 jstimpfle joined
07:40 ericw_ joined
07:41 weinzwan1 joined
07:41 earldoug1as joined
07:41 iqubic_ joined
07:41 d-q-d joined
07:41 takuan_dozo joined
07:41 hc joined
07:41 heath_ joined
07:41 phz__ joined
07:41 aweinsto1k joined
07:41 eyck_ joined
07:41 tinkyhol1oway joined
07:41 xinming_ joined
07:41 fryguybob joined
07:41 Sornaensis joined
07:41 geekosaur joined
07:42 ploop_ joined
07:43 rightfold left
07:44 theorbtwo joined
07:44 sagax_ joined
07:45 magicman joined
07:47 tg joined
07:47 jakub_ joined
07:48 wroathe joined
07:48 <ij> Can I export a name from a module under a different name?
07:49 <thang1> Sure, why not?
07:49 <thang1> wait... I might be thinking of import. jle` help pls
07:50 a3Dman joined
07:50 hvr joined
07:50 hvr joined
07:50 nickolay joined
07:50 <ij> I think you can export only under the real name.
07:50 <jle`> yeah you can't rename exports in general, that's actually one of the common complaints about the haskell module system
07:51 <jakub_> Hi, I currently have code like 'SomeTrans . put =<< (traverseOf lenses someTransAction) =<< SomeTrans get, is there a nicer way with lens library (to hide reading and writing the state, something like the %= but for a monadic action rather than plain old function)?
07:51 ventonegro joined
07:51 <thang1> Thanks. At first I was like, sure just import qualified as... but then I realized it was Export, not Import. Too late over here :)
07:51 <jle`> it prevents people from doing a lot of things that would make alternative Preludes useful
07:51 <jle`> with functions you can re-name the function and export the new binding, and same with type synonyms to some extent
07:52 <tsahyt> is there a schedule somewhere for the next GHC release? The wiki says mid April for the final release, but that's over already.
07:52 <jle`> jakub_: you might want to look into zoom
07:52 <tsahyt> I'm asking because apparently Cabal 2.0 should release with it, and I need foreign library support for something. So if the release is soon enough I can just wait a bit rather than trying to convince stack to use the new cabal somehow
07:53 <jakub_> jle`: thanks, i am reading it now
07:53 <jle`> i'm not sure if it's the exact pattern you're looking for, but it might be similar
07:54 <jakub_> jle`: hopefully we will see soon :) but currently i have no idea what zoom does :)
07:54 <jle`> jakub_: zoom :: Lens' s1 s2 -> State s2 a -> State s1 a
07:55 fotonzade joined
07:56 ystael joined
07:56 <jakub_> jle`: the challenge for me is that i want something that takes (a -> m b) and modifies the state accordingly, if i had a constant (m b) i guess i could just do <~
07:58 abinr joined
07:58 soniku joined
08:00 zeroed joined
08:00 zeroed joined
08:00 orhan89 joined
08:00 <thang1> welp it's 1am over here and I finally finished this dumbass assignment so I'm gonna go to bed and see how much sleep I can get before I need to wake up (hint: not enough)
08:01 xtreak joined
08:01 oisdk joined
08:02 uuplusu joined
08:03 hastell joined
08:04 wroathe joined
08:05 tomboy64 joined
08:05 srbaker_ joined
08:06 Itkovian joined
08:07 dfordiva` joined
08:07 DocWinter joined
08:07 blender3 joined
08:07 holla joined
08:08 blocky joined
08:08 biglama joined
08:09 redeemed joined
08:10 alfredo joined
08:11 cgfbee joined
08:11 a3Dman joined
08:11 biglama joined
08:15 fendor joined
08:16 balor joined
08:16 vlatkoB joined
08:16 falafel joined
08:16 fkurkowski joined
08:17 <ph88_> jle`, do you know a lot about Conduit ?
08:17 <jle`> i have used it before
08:18 dfordiva` joined
08:18 <cocreature> asking your question directly usually works better than asking if someone knows something about the topic of your question
08:19 wroathe joined
08:19 JagaJaga joined
08:20 <ph88_> cocreature, ye ok, but i asked it yesterday and it's a hard question i think. Not sure how to tie together Conduit State and IO
08:20 <ph88_> ok i re-ask
08:20 Swizec joined
08:22 mattyw joined
08:22 <ph88_> so ye basically i want to combine two functions https://bpaste.net/show/f541df9320e5
08:22 <ph88_> the second conduit function i want to call evalState on it, but i don't know how
08:23 <ph88_> i did some trial and error putting evalState in a few places but that was a dead end
08:23 andyhuzhill1 joined
08:23 <cocreature> where should the initial state come from?
08:23 <ph88_> i think this stackoverflow answer possibly contains an important hint http://stackoverflow.com/a/24528696
08:24 <cocreature> one option would be to mmorph both conduits to ConduitM … (StateT StreamState IO) …
08:24 mjora7 joined
08:24 <osa1> is there a way to encode a Csv type in cassava without generating a [Record] from `Csv` ?
08:24 lep-delete joined
08:24 <ph88_> i have this for the initial state https://bpaste.net/show/667e3809ad7f
08:24 <cocreature> ph88_: maybe add a type annotation to pipe to make it clearer what you expect the result of the composed conduits to be
08:25 <ph88_> cocreature, i don't have any expectations about that yet
08:25 <ph88_> can i use StateT and use liftIO as the SO answer suggest ?
08:26 <srhb> osa1: Can you explain why you want this? It doesn't sound like it makes a lot of sense, if you have just one "Record", using encode is as simple as making a one-element list.
08:26 <cocreature> sure
08:26 Rodya_ joined
08:26 <ph88_> but how ?
08:26 <cocreature> that’s what I meant by mmorphing to ConduitM … (StateT StreamState IO)
08:26 <ph88_> oh
08:26 <ph88_> i thought you wanted me to use this package https://hackage.haskell.org/package/mmorph
08:26 <cocreature> I do :)
08:26 <ph88_> o_O
08:26 <cocreature> conduit already depends on it anyway
08:27 <cocreature> and provides the necessary MFunctor instance
08:27 <osa1> srhb: I don't have a single Record, I have a vector of Records (type Csv = Vector Record)
08:27 <srhb> osa1: Ah, so you want to avoid going through list because you already have the vector?
08:27 fakenerd joined
08:27 <osa1> srhb: yes
08:27 <cocreature> ph88_: https://hackage.haskell.org/package/mmorph-1.0.9/docs/Control-Monad-Morph.html#v:hoist is the relevant function
08:28 a3Dman joined
08:28 <cocreature> you need a function "IO a -> StateT s IO a" to lift one of the conduits into StateT
08:28 <srhb> osa1: You are right that there's no out of the box encode that does that (and I doubt it would perform much better anyway)
08:28 <cocreature> and you need "State s a -> StateT s IO a"
08:28 <osa1> srhb: I don't care about performance, I don't want to introduce vector dependency just for this
08:29 <ph88_> cocreature, i have some resistance here because my expectations were that this would be trivial to solve because in the tutorial they also use state https://www.schoolofhaskell.com/school/to-infinity-and-beyond/pick-of-the-week/conduit-overview can you tell me that your way is the most straightforwaded way to do it and i will belief you
08:29 <osa1> srhb: also, it's weird that there's no way to encode Csv type
08:30 jakub_ left
08:30 <cocreature> ph88_: the tutorial doesn’t seem to combine State and IO
08:30 <cocreature> ph88_: which is what is causing problems in your case
08:30 <ph88_> true .. but that just make me think i setup my functions wrongly in the first place and possibly should rewrite them
08:30 <cocreature> ph88_: if you can change the defintiion and the type of adjustSampleInterval and the other thing you can avoid hoisting
08:31 CurryWurst joined
08:31 <ph88_> adjustSampleInterval has to have state
08:31 srbaker_ joined
08:31 <ph88_> don't know how to change it's type
08:31 <cocreature> try getting something of type "MonadState StreamState s => Conduit Double m Double"
08:31 <cocreature> and "MonadIO m => ConduitM ByteString Double m ()"
08:31 <cocreature> then you should be able to just compose them
08:32 <ph88_> i'm confused by that because i don't see s reappear after the => arrow
08:32 govg joined
08:32 <cocreature> oh that should be MonadState StreamState m
08:32 <cocreature> typing is hard
08:33 <ph88_> i don't know how to change both functions to get those type signatures
08:33 <cocreature> change the type signatures and try to follow the errors
08:33 <ph88_> ConduitM BSC.ByteString Double IO () into MonadIO m => ConduitM ByteString Double m ()
08:33 <cocreature> it should be relatively easy to figure out where you need liftIO
08:33 <ph88_> Conduit Double (State StreamState) Double into "MonadState StreamState s => Conduit Double m Double
08:33 <ph88_> ok
08:33 cchalmers joined
08:34 <ph88_> you want to see the function implementation ?
08:34 <cocreature> the latter might work out of the box if you’re lucky
08:35 Tomatosoup- joined
08:35 wroathe joined
08:35 cloudhead joined
08:36 <ph88_> cocreature, i changed the first type signature but i didn't get a type error
08:36 mohsen_ joined
08:37 cschneid_ joined
08:37 <cocreature> ph88_: great :)
08:38 <ph88_> same with second one
08:38 <cocreature> so now you should be able to compose them
08:39 <ph88_> where should i put evalState ?
08:39 <ph88_> conduitParserEither parseLine .| selectColumn .| (evalState adjustSampleInterval startStreamState) ??
08:39 laz joined
08:39 <cocreature> I don’t know, that depends on what you want to do
08:39 <cocreature> you can use conduitParserEither parseLine .| selectColumn .| adjustSampleInterval
08:40 fakenerd joined
08:40 kuribas joined
08:40 <ph88_> cocreature, i changed the types as you suggested and used .| now i get this type error https://bpaste.net/show/fd283543c425
08:41 <ph88_> i saw this error before by the way, but i don't know what to do with it
08:41 <cocreature> what’s the type of selectColumn?
08:42 <cocreature> it means something is forcing m to be IO so it seems like you forgot to change one of the type signatures
08:42 <ph88_> cocreature, https://bpaste.net/show/6845acc97a97
08:43 <cocreature> ph88_: what’s the type of conduitParserEither?
08:44 <ph88_> ghci infers: conduitParserEither parseLine .| selectColumn :: MonadIO m => ConduitM BSC.ByteString Double m ()
08:45 <ph88_> cocreature, https://hackage.haskell.org/package/conduit-extra-1.1.15/docs/Data-Conduit-Attoparsec.html#v:conduitParserEither
08:45 <ph88_> conduitParserEither :: (Monad m, AttoparsecInput a) => Parser a b -> Conduit a m (Either ParseError (PositionRange, b))
08:45 <anoe> there is a booleaQueryParser :: String -> Tree a already ?
08:46 thunderrd joined
08:47 <ph88_> anoe, hhmm not by searching https://hayoo.fh-wedel.de/?query=String+-%3E+Tree+a
08:48 <alexbiehl> ph88_ the hayoo database is quite old
08:49 danza joined
08:49 biglama joined
08:51 a3Dman joined
08:52 <cocreature> ph88_: http://lpaste.net/354913 works just fine so it seems like you’re doing something different than you are telling me
08:52 razi1 joined
08:52 simukis_ joined
08:53 Wizek_ joined
08:53 vishesh joined
08:53 <ph88_> cocreature, the type signature you put on pipe is different than mine
08:54 <ph88_> i changed it now my code works too
08:54 <cocreature> ph88_: you said you didn’t have a type signature :P
08:54 <ph88_> did i ? :/
08:54 <cocreature> maybe I misunderstood. anyway I’m glad you got it working
08:55 <ph88_> ye me too
08:56 ystael joined
08:57 <ph88_> how do i turn a ConduitM BSC.ByteString Double IO () into a Source IO Double ?? i have these two functions that i want to make compatible https://bpaste.net/show/572100c2c0c7
08:57 binaryplease joined
08:57 <ph88_> streamToVector pipe just gives type error that types don't match
08:58 <ph88_> by the way ... this piece here (MonadIO m, MonadState StreamState m) => is kind of an eye opener for me ^^
08:59 <ph88_> it's like an on-the-fly monad isn't it ?
08:59 richi235 joined
09:00 insitu joined
09:01 insitu joined
09:02 sproingie joined
09:03 Argue__ joined
09:04 zero_byte joined
09:04 hastell joined
09:04 mattyw joined
09:05 <kubrat> ~.
09:05 hamishmack joined
09:06 xtreak joined
09:06 wroathe joined
09:07 dmead joined
09:07 merijn joined
09:08 alqatari joined
09:09 rockfordal joined
09:09 <ph88_> oh i think i need a source :P
09:11 balor joined
09:12 a3Dman joined
09:12 skeuomorf joined
09:16 Swizec joined
09:18 tobiasBora joined
09:18 oish joined
09:19 <tsahyt> is there a really compact TLDR for compact regions, just as a reference point before I start into the paper?
09:20 <merijn> tsahyt: Ok, so I have to admit I haven't read it and only now some high level things, but afaict it boils down to the following.
09:20 atk joined
09:20 <merijn> tsahyt: Are you a little familiar with how GHC does GC?
09:20 <tsahyt> roughly
09:21 <merijn> tsahyt: i.e., it copies every bit of live data into a new heap and then throws away the entire old one
09:21 <tsahyt> yes
09:21 <merijn> tsahyt: From this obviously follows: having lots of live data requires A LOT of copying, which means your GC is slower
09:22 <merijn> tsahyt: So, suppose we have a huge (few GB, maybe?) static data structure that we keep around to compute, whatever the fuck on. Every single time we trigger GC we have to copy the entire damn thing
09:22 <tsahyt> I never quite realized how inefficient that gets
09:22 <tsahyt> I always just assumed that GHC would be more clever about this, with unchanging data
09:22 <merijn> tsahyt: Well, if we know AHEAD that we have such a huge thing and we know we'll never GC parts of it (i.e. we always either keep the entire thing or throw all of it away)
09:24 <merijn> tsahyt: The idea behind compact regions is, "let's just allocate this huge thing once in this special region and then never copy is, since we assume the entire region stays alive" (you could GC the entire region based on whether *anything* points into it, or you could require explicit freeing, not sure what GHC does
09:24 <merijn> tsahyt: But that's the high level gist
09:24 mfukar joined
09:24 <merijn> tsahyt: Well, the copying happens in parallel and there's a bunch of clever things in the GC to reduce this problem, but it can be an issue for some specific cases
09:24 <tsahyt> hmm okay. so this region is then also immutable?
09:25 ub joined
09:25 <cocreature> compact regions can only point into themselveso so you also don’t need to trace inside the region
09:26 a3Dman joined
09:26 <cocreature> iirc a region is freed automatically as soon as there is no pointer pointing inside the region
09:26 <tsahyt> alright. does this require some special programmer intervention, e.g. some allocing or so?
09:26 fakenerd_ joined
09:26 <merijn> tsahyt: Yeah (note, I'm guessing from skimming text), you basically trigger a "custom" GC for an object, but instead of copying it into the new "heap" we copy it into a special separate heap that we then know not to inspect further
09:26 yellowj joined
09:26 <merijn> tsahyt: Yeah, there's an API you can call to "compactify" some data structure
09:27 <tsahyt> alright, thanks! I think that's enough for motiviation :)
09:27 Rodya_ joined
09:27 <alexbiehl> Here is a quick starter: https://github.com/ezyang/compact#tutorial
09:27 <merijn> I was just about to link that :)
09:29 <ph88_> i have some conduits and it seems one is missing a ResourceT .. so i try to add it in the type signature but that just makes things worse ad the conduits no longer seem to be compatible with each other .. https://bpaste.net/show/5163654a06ac
09:29 <tsahyt> so here the Compact pointer gets discarded, doesn't it? set <- fmap getCompact (compact (Set.fromList (words dict)))
09:29 nickager joined
09:29 <tsahyt> so set holds a reference to the compact region, and when set goes out of scope, the region can be discarded?
09:32 <merijn> tsahyt: Yes, so it seems the GC takes care of tracking the liveness of the region (which I hoped, but wasn't sure)
09:32 <merijn> tsahyt: It's just that the GC knows that "as long as I have a pointer to anywhere in the region, I don't have to throw it away"
09:32 <tsahyt> that's nice. but couldn't I get something like that by abusing the FFI and finalizers a bit?
09:32 fakenerd joined
09:33 <merijn> tsahyt: That requires you to be able to convert your Haskel data structure to a C one, which might not be possible
09:33 <merijn> tsahyt: Consider a huge data structure containing, I dunno, IORefs, MVars, sockets, file descriptors, what not. Can't easily serialise that to C via FFI
09:33 <tsahyt> right. also I think that you can't just hold on to the memory using *any* pointer into it
09:34 <merijn> tsahyt: I agree that it solves a rather niche problem, but it's also a problem that if you're running into it, would be really hard to solve without GHC support :)
09:34 <merijn> So it's a neat trick to be aware of, should you ever need it
09:35 <tsahyt> I think it might help with keeping latency down in some appliations
09:35 fakenerd_ joined
09:35 <tsahyt> I wonder whether there can be some interesting interplay between that and the proposed linear types extension
09:35 <merijn> Certainly, reduced latency AND improved GC efficiency
09:35 <merijn> Also, reduces the time of global GC stops
09:35 mr_sm1th joined
09:36 <tsahyt> why does the GC have to be stop-the-world to begin with?
09:36 <merijn> tsahyt: Because GHC does compacting GC
09:37 <merijn> tsahyt: i.e. "objects" are moved to different addresses. Other threads may be using those objects
09:37 wroathe joined
09:37 <merijn> tsahyt: Other GCs keep objects whereever they're initially allocated, but that has the downside of fragmenting memory
09:37 <tsahyt> oh, so you'd essentially have to put everything into mutexes otherwise
09:37 <tsahyt> or rather locks around everything
09:38 locallycompact joined
09:38 <merijn> tsahyt: Which would kill performance anyway, since you'd have to take a lock for every single operation
09:38 <tsahyt> is fragmenting memory really that big a deal? I guess it could mess with caching due to decreased locality in some cases
09:38 <merijn> tsahyt: There's two ways to avoid this: 1) per thread heaps, like Erlang has and copy by value 2) global GC stop
09:39 <merijn> tsahyt: Well, fragmenting memory means more complex allocation routine, which means slower allocation
09:39 <tsahyt> I see
09:39 <tsahyt> and since basically everything possibly allocs in haskell, that'd be bad
09:39 <merijn> tsahyt: GHC's memory allocation is currently literally an increment followed by an if
09:39 <merijn> tsahyt: if you want to allocate 100 bytes, look at the current heap size, increment by 100, check for heap overflow, done
09:39 <tsahyt> is that why the runtime just fetches a ton of virtual memory from the outset?
09:40 xtreak joined
09:40 <tsahyt> it started doing that with GHC 8 iirc
09:40 a3Dman joined
09:40 newhoggy joined
09:40 <merijn> tsahyt: That's to simplify the GC by allowing GHC to assume the heap is *always* contiguos, instead of spread out through memory
09:41 govg joined
09:41 <tsahyt> and then just let the OS handle the rest
09:41 <merijn> tsahyt: The advantage of this allocation method is that if you assume most allocations die quick (they mostly do) you can allocate, say, 50MB by incrementing pointers and if only 200bytes are still alive, then GCing those 50MB means "reset heap offset and copy 200 bytes to new heap"
09:42 ixxie joined
09:42 hastell joined
09:42 locallycompact joined
09:43 <kuribas> is there a lossless way to read and write a Double?
09:43 vlatkoB joined
09:43 <merijn> kuribas: Can you be more specific about the usecase?
09:43 <kuribas> merijn: debugging
09:44 <kuribas> I get different results in my program when testing on ghci
09:44 cgfbee joined
09:44 <merijn> That's peculiar
09:44 mekeor joined
09:44 <merijn> The 100% guaranteed lossless way would be to dump them out as raw bytes
09:45 <kuribas> hm, I should try that
09:46 bennofs joined
09:47 yinn joined
09:49 phaji joined
09:50 a3Dman joined
09:50 oisdk joined
09:51 Spondyl joined
09:51 <merijn> How have I not seen edwardk's structs before? :o
09:51 <osa1> does servant have something like the Server type but for documentation generation? closest thing I could find was the API type but that doesn't check type of my documentation against the API type
09:51 <osa1> I want to avoid HasDocs typeclass
09:52 wroathe joined
09:54 Argue_ joined
09:55 kritzcreek joined
09:56 augur joined
09:56 rcat joined
09:57 marfoldi joined
09:57 binaryplease1 joined
09:57 ystael joined
09:58 Tomatosoup- joined
09:58 fizruk joined
10:00 soniku joined
10:02 nighty-- joined
10:03 JoelMcCracken joined
10:04 alfredo joined
10:08 soniku joined
10:10 jer1 joined
10:10 kattak joined
10:11 fakenerd joined
10:11 Aruro joined
10:13 <mniip> hmm
10:14 kattak_ joined
10:14 <mniip> considering that in system fc tyfams don't really have a function kind, and their application is significantly different from tycon application
10:14 <mniip> what if we made tyfams have a special arrow kind, distinct from the tycon arrow kind
10:15 <mniip> and add the ability to partially apply tyfams
10:15 <mniip> but not pattern match types of that special arrow kind
10:15 <mniip> would that be inconsistent?
10:16 augur joined
10:17 ExpHP joined
10:18 a3Dman joined
10:19 kattak joined
10:20 vimk joined
10:20 Argue joined
10:21 arpl joined
10:22 vaibhavsagar joined
10:23 wroathe joined
10:25 fotonzade joined
10:25 fakenerd joined
10:26 Argue_ joined
10:26 tomboy64 joined
10:26 guillaum2 joined
10:26 snowalpaca joined
10:26 snowalpa_ joined
10:27 seveg joined
10:27 Rodya_ joined
10:28 jer1 joined
10:30 coot__ joined
10:30 HoierM_ joined
10:31 takuan joined
10:32 a3Dman joined
10:32 Gurkenglas joined
10:32 xtreak joined
10:34 psychicist__ joined
10:34 xtreak joined
10:38 newhoggy joined
10:42 unK_ joined
10:43 aloiscochard joined
10:45 fakenerd joined
10:46 ixxie joined
10:46 afb joined
10:48 ogrady_ joined
10:49 gmcabrita joined
10:49 jer1 joined
10:52 ogrady joined
10:53 tsmish joined
10:54 wroathe joined
10:56 netheranthem joined
10:57 fendor joined
10:58 ystael joined
10:58 Filip_ joined
11:00 seveg joined
11:00 mada joined
11:01 fendor joined
11:01 ragepandemic joined
11:01 danthemyth joined
11:02 danthemyth joined
11:02 sproingie joined
11:02 Snircle joined
11:02 <lyxia> basically, type level lambdas
11:02 jer1 joined
11:05 ckubrak joined
11:07 uiop joined
11:07 fendor joined
11:07 miguel_fontes__ joined
11:10 vimk joined
11:11 <ertes> once again ertes returns to haskell, this time from scheme and clojure… i'm giving up on finding a separate language for "scripting"
11:12 tommd joined
11:12 <hpc> have you tried perl?
11:12 Cerise joined
11:12 <ertes> hpc: does it have concurrency?
11:12 Cerise joined
11:12 <hpc> not really :P
11:12 <ertes> then i won't even consider it =)
11:12 <hpc> you can pull some pretty stupid FP tricks in it though ;)
11:12 ziocroc joined
11:14 <ertes> clojure came closest, but its STM is simplistic and not very powerful
11:16 nepiktaz joined
11:17 srbaker_ joined
11:17 wroathe joined
11:19 <ertes> i have to admit though: easy anonymous records were quite refreshing to have… and no, vinyl is nowhere near easy =)
11:20 jchia_ joined
11:21 skeuomorf joined
11:21 skeuomorf joined
11:24 orhan89 joined
11:25 <tdammers> clojure is terrible for scripting
11:25 <tdammers> the language could work, but the implementation is just not suitable at all
11:26 newhoggy joined
11:27 ziocroc joined
11:28 Rodya_ joined
11:28 Shock_ joined
11:28 <ertes> it doesn't seem to offer any advantage over haskell anyway that isn't quickly overshadowed by its relative shortcomings
11:29 xtreak joined
11:30 <ph88_> what shortcomings ?
11:31 <ertes> missing type system, poor concurrency in comparison, and its hack for JVM's lack of proper tail calls
11:32 <capisce> what are the disadvantages of haskell for scripting?
11:32 <ertes> capisce: deployment
11:32 jchia_ joined
11:33 <ertes> GHC is not available everywhere, and when it's available, it only makes you want to shout at debian maintainers
11:33 <tdammers> almost everything that clojure does well, haskell does it better
11:33 <ertes> there are solutions though… if all else fails i'll just deploy nix closures
11:34 <srhb> ertes: If that's an option, I don't understand why you would even look further. :)
11:34 skeuomorf joined
11:35 <ertes> srhb: i really just wanted to try something else… it doesn't hurt to get new perspectives from time to time =)
11:35 stianhj joined
11:35 latro`a joined
11:36 <srhb> ertes: Right, I'm just being jealous that that's an option for you. ;-)
11:37 jchia_ joined
11:39 jchia_ joined
11:41 unyu joined
11:43 soniku joined
11:43 <ertes> srhb: i used to do PHP eight hours a day, so i had that, too… and yes, i was already a hobby haskeller at that point =)
11:45 grim_ joined
11:46 sgronblo joined
11:46 oisdk joined
11:47 jchia_ joined
11:47 <EvanR> the freer monad frees us from monads
11:48 jchia_ joined
11:48 fotonzade joined
11:49 balor joined
11:49 wroathe joined
11:49 newhoggy joined
11:49 JagaJaga joined
11:50 nepiktaz joined
11:51 soniku joined
11:51 <ph88_> ertes, ah me too !
11:51 <ph88_> which frameworks did you use ?
11:52 kamyar joined
11:52 fakenerd joined
11:52 sepp2k joined
11:52 <merijn> dolio: ping?
11:54 hastell joined
11:54 jchia_ joined
11:55 vimk joined
11:55 Boomerang joined
11:56 <ertes> ph88_: the worst: zend framework, with occasional GlobalVariables3 nightmares
11:56 jluttine joined
11:56 <ertes> s/GlobalVariables3/TYPO3/
11:56 <ph88_> zend is not so bad is it
11:56 Achylles joined
11:57 fendor joined
11:57 KingBuzzo joined
11:57 <ph88_> how did you get into haskell then ?
11:57 newhoggy joined
11:57 <ertes> well, to keep it short: it was semi-useful as a library, and horrible as the actual MVC framework it sells itself as
11:57 Levex joined
11:58 <tdammers> zend framework isn't the worst
11:58 <tdammers> home-grown framework that was lead (and only) programmer's first ever programming project
11:58 <ertes> actually i don't remember how i discovered haskell… my first memory of haskell was when i tried to learn it using the haskell road to logic
11:58 <kamyar> Please help me understand the code here: https://bendyworks.com/blog/authentication-via-haskell
11:59 ystael joined
11:59 <EvanR> i learned about haskell after looking into ocaml
11:59 <KingBuzzo> Hey! Little question: I need to access previously computed values of an unboxed vector for calculating the current one (for example like the Fibonacci progression). How can I access those?
11:59 <ertes> KingBuzzo: as in state, or as in dynamic programming?
11:59 soLucien joined
11:59 <KingBuzzo> as in dynamic programming
12:00 bweston92 joined
12:00 <ertes> KingBuzzo: you can use laziness for DP, for example a lazy list or a lazy vector
12:00 chelfi joined
12:01 <ertes> @let import qualified Data.Vector as V
12:01 mattyw joined
12:01 <lambdabot> .L.hs:130:1: error:
12:01 <lambdabot> Data.Vector: Can't be safely imported!
12:01 <lambdabot> The module itself isn't safe.
12:01 <ertes> too bad
12:01 mattyw joined
12:01 <ph88_> ertes, why haskell and not another language instead of php ?
12:01 <ertes> KingBuzzo: the following is going to be inefficient, because lists aren't suitable for this, but you can use it as inspiration for vector or Seq-based implementations
12:02 orhan89 joined
12:03 <ertes> @let f = f'; where xs = map f' [0..]; f' 0 = 0; f' 1 = 1; f' x = xs !! (x - 1) + xs !! (x - 2)
12:03 <lambdabot> Parse failed: Parse error: where
12:03 <ertes> @let f = f' where xs = map f' [0..]; f' 0 = 0; f' 1 = 1; f' x = xs !! (x - 1) + xs !! (x - 2)
12:03 Argue__ joined
12:03 <lambdabot> Defined.
12:03 <ertes> oh crap
12:04 <ertes> > map L.f [0..]
12:04 <lambdabot> [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,...
12:04 balor joined
12:04 <ertes> @undef
12:04 <lambdabot> Undefined.
12:04 <ertes> KingBuzzo: of course with lists you would simply use state instead of DP
12:04 wroathe joined
12:04 <ertes> > map fst (iterate (\(x, y) -> (y, x + y)) (0, 1))
12:04 <lambdabot> [0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181,6765,10946,...
12:04 <KingBuzzo> yeah thank you, i know this works fine :) my problem is that I struggle to find an appropriate data structure for my problem.
12:05 <Maxdamantus> > let fibs = 1 : 1 : [(fibs !! (n - 1)) + (fibs !! (n - 2)) | n <- [2..]] in fibs !! 100
12:05 <lambdabot> 573147844013817084101
12:05 <ertes> KingBuzzo: the fibonacci sequence is not a very good use case to begin with
12:05 jer1 joined
12:05 Faucelme joined
12:05 <Maxdamantus> > let fib 0 = 1; fib 1 = 1; fib n = fib (n - 1) + fib (n - 2) in fib 100
12:05 <lambdabot> mueval-core: Time limit exceeded
12:06 <Maxdamantus> list wins
12:06 <KingBuzzo> asked the question yesterday already here but didn't find a proper solution yet. I need to build a two dimensional table and access values i've computed already when computing a new one. Sounds easy but apparently isn't. Normal Data.Array seems horribly inefficient for this
12:06 newhoggy joined
12:06 athan joined
12:06 <ertes> @let fib = fib' where xs = map fib' [0..]; fib' 0 = 0; fib' 1 = 1; fib' x = xs !! (x - 1) + xs !! (x - 2)
12:06 <lambdabot> Defined.
12:06 <ertes> > fib 100
12:06 <lambdabot> 354224848179261915075
12:06 <KingBuzzo> so I was told to try Data.Vector.Unboxed (for which I had to translate the table's coordinates to a single value)
12:07 <KingBuzzo> but accessing older values doesn't work here
12:07 <ertes> KingBuzzo: you need to use a boxed structure
12:07 <ertes> Data.Vector will work
12:08 <KingBuzzo> and hopefully faster than Data.Array?
12:08 <ertes> unlikely
12:08 <ertes> as i said, fib is not a good use case
12:08 <KingBuzzo> was just an example anyway ;)
12:09 <KingBuzzo> basically all i need is an efficient data type which allows dyn prog
12:09 <ertes> depending on your access patterns you can use any structure that fits the problem
12:09 <ertes> Map, Seq, Vector, …
12:10 <KingBuzzo> for a table entry (i,j) i need to access values (k,l) with k<i and l<j
12:10 <ertes> sounds like a 2D array to me
12:11 <KingBuzzo> which have obviously already been computed. exactly. Data.Array is horribly slow though :(
12:11 <ertes> now there is a middle ground, if you're fine with precomputing an entire table
12:11 Shock_ joined
12:12 <ertes> vector has the 'constructN' function
12:12 <ertes> which is available for all vector flavours
12:12 <Maxdamantus> Weird. I Googled that `fibs !! 100` number and found: http://www.cgpgrey.com/573147844013817084101/
12:12 <Maxdamantus> interesting job filter.
12:13 cretiq joined
12:13 <ertes> if you want efficiency *and* laziness, you probably need to layer a plane wrapper over unboxed vectors
12:14 newhoggy joined
12:14 <ertes> type SemiLazyPlane a = V2 Int -> Vector a
12:14 govg joined
12:16 <KingBuzzo> o-kay... this is beyond my knowledge to be honest
12:16 barryburd joined
12:16 <ertes> the idea is simple: imagine a plane of boxed values… that's what a boxed Vector is… but it's also inefficient
12:16 vaibhavsagar joined
12:17 <KingBuzzo> the table values are a custom data type that has three Integer values if that's relevant
12:17 <ertes> now imagine that you split the plane into 16x16 squares, each individual square being an *unboxed* vector
12:17 <ertes> whenever you get a value from a square, the whole square is computed
12:18 <ertes> and you keep those squares in a boxed plane instead
12:18 <barryburd> Too many parentheses? How to convert the following code into idomatic Haskell?
12:18 <barryburd> module Main where
12:18 <barryburd> median xs = head [ x | x <- xs,
12:18 <barryburd> length([y | y <- xs, y < x]) == length([y | y <- xs, y > x]) ]
12:18 <barryburd> main = putStrLn $ "The median is " ++ show (median [4,7,2,1,0,9,6])
12:18 <KingBuzzo> like type XY = T Int Int Int
12:21 <KingBuzzo> so to sum it up, what would data structure would you recomment that suits my needs?
12:21 ystael joined
12:22 pungi-man joined
12:24 soniku joined
12:24 <lyxia> KingBuzzo: Vector
12:25 biglambda joined
12:25 asmyers joined
12:25 <lyxia> barryburd: sort then pick the middle
12:25 xtreak joined
12:25 <ertes> > let median xs' = let xs = sort xs' in head (drop (length xs `div` 2) xs) in median [1,5,3,8,9,4,2]
12:25 <lambdabot> 4
12:26 <ph88_> ertes, i also used php and wanted to try a new language, i was looking at a few options. Did you consider any other languages then ?
12:26 mattyw joined
12:27 <ertes> ph88_: C++ came to my mind, as it was the language i was most familiar with beside PHP… FP was very new to me
12:27 <barryburd> ertes, I really like the elegance of the list comprehension approach. Is that approach so bad?
12:28 <ph88_> barryburd, you can also use the list monad
12:28 ogrady joined
12:28 <ertes> barryburd: compare: filter (< x) xs
12:28 <ph88_> ertes, how long ago was this ?
12:29 <ertes> vs. [ y | y <- xs, y < x ]
12:29 Rodya_ joined
12:29 snowalpaca joined
12:29 newhoggy joined
12:29 <ertes> ph88_: 2007
12:30 <barryburd> ertes, you make a good point
12:30 <KingBuzzo> lyxia: but when using a Vector and the constructN function, i don't have direct access to the current index right?
12:30 <ertes> barryburd: note: you received answers to two different questions: one is about efficiency/algorithm, the other is about style
12:30 wroathe joined
12:31 <ertes> barryburd: i generally prefer combinator syntax over comprehensions, because combinators are composable
12:31 <ertes> but there are some legitimate use cases for comprehensions as well
12:31 <barryburd> ertes, I prefer style over efficiency
12:32 <ertes> barryburd: then you haven't watched this yet: https://www.youtube.com/watch?v=fHNmRkzxHWs
12:34 <ertes> i think it's not necessary to squeeze the last nanosecond and byte of memory out of code, but in my view efficiency should always be taken seriously
12:35 <EvanR> we have the luxury of caring about efficiency because there exist possible routes to get it in haskell which dont resort to FFI
12:35 <EvanR> which is weird for a high level language
12:36 danthemyth joined
12:36 <barryburd> ertes, I’m teaching people who are uncomfortable with code, so the ability to read the code and the clarity of the code that they write is of utmost importance. Efficient code that’s the least bit difficult to read would make them run in the other direction. (But I understand arguments to the contrary.)
12:37 jeltsch joined
12:37 <ertes> barryburd: ironically in haskell efficient code is usually also the most readable, because you get an API that actually fits your problem =)
12:37 <EvanR> i wish efficient code thats the least bit difficult to read made people run the other direction in other circumstances
12:38 orhan89 joined
12:38 <EvanR> or inefficient code for that matter
12:38 GeorgeEdward joined
12:39 <ertes> this is something that is often misunderstood: if you want to make haskell code run fast, you should write it in an idiomatic way
12:39 <tdammers> there are a few exceptions though
12:40 fendor joined
12:40 <ertes> IntMap/Map, Seq, IntSet/Set… and never share lists
12:40 <ertes> sure, but it's a good general rule
12:40 <ertes> s/rule/guideline/
12:41 detrumi joined
12:41 Kreest__ joined
12:41 geekosaur joined
12:42 caasih joined
12:42 ExpHP joined
12:42 <EvanR> never share lists?
12:43 <ertes> EvanR: median xs' = let xs = sort xs' in head (drop (length xs `div` 2) xs) -- xs is shared, and that's bad
12:43 JonReed joined
12:44 <tdammers> why is it bad?
12:44 oisdk joined
12:44 <merijn> tdammers: Prevents GC
12:44 <tdammers> oh, ok
12:44 <merijn> tdammers: Thus leaks memory
12:45 <Boomerang> No list fusion? Is that something linear types can help with?
12:45 <tdammers> thought this was the exuberant laziness problem
12:45 <merijn> tdammers: Well laziness ensures things are kept alive longer
12:45 jdnavarro joined
12:45 <merijn> tdammers: Consider "avg l = sum l / length l"
12:45 fotonzade joined
12:46 <merijn> Sum forces the entire list and it can't be GCed since length keeps it alive
12:46 <tdammers> right
12:46 <GeorgeEdward> does anybody know of any papers tackling halo exchange in functional languages?
12:47 <tdammers> funnily, this particular implementation wouldn't have crossed my mind
12:48 <EvanR> in avg l = sum l / length l, how do you "unshare" l ?
12:48 cobreadmonster joined
12:48 <ertes> EvanR: you use a single fold
12:49 sproingie joined
12:49 <ertes> :t uncurry (/) . foldl' (\(s, l) x -> (s + x, l + 1)) (0, 0)
12:49 <davean> GeorgeEdward: what would be special about it in a functional vs. non-functional language?
12:49 <lambdabot> (Foldable t, Fractional c) => t c -> c
12:49 <ertes> EvanR: like that
12:49 cpennington joined
12:49 <EvanR> well, im not going to call this a more natural way
12:49 <tdammers> tuple up (x, 1) for each x in l, then fold that with a sum-both operation
12:49 DragonWolf joined
12:50 <ertes> EvanR: you can make it nicer by using a composable folds library like 'foldl'
12:50 <GeorgeEdward> davean: just curious as to thinking of implementation
12:50 <GeorgeEdward> davean: I'm not sure whether it'd be better in a multiple process capacity or if there's some clever monad-fu to be done
12:51 <ertes> EvanR: then you can write: liftA2 (/) Foldl.sum Foldl.length
12:51 <EvanR> o_O
12:51 <EvanR> i dont know if this is idiomatic, but it doesnt sound like an obvious route to get haskell to go fast, at least for beginners
12:52 <ertes> EvanR: i had beginners come up with that fold on their own… you're underestimating them =)
12:53 <ertes> in fact i'd say they should be taught to
12:53 <osa1> is there a GHC flag for dumping all instances of T when compilation fails with `no instance for T x ...` ?
12:53 <EvanR> this is an instance of having to understand operational semantics to write something in a non obvious way to get performance boost
12:54 cschneid_ joined
12:54 <sproingie> beginners needn't be obsessed with performance. get the complexity order right and call it done.
12:54 <barryburd> Beginners come up with all kinds of things, but that doesn’t mean they can use a feature sensibly more than once. Besides, there are different kinds of beginners. Some are very quick but many need lots and lots of practice with basics.
12:56 <osa1> I found -fprint-potential-instances but I don't think it's working. maybe a bug
12:56 burtons joined
12:56 <ertes> well, there is a recurring theme: beginners learn all the basics, while swiftly skipping over details like proper handling of strictness, because teachers think they are "too difficult" or "unimportant for beginners"… those same beginners end up not being able to write any real programs without repeatedly running into these issues and being unable to solve them on their own
12:57 HoierM joined
12:57 Levex joined
12:57 <ertes> it's a mistake to swipe this under the rug
12:57 <sproingie> -fprint-potential-instances is the only one i know of. :i SomeClass will show all of them afaik
12:57 <EvanR> not saying its unimportant, but saying its not what id brag about as a language strength
12:57 <cocreature> also you can easily end up in the wrong complexity class when it comes to memory usage if you don’t pay attention to this
12:57 <sproingie> it's also a mistake to pull out the rug
12:58 doomlord joined
12:58 <ertes> it's not a strength, but it is an inherent feature of haskell that needs to be explained – and it needs to be explained early
12:58 conal joined
12:58 <sproingie> early and clearly. the latter usually fails.
12:59 <sproingie> the language does need more and better teachers, sure
12:59 alfredo joined
13:00 Argue_ joined
13:00 fizbin joined
13:00 TheLemonMan joined
13:00 <sproingie> right now this channel's the best resource. takes patience tho, the genius of IRC is more an emergent property than inherent
13:01 <capisce> https://en.wikipedia.org/wiki/Gotcha_(programming)
13:01 <capisce> "In programming, a gotcha is a valid construct in a system, program or programming language that works as documented but is counter-intuitive and almost invites mistakes because it is both easy to invoke and unexpected or unreasonable in its outcome."
13:02 kosorith joined
13:02 xormor joined
13:02 Argue joined
13:03 kattak joined
13:03 Swizec joined
13:04 eschnett joined
13:04 hastell joined
13:04 be5invis joined
13:05 <lyxia> KingBuzzo: well it is the length of the already constructed part. You can also use generate and define the vector recursively
13:06 <sproingie> haskell steers away from whole classes of gotchas. purity has its advantages. there's tradeoffs, of course.
13:06 <KingBuzzo> that's what I figured. Thanks!
13:06 fizbin joined
13:06 Wuzzy joined
13:08 crobbins joined
13:08 oisdk joined
13:08 <sproingie> a "teaching subset" of haskell might be worth considering. then again, perhaps that's what Elm is.
13:09 des_ joined
13:09 iAmerikan joined
13:09 <EvanR> no
13:09 <sproingie> i know, not a great subset
13:09 <EvanR> haskell is the teaching subset
13:10 <sproingie> Prelude used to be a lot simpler. not saying better, but simpler for sure.
13:10 <ertes> sproingie: based on all the workshops i ran i don't see value in teaching a beginner subset of haskell
13:10 <GeorgeEdward> I've never had the opportunity of taking a haskell course
13:11 dbmikus_ joined
13:11 earldouglas joined
13:12 <sproingie> ertes: yeah i'm actually a bit skeptical about subsetting languages. scala tried that, it went nowhere. i'm willing to be surprised tho.
13:12 tommd joined
13:12 <ertes> under the premise that i expect people to actually use haskell for real stuff
13:12 <sproingie> different language entirely is probably the better way to do gradualism
13:12 <EvanR> that seems like a giant waste of work
13:12 <ertes> you won't be doing that, unless you understand the language as well as some of the common extensions
13:13 <EvanR> to set up something that cant do as much
13:13 jaspervdj joined
13:13 <ertes> well, remember helium?
13:13 <sproingie> naw. i actually do believe in "teaching languages", they specifically shouldn't be industrial-strength "real world" languages
13:13 <sproingie> they teach java in schools. now schools graduate people who can only think in java
13:13 <ertes> it was a haskell-like language that dispensed with type classes in order to be simpler to learn
13:13 <EvanR> imagine a "teaching" version of java
13:14 <EvanR> be horrified
13:14 <sproingie> it existed, it was called BlueJ
13:14 <ertes> unfortunately it's useless
13:14 <sproingie> BlueJ had some really nice tools. crappy language tho.
13:14 <ertes> it hides one of the main abstraction capabilities of haskell, and you can't do anything real with it
13:14 <EvanR> so people graduate only thinking in blueJ, according to this theory
13:14 <sproingie> no, they learn in that then transfer their knowledge to another language
13:15 bjz_ joined
13:15 <EvanR> well i did that in haskell
13:15 <sproingie> learning to make that mapping is the target skill, not learning to grind out code in Blub
13:15 jimmyrcom joined
13:15 iliastsi joined
13:15 <ertes> i think the main mistake here is to make assumptions about beginners
13:15 <ertes> in particular the "beginners need support wheels" assumption
13:16 des_ joined
13:17 oisdk joined
13:17 orhan89 joined
13:18 wroathe joined
13:19 <sproingie> well they do need support, whether it's training wheels or people helping catch them
13:20 fakenerd joined
13:20 a143753 joined
13:21 jathan joined
13:21 refold joined
13:24 <EvanR> if i iterate through a hashmap and either decide to modify or not modify each value, and possible delete it, is it more efficient to just build a whole new hashmap
13:24 <EvanR> or use a list instead entirely
13:24 mizu_no_oto_work joined
13:24 <EvanR> or
13:25 crobbins joined
13:25 sepp2k joined
13:25 crobbins joined
13:25 <sproingie> if you're iterating, may as well construct a new map. technically you're doing that on any change.
13:26 dsh joined
13:26 <pacak> mapMaybeWithKey ?
13:26 <EvanR> if during the iteration you only modify/delete 1 item, then its not rebuilding the entire map
13:27 jmiven joined
13:27 sellout- joined
13:27 <EvanR> mapMaybeWithKey would certainly rebuild everything, it has no way to know you didnt change some part
13:28 <EvanR> and i guess a list would be the same way, but its a list so its cheaper to do that
13:28 <GeorgeEdward> I'd just use a map tbh, you have to traverse this thing once anyway
13:28 <GeorgeEdward> have a look at the implementation of those functions
13:29 soniku joined
13:29 <sproingie> could carry the map around as state while you iterate i suppose
13:29 <EvanR> huh?
13:29 Rodya_ joined
13:30 kmels joined
13:31 <ertes> EvanR: you should do unions and intersections instead
13:31 <ertes> if possible
13:31 meba joined
13:31 <EvanR> you think that would be faster?
13:31 <GeorgeEdward> are you just trying to map a function over the hashmap?
13:32 <Squarism> I see my application is taking cpu cycles when i expect no activity at all. Is there some way to see what threads contribute to that cpu utilization?
13:32 <ertes> EvanR: if you can preconstruct the changes as a submap efficiently, then yes, likely
13:32 <GeorgeEdward> Squarism: try threadscope
13:32 <EvanR> iterating over a hashmap, coming up with a collection, probably small, of items to delete or modify. probability is the item does not change
13:32 <ertes> EvanR: of course no guarantees… benchmark if you want to know for sure =)
13:33 <EvanR> so reconstructing the thing seems bad in this case
13:33 <EvanR> so ertes's suggestion might work
13:33 jeltsch joined
13:33 <Squarism> GeorgeEdward, thanks
13:33 jship joined
13:34 <GeorgeEdward> there's nothing better than trying both and seeing which is more performant
13:34 des_ joined
13:34 <EvanR> yeah too lazy
13:34 <EvanR> if i pick the wrong one, not a big deal
13:35 Rodya_ joined
13:36 EvilMachine joined
13:37 jangsutsr joined
13:38 uuplusu joined
13:39 Zialus joined
13:39 selthas joined
13:39 ystael joined
13:40 cschneid_ joined
13:40 chlong joined
13:43 oleo joined
13:43 oleo joined
13:46 SadoqueTD joined
13:48 freusque joined
13:49 crobbins_ joined
13:49 wroathe joined
13:50 `^_^v joined
13:52 mu joined
13:55 dfeuer joined
13:55 mizu_no_oto_work joined
13:56 danthemyth joined
13:57 oisdk joined
13:57 noark9 joined
13:57 `^_^v joined
13:59 ChristopherBurg joined
13:59 descender joined
13:59 bodisiw joined
13:59 cretiq joined
14:00 salva joined
14:00 cdg joined
14:01 revprez_atlanta joined
14:02 umib0zu joined
14:03 oisdk joined
14:03 <ph88_> i have some conduits and it seems one is missing a ResourceT .. so i try to add it in the type signature but that just makes things worse ad the conduits no longer seem to be compatible with each other .. https://bpaste.net/show/5163654a06ac what can i do about this ?
14:04 douglascorrea joined
14:04 suppi joined
14:06 filostrato joined
14:06 wroathe joined
14:08 <cocreature> ph88_: pretty much the same thing that I explained to you earlier today: don’t write your conduits against conduit transformers but write them against an abstract monad and add the necessary typeclass constraints
14:09 <cocreature> (or mmorph your way to glory)
14:09 burdges joined
14:10 <ph88_> lets keep with the abstract monad
14:10 <ph88_> i try adjustSampleInterval :: (ResourceT s, MonadState StreamState s) => Conduit Double s Double Expecting one more argument to ‘ResourceT s’
14:10 <cocreature> ResourceT is not a typeclass
14:10 <cocreature> it’s called MonadResource iirc
14:11 <filostrato> what exactly is a Conduit?
14:11 oisdk joined
14:11 <cocreature> ph88_: remember that everytime you use ".|" the conduit on the left and the conduit on the right need to be written on top of the same monad. that’s why you are getting these errors
14:11 <mizu_no_oto_work> filostrato: conduit is a library for streams.
14:11 <ph88_> filostrato, it's like a unix pipe .. helps with streaming
14:12 <ph88_> cocreature, ok that "remember" was the first time i heard that :\
14:12 <cocreature> :t (.|)
14:12 <lambdabot> error:
14:12 <lambdabot> • Variable not in scope: .|
14:12 <lambdabot> • Perhaps you meant one of these:
14:12 <cocreature> gnah
14:12 <cocreature> (.|) :: Monad m => ConduitM a b m () -> ConduitM b c m r -> ConduitM a c m r
14:12 <cocreature> ph88_: see how the m is the same for both arguments
14:13 <cocreature> so you can’t use IO for one and ResourceT IO for the other
14:13 kattak joined
14:14 plutoniix joined
14:14 <ph88_> ye ok i still have to learn to make such deductions
14:14 coot__ joined
14:14 <cocreature> ph88_: maybe we should take a step back, do you understand why "(1 :: Int) + (2 :: Double)" doesn’t work?
14:14 plutoniix joined
14:15 asmyers joined
14:15 <ph88_> so i was thinking to change the nice conduit in the chain from doubleToByteString :: Conduit Double IO BSC.ByteString to doubleToByteString :: (MonadResource m, MonadIO m) => Conduit Double m BSC.ByteString
14:15 <ph88_> cuz Int and Double don't share a typeclass for + ?
14:15 a143753 joined
14:16 shesek joined
14:16 <cocreature> if you have a function "a -> a -> a" (like (+)) the fact that both arguments are of type "a" means that they need to have _exactly the same type_
14:17 <cocreature> "a" can be arbitrary but it needs to be the same everywhere it appears in the type signature
14:17 dedicated joined
14:17 heurist joined
14:17 <cocreature> just like the "m" in the type signature of (.|) can be arbitrary but needs to be the same everywhere it appears in that signature
14:17 <ph88_> ok
14:18 <cocreature> :t (>>)
14:18 <lambdabot> Monad m => m a -> m b -> m b
14:18 <cocreature> you also can’t do Just 1 >> putStrLn "hello world"
14:18 Tomatosoup- joined
14:19 <ph88_> i think i have more trouble with the process of of debugging this stuff than to understand that a -> a -> a all a are the same
14:20 <cocreature> “couldn’t match x with y” is GHC’s way of telling you, you tried to use x for m and y for m, but x and y are not the same
14:20 tommd joined
14:20 carlomagno1 joined
14:21 <filostrato> I guess long before inquiring about conduit, I should learn more about the basics, as there are still things about monads I don't understand; is there a separate channel for noobs to ask questions, or would that be here? :P
14:21 zeroed joined
14:21 zeroed joined
14:21 wroathe joined
14:21 <ph88_> filostrato, here or #haskell-beginners
14:21 <cocreature> filostrato: beginner questions are completely fine here :)
14:22 newhoggy joined
14:22 chaosmasttter joined
14:22 freyr joined
14:23 sgronblo joined
14:24 fizbin joined
14:25 des_ joined
14:25 nitrix joined
14:25 <ph88_> cocreature, on adjustSampleInterval i have MonadState StreamState s => do i need to put this constraint on all the other functions too ? i think this is ugly because the other functions don't use state !
14:25 <filostrato> I'll join it anyway, but good to know; I'm currently building a website for a friend, to display some of his art, and as I came to a point in the JS client where the backend REST API would be nice to have available, I started considering trying to make it using Servant and something like Persistent; only problem is that I'm still a real beginner at Haskell, but I thought it would be a nice way to learn
14:26 <benzrf> neat
14:26 MarioBranco joined
14:26 <mekeor> cool
14:26 <cocreature> ph88_: no you don’t. however, you do need to put it on the result of applying .| to adjustSampleInterval or something else
14:26 iliastsi joined
14:27 <ph88_> filostrato, i just started with a REST API in haskell as well .. i considered some frameworks and then decided on Spock .. the example app of spock was recently updated to new GHC version. And i was asking for an example of static HTML with REST endpoints ..
14:27 <reactormonk[m]> filostrato: given that servant gives you swagger for free, see if you can make use of that for your client side.
14:28 <filostrato> hmm, interesting; I was looking at a blog post where someone combined Servant and Persistent, but it's not as up-to-date
14:28 <ph88_> cocreature, then i don't understand if i don't put the constraint .. how is it still the same monad m ?
14:28 <filostrato> reactor: what kind of swagger? :P
14:29 Denommus joined
14:29 <cobreadmonster> I'm trying to build a parser for a language that doesn't have an EBNF form using Parsec.
14:29 <cobreadmonster> Think Markdown.
14:30 <cobreadmonster> So I'd like to encounter a "*", and then push a token like BOLD onto a stack held in the parser state.
14:30 <benzrf> cobreadmonster: that's not how you use parsec
14:30 thunderrd joined
14:30 <cobreadmonster> benzrf: How do I use parsec?
14:30 soniku joined
14:31 <benzrf> well, you could tokenize by hand first with simple pattern-matching lookahead
14:31 Kototama joined
14:31 <cobreadmonster> Okay.
14:31 <benzrf> or you could do something like
14:31 <benzrf> uh, idk,
14:31 <ph88_> lol
14:31 <cobreadmonster> lol
14:31 <benzrf> parseBold <|> parseItalic
14:31 <Kototama> why does t need to be Traversable in the cataM function whereas it's only a Functor for cata ?
14:31 <benzrf> actually don't listen to me, i don't really know the correct way to deal with this in parser combinators
14:32 cretiq joined
14:32 <cobreadmonster> benzrf: Yeah, that was my first approach too.
14:33 <cobreadmonster> But what do you do if you have nested things?
14:33 DocWinter joined
14:33 <benzrf> well... recursive definitions, of course
14:33 <cobreadmonster> So for instance "this is *some +text as+ an +example* to illustrate+"
14:33 HMPerson1 joined
14:33 <cobreadmonster> That's perfectly valid Markdown.
14:34 <cobreadmonster> But something that assumes things are nested would break down.
14:34 <lyxia> Kototama: because cataM is effectful, so the order in which you compose actions matters, and that order is determined by Traversable
14:34 Khisanth joined
14:34 <cobreadmonster> benzrf: any other ideas?
14:34 fizbin joined
14:34 <Kototama> lyxia: what does cataM brings that traversable does not?
14:34 <cobreadmonster> The explicit stack is ugly af but there's really no cleaner way to do this.
14:35 <sproingie> markdown is a wretched awful standard and parsing it fully is not fun
14:35 <benzrf> cobreadmonster: i mean, you can certainly use a stack
14:35 <benzrf> but in that case don't bother with parsec!
14:35 <sproingie> but there's quite a few markdown parsers in parsec that will show how it's done
14:35 <cobreadmonster> benzrf: Parsec does a lot of the tokenizing and shit for me.
14:35 <cobreadmonster> sproingie: Really? Any links?
14:35 HMPerson1 joined
14:36 coot__ joined
14:36 <sproingie> just googled "markdown parsec". i'm seeing a couple so far.
14:37 <c_wraith> I mean, isn't pandoc the ideal?
14:37 <c_wraith> though the real problem is that markdown isn't a spec
14:37 <cobreadmonster> sproingie: Okay, fantastic thanks!
14:37 <cobreadmonster> c_wraith: I'm trying to write my own markdown-y language to convert.
14:37 <c_wraith> markdown is a huge family of incompatible-but-slightly-related specs
14:37 <lyxia> Kototama: folds the Fix t structure, traverse can only traverse a (t a).
14:37 <sproingie> pandoc is old, its parser might be using a similarly old parsec API
14:37 <cobreadmonster> Also, this is a very instructive exercise.
14:38 newhoggy joined
14:38 <sproingie> c_wraith: there is an actual spec for markdown. go read it sometime if you're into the horror genre.
14:38 <cobreadmonster> sproingie: Where?!
14:38 <c_wraith> sproingie: sure, but no one implements it
14:38 <sproingie> of course not. reading the spec should instantly demonstrate why,
14:39 <sproingie> cobreadmonster: again i use the googlez: commonmark.org
14:39 <sproingie> well, spec.commonmark.org
14:39 <filostrato> latest: http://spec.commonmark.org/0.27/
14:40 <ph88_> cocreature, i logically try to apply what i think you were trying to tell me .. but it doesn't make sense to me. First you say that all m need to be the same .. now i find examples that they are not the same but work anyway ?! and also i find examples where they are not compatible but i don't understand why https://bpaste.net/show/1e3d57143046
14:40 danza joined
14:41 <cobreadmonster> Man, is there a Parsec tutorial?
14:41 <sproingie> lots. watch out for old ones.
14:42 sepp2k joined
14:42 <cobreadmonster> Yeah.
14:42 <cobreadmonster> I found one that uses Parsec 3.1
14:42 <cobreadmonster> But it's new enough for my purposes.
14:42 coot__ joined
14:42 <cobreadmonster> Parsec is so fucking awesome, why does ghc use happy?
14:42 <sproingie> the ideas still all apply, it's the syntax that changes
14:43 <filostrato> does anyone use darcs over git?
14:43 <sproingie> a few die-hard holdouts
14:43 newhoggy joined
14:43 <c_wraith> I liked the idea of darcs, but the exponential-time bad cases just weren't workable. and by the time most of them had been worked out, everyone was using git.
14:44 <sproingie> i like the idea of darcs, but it was never all that zippy
14:44 <Kototama> lyxia: and the difference between cataM and foldable?
14:44 <sproingie> (heh, said the same thing)
14:44 <c_wraith> I mean, I started using darcs when most people were on CVS and waiting for SVN.
14:44 noark9 joined
14:45 <c_wraith> both of which are terrible. So anything was an improvement. But then git came along.
14:45 <sproingie> yah, there was some effort to get linux to switch to darcs after the bitkeeper kerfuffle. but darcs pretty much fell over with it.
14:46 <lyxia> Kototama: Foldable does less than Traversable, folding a (t a), whereas Fix t is recursive.
14:46 <sproingie> linus was probably never going to accept it ayway
14:46 al-damiri joined
14:47 kritzcreek joined
14:48 <filostrato> I see; how about xmonad? :P
14:48 <Kototama> lyxia: Foldable does not recur?
14:48 <sproingie> never took a shine to tiled wms. i like a blend of tiled and non.
14:49 <sproingie> (and being on a mac now, my preference of window managers is kinda academic)
14:49 eacameron joined
14:51 NyanPasu joined
14:51 enitiz joined
14:51 newhoggy joined
14:51 <lyxia> Kototama: Fix t is isomorphic to something that would look like t (t (t ...)) fold/traverse are only able to look at one layer, whereas cataM can collapse them all.
14:52 wroathe joined
14:53 <sproingie> it's ironic that the thing that frequently breaks my brain is called "Fix"
14:54 asmyers joined
14:54 <cobreadmonster> c_wraith: Can I PM?
14:54 <mizu_no_oto_work> filostrato: My current machine's a mac, but on Linux I prefer xmonad.
14:55 <Kototama> lyxia: excuse me to ask further, but why can't foldMap recurse like cataM?
14:56 <mizu_no_oto_work> filostrato: Probably, the biggest problem with darcs is that github won. Regardless of the technical merits of various SCMs (pijul looks pretty cool), if you're on github you're much more likely to get issues filed or pull requests.
14:56 coot__ joined
14:56 <lyxia> Kototama: because it doesn't have the right type
14:56 Tomatosoup- joined
14:57 newhoggy joined
14:57 <filostrato> I was considering trying out xmonad (I'm on Arch), but I think I'll stick with this web project for learning more Haskell for now
14:57 <filostrato> and yeah, maybe it would be more popular with a DarcsHub
14:58 JimConner joined
14:59 Guest48456 joined
14:59 refold joined
14:59 flatmap13 joined
14:59 <mizu_no_oto_work> filostrato: https://hub.darcs.net/
14:59 coot__ joined
15:00 <mizu_no_oto_work> The issue is that darcshub is even less popular than bitbucket, and you're not going to get anywhere near as many pull reqs on bitbucket.
15:00 abbas joined
15:01 <filostrato> right
15:01 <filostrato> what exactly just happened, node split?
15:02 <lyxia> Kototama: it doesn't make sense for foldMap and other foldable functions to recurse like cataM does because it only takes a value of type "t a" for a parametric a. You need a type like Fix to be able to express that recursive structure in the first place.
15:03 Cooler joined
15:03 <Cooler> lambdabot hey
15:03 <Cooler> lambdabot, hello?
15:03 javjarfer joined
15:03 <Cooler> lambdabot, \x = x + 2
15:03 <Cooler> \x = x + 2
15:03 <abbas> hey every body , i have simple function but i cant understand why it give error . CODE AND ERROR: https://paste.ubuntu.com/24454556/
15:03 <Cooler> how do you activate it?
15:03 <lyxia> > "spamming is bad"
15:04 <lambdabot> "spamming is bad"
15:04 <lyxia> Cooler: you can also talk to lambdabot in private
15:04 hucksy joined
15:04 <Clint> abbas: what is the type of (:) ?
15:05 cschneid_ joined
15:05 <sproingie> you're trying to cons a list onto the head of a list
15:05 <c_wraith> cobreadmonster, sure, I suppose
15:05 newhoggy joined
15:06 <sproingie> you may be looking for ++ instead of :
15:06 codesoup joined
15:06 kosorith joined
15:08 <Kototama> lyxia: what about something like http://stackoverflow.com/questions/23319683/foldr-foldl-for-free-when-tree-is-implementing-foldable-foldmap
15:08 <Kototama> it is recursive
15:09 tomphp joined
15:10 Jayhet joined
15:10 tommd joined
15:10 <Cooler> > (++ "1") . concat . (take 24) . repeat $ "1+"
15:10 <lambdabot> "1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1"
15:10 <Cooler> is there a better way to do this?
15:10 <Cooler> show 25 1s
15:10 <Jayhet> hello, can anybody help me in a function that I can't resolve?
15:10 mirpa joined
15:11 newhoggy joined
15:11 coot__ joined
15:11 Aidan[m] joined
15:11 pera joined
15:11 <sproingie> Cooler: there are infinity ways to golf that. "better" is something you ask for code that's actually useful.
15:11 <filostrato> Jayhet: I've learnt over the years that it's often better to just ask, than asking to ask ;)
15:11 alfredo_ joined
15:12 raichoo joined
15:13 <Jayhet> first time, okay, the function is: " f::(a,b) -> c -> (a -> b -> c)" and below is "f h _________" what is "f h = ___" ?
15:14 <lyxia> Kototama: It is, but in a different way.
15:14 <mniip> Cooler, (take N . repeat) = replicate N
15:14 <lyxia> Kototama: the recursion I'm talking about would in this case correspond to trees within a tree
15:15 _flow_ joined
15:15 <Kototama> i see. So the recursion of Foldable is nonetheless necessary for cataM
15:15 coot__ joined
15:15 <Kototama> whereas functor is enough for cata
15:15 <ClaudiusMaximus> Cooler: Data.List.intercalate may be useful
15:16 osa1 joined
15:16 osa1 joined
15:16 eiriksfa joined
15:16 Itkovian_ joined
15:16 <Kototama> but why use cataM over foldMap?
15:16 wictory[m] joined
15:16 reactormonk[m] joined
15:16 bb010g joined
15:16 closures999[m] joined
15:16 NickHu joined
15:16 davidar_ joined
15:16 Naughtmare[m] joined
15:16 pellegrino joined
15:16 alaradia[m] joined
15:16 iffsid[m] joined
15:16 TheWizardTower joined
15:16 jyp[m] joined
15:16 davidar joined
15:16 riaqn joined
15:16 roadrunner168[m] joined
15:16 nick2000 joined
15:16 karroffel joined
15:16 M-BostonEnginerd joined
15:16 unlmtd[m] joined
15:16 akr[m] joined
15:16 seequ_ joined
15:16 curry[m] joined
15:16 travisr joined
15:16 m4lvin[m] joined
15:16 herzmeister[m] joined
15:16 tester668[m] joined
15:16 unclechu joined
15:16 elwan7[m] joined
15:16 jmnoz[m] joined
15:16 monomon[m] joined
15:16 korayal[m] joined
15:16 miviotros[m] joined
15:16 sudoreboot[m] joined
15:16 sirius[m] joined
15:16 M-schmittlauch joined
15:16 MatrixTraveler[m joined
15:16 M-Illandan joined
15:16 aer[m] joined
15:16 hendrik[m] joined
15:16 Magnap joined
15:16 M-berdario joined
15:16 hiq[m] joined
15:16 corintho[m] joined
15:16 tfc[m] joined
15:16 M-Quora joined
15:16 srenatus[m] joined
15:16 rdesfo[m] joined
15:17 FederalRick[m] joined
15:17 bobjason[m] joined
15:17 cbHXBY1D[m] joined
15:17 TylerCecil[m] joined
15:17 M-krsiehl joined
15:17 Soif[m] joined
15:17 ptek[m] joined
15:17 unknownln joined
15:17 jacqueline[m] joined
15:17 goodboy[m] joined
15:17 hakan[m] joined
15:17 mmmrrr[m] joined
15:17 noraesae joined
15:17 jascot[m] joined
15:17 moonarch joined
15:17 rfabbri[m] joined
15:17 colton[m] joined
15:17 tomkerk[m] joined
15:17 latro`a joined
15:17 aspiwack[m] joined
15:17 wr3n[m] joined
15:17 Guest91110[m] joined
15:17 gentam[m] joined
15:17 ProofTechnique[m joined
15:17 zaphar_ps[m] joined
15:17 M-kevinliao joined
15:17 rakete joined
15:17 gkaplan[m] joined
15:17 zar[m] joined
15:17 drasich[m] joined
15:17 M92854[m] joined
15:17 TesX[m] joined
15:17 NopeMarker[m] joined
15:17 Yves[m]1 joined
15:17 <Jayhet> first time, okay, the function is: " f::(a,b) -> c -> (a -> b -> c)" and below is "f h _________" what is "f h = ___" ?
15:18 <cocreature> ph88_: I don’t know what exactly you’re doing, but 1 and 2 are definitely not compatible
15:19 buttbutter joined
15:19 <sproingie> Jayhet: sounds like you're being asked to fill in the blank.
15:19 <eschnett> Jayhet: This is a strange function. Are you sure you got your parentheses correct?
15:19 <sproingie> eschnett: it's curry
15:19 <sproingie> except hm, curry would need extra parens
15:20 ixxie joined
15:20 <Jayhet> yes, i know thats curry, but I can't fill the blank
15:21 seveg joined
15:21 Sampuka joined
15:21 <sproingie> :t curry
15:21 <lambdabot> ((a, b) -> c) -> a -> b -> c
15:21 coot__ joined
15:21 <sproingie> yeah the parens are all wonky on f
15:23 SadoqueTD joined
15:23 <Jayhet> are you sure? my professor gave that question, and I have looked anywere and nothing... I have been trying this for 2 days
15:24 eklavya joined
15:24 wroathe joined
15:25 <eschnett> Jayhet: Yes, we are sure.
15:25 <Jayhet> unless you tell me that function "f :: (a,b) -> c -> (a -> b -> c)" is impossible
15:25 uglyfigurine joined
15:25 <eschnett> Jayhet: This function is either impossible or trivial.
15:26 <eschnett> Jayhet: The other one (see lambdabot’s answer) is quite fundamental, and it seems you are asked to implement it.
15:26 oisdk joined
15:26 <cocreature> it’s as trivial as "a -> b -> (c -> b)"
15:26 <filostrato> oh, can anyone use lambdabot?
15:26 <cocreature> filostrato: sure
15:27 <filostrato> :t map
15:27 <lambdabot> (a -> b) -> [a] -> [b]
15:27 <filostrato> nice
15:27 <cocreature> filostrato: but if you want to play arount with it, stick to private messages to avoid spamming the channel
15:27 <sproingie> it's possible, it just isn't necessarily interesting. i'd ask your prof or TA for clarification
15:27 <filostrato> kk, I won't, hehe
15:27 <eschnett> … as in “/msg lambdabot”…
15:27 <sproingie> if it's just a typo in parentheses, your prof would be the only one to know for sure
15:27 gehmehgeh joined
15:27 tsdh joined
15:28 <Kototama> lyxia: there is a pretty good explanation there http://stackoverflow.com/questions/27769688/what-is-the-most-general-way-to-compute-the-depth-of-a-tree-with-something-like/27783737#27783737
15:28 <Jayhet> okay guys, i'll look around, thank you all
15:29 dunx joined
15:29 cables joined
15:30 <glguy> ?djinn (a,b) -> c -> (a -> b -> c)
15:30 <lambdabot> f _ a _ _ = a
15:30 <sproingie> add the parens yourself and implement curry and your prof might like your initiative. or might robotically mark it wrong.
15:30 fendor joined
15:30 <sproingie> that's why you go find your prof in office hours
15:31 coot__ joined
15:31 <cocreature> or just send them an email :)
15:31 <sproingie> or in this newfangled century, that
15:32 <cocreature> welcome to the future
15:32 Tomatosoup- joined
15:32 <sproingie> i had to send 'em a wax tablet and I LIKED IT
15:32 dm3 joined
15:32 dunx joined
15:32 <dequbed> Proof over avian carrier? :P
15:32 taktoa joined
15:32 hurkan joined
15:33 <filostrato> "At the moment one starts acquiring a skill, one is completely incompetent, which triggers an initial period of frustration and being stymied while waiting for someone, like an instructor, to spoon-feed process steps to the acquirer (or else, as Dreyfus and Dreyfus put it, they “like a baby, pick it up by imitation and floundering”)."
15:33 <filostrato> me in Haskell right now ;D
15:33 <ReinH> everyone in Haskell at some point
15:33 <filostrato> "After a relatively short phase of being a complete initiate, however, one reaches a point where the skill acquisition becomes possible as a solo activity via practice, and the renewed and invigorated acquirer begins to improve quite rapidly as he or she picks “low hanging fruit.”"
15:33 <filostrato> hopefully me in Haskell in a few months
15:35 danza joined
15:37 sssilver joined
15:37 sleffy joined
15:40 wroathe joined
15:40 <Kototama> filostrato: there is no low hanging fruits, only low bounded fruitomorphisms
15:40 burtons joined
15:40 pgib joined
15:40 Itkovian joined
15:42 newhoggy joined
15:42 coot__ joined
15:42 tommd joined
15:43 danthemyth joined
15:43 refold joined
15:43 Gentilhomme joined
15:43 magneticduck joined
15:44 Jesin joined
15:45 nicknovi1 joined
15:46 trism joined
15:47 buttbutt1r joined
15:47 jhinkle[m] joined
15:48 yinn joined
15:48 burtons_ joined
15:49 binaryplease joined
15:49 des_ joined
15:49 kattak joined
15:49 uuplusu_ joined
15:53 jmelesky joined
15:53 nkr joined
15:54 latro`a_ joined
15:55 mirpa joined
15:56 coot__ joined
15:57 maarhart joined
15:57 Rockfordal_ joined
15:58 newhoggy joined
15:58 nicknovi1 joined
15:59 so joined
16:01 eazar001 joined
16:01 Hermit joined
16:02 MarioBranco joined
16:02 Sonolin joined
16:02 sleffy joined
16:04 CountryNerd joined
16:04 <Guest92555> is there some setting I can use to make haskell escape non-printable chars in strings/bytestrings as hexadecimal?
16:05 physicalist joined
16:05 <lyxia> don't use show
16:06 <Guest92555> it's not practical for me translating stuff like \GS \SOH \ETX because they aren't even fixed length, for example, I see \GSE\ETX
16:06 <Guest92555> it's plain tricky
16:06 <Guest92555> sometimes it's 3 letters, sometimes 2
16:06 <Guest92555> sucks
16:06 coot__ joined
16:07 <Guest92555> yeah, will have to make my own printer
16:07 newhoggy joined
16:08 danthemy_ joined
16:08 <ExpHP> I have a Get, how do I decode a bytestring with it
16:08 <Kototama> is it possible to implement Foldable on something like data Tree a = Leaf Int | Node (Tree a) (Tree a) ? I guess not
16:08 <ExpHP> or do I have to make some dummy wrapper type just to have a Binary instance
16:09 <cocreature> :t runGet
16:09 <lambdabot> error: Variable not in scope: runGet
16:09 <cocreature> lambdabot does really not like me
16:09 <cocreature> ExpHP: anyway, that’s what you’re looking for
16:09 <ExpHP> Data.Binary.Get is opaque
16:10 <cocreature> no?
16:10 <ExpHP> also its record field is unGet
16:10 <ExpHP> or am I in the twilight zone?
16:10 <cocreature> I really mean runGet
16:10 dargains joined
16:10 <cocreature> it’s exposed from Data.Binary.Get
16:10 <cocreature> so "import Data.Binary.Get" and use runGet
16:10 <ExpHP> wow, I was on some very old docs
16:11 <ExpHP> thanks
16:12 dargains_ joined
16:12 meandi_2 joined
16:12 sleffy joined
16:12 <lyxia> Kototama: the fold will simply do nothing
16:12 connrs joined
16:12 <lyxia> Kototama: try DeriveFoldable
16:13 coot__ joined
16:13 Younder joined
16:14 Swizec joined
16:14 tlaxkit joined
16:15 jason85 joined
16:15 kattak joined
16:16 tommd joined
16:17 jship joined
16:18 Argue_ joined
16:18 mizu_no_oto_work joined
16:20 iomonad joined
16:21 wroathe joined
16:21 baweaver left
16:22 ezyang joined
16:22 cpennington joined
16:22 pgib left
16:23 Madars_ joined
16:23 Argue joined
16:23 anishathalye joined
16:24 newhoggy joined
16:24 chlong joined
16:24 vimk joined
16:25 <ExpHP> sigh... lazy bytestring to strict bytestring?
16:25 sampuka joined
16:25 sellout- joined
16:25 coot__ joined
16:26 <ExpHP> haddock docs need a really good integrated search feature like rustdoc has
16:27 tv joined
16:27 <ExpHP> especially with how haskell's module system forces some modules to be really ridiculously smal
16:28 <davean> ExpHP: which modules are you thinking of specificly when you think they're really rediculously small?
16:29 dylukes joined
16:29 <davean> And there are a bunch of search systems for them
16:29 <ExpHP> davean Some.Module.Types, which inevitably contains some extremely important documentation for anyone using Some.Module
16:29 <davean> Like https://www.haskell.org/hoogle/ specificly searches for signatures, like you're asking about above
16:30 <ExpHP> the only hoogle only seems to cover a small portion of hackage
16:30 soniku joined
16:30 <ExpHP> and then on my local machine I run into trouble with stack versions and large databaases
16:31 <ExpHP> s/only hoogle/online hoogle/
16:31 <davean> Ick, yah, I don't like anything to do with stack personally
16:31 <davean> hoogle works fine with cabal though
16:32 <davean> I've never seen any issues wiht hoogle and size, and I've installed basicly all of hackage
16:32 <ExpHP> davean I used cabal sandboxes for a year and could never stand to sit through the repeated rebuilds of all of hackage
16:32 <ExpHP> of course, there's new-build, but I had to roll my own scripts for that and 90% of editors just assume it doesn't exist
16:33 <ExpHP> when I switched to stack it was like an angel choir
16:34 mmhat joined
16:34 kattak joined
16:34 <ExpHP> ...except for using hoogle
16:34 <ExpHP> @hoogle Data.ByteString.Lazy.ByteString -> Data.ByteString.ByteString
16:34 <lambdabot> Data.ByteString tail :: ByteString -> ByteString
16:34 <lambdabot> Data.ByteString init :: ByteString -> ByteString
16:34 <lambdabot> Data.ByteString reverse :: ByteString -> ByteString
16:34 <ExpHP> oh of course, there's also the fact that it doesn't give a shit about anything beyond the unqualified name
16:35 <davean> Its toStrict BTW
16:35 wimpunk joined
16:36 <glguy> ExpHP: fwiw when you resort to whining, "sigh..." complaints, etc, you drive away people who might have otherwise volunteered to help
16:36 <ExpHP> no wonder, all the conversion functions are in Data.Bytestring.Lazy
16:37 <davean> Why do you think I didn't just answer?
16:37 SpinTensor joined
16:37 wroathe joined
16:38 eklavya joined
16:38 afarmer joined
16:38 <ExpHP> thanks
16:40 henriksod joined
16:40 geekosaur joined
16:40 newhoggy joined
16:40 Maxou joined
16:43 Cooler left
16:44 <ph88_> cocreature, you were right i made a mistake, this is the updated paste https://bpaste.net/show/262ab3b65dea
16:44 <orion> https://github.com/haskell-crypto/cryptonite/pull/156 <-- What does "pin status" mean here?
16:45 cdg_ joined
16:45 newhoggy joined
16:45 <davean> orion: I'd assume pinned memmory
16:45 abinr joined
16:45 sleffy joined
16:46 <davean> But I'd have to review the patch to be sure
16:47 orhan89 joined
16:48 sproingie joined
16:48 sproingie joined
16:48 juliagoda joined
16:48 smillmorel joined
16:50 newhoggy joined
16:52 cdg joined
16:52 magneticduck joined
16:54 hastell joined
16:54 doomlord joined
16:54 connrs joined
16:55 nicknovi1 joined
16:55 <ExpHP> glguy: I'm just frustrated. Haskell presents me with difficulties in finding information that I have not had to face in any other language. Given an object of some arbitrary type, it is surprisingly difficult to find out what one can do with said object
16:55 balor joined
16:55 <ExpHP> typeclasses, as wonderful as they are, often hide key pieces of a type's API
16:56 <glguy> I'm just warning you that taking that frustration out on the channel is a good way to get less help
16:56 <ExpHP> and I cannot rely on autocomplete due to the lack of name-directed method resolution
16:56 <davean> ExpHP: I find your issues divergent, perhaps you're going about it wrong
16:56 gnatt joined
16:56 <davean> but yes
16:57 <davean> you'd have gotten far more help from me if you'd not made an ass of yourself. I'd have just told you
16:57 <ExpHP> the "sigh" is because I feel like an asshole repeatedly asking "how do I get from a -> b" questions on here
16:57 <ReinH> It's not the questions you're asking so much as your method of asking them.
16:58 tomphp joined
16:58 <ReinH> We get a large number of very basic questions every day, clearly we're pretty ok with answering basic questions.
16:58 <ReinH> But most people don't pair them with a diatribe on why the language we like is terrible.
16:59 newhoggy joined
16:59 <ExpHP> hey, it's my favorite language, too
17:00 <sproingie> it's beautiful and terrible
17:00 <ph88_> i have some basic questions in here https://bpaste.net/show/262ab3b65dea .. i think they are basic anywayz
17:01 <davean> ph88_: have you tried a lift variant?
17:01 <ph88_> what's a lift variant ?
17:01 <davean> Do you know what lift is?
17:02 <ph88_> seen liftIO to access IO from other monad
17:02 <cocreature> ph88_: the type signature you’re claiming for the combination of 2 and 3 is incorrect I think
17:02 gnatt left
17:02 <ph88_> ok let me double check that
17:02 cloudhead joined
17:02 <cocreature> 2 and 3 should fail
17:02 <davean> Hum, ok, so I'm not sure I'm ready to do the transformers speal ATM
17:03 <davean> ph88_: http://hackage.haskell.org/package/conduit-1.2.10/docs/Data-Conduit.html#v:transPipe
17:03 <ph88_> cocreature, ghci infers that type
17:03 <ReinH> MonadIO m => m unifies with ResourceT IO iff ResourceT IO is an instance of MonadIO.
17:03 <cocreature> ph88_: then parseAndSelect has a different signature than the one you’re claiming it has
17:03 <cocreature> ah you have a different signature below
17:03 <cocreature> with that it can work
17:03 <ph88_> ah shit ye ... let me update the paste again -___-
17:03 <cocreature> with the one at the top it can’t
17:03 <ph88_> ye
17:03 oisdk joined
17:04 halogenandtoast joined
17:04 yinn joined
17:04 <ph88_> i updated the paste for the mistake on combination of 1 and 2 and then forgot to update paste of combination of 2 and 3
17:05 <halogenandtoast> If anyone has Yesod experience (or not), could someone help me understand this error and perhaps point me in a direction on how to fix it? I can't seem to get the types to line up: https://gist.github.com/halogenandtoast/f17c35acd446f380b32aea1842c2b931
17:05 newhoggy joined
17:05 <davean> ph88_: So, clearly you've worked with monad transformers?
17:05 oisdk joined
17:06 caumeslasal joined
17:06 flatmap13 joined
17:06 SonicTheEdgehog left
17:07 flatmap1_ joined
17:07 <ph88_> here is updated paste https://bpaste.net/show/6e4ce11f213d
17:08 wroathe joined
17:09 <ReinH> So what's the question now? Why does ResourceT IO unify with MonadIO m => m?
17:09 <cocreature> ph88_: so do you understand the things above line 50?
17:09 <ph88_> davean, i barely touched monad transformers .. but yes i've "worked" with them
17:10 <davean> Right, so not exactly about your problem but in 1, you get "Couldn't match type ‘IO’ with ‘ResourceT IO’"
17:10 <davean> so "lift" is the m a -> t m a transfomration
17:10 <cocreature> you can’t use lift directly here
17:10 <davean> cocreature: I already linked what you can use
17:11 cdg joined
17:11 <davean> cocreature: I'm explaining how it works
17:11 <ph88_> cocreature, yes i understand the errors now above line 50
17:11 <cocreature> ah sry
17:11 Wamanuz joined
17:11 <halogenandtoast> In my code I've tried both `redirect` and `redirectUltDest` both provide the same issue.
17:11 <mivael> hello all! Could anyone please point me out to a minimalistic example of using Data.Attoparsec.ByteString.Lazy for simplest cases?
17:11 <mivael> (Like, for example, reading from stdin a large number of decimal integers separated by spaces/newlines and feeding them to a pure function as a lazy list for actual calculations.)
17:12 <cocreature> ph88_: ResourceT IO and m are compatible because GHC can just set m = ResourceT IO. it also needs to satisfy a constraint but there is an instance of MonadIO for "ResourceT IO"
17:12 connrs joined
17:12 <cocreature> in the second case GHC tries to set s = IO, but there is no instance of MonadState StreamState for IO
17:12 <cocreature> so that fails
17:13 <ph88_> davean, can i do without hoist and use more abstract monads only? (from what i understand more abstract monads to be is => m with more constraints put on it)
17:13 <davean> ph88_: Theres a less common ability to take t m a -> t n a, when you have an m a -> n a, in this case thats transPipe, and of course lift is the m a -> n a
17:13 <davean> ph88_: generally yes
17:13 MarioBranco joined
17:13 <davean> but you're functions will have to support it also, which either means a lot of type classes or lifts
17:13 newhoggy joined
17:13 jeltsch joined
17:13 BlueRavenGT joined
17:14 jaziz1 joined
17:15 <ph88_> what do you mean with ability "t m a -> t n a" ? how can you loose monad m here? where it go?
17:15 <ph88_> what's t even ?
17:16 <davean> t is the transformer
17:16 <davean> and you ddon't "lose" the m, you transform it
17:16 <ph88_> what does that mean transform ?
17:17 <davean> in the case of lift you actually get "t m a -> t (g m) a"
17:17 oisdk joined
17:17 <davean> Well, some monads can be rewriten into other ones
17:17 <ph88_> is t a typeclass that has instances for m and n ?
17:17 Swizec joined
17:17 <davean> 've failed :(
17:17 <ph88_> :(
17:18 mohsen_ joined
17:18 <davean> t is a type variable, you have to actually fill it in with something specific at some point
17:19 <ph88_> ah ok
17:19 <ph88_> how do you know which monads can be rewritten into which other monads ?
17:19 <davean> in your case its Producer or ConduitM or something
17:19 <davean> well, you have functiosn that do it
17:20 <davean> for example, lift
17:20 <davean> or runReaderT
17:20 initiumdoeslinux joined
17:20 <ph88_> ah ok
17:20 <davean> tranPipe just *takes* one of those
17:20 vimk joined
17:20 <davean> and knows how to move its stuff over based on that
17:20 <ph88_> transPipe takes on of what ?
17:21 <davean> transPipe :: Monad m => (forall a. m a -> n a) -> ConduitM i o m r -> ConduitM i o n r
17:21 <ph88_> it takes a function lift ?
17:21 <davean> Well, lift is one option, there are other options
17:21 <ph88_> oh transPipe stands for transform pipe ?
17:21 <davean> you provide the appropriate function
17:21 <ph88_> ok
17:21 <davean> in your case, yes, lift
17:22 <davean> but, there are other cases
17:22 <davean> like one could have a ConduitM BSC.ByteString Double (ReaderT r IO) ()
17:22 <davean> and want an ConduitM BSC.ByteString Double IO ()
17:22 newhoggy joined
17:22 <davean> We could push runReaderT down to convert in the other direction
17:22 <ph88_> oh that's nice
17:23 <ph88_> what did you mean before with "which either means a lot of type classes or lifts" ? where does transPipe fit into this? the "lifts" option ?
17:23 <davean> That fits in avoiding transPipe and just making your function more generic
17:23 <davean> transPipe is a way of taking two specific things that are different and making them match
17:23 <ph88_> so i have 3 options, lot of type classes, lifts or transPipe .. is that right ?
17:24 <davean> lift and type classes are ways of taking something specific and something generic and making them match
17:24 flatmap13 joined
17:24 <davean> Yah
17:24 Maxou joined
17:24 <ph88_> can you tell a little bit about the other two options .. i think i have get the basics of transPipe now
17:24 <davean> so, the type class version would be removing the IO and making it MonadIO m
17:24 wroathe joined
17:24 <ph88_> ye i think that was the path i was on at the moment ..
17:24 <davean> this is the one I'd generally recomend
17:25 <ph88_> ya
17:25 <davean> Though I fell understanding the transPipe version is more important for your understanding of whats actually happening
17:25 <ph88_> ye ok
17:25 <* mivael> is lost in Attoparsec docs...
17:25 <davean> the lift, well, thats more constrained
17:25 <davean> lift just takes some m a and makes it into a t m a for any given t
17:26 <davean> with is a less general form of what liftIO does
17:26 <ph88_> using typeclasses would mean that all 5 functions would need to be of type signatures (foo, bar) => m without any concrete type for m, is that right ?
17:26 acertain joined
17:26 <davean> not quite
17:26 <davean> you can have some concret ms
17:26 <davean> just not more then one really
17:26 <davean> and some might be something like ResourceT m
17:26 afarmer joined
17:26 <ph88_> but that one needs to have an instance for all the constraints given in the other functions ?
17:26 m0cesta joined
17:26 <davean> where we know we're in something transformed by ResourceT but not what it is specificly
17:27 <davean> No, functions only need to knwo what THEY require
17:27 <ph88_> i mean for it to work with you chain them with .|
17:28 <ph88_> when you have a .| b .| c and b has a concrete type, i think this type needs instances of the constraints given on the types in a and c
17:28 <mivael> Does anyone know how to parse a decimal integer using attoparsec?
17:28 <ph88_> mivael, ya i do
17:28 <mivael> ph88_, Can you please give me a hint? :)
17:28 <ph88_> https://hackage.haskell.org/package/attoparsec-
17:28 <ph88_> https://hackage.haskell.org/package/attoparsec-
17:29 <davean> ph88_: yes, the concret types need to be instances
17:29 <ph88_> mivael, oh i gave the wrong links .. but just scroll up for decimal
17:29 <mivael> thanks! I did not look into Char8 and Text (I thought somehow they are not related)
17:29 sirreal joined
17:30 newhoggy joined
17:30 <davean> ph88_: so maybe you understand a little more haskell now, or maybe I'm a massive failure as a teacher. Sadly my bet is on the later ATM
17:30 <davean> but I hope it helped
17:30 <ph88_> ye it helps
17:30 <ph88_> davean, for my problem when i choose to solve it with typeclasses and i can have 1 function with a concrete type .. which type should i choose ?
17:31 <ph88_> thanks very much
17:31 <davean> ph88_: probably ResourceT m
17:31 kattak joined
17:31 <davean> and then in the end ResourceT IO, most likely
17:31 <ph88_> then i will get that IO does not implement MonadState MyState IO i think
17:31 soniku joined
17:32 <davean> ph88_: well, ResourceT m doesn't say IO then
17:32 <davean> ResourceT m could be ResourceT (StateT MyState IO)
17:32 <ph88_> oh it's ResourceT which has to implement MonadState ?
17:32 <ph88_> aah ok
17:33 <ph88_> type parameters combined with typeclass constraints are still confusing
17:33 <davean> why is that?
17:33 acidjnk joined
17:33 <davean> So you can have "MonadState MyState m => ResourceT m"
17:33 <ph88_> partly because of the syntax
17:33 <davean> Hum, what is it about the syntax?
17:34 <davean> would it be better with explite foralls for you?
17:34 <ph88_> no
17:34 <davean> "Forall m such that m is an instance of MonadState MyState we work with ResourceT of said m"
17:34 <davean> forall m. MonadState MyState m => ResourceT m
17:35 <ph88_> if you have a ResourceT (MonadState MyState m) .. you don't really notice is that you are using a constraint here wrongly ... they both are a normal word which starts with a capital
17:35 <davean> No
17:35 {emptyset} joined
17:35 <davean> MonadState is a typeclass constraint, not a type
17:35 <ph88_> so i found that there is some kind of correspondence between MonadState and State .. but there is no hint in my editor that they belong together or i can interchange them (sometimes)
17:36 newhoggy joined
17:36 <davean> You can never interchange them
17:36 <cocreature> davean: yeah but I think ph88_’s point is that you can’t see that syntactically
17:36 <cocreature> which is a valid point
17:36 <davean> sure
17:36 mizu_no_oto_work joined
17:36 <ph88_> you can change around MonadState x m => m with State x sometimes
17:37 coot__ joined
17:37 n1 joined
17:37 <ph88_> i dunno, it just seems there are a lot of options to do stuff .. i think the design space for the language is pretty big ... so to figure out how all the combinations work together is not straightforward
17:37 <ph88_> but your explanation helped a lot already
17:37 <davean> ... sorta, you're not changing around there
17:38 <davean> you'e specifyin WHICH MonadState to use
17:38 <davean> State and StateT are specific MonadStates
17:38 <davean> I'm glad it helped a little, I was worried I'd lost you :)
17:38 <nitrix> namely, Monad m => MonadState s (StateT s m)
17:38 <nitrix> and State should be a type alias of StateT
17:38 physicalist joined
17:39 <ph88_> ye sometimes i get the higher level concepts even though i don't understand the lower level concepts which they are based on o_O
17:39 replay joined
17:39 PennyNeko joined
17:39 <nitrix> One would argue it's the other way around. You understand some applications of these concepts on their lower level, but don't recognise the generalization for them on a higher level of abstraction.
17:39 <nitrix> Abstraction goes upwards.
17:40 <nitrix> At least, I've always seen it described this way.
17:40 wroathe joined
17:41 nwf joined
17:41 newhoggy joined
17:42 <ph88_> dunno ..
17:42 <ph88_> this comes to mind though "It was clear, from the questions students asked me in office hours, that those who were underperforming weren’t struggling with the fundamental concepts in the class, but with algebra: the problems were caused by not having an intuitive understanding of, for example, the difference between f(x+a) and f(x)+a." https://danluu.com/teach-debugging/
17:42 <ph88_> have to go
17:42 <ph88_> thanks again davean & cocreature
17:42 <ph88_> bye bye
17:43 spopejoy joined
17:43 spopejoy left
17:44 <davean> ironically thats almost litterly the monad transformers issue :)
17:44 maarhart joined
17:44 cyborg-one joined
17:45 <sproingie> i had a typical US math education too. in other words, i grew up hating math.
17:45 <sproingie> now i find i actually love math, i just hate numbers.
17:46 <davean> numbers are uselessly specific
17:46 <koala_man> they don't teach math in the US. they teach calculation
17:46 <koala_man> at least up until common core
17:48 bertschneider joined
17:48 fragamus joined
17:49 ompaul joined
17:50 Maxou joined
17:50 <fragamus> https://gist.github.com/fragamus/56e570e2df276de569c68d018d54aaae
17:50 TheLemonMan joined
17:50 newhoggy joined
17:51 cyborg-one joined
17:51 vimk joined
17:51 hackebeilchen joined
17:52 hybrid joined
17:53 ikke joined
17:54 chlong joined
17:54 kattak joined
17:54 <fragamus> can anyone tell me why i is always zero in that gist
17:54 coot__ joined
17:54 newhoggy_ joined
17:55 <monochrom> Is 0 printed just once? Is 0 printed multiple times?
17:56 ralu joined
17:56 <fragamus> multiple times
17:56 sssilver joined
17:56 <fragamus> wierd huh
17:56 <monochrom> Yeah, I don't know why.
17:56 <monochrom> And "TEN" never happened, right?
17:57 atomi joined
17:57 <fragamus> it always happens
17:57 <monochrom> Actually "TEN" should happen once, first iteration, at least.
17:57 <monochrom> Ah OK.
17:58 <fragamus> 0 `mod` 10 is always 0
17:58 hydraz joined
17:58 <fragamus> weird maybe i can simplify the code and the bug will pop out
17:58 <monochrom> I am even comparing all the "filePathPipe2" occurences at almost pixel level to look for typos :)
17:59 twanvl joined
17:59 coot__ joined
18:00 Cassiopaya joined
18:01 mac10688 joined
18:01 <monochrom> At present the only plausible conjecture I have is "maybe filePathPipe 1 dies before getting to print 1; all the printings of 0 come from multiple calls to filePathPipe from the outside".
18:01 <fragamus> oooh I moved the liftIO $ putStrLn $ show i to be the first thing in the do block
18:01 <fragamus> now it says 1 but also says TEN
18:01 connrs joined
18:02 <fragamus> seems to back your theory
18:02 <tabaqui> @let a = 1000 :: PortNumber
18:02 <lambdabot> .L.hs:163:13: error:
18:02 <lambdabot> Not in scope: type constructor or class ‘PortNumber’
18:02 blym joined
18:02 <tabaqui> hm
18:02 <tabaqui> can anyone test this code?
18:02 <tabaqui> a = 1000 :: PortNumber
18:02 <tabaqui> a < 2000
18:02 <tabaqui> in my ghc it returns False
18:03 zzz joined
18:03 <tabaqui> it's strange, because PortNumber is deriving Ord from Word16
18:03 <tabaqui> and the same code with Word16 works fine
18:04 <Tuplanolla> Which version of `network`, tabaqui?
18:04 <Tuplanolla> I think they changed the type quite recently.
18:04 newhoggy joined
18:04 glebec joined
18:04 eliasr joined
18:04 <glebec> howdy y'all
18:04 <geekosaur> tabaqui, be very careful with PortNumber
18:05 <monochrom> Oh! PortNumber \xabcd would become \xcdab
18:05 <geekosaur> network has a tendency to byteswap values to network byte order
18:05 <geekosaur> or, what monochrom just said
18:05 <Squarism> is there a nicer way of filtering "Right"'s from let k :: [Either String Int] ; k = [Right 1,Left "a"] ? My best is this clumsy one : concatMap (\x -> case x of ; Right r -> [r] ; o -> []) k
18:05 <ClaudiusMaximus> i think that fromInteger for PortNumber does some byte swapping for network byte order maybe? which would make deriving Ord a bug
18:05 <tabaqui> Tuplanolla:
18:05 flatmap13 joined
18:05 bvad joined
18:06 <Squarism> oh
18:06 <Squarism> "rights"
18:06 <monochrom> You probably want to "toInteger a < 2000" for higher reliability
18:07 <monochrom> or fromIntegral and choose your type if you think Integer is overkill.
18:07 <tabaqui> monochrom: looks fine, so I'll do it
18:07 <tabaqui> thanks
18:08 <Tuplanolla> It has an `Ord` instance, so there should be no problem there.
18:08 <fragamus> ok thanks monochrom i have to go to lunch but ill try that later
18:08 Gurkenglas joined
18:08 conal joined
18:08 tomphp joined
18:08 <tabaqui> ClaudiusMaximus: Data.Either.rights
18:09 <tabaqui> ClaudiusMaximus: sorry, wrong recepient
18:09 gehmehgeh joined
18:09 <filostrato> so, who wants to take a crack at giving me a good intuitive understanding of (>>) and (>>=)?
18:09 <Tuplanolla> This looks like a bug to me, tabaqui.
18:10 <monochrom> Well, the rest of network's code is consistent with that, so it is arguably a "feature" or at least a design decision.
18:10 danthemyth joined
18:11 <geekosaur> it's a fairly well known gotcha with network
18:11 <Tuplanolla> The source code says `newtype PortNumber = PortNum Word16 deriving (Eq, Ord, Typeable)`, yet `(1000 :: PortNumber) < (2000 :: PortNumber)` is `False`.
18:11 <ReinH> filostrato: what do you already know?
18:11 <davean> Tuplanolla: so? It has an Ord, it just doesn't have the Ord you expect
18:11 <monochrom> But you've got to look at its Num instance
18:11 <geekosaur> ^
18:11 <davean> Tuplanolla: Its a perfectly valid ordering
18:11 MarioBranco joined
18:11 <ReinH> Tuplanolla: what does the fromInteger do?
18:11 <monochrom> What does fromInteger do?
18:11 <ReinH> monochrom: I got u
18:12 <Tuplanolla> Oh, I see now.
18:12 <davean> ReinH: this is why I didn't like your implicite Ord instance dependancy last night
18:12 <mivael> Now I know how to parse one integer :)
18:12 <mivael> A8.parseOnly (A8.decimal <* A8.endOfInput) $ B8.pack "123" -- Data.ByteString.Char8 as B8, Data.Attoparsec.ByteString.Char8 as A8
18:12 <ReinH> davean: yes, it was just clever
18:12 <ReinH> clever is bad but also fun
18:12 <monochrom> I agree that it's a bad choice. People actually want to test my_port_number > 1024. But apart from that it is a legit choice.
18:13 <ReinH> anyway I'm not the one who has to live with the code so YOLO
18:13 <davean> ReinH: :(
18:13 newhoggy joined
18:13 <davean> I often depend on Ord being an ordering but I generally try avoid depending on WHICH ordering it is
18:13 oisdk joined
18:13 coot___ joined
18:13 Sh4rPEYE joined
18:13 <monochrom> In fact if their Ord instances do the inverse swapping before comparing, you would never know this one little implementation detail.
18:13 <mivael> Any hints about my next step? How to combine attoparsec parsers? How to parse two integers? N integers?
18:14 <dysfun> sepBy?
18:14 <ReinH> Arguably, there should be a coherence between whatever fromInteger does and whatever compare does.
18:14 negatratoron joined
18:14 <ReinH> i.e. x :: Integer < y :: Integer => x :: PortNumber < y :: PortNumber
18:14 <monochrom> Yeah
18:14 <mivael> dysfun, thanks
18:14 <Sh4rPEYE> Hello. I'm trying to understand this simple function. Well, I know it should be simple, but it just doesn't click to me... How does that work? I tried to work it out with pen and paper, but there is just too much things to keep eye on, for me at least
18:14 <Sh4rPEYE> combinations'' 0 _ = [[]]
18:15 <Sh4rPEYE> combinations'' n xs = [ y : ys | y:xs' <- tails xs, ys <- combinations'' (n - 1) xs' ]
18:15 <Gurkenglas> davean, sounds like a line that I should use to shill for a paper that sounds related from a lecturer I know https://link.springer.com/chapter/10.1007/978-3-642-38536-0_10
18:15 <ReinH> > tails [1,2,3,4]
18:15 <lambdabot> [[1,2,3,4],[2,3,4],[3,4],[4],[]]
18:16 <Sh4rPEYE> Yes I know that. But I don't see how that helps me to get the combinations :/
18:16 <ReinH> I wasn't suggesting that you didn't
18:16 <filostrato> ReinH: well, ok, (>>=) goes by the name bind, and has the type m a -> (a -> m b) -> m b; essentially that means it takes a monadic value, and a function from that value to a monadic value of a different type, and returns a monadic value of that latter type, by collapsing m (m b) to m b I suppose
18:16 <ReinH> filostrato: that's correct, at least conceptually
18:17 <filostrato> so I kind of get it, but it's the intuitive part I struggle with, I don't really grok it
18:17 <ReinH> (often join is written in terms of bind, rather than vice versa, but the two ways of writing it are equivalent)
18:17 sssilver joined
18:17 <ReinH> filostrato: Look at the type types and ask yourself, "what happens to the 'a'"?
18:17 <ReinH> :t (>>=)
18:17 <lambdabot> Monad m => m a -> (a -> m b) -> m b
18:17 <ReinH> :t (>>)
18:17 <lambdabot> Monad m => m a -> m b -> m b
18:18 rblaze joined
18:18 <ReinH> s/type types/two types
18:18 <sproingie> i usually find the fmap+join (aka flatMap) a lot more intuitive than bind. kind of depends on the monad tho.
18:18 newhoggy joined
18:19 <ReinH> specifically, what is the difference between (a -> m b) and (m b)?
18:19 <filostrato> type types?
18:19 <ReinH> type types is a typo, I meant "two types"
18:19 <filostrato> oh, right,
18:19 <mivael> dysfun: thank you much: A8.parseOnly (((A8.decimal) `A8.sepBy1` (A8.char ' ')) <* A8.endOfInput) $ B8.pack "123 456"
18:19 <ReinH> >>=, as you already noted, uses a function a -> m b to produce an m b from an m a
18:19 <ReinH> what does >> do to produce an m b?
18:19 ner0x652 joined
18:20 <filostrato> just m b, seems like it just discards m a
18:20 <ReinH> well, there are a couple things it could do
18:20 <ReinH> that's one of them
18:20 <ReinH> what else could it do?
18:20 mmachenry joined
18:20 <dysfun> mivael: there are other things to play with in the Combinators namespace
18:20 <ReinH> here's a hint: can you write a function that turns an m b into an a -> m b?
18:20 <ReinH> what would that function do with the 'a'?
18:21 <filostrato> let me think; I enjoy being taught socratically btw
18:21 <ReinH> excellent
18:22 <ReinH> f :: Monad m => m b -> a -> m b; f mb a = ???
18:22 <sproingie> you can even ignore the 'm' there. there's only one way to write a -> b -> b
18:22 <ReinH> that's true
18:22 <ReinH> we can ask djinn
18:22 <ReinH> @djinn mb -> a -> mb
18:22 <lambdabot> f a _ = a
18:22 <ReinH> @. pl djinn mb -> a -> mb
18:22 <lambdabot> f = const
18:22 <ReinH> it's const
18:23 <ReinH> it just throws away the a
18:23 <filostrato> heh
18:23 <ReinH> so >> is an >>= that throws away the 'a'
18:23 <ReinH> but keeps its m context
18:23 <filostrato> that's what I said to begin with though, just throw away the m a
18:23 <mivael> dysfun, you mean they are compatible with attoparsec?
18:23 <ReinH> and combines it with the m b context
18:23 <ReinH> @src (>>)
18:23 <lambdabot> m >> k = m >>= \_ -> k
18:23 <sproingie> you use it for stuff where the return value doesnt matter, i.e. side effects in IO
18:23 <ReinH> it's literally >>= and const
18:23 <dysfun> mivael: i mean Attoparsec has a combinators namespace full of things like sepBy
18:24 <ReinH> filostrato: no, not throw away the m a
18:24 <ReinH> throw away the *a*
18:24 <ReinH> > [1,2] >> "hello"
18:24 <mivael> dysfun, understood. I'm starting to like this way of parsing :)
18:24 <lambdabot> "hellohello"
18:24 newhoggy joined
18:24 <ReinH> the context in this case is that the list has two elements
18:24 <ReinH> the 'a' is what the elements are, which is thrown away
18:24 <dysfun> mivael: yes, it's quite nice compared to the alternatives
18:24 coot___ joined
18:25 laplacian joined
18:25 <filostrato> but isn't the m the same in all instances in the signature?
18:25 <filostrato> ooh
18:25 <ReinH> [1,2] and "hello" are the same m
18:25 <filostrato> I get it
18:25 <ReinH> same type, that is
18:25 <filostrato> I think; the m is still needed to determine the context
18:25 <ReinH> but m has some structure
18:25 <sproingie> ReinH: albeit kind of sneaky syntax for it
18:26 <ReinH> and the structure is different
18:26 <ReinH> or m is some sort of computation or effect, and those may differ
18:26 <ReinH> :t putStrLn "foo" >> putStrLn "bar
18:26 <lambdabot> error:
18:26 <lambdabot> lexical error in string/character literal at end of input
18:26 <ReinH> :t putStrLn "foo" >> putStrLn "bar"
18:26 <lambdabot> IO ()
18:26 <ReinH> :t putStrLn
18:26 <lambdabot> String -> IO ()
18:26 <sproingie> notice the a -> m b there
18:27 <ReinH> putStrLn "foo" gives back an m a where m ~ IO, a ~ ()
18:27 <sproingie> a is String, m is IO, b is ()
18:27 <ReinH> we don't care about the a, but we very much care about the m context
18:27 <sproingie> () usually pronounced "unit" btw
18:27 <filostrato> right; the context needs to be the same
18:27 <davean> Why do we use ~ for type equality BTW?
18:27 wroathe joined
18:28 <ReinH> because we are silly
18:28 <davean> Ok, because I've found it perpetually annoying
18:28 <ReinH> there's no good reason
18:28 <monochrom> Because = is already taken (to mean "definition").
18:28 tomphp joined
18:28 <filostrato> I understand it better now; that lead me to another thing though, what exactly is this ()?
18:28 <ReinH> that is a reason
18:28 <sproingie> using = would make the grammar even more nuts than it is
18:28 <ReinH> I dispute whether it is a *good* reason
18:28 <ReinH> Other languages get away with it
18:28 <sproingie> filostrato: it's a type called unit. it has only one value. it's basically what you return when you don't return anything
18:28 <davean> I'm rather unhappy with ~
18:28 <ReinH> filostrato: data () = () is a type with one value
18:29 <monochrom> I totally agree with you definition should be :=, equality should be =, nothing should be == or ~
18:29 Maxou joined
18:29 <davean> ReinH: two values?
18:29 <ReinH> two values, including bottom
18:29 <davean> correct!
18:29 <dysfun> monochrom: woohoo, pascal back in fashion!
18:29 <ReinH> it's a boring type we use when the value is boring
18:29 tomphp joined
18:29 <geekosaur> but then there's the internal ~~ silliness
18:29 <ReinH> IO () does some IO but that no interesting result so we use the boring type for the result type
18:29 <sproingie> yeah, everything can have bottom, but we don't account for it. you hit bottom, program goes boom.
18:29 chaosmasttter joined
18:30 <ReinH> er, "but has"
18:30 sssilver joined
18:30 <filostrato> haha
18:30 nkr left
18:30 <davean> sproingie: I don't know about you, but I find it pretty important to reason about the bottoms
18:30 <ReinH> it's the smallest possible thing you can use to indicate that something exists, but is otherwise uninteresting
18:30 cdg_ joined
18:30 <geekosaur> ob "fast and loose reasoning is morally correct" >.>
18:32 <filostrato> "It is very different from the empty type, called (by people I wish had chosen a better name like the one I suggested) in Haskell Void. The empty type is very exciting, because if somebody ever gives you a value belonging to it, you know that you are already dead and in Heaven and that anything you want is yours."
18:32 Jesin joined
18:32 <ReinH> filostrato: Moving up, we have Bool, which is the type with two inhabitants (not bottom), which we use when we have a choice of two things, like for if.
18:33 <filostrato> right, so () is a type with only one value
18:33 <ReinH> IO Void is an IO computation that can't be executed because it would have to produce a value that doesn't exist.
18:33 <filostrato> a boring type with a boring value
18:33 blym_ joined
18:33 <monochrom> When I'm dead, I want a mechanism to bring me back to life, thus completing the contradiction. :)
18:33 newhoggy joined
18:33 <ReinH> heh
18:33 <nitrix> filostrato: See `absurd`.
18:33 <nitrix> :t absurd
18:33 <lambdabot> Void -> a
18:33 tomphp joined
18:33 <ReinH> see also a -> Void, which is logical negation.
18:34 <sproingie> :t absurd (unsafeCoerce 1 :: Void)
18:34 <lambdabot> error:
18:34 <lambdabot> Variable not in scope: unsafeCoerce :: Integer -> Void
18:34 <sproingie> go fig
18:34 yinn joined
18:34 <mniip> :t absurd undefined
18:34 <lambdabot> a
18:34 ziocroc joined
18:35 Sampuka joined
18:35 <nitrix> mniip: The real question is if it's implemented as absurd = undefined or absurd Void = undefined
18:35 Levex joined
18:35 <mniip> absurd Void - can't write that
18:36 <filostrato> when is the empty type ever used?
18:36 <nitrix> whoopsie.
18:36 <ReinH> filostrato: you can imagine a function a -> b for some a and b as a way to make (sizeof a) choices of b, for examble Bool -> Int picks one of two Ints.
18:36 <mniip> Void either has no constructors or has an unary strict constructor
18:36 <filostrato> or is it just a joke? :P
18:36 <mniip> either
18:36 <nitrix> mniip: Sorry I meant absurd x = x `seq` undefined
18:36 <mniip> data Void; absurd x = case x of {}
18:36 Hexagenic joined
18:36 <ReinH> filostrato: () -> Int just selects an Int (picks one of one Ints)
18:36 <mniip> data Void = Void !Void; absurd (Void x) = absurd x
18:36 halogenandtoast joined
18:36 <ReinH> Void -> Int selects zero Ints
18:37 <sproingie> filostrato: Void is fairly uncommon in day-to-day code, it's useful for type-level programming as analogous to "false"
18:37 <monochrom> Such strictly Void. Much bottom in bottom.
18:37 <mniip> (x -> Void) ~ not x
18:37 oisdk joined
18:37 <dysfun> i guess that'll be less needed with TypeInType
18:37 <ReinH> filostrato: you might ask yourself, what is sizeof (a -> b)?
18:37 <sproingie> -Xzibit?
18:38 <ReinH> for example, how many ways can you write Bool -> Bool?
18:38 forgottenone joined
18:38 <mniip> sizeof?
18:38 <mniip> you mean cardinality of the set?
18:38 <filostrato> what does sizeof do?
18:38 <ReinH> yes
18:38 <filostrato> ok, hmm
18:38 <ReinH> filostrato: sizeof is how many inhabitants a type has
18:38 phyrex1an joined
18:38 <ReinH> I could say |a -> b|, I guess
18:38 <filostrato> infinite? :P
18:38 <mniip> card(...)
18:38 <sproingie> such wonderful tangents
18:38 <mniip> filostrato, wrong!
18:39 newhoggy joined
18:39 <mniip> filostrato, if a = (), b = (), there's only one
18:39 <ReinH> filostrato: what is |() -> ()|?
18:39 <mniip> and one is a finite number
18:39 <ReinH> how many ways can you go from () to ()?
18:39 <filostrato> one, I suppose
18:39 <ReinH> ok, what about |() -> Bool|?
18:39 <filostrato> still one
18:39 <ReinH> really?
18:40 <monochrom> Three ways if you allow bottom and insist on monotonicity.
18:40 <ReinH> what about \() -> True and \() -> False?
18:40 <mniip> ew
18:40 <mniip> bottoms
18:40 <filostrato> oh, okay
18:40 <ReinH> we're all going to hold our noses and pretend there are no bottoms.
18:40 <ReinH> filostrato: now, what about |Bool -> Bool|?
18:40 <mniip> monochrom, I cound about 5?
18:40 <filostrato> 4
18:40 <monochrom> OK, sorry I was just digressing.
18:40 <ReinH> you can write them out if it helps
18:40 <mniip> count*
18:41 <ReinH> filostrato: now, given Data Three = A | B | C
18:41 <monochrom> mniip: I am slow and I was still at ()->().
18:41 <ReinH> what is |Bool -> Three|?
18:41 <mniip> ah
18:41 <filostrato> no,I get the combinatorics of it now, I believe
18:41 <mniip> yes with ()->() there's 3
18:41 <filostrato> 8
18:41 <filostrato> 6*
18:41 <monochrom> Bottom slows me down.
18:41 <ReinH> filostrato: and what is |Three -> Bool|?
18:41 <byorgey> uh, |Bool -> Three| is neither 8 nor 6
18:41 <filostrato> also 6?
18:42 <ReinH> write them down
18:42 <filostrato> kk
18:42 <ReinH> for both
18:42 <ReinH> since you didn't get either of them right ;)
18:42 <ReinH> Once you finish writing them down, try to figure out what the relationship between |a -> b| and |a| and |b| is
18:43 <filostrato> \True -> A, \True -> B, \True -> C, \False -> A, \False -> B, \False -> C
18:43 <filostrato> for the first one, still 6, so I guess I'm missing something crucial
18:43 wroathe joined
18:43 <Gurkenglas> @tell Sh4rPEYE Here's a step by step evaluation for combinations'' http://tinyurl.com/mjj63qw
18:43 <lambdabot> Consider it noted.
18:44 Levex joined
18:44 <nshepper1> \True -> A isn't a total function. You need two cases
18:44 newhoggy joined
18:45 <ReinH> filostrato: \case { True -> A; False -> B }, \case { True -> A; False -> C } ...
18:45 <filostrato> oh
18:45 <filostrato> of course
18:45 <filostrato> that's how functions work
18:45 <filostrato> :D
18:45 <ReinH> :)
18:46 <mniip> for ease of notation you can use bool
18:46 augur joined
18:46 <mniip> :t bool
18:46 <lambdabot> a -> a -> Bool -> a
18:46 <ReinH> an easier one that demonstrates the same thing
18:46 <ReinH> what is |() -> Bool| and what is |Bool -> ()|?
18:46 orphean joined
18:46 <filostrato> so it's 9 then
18:47 <ReinH> yeah
18:47 <ReinH> and now |Three -> Bool|
18:47 <filostrato> AA, AB, AC, BA, BB, BC, CA, CB, CC
18:47 <filostrato> that would be 8
18:48 <mniip> and now for something completely different: Integer -> Bool
18:48 <filostrato> 000, 001, 010, 011, 100, 101, 110, 111
18:48 <ReinH> ok, so we have |Bool| = 2, |Three| = 3, |Bool -> Three| = 9, |Three -> Bool| = 8
18:49 <filostrato> mniip: Integer holds infinite values, no?
18:49 <ReinH> so what might you guess about the relationship between |a -> b| and |a| and |b|?
18:49 <filostrato> exponentiation
18:49 <ReinH> yep
18:49 <ReinH> |a -> b| = b^a
18:49 <filostrato> yeah, it makes sense now that I think about how functions map
18:50 <mniip> filostrato, sure does
18:50 <ReinH> in algebra, you actually see b^a used as notation for a -> b
18:50 <ReinH> that's because the types form an algebra
18:50 <mniip> |Integer| = aleph_0
18:50 <mniip> 2^aleph_0 = aleph_1
18:50 Sh4rPEYE joined
18:50 <ReinH> and that algebra happens to have exponentiation, but only when we pretend that Haskell is well-behaved.
18:50 NeverDie_ joined
18:50 grim__ joined
18:50 <ReinH> which is why I've been ignoring bottoms this whole time
18:50 <Sh4rPEYE> ReinH: Can I have one more question about the combinations?
18:51 <ReinH> sure
18:51 <filostrato> so that's where R^3 comes from when talking about three-dimensional space, and similar?
18:51 ixxie joined
18:51 <mniip> you could imagine a point in R^3 to be a function from Three to R
18:51 <filostrato> yeah, exactly
18:51 <filostrato> that makes sense, nice
18:51 sampuka joined
18:51 bertschneider joined
18:52 <ReinH> filostrato: x^3 = x * x * x and (R, R, R) = Three -> R
18:52 <mniip> well really
18:52 <mniip> it stands for R*R*R
18:52 <mniip> which, in set algebra, happens to equal R^3
18:52 newhoggy joined
18:52 <ReinH> (a,a) is isomorphic to Bool -> a
18:52 <ReinH> can you write the to and from functions that exhibit this?
18:52 <Sh4rPEYE> ReinH: I understand the code conceputally. When I call tails, though, I get also the tails which are shorter than my 'n'. How come the code doesn't also list combinations of lengths n-1, n-2...0?
18:53 <mniip> I remember there was a paper on how division by 3 in constructive set theory was actually super hard
18:53 <filostrato> ReinH: don't really understand what that means
18:53 <mniip> filostrato, you know what an isomorphism is?
18:54 bennofs joined
18:54 <ReinH> mniip: can you convert between (a,a) and Bool -> a
18:54 lin___ joined
18:54 <mniip> that was not addressed at me was it
18:54 <ReinH> to :: (a,a) -> Bool -> a, from :: (Bool -> a) -> (a,a)
18:54 <ReinH> such that to . from = id and from . to = id
18:54 <ReinH> mniip: sorry
18:54 <ReinH> filostrato: ^
18:54 hastell joined
18:55 <filostrato> only concept I have of isomorphism is some kind of equivalence; I'm going to have to process that @ ReinH
18:56 <ReinH> filostrato: the above is what it means to be an isomorphism
18:56 <mniip> filostrato, bijection?
18:56 <filostrato> right, I just need to think about how to write the functions
18:56 <filostrato> right, a bijection is a one-to-one
18:56 <mniip> exactly
18:56 <ReinH> start with: to (a,a') b = ?
18:57 <mniip> a bijection can be represented with a pair of functions
18:57 <mniip> a forward and a backward correspondence
18:57 zzz joined
18:57 <ReinH> filostrato: then split b into cases
18:57 <mniip> but the laws that ReinH stated have to hold
18:57 <filostrato> a and a'?
18:57 <ReinH> two values of type a
18:57 oish joined
18:58 <filostrato> I thought that was just denoted (a, a), why the apostrophe?
18:58 <ReinH> because this is the type level
18:58 newhoggy joined
18:58 <ReinH> er
18:58 <ReinH> value level
18:58 <ReinH> gosh
18:58 <ReinH> this is the value level
18:58 <ReinH> you're defining the function `to'
18:58 <ReinH> maybe it's my fault for reusing 'a' at both levels
18:58 <ReinH> to (x,x') b = ?
18:59 <ReinH> well, the only thing you can do is case b to figure out which one you have
18:59 sdothum joined
18:59 sssilver joined
18:59 wroathe joined
18:59 <ReinH> and then depending on which one you have, select one of the members of the tuple
18:59 meandi joined
18:59 <filostrato> I don't mean to be that guy, but you've kind of lost me right now
18:59 <ReinH> ok
18:59 <ReinH> we want to write `to'
19:00 <ReinH> to :: (a,a) -> Bool -> a
19:00 <ReinH> to is a function that takes a pair and then a Bool that is used to choose a member of the pair
19:00 <filostrato> right, with you so far
19:00 <ReinH> so the Bool selects the first or second member of the pair
19:00 fizruk joined
19:00 <filostrato> yep
19:01 <filostrato> so
19:01 bvad joined
19:01 <ReinH> so to (x,x') b = case b of { True -> x; False -> x' }
19:01 <filostrato> to True = x
19:01 <filostrato> to False = x'
19:01 <ReinH> yep
19:01 <ReinH> well, doing it that way to (x,x') True = x
19:01 <ReinH> but yes
19:01 <ReinH> now com ing the other way
19:02 <ReinH> from choose = ?
19:02 <ReinH> so choose :: Bool -> a
19:02 <ReinH> we make both choices and put them in the right spot in the result tuple
19:02 <ReinH> from choose = (choose True, choose False)
19:03 <filostrato> lost me again
19:03 sssilver joined
19:03 <ReinH> ok
19:03 newhoggy joined
19:03 <ReinH> from :: (Bool -> a) -> (a,a)
19:03 <ReinH> from takes a function for choosing an a
19:04 <ReinH> where you can make two choices
19:04 <alx741> shouldn't that be choose :: a -> Bool -> (a, a) ?
19:04 <ReinH> because |Bool| = 2
19:04 zeroed joined
19:04 oisdk joined
19:04 <ReinH> should it?
19:04 <filostrato> right
19:04 <ReinH> choose is the argument to from
19:04 <ReinH> so its type is what?
19:04 <filostrato> choose :: Bool -> a
19:05 <mniip> alx741, no?
19:05 <ReinH> Right
19:05 <mniip> alx741, you need a function from a -> Bool to (a, a)
19:05 <mniip> oops
19:05 <ReinH> Bool -> a
19:05 <mniip> alx741, you need a function from Bool -> a to (a, a)
19:05 <ReinH> filostrato: so from takes as its argument a function Bool -> a
19:05 <ReinH> this function chooses an a
19:05 <ReinH> making one choice for each inhabitant of Bool
19:05 <alx741> mniip: so choose :: Bool -> a -> (a, a) , right?
19:05 <ReinH> so a choice for True and a choice for False
19:05 <filostrato> right
19:05 <ReinH> alx741: no
19:05 <mniip> alx741, no?
19:06 <ReinH> filostrato: so to get an (a,a) back, we make both choices
19:06 <ReinH> and pair them up
19:06 <mniip> alx741, you're confusing this with A -> (B -> C) = A -> B -> C
19:06 <ReinH> from choose = (choose True, choose False)
19:06 <mniip> which is because we made -> associate that way because it is useful
19:06 <alx741> oh! got it, thanks for the clarification
19:06 <mniip> (A -> B) -> C /= A -> (B -> C)
19:06 <ReinH> choose is the function that takes a Bool and gives an a, it records the choices that were originally made by pairing the two values
19:07 sssilver joined
19:07 <ReinH> the only gotcha is that you have to remember whether True represents the first or second part of the pair
19:07 <ReinH> you could write it wrong
19:07 <ReinH> like from choose = (choose False, choose True)
19:07 <ReinH> the type of from isn't restrictive enough to prevent you from writing the wrong implementation
19:08 <ReinH> you could write a dependent version that was guaranteed to be correct
19:08 <ReinH> filostrato: do to and from make sense now?
19:08 <filostrato> eh, it's very conceptual; how did we end up on that tangent again?
19:08 <mniip> ReinH, now explain why '\choose -> (choose True, choose True)' and '\(x, y) -> const x' don't make an isomorphism!
19:08 <ReinH> filostrato: because I wanted to show you that R^3 = (R,R,R)
19:09 <ReinH> so we can use a triple to represent 3D space
19:09 newhoggy joined
19:09 <ReinH> rather than being forced to use a function Three -> R
19:09 sampuka joined
19:09 <ReinH> filostrato: it has almost nothing to do with your original question
19:10 <ReinH> well it sort of does
19:10 <ReinH> but only barely
19:10 cpennington joined
19:10 <filostrato> right; I intuitively understand that very well, but I see now that it's nice to understand the actual underlying functions and types
19:10 <ReinH> > [(),()] >> "hello"
19:10 <lambdabot> "hellohello"
19:10 <ReinH> why does that have 10 characters?
19:10 <filostrato> now that's a good question
19:10 <ReinH> because join is a product, and join for [] specifically is cartesian product
19:11 <ReinH> and that's how products work
19:11 <filostrato> why is join a product?
19:11 <ReinH> 2 * 5 = 10
19:11 <ReinH> join :: m (m a) -> m a
19:11 <mniip> uhhh
19:11 <ReinH> join takes a product
19:11 <ReinH> m . m
19:11 <mniip> are you referring to the tensor product in the monoidal cat of endo functors?
19:11 <ReinH> and does something product-y with it
19:11 nickager joined
19:11 <c_wraith> join is mappend
19:11 <ReinH> er, sorry
19:11 <c_wraith> in the sense that monads are endofunctors
19:12 <ReinH> yeah, I got that twisted
19:12 <mniip> I'm not sure filostrato has the knowledge to understand the productness
19:12 <ReinH> >> is a product under the hood, the applicative product
19:12 <sproingie> mniip: i'm plenty tickled that i finally learned enough to understand what you said
19:12 <c_wraith> or, rather, monoids of endofunctors
19:12 <filostrato> I don't, Your Productness
19:12 <mniip> sproingie, monads are monoids in the endofunctor category
19:12 <sproingie> mniip: what's the problem? :)
19:13 <mniip> sproingie, it's a really cool fact and I was amazed myself
19:13 <ReinH> and the applicative product for [] is the cartesian product
19:13 <mniip> sproingie, do you know that applicatives are monoids in a category as well!
19:13 <ReinH> rather than the pointwise product of ZipList
19:13 <sproingie> been studying category theory at the university of YouTube
19:13 <sproingie> i should probably get back to it soon
19:14 <mniip> sproingie, if you take the category of endofunctors
19:14 <mniip> but instead of the composition tensor product you use something a tad bit different
19:14 theelous3 joined
19:14 Kreest__ joined
19:15 wroathe joined
19:15 <mniip> F \otimes G = (a \mapsto \int_x \int_y Fx * Gy * (x -> y -> a))
19:15 <mniip> or, in haskell terms,
19:16 <mniip> data Apply f g a where Apply :: forall x y. f x -> g y -> (x -> y -> a) -> Apply f g a
19:16 <mniip> the identity of that tensor product is still Identity
19:16 <mniip> and I have the proofs for the assoc/unit axioms handy
19:16 <Zemyla> Would it be possible to have a Haskell variant where every type is linear by default, and the ones that aren't are instances of Comonoid?
19:17 mirpa joined
19:17 <Zemyla> class Comonoid a where { duplicate :: a -> (a, a); destroy :: a -> () }
19:17 Guest4561 joined
19:17 Guest4561 left
19:17 <mniip> sproingie, the monoids in *this* monoidal cat are precisely Applicative functors
19:17 <mniip> @let data Apply f g a where Apply :: forall x y. f x -> g y -> (x -> y -> a) -> Apply f g a
19:17 <lambdabot> .L.hs:167:31: error: Not in scope: type variable ‘f’
19:17 <lambdabot>
19:17 <lambdabot> .L.hs:167:38: error: Not in scope: type variable ‘g’
19:17 <mniip> @let data Apply f g a where Apply :: f x -> g y -> (x -> y -> a) -> Apply f g a
19:17 <lambdabot> Defined.
19:17 <mniip> :t \(Apply (Apply fx gy xyz) hw zwa) -> Apply fx (Apply (fmap (flip xyz) gy) (fmap (flip zwa) hw) (flip (.))) (flip id)
19:17 sssilver joined
19:17 <lambdabot> (Functor t1, Functor t2) => Apply (Apply t3 t2) t1 t -> Apply t3 (Apply t2 t1) t
19:18 <dolio> The unit isn't identity, is it?
19:18 <mniip> :t \(Apply fx (Apply gy hz yzw) xwa) -> Apply (Apply (fmap xwa fx) (fmap yzw gy) (.)) hz id
19:18 <lambdabot> (Functor t1, Functor t3) => Apply t3 (Apply t1 t) t2 -> Apply (Apply t3 t1) t t2
19:18 <mniip> :t \(Apply (Identity x) gy xya) -> fmap (xya x) gy
19:18 <lambdabot> Functor t1 => Apply Identity t1 t -> t1 t
19:18 <dolio> It's Const I, where I is the monoidal identity object.
19:18 <mniip> :t \ga -> Apply (Identity ()) ga (const id)
19:18 <lambdabot> g a -> Apply Identity g a
19:18 <ReinH> filostrato: sorry, I bungled that last bit
19:18 <mniip> dolio, here's your proof!
19:19 cretiq joined
19:19 <filostrato> that's fine; I think that's enough for me for today anyway
19:19 <ReinH> filostrato: There's a reason that length (xs >> ys) = length xs * length ys
19:19 otto_s joined
19:20 <ReinH> that is, it isn't an accident that the relationship between lengths is the product of lengths, it has to do with what join does for [].
19:20 lattenwald joined
19:21 t0m0 joined
19:21 gregoire joined
19:21 <filostrato> yeah, I have a vague notion of why, but probably need to learn some of that aforemention cat theory first
19:21 <mniip> sproingie, cool huh
19:21 LordBrain joined
19:21 baldrick joined
19:21 <mniip> dolio, monoidal identity object?
19:21 <filostrato> but thanks for the help; I'll prob be back over the coming days, hopefully weeks and months, heh
19:21 <mniip> what
19:22 <sproingie> mniip: once i can parse it. i find it easier to understand when it's circles and dots and arrows :)
19:22 <dolio> The construction you're talking about involves two monoidal categories.
19:22 <mniip> I only see one
19:22 <ReinH> filostrato: the Monad instance for [] represents choice (at least, that's one interpretation). >>= says "for each item in the list, I'll give you some choices to make, and then you combine them together"
19:23 <dolio> They each have tensors and unit objects.
19:23 <LordBrain> monoid is a binary operation with an identity, such as the empty string "" and concatenation, monoidal identity object would be the empty string in that case, but something else for a different monoid
19:23 Aruro joined
19:23 <mniip> (day convolution, Identity) induces a monoidal category
19:23 <mniip> on End(Hask)
19:23 <mniip> monoids in that are applicatives
19:24 <mniip> well
19:24 <LordBrain> okay, nvm.. i just walked in
19:24 <ReinH> :t (>>=) `asAppliedTo` []
19:24 <lambdabot> [a] -> (a -> [b]) -> [b]
19:24 <mniip> I have proof that every monoid is an applicative
19:24 <LordBrain> no idea what you two are talking about
19:24 <mniip> not vice versa but I'm fairly certain
19:24 <sproingie> LordBrain: welcome to #haskell :)
19:24 <LordBrain> thaks
19:24 <LordBrain> its not my first time, just first time today
19:25 <ReinH> filostrato: for each a, provide a choice of b's, and the result will be every choice that can be made
19:25 <ReinH> :t (>>) `asAppliedTo` []
19:25 <dolio> mniip: Identity doesn't even make sense in the general case, actually.
19:25 <lambdabot> [a] -> [b] -> [b]
19:25 <sproingie> anyway, here's the CT youtube series i've been watching: https://www.youtube.com/watch?v=I8LbkfSSR58&list=PLbgaMIhjbmEnaH_LTkxLI7FMa2HsnawM_
19:25 <Tuplanolla> I've been following along, but got lost at the not-integral integral signs.
19:25 newhoggy joined
19:25 <ReinH> is, isntead, for each a, throw it away and just choose these b's
19:25 <dolio> Because the general case is that the source and target are not the same.
19:25 <LordBrain> i'm not sure we should be proud of our abstractness or mathematicalness
19:26 <sproingie> oh i'm proud about it in an abstract way :)
19:26 <LordBrain> abstractness in terms of applicability sure
19:26 <dolio> Because monoidal functors aren't necessarily endofunctors.
19:26 <LordBrain> but i mean, we shouldnt create the impression that you need to know category theory to write haskell
19:26 <LordBrain> or to understand haskell
19:27 <sproingie> i think this is more a phenomenon of bored mathematicians playing around
19:28 <dolio> The more general case is that you have a monoidal category (V, *_V, I_V) and a monoidal category (C, *_C, I_C) enriched in V, and you consider monoidal functors C -> V.
19:28 <LordBrain> well, if i am honest, knowing some category theory is helpful perspective
19:28 Amadiro joined
19:28 <Aruro> its not
19:28 <LordBrain> whats not
19:28 <dolio> Or, actually, you consider all enriched functors C -> V.
19:28 <Aruro> CT is useless, it has no tools
19:28 fizruk joined
19:28 <LordBrain> hmm
19:28 <LordBrain> its language tho
19:29 <Aruro> otherwise so beloved applicative will be long known
19:29 <dolio> And that turns out to be a closed monoidal category, with day convolution as the tensor. And the monoids are monoidal functors.
19:29 <LordBrain> applicative is well known in here
19:29 blender3 joined
19:29 <Aruro> CT is 50 years old, applicative is younger than cat
19:29 <Aruro> so no, CT did not help discover anything usefull
19:29 <ReinH> idk, we've had closed functors for a long time
19:30 ChaiTRex joined
19:30 <LordBrain> well okay, but dont pick a fight wiht the CT guys
19:30 <Aruro> it help to pretend to be smart yes
19:30 <LordBrain> hahahaha
19:30 <sproingie> i'm always pretending
19:30 <ph88_> mivael, what are you parsing ?
19:30 <ReinH> well, understanding algebra is super helpful
19:30 <ReinH> and CT is just extra abstract algebra
19:30 <Aruro> algebra is not CT
19:30 wroathe joined
19:31 <ReinH> CT is the algebra of abstract functions
19:31 <sproingie> everything is CT :)
19:31 <LordBrain> Aruro, maybe the CT people should be studying haskell instead of the other way around eh?
19:31 oisdk joined
19:31 <Aruro> algebra is algebra
19:31 <ReinH> CT is algebra
19:31 mmachenry joined
19:31 <Aruro> LordBrain: perhaps there will be more use like that :D
19:31 biglambda joined
19:31 <LordBrain> well, i love math, majored in it, but i admit CT has a strange flavor, its like every proof is trivial.. this diagram commutes, etc
19:32 <Aruro> yeah! and most important laymen LOVE It
19:32 <ReinH> In as much as functional programmers concern themselves with functions, an algebra of functions is often useful to them
19:32 <sproingie> CT has "diagram chasing". everyone understands that, just follow the arrows.
19:32 soniku joined
19:33 <LordBrain> i dont think layman loved it until haskell came along and popularized it
19:33 <ReinH> I mean, sure, you can do Haskell without understanding CT. Of course.
19:33 <Aruro> ReinH: same u can say about philosophy, CT is as usefull to programming as general wisdom
19:33 <ReinH> It turns out that you can also do introductory Algebra courses without understanding Algebra
19:33 <alx741> mniip: every monoid is an applicative? interesting, how is that?
19:33 <ReinH> It just requires memorizing everything
19:33 <LordBrain> but Aruro, you could view CT as a generalization of haskell
19:33 <ReinH> since you don't have a unifying model
19:34 <dolio> mniip: Oh, and I think the unit is Hom_C(I_C, -), so that's why it's identity in the special case of endofunctors on Hask.
19:34 <Aruro> ReinH: i think haskell presents rather coherent system, functions and stuff for them
19:34 <dolio> Because () -> A ~ A.
19:35 <Tuplanolla> In many other fields of mathematics it feels like the level of abstraction is completely wrong. Definitions and theorems are not chosen in a way that makes results obvious.
19:35 <sproingie> haskell was created because theorists wanted a better tool
19:35 <sproingie> tho i dunno how many of the committee were CT people
19:35 meoblast001 joined
19:35 t7 joined
19:36 Faucelme_ joined
19:36 <ReinH> Aruro: there are two things going on imo. One is that they are learning concepts and developing models that implicitly algebraic or categorical, without having a way to formalize them. The other is that Haskell isn't actually a perfect, pure embodiment of category theory, so there's some impedance mismatch.
19:36 fotonzade joined
19:36 <sproingie> "CT" in my previous circles would expand to "Conspiracy Theory"
19:36 <ReinH> And a lot of the day to day work of being a Haskell programmer lives in that grey area
19:37 <ReinH> I've often had the experience of explaining a CT concept to a Haskeller and having them just go "oh, that's what that' is."
19:37 <Tuplanolla> For me the primary appeal of category theory is turning a few complicated and difficult theorems into a large collection of mundane or even uninteresting consequences.
19:37 <ReinH> because they had already developed a pretty sophisticated model just by doing haskell
19:37 davenpcm joined
19:37 inkbottle joined
19:38 JoshS joined
19:38 <LordBrain> CT seems to me less complicated than set theory
19:38 <LordBrain> which gives it greater elegance
19:38 <ReinH> CT conveniently avoids most of the hard parts of set theory by basically being set theory agnostic
19:38 <LordBrain> (as subjective as 'elegance' is...)
19:39 <ReinH> "this will all work with your set theory, whatever that may be, so we don't really care what your set theory is"
19:39 nscott76 joined
19:40 <sproingie> it was created to unify set theory and topology, right?
19:40 <ReinH> it was created to be able to talk about natural transformations
19:40 <ReinH> or possibly Kan extensions
19:40 TheLemonMan left
19:41 connrs joined
19:41 newhoggy joined
19:42 <sproingie> wrath of Kan
19:42 <Aruro> formalisation is only part of the problem, it useless if there are no Methods developed with it
19:42 <Aruro> CT to my knowledge has 0 methods
19:43 <Aruro> to find Nothing new
19:43 <ReinH> LordBrain: sort of like the analyst who wants the real numbers to form a complete ordered field, but doesn't particularly care if they are Dedekind cuts or classes of Cauchy sequences or whatever else, category theorists mostly just get on with their work and forget about the underlying set theory.
19:43 <ReinH> Or at least that's how it seems to me.
19:43 <LordBrain> in theory tho, it gives you greater lateral transfer Aruro
19:44 cpennington joined
19:44 <LordBrain> does it work that way in practice... i'm not actually good enough wiht it to say
19:44 <LordBrain> it seems like it should... conceptually
19:44 <dolio> The nice way of saying things in category theory says a lot of stuff about the category of sets, though.
19:44 <sproingie> plus it gives the great phrase "true by abstract nonsense" :)
19:45 <ReinH> LordBrain: I guess if you really want to know how the sausage is made, you spend $30 on https://link.springer.com/chapter/10.1007/BFb0059148
19:45 <LordBrain> suppose CT gave you 0 new results, but it helped you more easily jump from one field to the next, thats still a contribution
19:45 <dolio> But yes, it's similar to not caring exactly how the reals are constructed.
19:45 codesoup joined
19:46 <Aruro> certainly it is advantage, thats why we have philosophy of science :)
19:46 wroathe joined
19:47 raichoo joined
19:47 <LordBrain> once we have the properties of real numbers tho, they're construction is more or less irrelevant anyway... construction is just to satisfy to those theorists who require things like that, to justify their existence... But the axioms are not in terms of the construction, so just real analysis of the vanilla sort is agnostic to construction.
19:47 <ReinH> Or I guess Grothendieck universes
19:47 <LordBrain> regular real analysis already provides that
19:47 <LordBrain> without CT
19:47 n1k joined
19:48 <ReinH> I'm not suggesting that real analysis requires CT
19:48 <ReinH> I'm suggesting a parallel between the two
19:49 <ReinH> in terms of their relationship to the underlying set theory
19:49 fizruk joined
19:49 negatratoron joined
19:49 <dolio> Your choice of set theory may affect some properties that it has that are relevant to category theory, though.
19:49 <Aruro> there can be many set theories
19:49 <Aruro> same with CT
19:49 <johnw> Aruro: are you here to troll, or did you have something Haskell-related to say?
19:50 <dolio> Or, whatever foundation you choose to apply category theory to.
19:50 <mniip> 1493148820 [22:33:40] <alx741> mniip: every monoid is an applicative? interesting, how is that?
19:50 <mniip> every monoid in (End(Hask), Day convolution, Identity)
19:50 <Aruro> johnw: so far i see You, trolling me. add meaning to conversation.
19:50 <LordBrain> its hard to know there is no use to CT, unless you literally are a foremost expert in CT
19:51 <sproingie> that would actually be a little ironic
19:51 <johnw> Aruro: I'm giving you a warning to cease bashing CT, it is not contributing to the discussion
19:51 sssilver joined
19:51 <LordBrain> meaning you've read all the papers etc, understood them all, and found nothing of value... thats a tall order
19:52 <mniip> dolio, are we talking about the same thing?
19:53 <Aruro> johnw: are you doing CT? :)
19:53 <johnw> Aruro: in fact, I am, just a few minutes ago
19:54 <LordBrain> however, as i already pointed out, suppose there is no new results, nothing we didnt already know, the unification alone is theoretically useful, theoretically it allows you to operate a higher level of abstraction, and that has 2 benefits, one is your results, should you find any are more general, ie contribute to more fields, and two when you move from one field to another, you have a good idea of how much you take with you.
19:54 <dolio> mniip: Yes. There's a generalization I mentioned, though.
19:54 <LordBrain> the draw back tho is now everyone has to learn yet more jargon to understand
19:54 <Aruro> johnw: i think bashing CT has brought some interesting ideas in this chat.
19:55 chaosmasttter joined
19:55 <sproingie> LordBrain: new concepts require new language. new languages start with jargon.
19:55 <sproingie> hell, "quaternion" used to be crazily obscure jargon, now every game programmer uses 'em
19:55 <LordBrain> yeah, doesnt mean its not a draw back
19:56 <johnw> Aruro: bashing in general is not our approach, so let's avoid it. Asserting a global negative without proof or evidence serves little purpose. We have lots of constructive things to talk about.
19:56 <Aruro> sproingie: somebody like me probably even once said that quaternions are useless! :D
19:56 soLucien joined
19:57 <sproingie> eh, we went to the moon with euler angles
19:57 <LordBrain> one could argue there is some point of diminishing returns in abstractness, and perhaps we should consider that
19:57 oisdk joined
19:57 <sproingie> 'course the ship used *actual* gimbals too
19:57 sssilver joined
19:57 newhoggy joined
19:57 chlong joined
19:58 <Aruro> my point is that CT is very much a research and what is needs more than beginners HOT and intense debate
19:58 <sproingie> fsm knows i only treat quats as an opaque encoding of euler angles. visualing 4d complex numbers is not my bag.
19:58 <sproingie> *visualizing
19:58 <Aruro> is*
19:59 sigsin joined
19:59 <johnw> Aruro: that's an assertion, and you're welcome to it, but there's little purpose in trying to convince us that you're right. Some of us are using CT quite productively.
19:59 <Aruro> im trying to convince that abstractions fomr CT which are usefull do Not need full machinery of CT
19:59 <sigsin> Hey, I am using Haskell Stack @ Windows 10 with Creator's Update. And after the update it's broke. What should I do now?
20:00 <johnw> Aruro: OK, I think we all already accept that
20:00 <sproingie> but even without the understanding of the internals, i get enough about their behavior. same with other abstract concepts
20:00 <LordBrain> Aruro, do they ever have it.. in haskell i mean.. 'full machinery'
20:00 <LordBrain> they generally dont
20:01 <LordBrain> there's a sort of pragmatic concern tho, in terms of, nobody wants to use a library if they cant understand its documentation
20:01 <sproingie> sure, because if they can't understand it, they can't use it
20:01 <LordBrain> well
20:01 quobo joined
20:01 <LordBrain> sometimes they could
20:02 <LordBrain> but even then
20:02 <sproingie> unless it's such a black box that it has a tiny simple API they can just drop it into some recipe
20:02 oish joined
20:02 <sproingie> (like me and quaternions)
20:02 <LordBrain> they dont enjoy doing so, tis not open source in the sense that its not penetrable code
20:02 wroathe joined
20:02 <LordBrain> but you know, i'm ont saying people should stop writing code or such
20:02 xificurC joined
20:03 newhoggy joined
20:03 zaghiesags joined
20:03 {emptyset} joined
20:04 <zaghiesags> any burritos in here?
20:04 <LordBrain> open source hackers might use a library that works, even if they dont understand how, but they'd prefer using one that they could actually understand how and get in if necessary and tweak even.
20:05 <sproingie> everyone draws a line somewhere though
20:06 <LordBrain> it creates incentive to roll your own... so you pass up an existing library really
20:06 <sproingie> most people trust their compiler without ever eyeballing its source
20:07 <sproingie> (and yes i know about ken thompson)
20:07 <LordBrain> i am talking about preference, i'm not saying its a red line
20:08 sssilver joined
20:08 <mniip> huh
20:08 <mniip> does lambdabot not support record gadts?
20:08 <LordBrain> well, depending on the hacker and what they are trying to do and why, they might actually make it a read line
20:08 newhoggy joined
20:08 Levex joined
20:08 <mniip> @let data Foo where Foo :: { test :: Int } -> Foo
20:08 <lambdabot> Defined.
20:08 <mniip> wut
20:08 <sproingie> i like knowing a little about how everything works. my preference is toward the abstract though
20:10 dogui joined
20:10 mszczygiel joined
20:10 <mniip> @let data Foo where Foo :: Show a => { test :: a } -> Foo
20:10 <lambdabot> Parse failed: Parse error: {
20:10 <sproingie> but not as much as some. some part of me always thinks "how can i make a bitchin' game with this?" ;)
20:10 <mniip> that's valid ghc syntax
20:11 <sproingie> lambdabot doesn't have a whole lot of extensions enabled
20:11 ChaiTRex joined
20:11 a3Dman joined
20:12 <sproingie> come to think, is it still speaking caleskell?
20:12 <sproingie> > [1,2,3] . (1 +)
20:12 <lambdabot> error:
20:12 <lambdabot> • Couldn't match expected type ‘b -> c’
20:12 <lambdabot> with actual type ‘[Integer]’
20:12 <sproingie> survey says no
20:12 <sm> if you're interested in windows support for vty: https://mail.haskell.org/pipermail/haskell-cafe/2017-April/126890.html
20:12 <LordBrain> sproingie, yeah, i dont think people mind the abstract, if they get it, its just if they dont know the jargon and stuff, and if it is questionable that the jargon was necessary to get it... you know... its like if you speak chinese, you dont mind that all the code and comments and stuffa re in chinese i assume.
20:12 <MarcelineVQ> hmm that's GADT syntax but lambdabot can do GADT's can't it
20:13 <ReinH> What about Conorskill where : is , and , is also , and everything is , in either blue, red, or green.
20:13 <ReinH> Oh that's epigram.
20:13 sampuka joined
20:13 <ReinH> oh, and binary operations in three variables are everywhere
20:13 carlomagno joined
20:14 sampuka_ joined
20:14 <MarcelineVQ> hmm, maybe not actually
20:14 <sproingie> LordBrain: jargon can be alienating, yeah. but we couldn't work effectively without it. so it's a constant effort to find analogies in the middle
20:15 <LordBrain> sproingie, i think they know that too
20:15 <mniip> sproingie, that''s not an extension
20:15 <sproingie> speaking as someone largely in the middle, i'm hardly an expert in anything
20:15 <mniip> it's part of GADTs
20:15 <MarcelineVQ> ohh it has -XGADTSyntax but not -XGADTs
20:15 <LordBrain> sproingie, but someone like Aruro might have some doubts about whether it was necessary, you know, or whether it was used unnecessarily just to show off or something
20:16 <Aruro> i do
20:16 <sproingie> mniip: GADTs would be one of them glasgow extensions enabled with a pragma :)
20:16 baldrick joined
20:16 <sproingie> i'd be surprised to not see \bot support it tho
20:16 <Aruro> especially seeing how much and effort beginners put in CT
20:16 <Aruro> time*
20:16 <Aruro> better would be to write a couple of good haskell libs
20:17 <sproingie> beginners don't put anything into CT, if all the beginners i've come along with are any indication
20:17 <Aruro> they do
20:17 newhoggy joined
20:17 <Aruro> because Some people Talk about it non stop :)
20:17 <mauke> no, they don't
20:17 <sproingie> some beginners go and write language interpreters as their first haskell project
20:18 alx741_ joined
20:18 wroathe joined
20:18 <davean> sproingie: thats a pretty typical first project?
20:18 alx741 joined
20:18 <LordBrain> its not that they dont know the value of jargon generally, but you know its a trust issue... is this jargon justified/useful or not, is it a good mix, a good balance... naturally every programmer knows some jargon is justified, but we also know that it is possible to make a bunch of big words or show off unnecessarily, and its sort of you know, whats your assessment or faith in the average person/coder and your temperment and so on.
20:18 SadoqueTD joined
20:18 <davean> In any language, not just Haskell
20:18 <sproingie> no, and these beginners were usually pretty skilled in some other language
20:19 <sproingie> but their brains just have no problem bending to haskell's shape. or were already in that shape.
20:19 oisdk joined
20:19 <MarcelineVQ> it's a little typical due to things like write yourself a scheme
20:19 <davean> sproingie: I think of a language interpriter as the stereotypical first project in a new language
20:19 <sproingie> perl6's first implementation was in haskell, audrey tang hardly knew any haskell
20:19 <MarcelineVQ> One doesn't often go all the way through it first try though
20:19 <mniip> 1493151578 [23:19:38] <lambdabot> That paste is too long! (maximum length: 4096)
20:19 <mniip> who the hell made that
20:20 <mniip> (also, it can't count, my paste is 4036 bytes)
20:20 <mauke> audrey tang is a monster, though
20:20 <Aruro> mauke: ?
20:20 <osfameron> davean: I don't think most programmers write a language interpreter as their first project
20:20 <sproingie> some beginners are natural geniuses, sure
20:21 <osfameron> it might be more common among comp-sci grads I suppose?
20:21 Maxou joined
20:21 sleffy joined
20:22 <davean> osfameron: well I do tend to pay attention to the trained more then the untrained
20:22 <davean> The untrained are often uninteresting in that they don't make any informed decisions at all
20:22 <sproingie> Aruro: monster as in freakishly talented
20:23 newhoggy joined
20:23 fizruk joined
20:23 Deide joined
20:23 <Tuplanolla> Do you remember your first projects?
20:24 flatmap13 joined
20:24 <davean> Yah, I remember my first projects
20:24 <davean> well, at least in CS land
20:24 Faucelme joined
20:25 <LordBrain> i think i would break down and learn the ct necessary, but others might not, and i already have a math background so thats another factor too... now what about chinese? if it were chinese, would i break down and learn the chinese.. no.
20:25 <sproingie> i typed in a lot of source from Compute! magazine. first from-scratch stuff was C64 BASIC stuff for helping generate GURPS characters
20:25 <davean> sproingie: :)
20:25 <Tuplanolla> There should be a poll about people's first Haskell projects. That would probably be interesting.
20:25 <[exa]> watching this conversation, how many of you are university-related and/or university teachers?
20:25 <sproingie> Compute! actually did more harm than good to my programming ability
20:25 <cocreature> [exa]: are students university-related?
20:25 <davean> oh ... my first Haskell project was a Prolog
20:25 <LordBrain> well i like languages, so i guess i might, if i was already interested in chinese.. but you know what i mean
20:26 <sproingie> i thought i was stupid because i couldn't understand what all those DATA statements meant
20:26 moth joined
20:26 <sproingie> not knowing that nobody else could either
20:26 <[exa]> cocreature: yep
20:26 <LordBrain> and of course, if i have to learn chinese before i hack on a library, its going to take me a long time before i make any contribution for sure
20:26 <mauke> my first haskell project was trying to figure out this $@%&* language
20:26 <mauke> and giving up
20:26 <cocreature> then I definitely fall into that category :)
20:26 <Tuplanolla> My first Haskell project was a field equation solver and it was absolute horse shit.
20:27 <MarcelineVQ> the difference is that the chinese languages have a lot more primops than ghc does
20:27 cpennington joined
20:27 <davean> My prolog wasn't good but it wasn't terrible, it was just very straight forward
20:27 <LordBrain> MarcelineVQ, well the analogy is not very good for a number of reasons, but it shows the point nevertheless... chinese also falls apart before the mighty google translate
20:27 <sproingie> nothing wrong with that. start with obvious, generalize from there.
20:27 <MarcelineVQ> haskell's voca is pretty small really
20:27 <MarcelineVQ> *vocab.
20:28 <sproingie> LordBrain: my favorite channel lately has been "google translate sings"
20:28 <LordBrain> the point is, the more you have to learn before you can code, that is indeed a barrier to entry
20:28 <MarcelineVQ> sure
20:28 <[exa]> cocreature: well I'm actually teaching this stuff to students, so just kindof asking out for experiences
20:28 <LordBrain> i think a lot of people might not care about barriers to entry tho, they want to make code for themselves, and dont expect anyone to contribute anyway
20:28 newhoggy joined
20:29 replay joined
20:29 a3Dman joined
20:29 a3Dman joined
20:29 <davean> [exa]: I was in college when I did my first Haskell, but I only did that one project and put haskell down for like 8 years after
20:29 cdg joined
20:29 <davean> [exa]: I was in no way associated with education when I came back
20:29 <LordBrain> but ideally, we should care, i mean, it is better if we do probably
20:29 <* srk> working on plotting lib http://48.io/~rmarko/random/liveplot.jpg
20:30 <Tuplanolla> Apply directly to the foreh... screen buffer, srk?
20:31 dm3 joined
20:31 <srk> Tuplanolla: opengl
20:31 <mauke> I think the one thing that made me "get" it on my second attempt was concentrating on understanding IO and ignoring do syntax
20:31 mr_sm1th joined
20:31 blym joined
20:31 <srk> combination of mvc, pipes, vinyl-gl and andromeda
20:31 <mauke> do notation was a significant barrier to understanding
20:32 <Aruro> srk: why not on hub?
20:32 <srk> Aruro: gimme a minute :D
20:32 <Tuplanolla> Make sure to implement automatic recursive subdivisions unlike all other "plotting" libraries, srk.
20:32 <Aruro> :D
20:32 <davean> I think what mattered for me was enough ecosystem to make doing Haskell worthwhile
20:32 <LordBrain> fair point mauke, but is it not a worthy sugar anyway?
20:32 <mauke> sure
20:32 <srk> Aruro: it needs few upstream patches but it's buildable with stack
20:32 <mauke> after you understand >>=
20:33 <srk> Tuplanolla: for zooming?
20:33 <mauke> it's not good for teaching/learning
20:33 <Tuplanolla> For good quality around singular and high-curvature points, srk.
20:33 <srk> ah, ok
20:33 <LordBrain> i dont know if i agree or not, but i've seen that expressed before
20:34 wroathe joined
20:34 <srk> Tuplanolla: my requirements for now are simple - plot live data from pipes into multiple graphs. will extend it later with more feats and graph types
20:34 <sproingie> i first learned haskell from A Gentle Introduction. which had ... mixed results
20:34 newhoggy joined
20:34 <glguy> mniip: Speaking of GADT record syntax, do you happen to remember when that was added?
20:34 <Aruro> its good book
20:34 <LordBrain> i think the issue is the types and how they interact with do, maybe >>= is one way to make that more obvious, but i bet you could do it without >>=
20:34 <mniip> no
20:34 <srk> best way to learn haskell is to write haskell for everything :D
20:34 <mauke> I'm skeptical
20:35 <[exa]> :]
20:35 <Aruro> srk: +1
20:35 <mauke> I knew Perl and OCaml, so I was familiar with closures, callbacks, higher-order functions, algebraic types, pattern matching, etc.
20:35 <mauke> I understood purity intuitively
20:35 <mauke> but the whole IO thing was an incoherent mess
20:36 <[exa]> good point about the do notation
20:36 <sproingie> purity i got. i suffered through *every* monad tutorial.
20:36 <mauke> like, you have types randomly "tagged" with IO to show the operation is impure
20:36 <LordBrain> btw, i wasnt talkkng about barrier to entry for beginners
20:36 <[exa]> and monad tutorials on IO suck, people have already mixed opinions on IO
20:37 <mauke> but why is it e.g. putChar :: Char -> IO () and not putChar :: IO (Char -> ())?
20:37 <LordBrain> i was talking about barrier to entry for experienced haskellers who just arent great with CT
20:37 <sproingie> IO is too magical to use as the canonical introductory monad
20:37 <sproingie> Maybe and List are much better for that
20:37 <[exa]> I was thinking about List actually
20:37 <mauke> you have to randomly use 'let' and '<-', and a type like 'IO (IO ())' makes no sense
20:37 <sproingie> maybe Reader after those
20:38 <[exa]> looks like prolog, works kindof so
20:38 <davean> mauke: how does IO (IO ()) not make sense?
20:38 <davean> mauke: that was one of the best parts for me learning
20:38 <LordBrain> so, people who have already suffered through monad tutorials and such
20:38 <mauke> davean: if you're a beginner who's only seen bad tutorials that explain IO as kind of an "this is impure" tag ...
20:38 <[exa]> davean: is there an useful example for that?
20:39 <davean> [exa]: I mean, passing around actions to do? All over?
20:39 <davean> [exa]: I guess one of the most common would be returning a finalizer of some sort
20:39 Bashmetim joined
20:39 <sproingie> "You Could Have Invented IO"
20:39 <[exa]> davean: no, just some motivating example that would contain IO(IO a)
20:39 <Tuplanolla> It comes up in `resourcet`, [exa].
20:40 <davean> [exa]: anything about talking and selecting actions
20:40 <davean> *talking about
20:40 <mauke> [exa]: register :: Handler -> IO (IO ())
20:40 <mauke> the action registers a handler for some event
20:40 <sproingie> a -> m m b?
20:40 <mauke> it returns an unregister action
20:40 <sproingie> that's an odd signature
20:40 <mauke> that can be used to undo the registration
20:40 <davean> deciding what action to take, instead of actually TAKING the action was where it came up for me
20:41 <davean> which immediately leads to talking about actions as actual things
20:41 <[exa]> oh cool, thanks!
20:41 <c_wraith> [exa], I built an interface that builds and returns IO actions once.
20:41 <davean> and tada, I'm done
20:42 <sproingie> i invented IO in other languages long before i heard of haskell
20:42 <LordBrain> i did something similar once, i think working on an lmbd interface, dont recall now exactly
20:42 <sproingie> the benefit of collecting actions into some list then executing them in one place was just *obvious* to me, and i wasn't even an FP geek at the time
20:42 <sproingie> tho i had been exposed to a lot of lisp via my emacs hacking
20:42 <LordBrain> i knew a lot of other langauges before i finally came to haskell, and i have to admit, i never invented io in any of them :/
20:42 butterthebuddha joined
20:43 <sproingie> the language i did that in was MOO, actually
20:43 <davean> mauke: Its that it *undoes* bad monad tutorials that makes it important I tihnk?
20:43 <LordBrain> not familiar with moo
20:43 flatmap13 joined
20:43 <davean> LordBrain: not from the 90s?
20:43 <Sonolin> for programming MUDs/MOOs right?
20:44 <sproingie> yep. lambdamoo specifically
20:44 <Sonolin> nice
20:44 kamyar joined
20:44 <LordBrain> i am from the 90s
20:44 <LordBrain> sure
20:44 <LordBrain> i guess
20:44 <Sonolin> damnit all this MUD talk makes me want to re-experience them
20:44 <LordBrain> whatever that means
20:45 <LordBrain> i did oo, mostly in c++
20:45 <sproingie> Sonolin: it makes me want to *write* one. but hardly anyone plays text MUDs anymore
20:45 <Sonolin> not true!
20:45 <mauke> davean: I don't know if there were monad tutorials at the time
20:45 <sproingie> no, really, hardly anyone
20:45 <Sonolin> I've heard at least 3 people in the last day say they're playing a MUD :p
20:45 anishathalye joined
20:45 <davean> mauke: as when?
20:45 <Sonolin> (in IRC at least)
20:45 <davean> mauke: I was talking about IO (IO ())
20:45 <sproingie> IRC is perhaps a little self-selecting there
20:45 <kadoban> I play nethack ... but no muds
20:45 <Sonolin> Aardwolf is still pretty popular I think
20:45 newhoggy joined
20:46 <LordBrain> we're too much of a hive minmd
20:46 <sproingie> i was into nethack for a while. hell, i had my own fork of nethack for a while.
20:46 <LordBrain> people say stuff while i think it
20:46 <kadoban> It's pretty fun. 3.6 is hard though
20:46 <sproingie> then a couple months ago i disastrously burned out and deleted it and the repo copies
20:46 <Sonolin> damn that really sucks
20:46 <sproingie> it was very educational, i learned a lot of modern c++ along the way
20:47 <kadoban> I can't even imagine forking nethack. The code looks so so bad. It's like 80s awful horror code.
20:47 <sproingie> (my project was a port of the nethack codebase to c++)
20:47 augur joined
20:47 <Aruro> i think data<+>instance declaration mastery is when u start thinking now i got it.
20:47 <sproingie> and yes, i deliberately chose something that awful, because it was both awful and fun
20:47 a3Dman joined
20:47 <sproingie> lambdamoo's codebase by comparison is the picture of elegance
20:47 <[exa]> sproingie: sorry to say that but porting nethack to c++ was predetermined to fail, the C-styled mess is actually a feature
20:48 <sproingie> [exa]: i did it, and was making pretty good progress at porting large chunks of it
20:48 <kadoban> Port nethack to haskell? Hehe
20:48 <davean> I feel porting nethack to Haskell would be far easier then to C++
20:48 <Aruro> there is already some dangeon crawler in haskell
20:48 orhan89 joined
20:48 <Aruro> or library to make one
20:48 <davean> Nethack and Haskell seem like they'd be pretty compatible
20:48 <sproingie> [exa]: however big picture, you're right. NH's codebase at root is pretty damn intractible
20:48 <Sonolin> yea Lambdahack
20:48 <[exa]> sproingie: I didn't want to say that it's a bad idea, its actually a very good idea, but the good point about nethack is that the language is primitive and therefore hacking is game
20:49 strykerkkd joined
20:49 <sproingie> [exa]: that's how i saw it
20:49 <Sonolin> in the README it also specifically mentions Nethack-like features as welcome PRs :)
20:49 jsgrant__ joined
20:49 <sproingie> the game here was simply to port it
20:49 hucksy_ joined
20:49 <[exa]> if you ever found a last repo copy please ping me. :]
20:49 <LordBrain> i think someone should port llvm to haskell
20:49 wroathe joined
20:49 <davean> LordBrain: ... why?
20:49 <LordBrain> as in, not even bindings, the whole thing in haskell
20:50 MarioBranco joined
20:50 <davean> Oh I understood the horror you proposed
20:50 <[exa]> LordBrain: actually working on a similar ll language now
20:50 <sproingie> naturally it wasn't really for technical reasons i burned all my work
20:50 <LordBrain> exa great, i really just mean that kind of thing actually, it doesnt have to truly be llvm, just something that fills that niche
20:50 carlomagno1 joined
20:50 jsgrant joined
20:51 <[exa]> LordBrain: it will produce assembly from llvm-like code
20:51 <LordBrain> i have made some stuff myself, but i didnt publish
20:51 <sproingie> [exa]: it wasn't really that far along, it compiled as C++, but was still almost entirely ANSI C
20:51 crave joined
20:51 <Myrl-saki> Does anyone here who visit /r/haskell remember the link to that reader thing that could be configured using CSS?
20:51 <[exa]> sproingie: did you ascend btw?
20:51 <sproingie> hell, converting NH's source to ANSI (it's K&R, yes) was actually more annoying
20:52 <sproingie> [exa]: yunno, i've never ascended a char outside of wizard mode
20:52 <Aruro> do u guys have thinking sessions, like no internet, no computer, just table and window?
20:52 <[exa]> nethack is brutal.
20:52 <sproingie> being a source hacker, naturally i played a lot in wizard mode
20:52 <LordBrain> i have, unpublished, a intel x86 assembly validator, sort of almost dissassembles completely, but not quite... really just enough to know instruction boundaries
20:52 <Myrl-saki> Ah, mdviewer.
20:52 <sproingie> Aruro: yep. i call those "hikes"
20:52 <Myrl-saki> It was posted one month ago, wow, that's so long ago.
20:52 <LordBrain> exa, does it sound like something useful to you?
20:52 <sproingie> been raining and hailing, so no hikes lately. sad sproingie :(
20:53 <Aruro> sproingie: yeah, or that :)
20:53 <LordBrain> it could be used for unit testing for example in your code gen
20:53 <[exa]> LordBrain: I'm actually doing a project that compiles out all gc-requiring stuff from haskell-like language, that llvm-alike only recently surfaced as a necessity
20:53 <[exa]> not a priority
20:54 <LordBrain> well, i'm hoarding it for now
20:54 <LordBrain> heh
20:54 <[exa]> :]
20:54 augur joined
20:54 <LordBrain> let me know tho if you think it sounds valuable
20:54 diegoksp joined
20:54 newhoggy joined
20:55 <[exa]> Aruro: I'm riding a bike to work, if you choose a quiet path it's the best environment for practical thinking
20:55 <Tuplanolla> The beauty of LLVM is in the `.a` file architecture, but people always overlook that aspect, [exa].
20:55 <LordBrain> if there is an interest in people using it to unit test their code gens, then i might be persuaded to stop sitting on it and publish
20:55 sudoreboot joined
20:55 <[exa]> Tuplanolla: really? please explain
20:56 <LordBrain> but if nobody cares anyway, i'll just continue hoarding
20:56 <Tuplanolla> @google aosa llvm
20:56 <lambdabot> http://www.aosabook.org/en/llvm.html
20:56 <lambdabot> Title: The Architecture of Open Source Applications: LLVM
20:56 <[exa]> LordBrain: published code without documentation is better than unpublished
20:56 <Tuplanolla> Read the part about linking, [exa].
20:58 grim_ joined
20:59 tomphp joined
20:59 <[exa]> Tuplanolla: yeah, this is supercool
20:59 <LordBrain> [exa], well, lets put it this way, as a hoarded thing, its my own little tool, an advantage over everyone else, that may not be much, but its a little something of value right, now if i publish and nobody uses it, i just gavve that up for no reason, but if people are going to use it, then i'll have the value it is to have contributed and enhanced the community code base and such. So... its only worth it to me to publish, if truly people would use i
20:59 <LordBrain> t.
20:59 <[exa]> didn't know about the suffix though :]
20:59 ertesx joined
20:59 <davean> LordBrain: I sorta doubt your analysis
20:59 <[exa]> LordBrain: hard decision awaits!
20:59 <LordBrain> how so davean
21:00 Froggman joined
21:00 crobbins joined
21:01 <Froggman> hi, guys, can someone give one or two examples where could I use (zip, unzip, zip3 and unzip3). Like a common usage for them
21:01 <tobiasBora> Hello,
21:01 <[exa]> LordBrain: approach it ecologically; will the publication enrich the world? :]
21:01 Prutheus joined
21:01 <LordBrain> its not hard actually, i am already decided to hoard, unless someone says, yeah i could really use a thing like that..
21:01 <tobiasBora> I'm doing a function to catch the errors of any function, with something like:
21:02 <tobiasBora> avoidErrors :: IO a -> IO a
21:02 bjz joined
21:02 <tobiasBora> However I've an error: Couldn't match type ‘a’ with ‘()’ ‘a’ is a rigid type variable bound by the type signature
21:02 <LordBrain> you get what it does, do you need that or not, what it does is you feed it a byte and anotehr and another, and you can check each time whether you are an instruction boundary or not, and so you can test your expectations about instruction boundaries
21:02 <tobiasBora> Expected type: IO a, Actual type: IO ()
21:02 nicknovi1 joined
21:03 NeverDie joined
21:03 <tobiasBora> Why () cannot be seen as 'a' ?
21:03 <[exa]> LordBrain: I guess I don't need it now. But I'll remember you! :D
21:03 <pikajude> tobiasBora: () is (), not any type
21:03 <LordBrain> okay
21:03 <pikajude> nothing is type IO a
21:03 <Aruro> Froggman: zipWith is good
21:03 <Myrl-saki> Froggman: I use zip for parallel list processing.
21:03 <pikajude> except for, like, undefined
21:03 <dyreshark> Froggman: `Map.fromList $ zip foos bars` will give you a map of foos to bars.
21:03 <pikajude> tobiasBora: code?
21:04 <Aruro> Froggman: zip == zipWith (,)
21:04 <Aruro> @src zip
21:04 <lambdabot> zip (a:as) (b:bs) = (a,b) : zip as bs
21:04 <lambdabot> zip _ _ = []
21:04 <LordBrain> [exa], i imagine this kinda thing might be useful for certain kinds of AI too, where you're trying random code, like genetic algorithms
21:04 <sproingie> logically it's zipWith (,) anyway
21:05 <tobiasBora> pikajude: What? I don't understand...
21:05 <mniip> dolio, hey look
21:05 <tobiasBora> my code looks like:
21:05 <Froggman> I need a common usage for zip3 and unzip3
21:05 <tobiasBora> avoidErrors f = do
21:05 <tobiasBora> f `myCatchAny` -- Check if an error occured
21:05 <tobiasBora> (\ex -> do putStrLn "An error occured")
21:05 <pikajude> can you use hpaste or something instead
21:05 <pikajude> oh, is that it?
21:05 newhoggy joined
21:05 <tobiasBora> pikajude: http://paste.debian.net/929338
21:05 wroathe joined
21:05 <mniip> > Just reverse ~<*> Just "moo"
21:05 <lambdabot> Just "oom"
21:05 <mniip> :t (~<*>)
21:05 <glguy> tobiasBora: then avoidErrors :: IO () -> IO ()
21:05 <lambdabot> Monoid' f (NT (->) (->)) Apply => f (a -> b) -> f a -> f b
21:05 <pikajude> tobiasBora: `f` can be IO a where a is any type
21:05 <sproingie> Froggman: zip3 is just for zipping three lists. haskell isn't so hot at variable-arity functions, so it needs zip3 where some languages do it all with zip
21:06 <[exa]> Froggman: 2 weeks ago I gave students an assignment to write matrix multiplication only with zips/maps/folds; turned out to be lot shorter than handmade
21:06 butterthebuddha joined
21:06 <geekosaur> tobiasBora, in general when you have a type constraint IO a, it means a was specified by the caller, not by you
21:06 <tobiasBora> glguy: Oh yes of course, the "putStrLn" forces a to be ()...
21:06 <geekosaur> so you can't just say ()
21:06 <geekosaur> (or somethingt hat leads to ())
21:06 <tobiasBora> geekosaur: Yes, but I forgot that in case of error I force it to be IO ()
21:06 <tobiasBora> so now everything is clear, thank you
21:07 <dolio> mniip: What?
21:07 <mniip> dolio, applicatives as monoids
21:07 <mniip> :t mappend'
21:07 <lambdabot> forall o (p :: (o -> o, o -> o) -> o -> o) (k :: (o -> o) -> (o -> o) -> *) (f :: o -> o). Monoid' f k p => k (p '(f, f)) f
21:07 <mniip> :t \f k -> runNT mappend' $ Apply f k id'
21:07 <lambdabot> Monoid' g (NT (->) (->)) Apply => g (y -> a) -> g y -> g a
21:08 <mniip> I have monads too
21:08 <mniip> :t join'
21:08 <lambdabot> Monoid' f (NT (->) (->)) Compose => f (f a) -> f a
21:09 fizruk joined
21:09 <sproingie> whaaaah?
21:10 <sproingie> that context doesn't parse for me
21:10 <mniip> which
21:10 <sproingie> Monoid' f (NT (->) (->)) Compose
21:10 <mniip> :k Monoid'
21:10 <lambdabot> (o -> o) -> ((o -> o) -> (o -> o) -> *) -> ((o -> o, o -> o) -> o -> o) -> Constraint
21:10 <mniip> :k NT
21:10 <lambdabot> (o -> o -> *) -> (* -> * -> *) -> (o -> *) -> (o -> *) -> *
21:10 <mniip> :k Compose
21:10 <lambdabot> (k -> *, k1 -> k) -> k1 -> *
21:10 <sproingie> well my head done asploded now
21:10 newhoggy joined
21:11 vydd joined
21:11 <[exa]> sproingie: it's a multiparameter typeclass
21:11 <Aruro> :k Monoid'
21:11 <lambdabot> (o -> o) -> ((o -> o) -> (o -> o) -> *) -> ((o -> o, o -> o) -> o -> o) -> Constraint
21:11 <Aruro> beauty
21:11 <mniip> well, Monoid' has 2 methods
21:11 <mniip> :t mempty'
21:11 <lambdabot> forall o (p :: (o -> o, o -> o) -> o -> o) (k :: (o -> o) -> (o -> o) -> *) (f :: o -> o). Monoid' f k p => Proxy p -> k (Id p) f
21:11 <mniip> :t mappend'
21:11 <sproingie> what's with the ticks?
21:11 <lambdabot> forall o (p :: (o -> o, o -> o) -> o -> o) (k :: (o -> o) -> (o -> o) -> *) (f :: o -> o). Monoid' f k p => k (p '(f, f)) f
21:12 <mniip> sproingie, I can't import Prelude hiding... in lambdabot
21:12 <mniip> so I had to define them as mappend' etc
21:12 <sproingie> ah
21:12 <Froggman> it's right that I can use zip and unzip to compress files? to compare 3 lists?
21:13 <mniip> Froggman, zip/unzip have nothing to do with the DEFLATE compression algorithm
21:13 <mniip> :t zip
21:13 <lambdabot> [a] -> [b] -> [(a, b)]
21:13 <mniip> it's a function that takes two lists and returns a list of respective pairs
21:13 <sproingie> > zip [1,2,3] ["foo", "bar", "baz"]
21:14 <lambdabot> [(1,"foo"),(2,"bar"),(3,"baz")]
21:14 <Tuplanolla> @hoogle gzip
21:14 <lambdabot> Data.Generics.Twins gzip :: GenericQ (GenericM Maybe) -> GenericQ (GenericM Maybe)
21:14 <lambdabot> Data.Conduit.Zlib gzip :: (MonadThrow m, MonadBase base m, PrimMonad base) => Conduit ByteString m ByteString
21:14 <lambdabot> Network.Wai.Middleware.Gzip gzip :: GzipSettings -> Middleware
21:15 <[exa]> what does the apostrophe in »'(f, f)« mean anyway?
21:15 <ExpHP> > zip [0..] "Froggman"
21:15 <lambdabot> [(0,'F'),(1,'r'),(2,'o'),(3,'g'),(4,'g'),(5,'m'),(6,'a'),(7,'n')]
21:15 <LordBrain> gzip is unrelated
21:15 <mniip> [exa], lifted tuple
21:15 <sproingie> @hoogle zlib
21:15 <lambdabot> package zlib
21:15 <lambdabot> Codec.Compression.Zlib.Lens zlib :: Format
21:15 <lambdabot> module Data.Conduit.Zlib
21:15 <sproingie> that's what you'd want for compression
21:15 <mniip> :k (Int, Char)
21:15 <lambdabot> *
21:15 <mniip> :k '(Int, Char)
21:15 <lambdabot> (*, *)
21:15 <LordBrain> gzip = compression, zip = making a list of pairs from two lists
21:15 <Tuplanolla> The first result is actually a generic zip.
21:15 <LordBrain> oh
21:15 <Tuplanolla> That's the joke.
21:16 <[exa]> oh, tuple of kinds. oh my.
21:16 <LordBrain> okay
21:16 <mniip> tuple of types
21:16 justicefries left
21:16 <LordBrain> are you sure its a joke?
21:16 <Froggman> thanks, so to compare 2 lists or processing 2 lists is right?, 1 digit/caracter by 1
21:16 <geekosaur> might be worth remembering that zip (not just gzip) is also a compression format, largely used on windows
21:16 <sproingie> it's a terrible name that's for sure
21:16 <[exa]> mniip: thanks :]
21:16 ragepandemic joined
21:16 <sproingie> (gzip for generic zip that is)
21:16 <[exa]> oh so it's datakinds thing
21:17 <geekosaur> yes
21:17 pdgwien joined
21:17 <mniip> [exa], if we had 'data TC x y = DC x y', then (Int, Char) would be TC Int Char
21:17 <mniip> and '(Int, Char) would be DC Int Char
21:17 <mniip> and DC Int Char :: TC * *
21:17 alexv19 joined
21:17 <mniip> makes sense?
21:18 <alexv19> Can this code be simplified?
21:18 <alexv19> (r ^? responseBody . key "collection" . nth 0 . key "track" . key "id" . _Integer) <|> (r ^? responseBody . key "collection" . nth 0 . key "playlist" . key "id" . _Integer)
21:19 <[exa]> mniip: yeah, that's reasonable
21:19 <alexv19> is there a way to combine two prisms, so when one fails use another?
21:19 Rodya_ joined
21:21 wroathe joined
21:21 <mniip> alexv19, what would such a prism review?
21:21 <edwardk> alexv19: yes
21:21 <edwardk> (the first question anyways.)
21:22 <mniip> ay edwardk
21:22 <edwardk> you can use <> to append two different folds into one fold
21:22 <mniip> look applicatives are monoids
21:22 <mniip> :t (~<*>)
21:22 <lambdabot> Monoid' f (NT (->) (->)) Apply => f (a -> b) -> f a -> f b
21:22 Durbley_ joined
21:23 <edwardk> r^? responseBody . key "collection" . nth 0 . (key "track" . key "id" <> key "playlist" . key "id") . _Integer
21:23 <edwardk> or something probably works
21:23 <edwardk> or even (key "track" <> key playlist)
21:23 <edwardk> factoring it further
21:24 <mniip> key ("track" <> "playlist")
21:24 <mniip> :D
21:24 <edwardk> r ^? responseBody . key "collection" . nth 0 . (key "track" <> key "playlist") . key "id" . _Integer
21:24 <edwardk> thats almost pretty
21:25 <edwardk> mniip: i don't recommend that last step =)
21:25 <edwardk> alexv19: that work for you?
21:26 <alexv19> edwardk: yes, thank you!
21:26 <edwardk> it still amuses me how much utility folks have gotten out of those combinators
21:26 <edwardk> the api was basically "write down true stuff about json"
21:27 <edwardk> oh it compiles, next.
21:27 coot___ joined
21:27 okuu joined
21:27 laplacian joined
21:29 jlouis joined
21:31 <nitrix> What are the limitations of a language without first-class functions? Presumably you can still have higher-order functions, possibly via some function name/axiom/label system.
21:31 oleksiyp joined
21:32 <nitrix> I'm assuming partial application becomes impossible?
21:32 <kadoban> Depends how not-first-class they are I suppose.
21:32 <Tuplanolla> I frequently use higher-order functions in C, nitrix.
21:32 <Tuplanolla> You just have to pass in the closure in a `void*`.
21:33 <nitrix> So you end up emulating the capture of the environment when needed?
21:33 pdgwien joined
21:34 <nitrix> Second question; is there a library for Haskell that works similarly to Chan and MVar but would be over the network?
21:34 soniku joined
21:34 <nitrix> (Been playing with erlang and I'm in exploratory bastard child phase of Haskell having a baby with Erlang :P)
21:34 swap joined
21:35 Swizec joined
21:36 <sproingie> cloud-haskell perhaps
21:37 wroathe joined
21:37 <LordBrain> i think in old versions of ghc, i could use __LINE__ as the cpp macro for line number, but currently its assuming i mean a typed hole, how do i tell it i mean the CPP thing?
21:38 epsilonhalbe joined
21:38 <glguy> LordBrain: did you turn on CPP?
21:38 <LordBrain> yes
21:38 <LordBrain> am i remembering wrong about the name of the macro?
21:38 <LordBrain> thats possible, i did it off my head
21:38 ziocroc joined
21:38 mmn80 joined
21:38 <glguy> LordBrain: works for me
21:38 Immune joined
21:39 <LordBrain> this is 7.10.3
21:39 <LordBrain> is it a known bug?
21:39 <sproingie> should work back to ancient ghc versions
21:39 locallycompact joined
21:39 <LordBrain> ancient didnt have the holes thing
21:39 <glguy> LordBrain: I'd guess you got the {-# Language CPP #-} pragma wrong in some way
21:40 <geekosaur> ^
21:40 <geekosaur> because if cpp is expanding it then it's not there for ghc to see as a hole
21:40 quobo joined
21:40 <geekosaur> so you are somehow not getting it expanded
21:40 <glguy> or you got the wrong number of underscores on each side (2)
21:40 <geekosaur> beware of things like primes, which confuse cpp into thinking it's not supposed to expand in a (char) literal
21:41 <geekosaur> or # which also means something special to cpp
21:41 <LordBrain> its highlighted correctly in vim, its only three letters other than the language part
21:41 <LordBrain> {-# LANGUAGE CPP #-}
21:41 <LordBrain> see an issue?
21:41 <Tuplanolla> See if you can `#define __LINE__` yourself and change the outcome, LordBrain.
21:41 <Tuplanolla> You should not be able to.
21:41 cloudhead joined
21:42 dm3 joined
21:42 <LordBrain> i tried using -XCPP on the command line, still got the hole error
21:42 <sproingie> just add #error hey, cpp works
21:42 <glguy> LordBrain: It's going to be hard to guess what you're doing wrong. Can you paste some code that doesn't work to lpaste.net?
21:42 <sproingie> if you don't get that error, cpp ain't working
21:43 <LordBrain> it worked
21:43 <LordBrain> the #error i mean
21:43 <LordBrain> its __LINE__ yes? two underscores each side?
21:43 <geekosaur> yes
21:43 <sproingie> well that's just weird then. should be __LINE__ yes
21:43 <Tuplanolla> What does my suggestion do, LordBrain?
21:44 <* geekosaur> will second glguy, send failing code to lpaste (or gist, etc.)
21:44 sssilver joined
21:45 <LordBrain> warning: "__LINE__" redefined [-Wbuiltin-macro-redefined]
21:45 <LordBrain> but it still said Found hole ‘__LINE__’ with type: [Char]
21:45 <Tuplanolla> Good. Your compiler is not to blame.
21:45 <Tuplanolla> Paste code now.
21:47 hucksy joined
21:47 <LordBrain> the __LINE__ is inside a macro definition
21:47 <LordBrain> see if your compilers still work when thats the case
21:47 sigmundv joined
21:48 <LordBrain> i could paste, but its all intwined with nonpublic code, so you couldnt run it anyway
21:48 <glguy> That means you have to make a bit of code that isn't intertwined, but which exhibits the same problem.
21:49 <LordBrain> okay, i'll work something up
21:49 <Tuplanolla> The solution to nonpublic code is to publicize it.
21:50 grp joined
21:52 wroathe joined
21:53 <geekosaur> if it's inside a macro definition, the question might be how / where that macro is expanded
21:53 hiratara joined
21:53 <geekosaur> traditional cpp has some weird gotchas (ANSI cpp tried to clean this up a bit with token splicing)
21:53 newhoggy joined
21:53 blym_ joined
21:53 <lpaste> LordBrain pasted “cpp __LINE__ & found hole” at http://lpaste.net/354931
21:54 mizu_no_oto_work joined
21:54 eazar001 joined
21:54 <LordBrain> could be using __LINE__ inside a macro is improper.. maybe i need to notate that different, been a long time since i messed with cpp
21:55 <geekosaur> it should be usable in a macro
21:55 <geekosaur> again, depends on how it gets expanded
21:56 jship joined
21:56 <LordBrain> does my lpaste code actually work for you? it gives the same error over here
21:56 <geekosaur> in partiuclar, __FILE__ and __LINE__ don't get expanded in a macro parameter list, but when that macro is expanded.
21:57 <geekosaur> (otherwise something like #define logger(x) _logger(x, __FILE__, __LINE__) wouldn't work as expected)
21:57 <hexagoxel> LordBrain: i doubt CPP parses bloo' as one full identifier. is ' even allowed in idents?
21:57 <LordBrain> ah
21:57 <LordBrain> that might be my issue
21:57 <hexagoxel> if you rename bloo' it works
21:57 <geekosaur> ut;s the '
21:57 <LordBrain> yeah
21:57 <LordBrain> thanks
21:57 <geekosaur> as I mentioned earlier be careful with primes
21:57 <geekosaur> cpp expects C code, it thinks it's in a char constant
21:57 <geekosaur> (yes, they can be multicharacter. traditional cpp doesn't check this)
21:58 <sproingie> it's almost as if cpp is some sort of bolted-on hack!
21:59 <sproingie> that is kinda blogpost-worthy though. very unobvious behavior
22:00 <LordBrain> its working
22:00 danza joined
22:00 <fragamus> monochrom are you here
22:02 mmachenry joined
22:02 stass joined
22:03 padre_angolano_ joined
22:03 fizruk joined
22:06 epsilonhalbe joined
22:08 cdidd joined
22:08 wroathe joined
22:09 sssilver joined
22:10 oisdk joined
22:11 Orion3k joined
22:11 refold joined
22:13 bennofs joined
22:19 <athan> Is there a... Cont RPC specification, which could define something like "run this JSON rpc method, then invoke this URL upon completion"? So we can be all asynchronous and stuff without discipline
22:21 sigmundv joined
22:21 Durbley joined
22:22 darjeeling_ joined
22:26 castlelore joined
22:28 biglambda joined
22:28 flatmap13 joined
22:30 Koterpillar joined
22:31 hiratara joined
22:32 Uakh joined
22:33 jmcarthur joined
22:33 SadoqueTD joined
22:34 crobbins joined
22:36 soniku joined
22:37 eschnett joined
22:39 jaziz1 joined
22:40 wroathe joined
22:44 nakal joined
22:47 orhan89 joined
22:49 dylukes joined
22:51 newhoggy joined
22:54 soLucien joined
22:55 Lyraz joined
22:56 wroathe joined
22:56 blym_ joined
22:57 guillaum2 joined
22:57 zachary joined
22:57 moth joined
23:01 austinkeeley joined
23:01 inr_ joined
23:02 theDon_ joined
23:02 nicknovi1 joined
23:04 Jinixt joined
23:04 arand joined
23:05 Fairy joined
23:07 sgronblo joined
23:08 crobbins joined
23:09 seanparsons_ joined
23:09 sigmundv joined
23:10 takle joined
23:11 whiteline joined
23:12 mkoenig joined
23:14 {emptyset} joined
23:15 danza joined
23:15 cschneid_ joined
23:16 meba joined
23:19 blym_ joined
23:20 Frans-Willem joined
23:22 sz0 joined
23:22 lambda-11235 joined
23:26 hybrid joined
23:27 wroathe joined
23:29 evrt joined
23:29 eyck joined
23:33 Doc_ joined
23:35 Welkin joined
23:35 conal joined
23:38 taktoa joined
23:44 soniku joined
23:44 arpl left
23:46 leothrix joined
23:48 richi235 joined
23:49 r1m4n joined
23:49 zachary joined
23:49 Achylles joined
23:50 umib0zu left
23:52 whaletechno joined
23:53 eacameron joined
23:53 nakal_ joined
23:53 YongJoon joined
23:54 markus1189 joined
23:54 uiop joined
23:55 leothrix joined
23:55 markus1199 joined
23:55 geekosaur joined
23:56 orhan89 joined
23:56 cschneid_ joined
23:56 infinity0_ joined
23:56 infinity0_ joined
23:58 sgronblo joined
23:58 sigmundv joined
23:59 wroathe joined
23:59 infinity0 joined