<    April 2017    >
Su Mo Tu We Th Fr Sa  
                   1  
 2  3  4  5  6  7  8  
 9 10 11 12 13 14 15  
16 17 18 19 20 21 22  
23 24 25 26 27 28 29  
30
00:14 permagreen joined
00:32 ali_bush joined
00:32 ali_bush joined
00:43 cschneid_ joined
00:48 Pupnik joined
00:52 Uniaika joined
00:55 nicoman joined
00:55 dni- joined
00:56 mariusz89016 joined
00:56 takle joined
01:05 aez joined
01:05 takle joined
01:08 vaibhavsagar joined
01:12 ali_bush joined
01:12 ali_bush joined
01:15 Cale joined
01:17 takle joined
01:18 ali_bush joined
01:18 ali_bush joined
01:20 malaclyps joined
01:22 eacameron joined
01:34 cschneid_ joined
01:40 NeverDie joined
01:44 eacameron joined
01:53 Youmu joined
02:02 DataComputist joined
02:08 exferenceBot joined
02:12 hexagoxel joined
02:13 takle joined
02:23 louispan joined
02:26 danny_ joined
02:35 geekosaur joined
02:43 ali_bush joined
02:43 ali_bush joined
02:44 dni- joined
02:49 cur8or joined
02:53 cschneid_ joined
02:55 meandi_2 joined
02:55 takle joined
02:57 DataComputist joined
03:07 cur8or joined
03:25 roboguy` joined
03:25 louispan joined
03:59 cur8or joined
04:09 aarvar joined
04:22 ali_bush joined
04:22 ali_bush joined
04:32 mariusz89016 joined
04:33 dni- joined
04:41 blissdev joined
04:46 cschneid_ joined
04:50 louispan joined
04:58 Cale joined
05:03 azahi joined
05:07 Mutter joined
05:10 systemfault joined
05:11 systemfault joined
05:13 systemfault joined
05:14 systemfault joined
05:15 systemfault joined
05:21 mariusz89016 joined
05:24 jud joined
05:24 jud joined
05:35 takle joined
05:44 aarvar left
05:53 mariusz89016 joined
05:56 eacameron joined
05:59 takle joined
06:00 ThomasLocke joined
06:00 ThomasLocke joined
06:12 DataComputist joined
06:18 <dmj`> cobragoat: sure paste it
06:22 govg joined
06:22 dni- joined
06:26 aarvar joined
06:26 galderz joined
06:30 Forkk joined
06:31 gregman_ joined
06:31 geekosaur joined
06:45 takle joined
06:47 ali_bush joined
07:01 mattyw joined
07:02 thc202 joined
07:04 DataComputist1 joined
07:04 DataComputist1 joined
07:05 DataComputist1 joined
07:05 takle joined
07:06 hdeshev joined
07:11 nick_h joined
07:17 cur8or joined
07:30 vaibhavsagar joined
07:34 slomo joined
07:39 takle joined
07:44 azahi joined
07:45 merijn joined
08:02 takle joined
08:03 takle joined
08:06 grdryn joined
08:08 eacameron joined
08:11 dni- joined
08:13 eacameron joined
08:18 eacameron joined
08:20 takle joined
08:21 mthek joined
08:27 eacameron joined
08:32 eacameron joined
08:47 Iceland_jack joined
08:51 colt44 joined
08:53 zero_byte joined
08:55 govg joined
09:00 eacameron joined
09:02 cschneid_ joined
09:07 jespada joined
09:07 cschneid_ joined
09:13 jespada joined
09:13 yellowj joined
09:19 eacameron joined
09:34 pbrant joined
09:39 mattyw joined
10:00 dni- joined
10:19 mattyw joined
10:26 jarshwah joined
10:26 vaibhavsagar joined
10:29 <adarqui> sometimes i get so much code done, feel great. then sometimes i can barely code. it's like the performance of my brain fluctuates greatly.
10:33 <merijn> adarqui: Story of my life :p
10:33 <Iceland_jack> The code is a reflection of your mental state
10:34 <Iceland_jack> Eyes^Wcode is the window to the soul
10:46 Axman6 joined
10:47 <adarqui> Iceland_jack: ya definitely .. merijn: unfortunately im not alone!
10:48 <adarqui> Iceland_jack: ya that's really interesting.. the quality of the code, volume of code you can get done in a day, etc.. are all a reflection of what's going on internally
10:49 <adarqui> i should probably learn how to 'not code' when i'm feeling like crap (mentally/physically)
10:49 <adarqui> should do something else instead
10:50 <adarqui> i've contemplated that before, but i've never really experimented it for a prolonged period of time
10:50 <merijn> adarqui: Walk outside, read a book
10:50 <merijn> Go to the gym!
10:50 <adarqui> it's similar in athletics.. learning how to leverage the ups/downs is important
10:51 <adarqui> merijn: well i do daily exercise, so it's somewhat "beyond that"
10:51 <merijn> What kinda exercises?
10:51 <adarqui> but ya, maybe just reading a book/studying .. not actually "creating" would be good
10:51 <adarqui> running, sprinting, jumping, calisthenics
10:51 <merijn> ugh...I'm allergic to cardio ;)
10:52 <adarqui> most people are.. lul
10:52 <Iceland_jack> adarqui: Sometimes feeling like crap produces good code!
10:53 <adarqui> it's good for the brain, to an extent.. if you do really long runs, in my experience, actually makes my brain worse. fatigues me mentally.
10:53 <Iceland_jack> Sometimes I make better music when other things have gone awry, sometimes not
10:53 <adarqui> Iceland_jack: true, but not this 'foggy brain' feeling like crap i have..
10:53 <adarqui> i've never been able to produce good code with that
10:53 <Iceland_jack> Use code as a tool to de-fog your brain
10:54 <adarqui> some of my most productive coding days are when i get really sick: flu for example.. but, that's different than this brain fog feeling
10:54 <Iceland_jack> yeah
10:54 <adarqui> this brain fog stuff is a really weird feeling.. it's just like, going from fiber optics internet, to 14.4 kbps dialup
10:54 <Iceland_jack> hehe
10:55 <* Iceland_jack> tries to focus
10:55 <* Iceland_jack> dial-up noise
10:55 <adarqui> 8|
10:55 <adarqui> i'm also being distracting .. i am inducing brain fog on Iceland_jack
10:56 <Iceland_jack> It's 11:55 ;) I won't do much before lunch
10:56 mengu joined
10:56 <adarqui> you don't code much before lunch?
10:56 <adarqui> takes me a while to get coding.. my most productive period is ~11 PM - 6 AM
10:56 <Iceland_jack> not in the next 4 minutes!
10:57 <Iceland_jack> It can take me days to get in the "mood", very annoying
10:57 <adarqui> it was easier when you were 'younger' right?
10:57 mariusz89016 joined
10:57 <adarqui> i think as i get older, it's harder to be a non-stop motivated spunge
10:57 <adarqui> sponge
10:57 <Iceland_jack> Not my experience, I have never been good at doing tasks
10:58 <adarqui> ah
10:58 <Iceland_jack> I have gotten better about trying to fit into what it feels like I should be
10:58 <Iceland_jack> I have a billion unfinished projects and that's how I shine
10:59 <adarqui> i have many unfinished projects too.. but that doesn't "eat at you" ?
10:59 <adarqui> it bothers me now, not to finish them
10:59 <Iceland_jack> no, I move on but keep the ideas at the back of my head
10:59 <adarqui> like i feel like im this graph node, with all of these relationships to unfinished project nodes, and they are all tugging at me
11:00 <Iceland_jack> yeah, that's the step I had to take: sever the guilt
11:00 <Iceland_jack> Accept that I'm not that kind of coder
11:00 <adarqui> ya, i've tried but i can't kick it 100%
11:00 <adarqui> cool
11:01 <Iceland_jack> People kept telling me ideas are 1%, implementing is 99%
11:01 <adarqui> i know my limits too and what kind of coder i am, i guess i just dwell more on those things, and haven't been able to sever "the guilt" and other issues like that
11:01 <Iceland_jack> so if I get 99 ideas, that should be the same as 1 implementation.......... maybe??
11:01 <adarqui> hah
11:01 <adarqui> nice
11:01 yellowj joined
11:01 <adarqui> ya it feels fun to just work on lots of different things too
11:01 <adarqui> feels more like "play"
11:03 mthek joined
11:04 Iceland_jack joined
11:04 <Iceland_jack> lunch! ttyl
11:04 <adarqui> peace!
11:06 mariusz89016 joined
11:18 cschneid_ joined
11:28 rockfruit joined
11:30 Pupnik_ joined
11:35 acarrico joined
11:39 Gurkenglas joined
11:44 NeverDie_ joined
11:49 dni- joined
11:52 <Iceland_jack> back
11:52 <Iceland_jack> had a lively political discussion
11:55 ederign joined
11:57 <adarqui> lunch + politics?
11:57 <Iceland_jack> yeah
12:00 <Akii> is there an Arbitrary instance for UUID (Data.UUID)?
12:00 <adarqui> i've only been alive 34 years, all of which i've spent in the US. I've never seen/felt anything like what's going on now 8|
12:00 <adarqui> akii, i actually remember seeing a separate repo once for that..
12:01 <adarqui> like data-uuid-arbitrary or something
12:01 <Iceland_jack> Akii: You can try lifting "fromWords"
12:01 <Iceland_jack> liftA4 fromWords arbitrary arbitrary arbitrary arbitrary
12:01 <adarqui> also not sure what this is: https://github.com/docmunch/uuid-doxiq/blob/master/tests/TestUUID.hs
12:03 <Iceland_jack> adarqui: it's a bit crazy, but I might argue it's just finally surfacing
12:03 <Akii> ye that looks strange: choose (U.nil, U.nil)
12:04 <Cale> -- the UUID random instance ignores bounds
12:04 <Cale> heh
12:04 <Iceland_jack> People should now more than ever be suspicious of narratives
12:05 <Iceland_jack> Akii: "instance Arbitrary UUID where" is always what I start Googling
12:05 <Akii> Iceland_jack: nifty trick :o
12:05 <Iceland_jack> Akii: I wish "Googlability" were a factor in programming language design
12:06 <Iceland_jack> I would change some things
12:06 <Akii> fromWords worked, thanks! :D
12:07 <Akii> was using unsafePerformIO before but that didn't quite work
12:07 <Iceland_jack> Akii: here is one thing that really bothers me
12:07 <Iceland_jack> Let's say you want to find the implementation of a "Testable" type class instance
12:08 <adarqui> many of my neighbors are suspicious, but only because those pushing a narrative have told them to be suspicious of x y z.. so it's not "proper suspicion". there's a massive confirmation bias problem going on. people are only researching things that back up their own views
12:08 <adarqui> that "emotional" politics
12:08 jship joined
12:09 <Cale> The thing that really bothers me here is that that implementation really ought to be a valid implementation of Arbitrary, but it's not because UUIDs are dumb, and aren't quite random.
12:09 <Iceland_jack> adarqui: It's difficult to fight propaganda, from any side
12:09 <Iceland_jack> that is the nature of it
12:10 <Iceland_jack> We have short memories
12:10 <adarqui> yup .. but the US mainstream media & two biggest political parties, have done a great job making their bases susceptible to it, unfortunately
12:10 <Akii> also I'm just getting started with testing
12:10 <Akii> I have a data structure that I'd like to generate, but it should be a valid data structure of course
12:11 <Akii> is Arbitrary the right way to do that?
12:11 <Iceland_jack> Akii: Details on the data structure?
12:11 <Iceland_jack> Sure, you can also make your own (Gen A) value
12:11 <Akii> Iceland_jack: not important, just some invariants that need to hold
12:11 <Akii> I've to read up on the difference between Arbitrary and Gen
12:11 <Iceland_jack> There are many ways to do that, kind of depend on the exact data structure
12:12 <Iceland_jack> Akii: Arbitrary *contains* a distinguished (arbitrary :: Arbitrary a => Gen a)
12:12 <Iceland_jack> but you may want more than one way to generate your (a)
12:13 <Iceland_jack> If you wanted only even numbers you could write (arbitrary `suchThat` even :: Gen Int)
12:13 <Iceland_jack> This generates odd numbers, but throws them away
12:14 <Iceland_jack> you could also write (fmap (2 *) arbitrary :: Gen Int) which "turns" your odd numbers even
12:14 mattyw joined
12:14 <Akii> yes I've a similar case where I'd need to generate a set of UUIDs and then have other generators pick ids from that set
12:15 <Iceland_jack> if you have a (uuids :: [UUID]) then you can use (elements uuids :: Gen UUID)
12:16 <Iceland_jack> which approach you want require more details
12:16 <Akii> I'll fiddle around some more and see if I can write an Arbitrary instance :D
12:16 <Akii> I think I have everything I need, thanks!
12:16 <Iceland_jack> You're welcome
12:16 <Akii> @karma+ Iceland_jack
12:16 <lambdabot> Iceland_jack's karma raised to 10.
12:16 <Akii> :D
12:16 <Iceland_jack> YAY
12:16 yellowj joined
12:16 <Iceland_jack> An Arbitrary instance can be nice but it is not necessary
12:17 tmciver joined
12:17 <Iceland_jack> you can use (forAll arbitrary :: (Int -> Bool) -> Property) to provide the generators yourself
12:18 <Iceland_jack> forall (arbitrary `suchThat` even) :: (Int -> Bool) -> Property
12:18 Bane^ joined
12:19 <Iceland_jack> genEven = (2 *) <$> arbitrary
12:20 dibblego joined
12:20 dibblego joined
12:20 <Iceland_jack> prop_even = forAll genEven $ \a -> forAll genEven $ \b -> even (a * b)
12:20 <Iceland_jack> checks that even * even = even
12:21 netheranthem joined
12:21 <Iceland_jack> A lot more flexible than creating a type class, keep it in mind :)
12:31 Gurkenglas joined
12:38 amir_ joined
12:39 <Guest86562> What is the best way to practice writing point-free style? also what are the most used combinators?
12:42 yellowj joined
12:43 <srhb> Guest86562: Recognizing foo x = (g . f) x and getting rid of the x'es
12:43 <srhb> Guest86562: Knowing a few combinators like >=> in place of >>= where possible.
12:44 <srhb> Guest86562: But really, I'm not sure I'd explicitly practice it. When it's clearer it's probably pretty easy to spot.
12:46 <Guest86562> Thanks, I had never used >=> before for example. Any place I can find more commonly used combinators?
12:47 <Guest86562> i know about (.) . (.) and `on`
12:48 lithie joined
12:49 <srhb> Guest86562: Usually I think people go "hey, it would be useful if when I have ... I could get rid of ... -- is there an combinator for that already or do I write it myself?"
12:49 <srhb> Guest86562: ie. when you recognize repetition.
12:49 wei2912 joined
12:51 <Guest86562> OK thanks.
12:55 Axman6 joined
12:55 Axman6 joined
12:59 <Cale> Guest86562: Here's most of what you need to do: if you ever catch yourself writing stuff like f $ g $ h $ x change all but the last $ to . like f . g . h $ x
12:59 <Cale> Guest86562: The difference here is that f . g . h is itself a perfectly good value on its own
13:00 <Cale> and if you do this consistently, you'll start to get used to working with compositions of functions, and sometimes you'll realise that you don't need to mention the argument
13:02 jathan joined
13:02 <Guest86562> Thanks Cale.
13:02 <merijn> Cale: More importantly, any random subsection of "f . g . h" is *also* a perfectly good value on its own which you can lift out :)
13:02 <Cale> yes
13:04 <Guest86562> What do you mean by lift out Merijn? you mean applying the eta reduction?
13:05 <merijn> Guest86562: I mean you can do "let foo = f . g in foo . h"
13:05 <merijn> Guest86562: So you can move any random section of your composition into a local definition with a name and it will still typecheck and work
13:05 <merijn> Guest86562: You cannot generally do this when using $
13:05 <Guest86562> I see. got it.
13:06 <Guest86562> how do you deal with a bit more complicated cases, like the example in the book.
13:06 <Guest86562> (traverse makeIoOnlyObj . mapM decodeFn =<<) . fetchFn
13:07 <merijn> well, you could replace =<< with <=< :)
13:07 <Guest86562> :D good comment also for the book.
13:08 <Akii> hlint suggested to use >=> for some of my code; never used it before but it's really nice
13:08 <Guest86562> :t (>=>)
13:08 <lambdabot> Monad m => (a -> m b) -> (b -> m c) -> a -> m c
13:09 <Iceland_jack> Guest86562: Even though point-free style is not more legible, often time it is a good SIGN
13:09 <Guest86562> it is a bit reversed compared to (.)
13:09 <Iceland_jack> If a function naturally translates to point-free, it is more likely what you want
13:10 mthek joined
13:11 <Cale> (<=<) is a bit nicer just because it matches up well with (.) and the <- of do-notation
13:11 <Iceland_jack> Guest86562: (<=<) has the analogous direction
13:11 <srhb> That's obviously biased, but I often find point-free more legible, unless people are overdoing it.
13:11 <Cale> Also, (=<<) is nicer to use in practice than most uses of (>>=)
13:11 <srhb> For instance, I think (.) . (.) helps no one ever... :-P
13:11 <Akii> agreed ^^
13:12 <Guest86562> well i thought whenever you have two argument and then you want to combine it
13:12 <Guest86562> it is useful
13:13 <Guest86562> like (sequence .) . fmap
13:13 <Iceland_jack> (concat .) . map
13:14 <Cale> While that's not the worst thing ever, I would usually just write a lambda at that point
13:14 <Iceland_jack> > let (.:) = fmap.fmap in concat .: map
13:14 <lambdabot> error:
13:14 <lambdabot> • No instance for (Typeable a0)
13:14 <lambdabot> arising from a use of ‘show_M529762704827540902114022’
13:16 <Guest86562> Reading point-free is sometimes difficult for me as a beginner.
13:18 <Cale> Yeah, avoid anything which is difficult to read
13:18 iAmerikan joined
13:18 <Guest86562> btw, do you guys know if the book still goes under revision or what we have is a final version?
13:18 <Cale> (Well, have to be a little careful as a beginner, since maybe everything is a bit difficult to read ;)
13:18 <Guest86562> :D that's true.
13:19 <Cale> But generally, there's a balance to be struck with the points-free style
13:19 TheAceOfHearts joined
13:28 <Guest86562> Do you guys work with haskell in your day jobs as well?
13:28 <Cale> I do
13:28 <Guest86562> I am based in Netherlands, there are no such companies around.
13:28 <Cale> I'm working for Obsidian Systems, we build web applications for various clients entirely in Haskell
13:28 <Guest86562> wow. nice.
13:29 <srhb> Guest86562: Sadly no. Let me know if you find a job that you don't want. ;-)
13:30 <Iceland_jack> Guest86562: 40% of my coworkers are Dutch ;)
13:30 <Cale> For the frontend, we use Reflex-DOM, and compile to Javascript using GHCJS for the web, and to ARM code for mobile devices using GHC.
13:31 <Cale> It's really nice to have your frontend and backend both written in Haskell and to be able to share types and code between them.
13:31 <srhb> I didn't know you were doing Android stuff
13:31 <srhb> Please blog about it. ;-)
13:31 <Cale> yep, Android and iOS
13:33 <merijn> Iceland_jack: Where do you live/work? :)
13:33 <Iceland_jack> London / Standard Chartered
13:33 clrnd joined
13:34 <merijn> Iceland_jack: oh, right
13:34 <Cale> Well, I'm *personally* not having to worry so much about the details of how to get the mobile stuff working, it's being handled by other people on our team.
13:34 <merijn> I don't think Standard Chartered does remote work, right?
13:35 <srhb> Cale: Ah, okay. Just curious, it's kind of a void zone in Haskell land. Not a lot of people know how to do it.
13:35 <merijn> Standard Chartered seems like it'd be interesting to work, but I'd prefer not moving outside the country and having to start a new social life :p
13:35 <merijn> Although I suppose London + sufficient money I could just come back home every weekend :p
13:36 <Iceland_jack> merijn: Step 1, don't have friends
13:36 <Cale> Iceland_jack: Tell Don Stewart that we all miss him.
13:36 <Iceland_jack> Who shall I say it's from? I'll do it quickly because he's leaving us as well
13:36 <merijn> Cale: Does he even still program Haskell? I thought he was taking pictures of skylines/sunsets full time now ;)
13:36 <Cale> hah, you could say me
13:37 <Iceland_jack> "Don, me says they all miss you." :D
13:37 <Cale> But #haskell more generally
13:37 <Iceland_jack> yeah
13:37 <Cale> merijn: heh
13:37 <merijn> Iceland_jack: Also, tell him to fix the links to his papers/thesis on the wiki!
13:38 <Iceland_jack> done ;)
13:38 dni- joined
13:38 <Cale> merijn: I thought he *only* wrote job offers full time
13:38 <Cale> lol
13:40 shayan_ joined
13:43 eacameron joined
13:45 mattyw joined
13:46 nick_h joined
13:47 ederign joined
13:51 vmeson joined
13:52 eacameron joined
13:56 <Akii> *** Exception: QuickCheck.elements used with empty list
13:56 <Akii> lel
13:56 <Akii> y tho
13:56 <Akii> hm kinda makes sense
13:58 eacameron joined
14:01 mariusz89016 joined
14:01 <Cale> Akii: Which of the zero elements did you want it to randomly select?
14:01 <Cale> :)
14:01 <Akii> exactly
14:02 carlomagno1 joined
14:08 <Akii> lovin' this so far
14:08 mthek joined
14:11 binaryplease joined
14:12 NeverDie_ joined
14:20 eacameron joined
14:21 nick_h joined
14:22 chlong joined
14:22 takle joined
14:27 <Iceland_jack> I proposed changing the type signature of elements..
14:27 <Iceland_jack> elements :: NonEmpty a -> Gen a
14:27 <Iceland_jack> oh well
14:28 <Akii> idk, doesn't matter to me since you get the exception early
14:28 <Akii> especially since empty lists are always checked
14:28 <Iceland_jack> I like the types to tell you what is expected
14:28 <Akii> and then you can fix your test
14:28 <Akii> true
14:29 <Akii> I personally don't mind having sub optimal types in tests though
14:29 <Iceland_jack> it's not a grave concern
14:29 <Iceland_jack> I don't love passing values to functions I know only accept non-empty lists and having to downgrade them
14:30 iAmerikan joined
14:31 <Iceland_jack> I'd like to be able to write (traverse elements . group) for Data.List.NonEmpty.group :: [a] -> [NonEmpty a]
14:32 mizu_no_oto_work joined
14:32 <Iceland_jack> not that that particular example makes sense :D
14:39 <Akii> I like the Arbitrary instance for ()
14:43 obh15 joined
14:46 nil_ joined
14:47 <nil_> Does "import Prelude hiding ( stuff )" imply "LANGUAGE NoImplicitPrelude"?
14:49 <merijn> No, because it only hides one thing
14:51 <nil_> Does "import Prelude ( thingy )" then?
14:55 <obh15> Can someone give me a use-case of profunctor? My understanding of profunctor is, to put it simply, it's just a way of "mapping" over input and output, wouldn't be function composition is enough?
14:56 <Iceland_jack> obh15: As with many abstractions the use cannot be boiled down to what is provided
14:57 <nil_> obh15: I guess the most prominent use of Profunctors would be the "arrow" library. Arrows are Strong Profunctors that compose.
14:57 <Iceland_jack> Profunctors have a hierarchy that adds features to them (Strong, Choice, Closed, ..) and together with that you get profunctor optics
14:57 <Iceland_jack> (paper: http://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/poptics.pdf)
14:57 <obh15> Thanks for the response! will look into that
14:58 <Iceland_jack> At its very essence they are almost trivially simple, "input and ouput" and you're able to preprocess (input) and postprocess (output)
14:59 <obh15> disclaimer: I've only read about it where (->) is the instance
14:59 <obh15> maybe I should read more
14:59 <Iceland_jack> obh15: at it's core, it shouldn't be a separate type class
14:59 <Iceland_jack> Functor, Bifunctor, Profunctor, Contravariant are all instances of the same pattern
15:00 <merijn> I wouldn't say "the same pattern"
15:00 <Iceland_jack> why not?
15:00 <nil_> Iceland_jack: what classes would you keep?
15:00 <merijn> Iceland_jack: If they were the same pattern, they'd be the same :p
15:00 <merijn> obh15: Well, one intuition I like is:
15:01 <Iceland_jack> If we had a more powerful Functor definition they would be
15:01 <Iceland_jack> nil_: Functor
15:01 <merijn> obh15: "Functor f => f a" is a "producer of a's", which you can combine with a 'a -> b' into a producer of 'b'
15:01 <merijn> :t contramap
15:01 <lambdabot> Contravariant f => (a -> b) -> f b -> f a
15:02 mariusz89016 joined
15:02 <merijn> obh15: "Contravariant f => f a" is like a "sink of a's", so something you can dump 'a' into (sockets, GUIs, files) and contramap lets you use a function "a -> b" to turn a "consumer of bs" into a "consumer of as"
15:02 <Iceland_jack> nil_: if we could fiddle with the arrows, all of them would collapse into the same definition
15:02 <nil_> Iceland_jack: would that be a general "functor" in the CT sense at the top of the food chain and then a bunch of subclasses for (the current) Functor, Profunctor and so on?
15:03 <nil_> Iceland_jack: interesting.
15:03 <Iceland_jack> nil_: Yes only they wouldn't even be subclasses
15:03 <obh15> thanks!
15:03 <nil_> They wouldn't?
15:03 <merijn> obh15: "Profunctor p => p a b" is like a "pipe of as to bs", you can map over the 'a' to let the pipe consume something else (like a contravariant functor) or over the 'b' to make it produce something else, like a functor
15:03 <Iceland_jack> they *are* functors
15:03 <obh15> yes it is basically processing the input right
15:03 <obh15> the contravariant part
15:04 <nil_> merijn++
15:06 <Iceland_jack> nil_: We are used to (fmap :: (b -> b') -> (Either a b -> Either b b')) the arrows in (b -> b') and (Either a b -> Either a b') being the same
15:06 <Iceland_jack> the other functors simply let you replace those arrows with others
15:06 <Iceland_jack> type f ~> g = forall xx. f xx -> g xx
15:07 <Iceland_jack> fmap :: (a -> a') -> (Either a ~> Either a')
15:07 <Iceland_jack> Same concept, but it maps over the first component of Either
15:08 <nil_> I'm sorry, I'm at work and I can't quite keep up with this. :S
15:08 <Iceland_jack> No problem
15:09 <Iceland_jack> nil_: There are concepts that go beyond Bifunctor/Contra..., for example (Fix
15:09 <Iceland_jack> (Fix :: (Type -> Type) -> Type)
15:10 <Iceland_jack> Do we invent a new type class for that
15:12 cschneid_ joined
15:12 govg joined
15:14 <nil_> Why would you need a typeclass for Fix?
15:15 <Iceland_jack> Fix is a Functor
15:15 <Iceland_jack> we want to capture that for the same reason as all the other functor classes
15:16 <Iceland_jack> (Free :: (Type -> Type) -> (Type -> Type)) is yet another functor
15:17 <nil_> Hmm
15:19 <nil_> I guess I would avoid making a typeclass for functors that are unambiguous
15:19 <nil_> I mean, there's only one Fix, right? As well as only one Free.
15:19 <Iceland_jack> There is only one [], I don't understand your point
15:20 <nil_> I don't understand yours either, but I suppose it's me who's truly lost here.
15:20 <nil_> You just suggested making a typeclass for Fix, right?
15:21 <Iceland_jack> What I'm really getting at is that the solution of making new classes doesn't scale
15:22 <Iceland_jack> will we need a Trifunctor for (data A a b c = A a b c) etc.
15:22 <nil_> Oh.
15:22 <nil_> Huh, so your "functor" would be a higher-order typeclass, is that it?
15:23 <Iceland_jack> It could just be a type class with associated type families
15:23 <Iceland_jack> type Dom (Either a) = (->)
15:23 <Iceland_jack> type Cod (Either a) = (->)
15:23 <Iceland_jack> that's every Functor
15:27 dni- joined
15:29 <Iceland_jack> You can view (Either :: Type -> (Type -> Type)) as mapping from types (Type) to functors (Type -> Type)
15:29 <Iceland_jack> in this new design, we can make (Either) a functor: type Dom Either = (->) / type Cod Either = (~>)
15:29 chlong_ joined
15:30 <Iceland_jack> And Free is a higher-order functor: Dom Free = (~>) / Cod Free = (~>)
15:30 NeverDie joined
15:32 <Iceland_jack> We can denote covariance by being able to "flip" arrows
15:32 <Iceland_jack> type Dom (->) = (<-)
15:32 <Iceland_jack> type Cod (->) = (~>)
15:39 mattyw joined
15:42 mattyw joined
15:42 ralu joined
15:44 chlong joined
15:50 grdryn joined
15:50 mizu_no_oto_work joined
16:01 mariusz89016 joined
16:04 nacon joined
16:04 nacon joined
16:07 mariusz89016 joined
16:11 NeverDie_ joined
16:13 Gurkenglas joined
16:13 mariusz89016 joined
16:21 haskelleksah joined
16:22 iAmerikan joined
16:23 aarvar joined
16:24 <haskelleksah> how may I upgrade ghc with Stack?
16:24 <haskelleksah> The error message I got due to not having the recent version say to run “stack setup”
16:24 <haskelleksah> but running that does not upgrade ghc
16:25 <kadoban> haskelleksah: What command did you run originally? You can usually (always?) just run the same command with --install-ghc I believe
16:26 <haskelleksah> its actually an error from intellij…I am trying to setup Intellij to start using it for learning Haskell
16:26 <haskelleksah> I got this:
16:26 <haskelleksah> Something went wrong while calling hlint. Error: No compiler found, expected minor version match with ghc-8.0.2 (x86_64) (based on resolver setting in /Users/xyz/project/stack.yaml). To install the correct GHC into /Users/xyz/.stack/programs/x86_64-osx/, try running "stack setup" or use the "--install-ghc" flag
16:26 <haskelleksah> when I open the project
16:27 <kadoban> Oh, not sure, I'm not up to figuring out tooling xD You could try stack setup --resolver ghc-8.0.2 maybe. I am ... 50/50 if that'll help once it's done or not.
16:27 acarrico joined
16:28 <haskelleksah> @kadoban fingers crossed :)
16:28 <lambdabot> Unknown command, try @list
16:32 grdryn joined
16:38 eacameron joined
16:45 <haskelleksah> @kadoban seems to have done the trick…tnx
16:45 <lambdabot> Unknown command, try @list
16:46 <kadoban> Cool, 'welcome
16:46 binaryplease joined
16:59 mariusz89016 joined
17:02 sigmundv joined
17:09 iAmerikan joined
17:16 dni- joined
17:19 hoffmeyer joined
17:23 grdryn joined
17:24 initiumdoeslinux joined
17:37 govg joined
17:44 Robin_Jadoul joined
17:45 Cthalupa joined
17:51 <Durbley> what are dependent types
17:52 malaclyps joined
17:52 <srhb> Durbley: Types that depend on values.
17:52 <srhb> Durbley: The canonical example is a "length 4 vector" for instance.
17:52 <Durbley> that example i've seen
17:52 <Durbley> in general, how is that dependency specified
17:52 <glguy> Having the number 4 in types doesn't make a dependent type on its own
17:52 <srhb> Durbley: In Haskell? with much effort.
17:53 <srhb> Well, no, of course it's enforced.
17:53 <Durbley> not in haskell but i just assume ppl here are likely to know
17:55 <glguy> You can do length-indexed vectors in Haskell already, that doens't require dependent types. What requires dependent types is if you want the type of a functions result to depend on the value of its argument
17:55 <glguy> or a tuple where the type of the second component depends on the value of the first component
17:56 <Durbley> every time i google i find either too much jargon or a single-page blog talking about adding equal-length vectors
17:58 <* Akii> should start reading the Idris book
17:58 <qu1j0t3> Durbley: A good place to look would be the Idris community. They live and breathe DT's.
17:58 <qu1j0t3> Durbley: also Edwin Brady's videos are excellent
17:58 <Cale> Durbley: The most important thing you get is a type written Pi(x:A), B(x)
17:58 <qu1j0t3> Durbley: and Brady is also on Freenode from time to time
17:59 Cthalupa joined
18:04 stef204 joined
18:07 <Durbley> i also want that idris book
18:08 <qu1j0t3> manning just had a 50% discount. follow their twitter
18:11 expo873 joined
18:11 <Durbley> also Cale i have no idea what that syntax means
18:19 Robin_Jadoul joined
18:19 t0by joined
18:19 t0by joined
18:20 <MarcelineVQ> Cale: could you say more about it? goldfire is working on Pi types for ghc so it may become relevant to know about
18:23 merijn joined
18:23 <Cale> sorry, I was going to describe it, but I got pulled away
18:42 geekosaur joined
18:44 <Cale> Okay, maybe I can sneak it in
18:45 <Cale> So this is given some type A, and some type B(x) which depends on a variable x of type A
18:45 <Cale> Pi(x:A), B(x) is the type of functions which, given some value x of type A, produce a result of type B(x)
18:46 <Cale> Sigma(x:A), B(x) is the type of pairs (x,p) whose first component is a value x of type A, and whose second component is a value p of type B(x)
18:47 zero_byte joined
18:48 mariusz89016 joined
18:53 <Durbley> is there significance to the Pi and Sigma here
18:53 <Durbley> maybe relating to sums and products
18:53 <Cale> yeah
18:53 <Cale> exactly that
18:53 <Cale> Think about what happens when A = Bool
18:54 <Cale> In the case of Pi, you'll have functions which, when given True, give a result of type B(True), and when given False, give a result of type B(False)
18:54 mariusz89016 joined
18:55 <Cale> and so effectively, that's like a pair (B(False), B(True))
18:55 <Cale> well, like the Cartesian product of those types ;)
18:55 <Durbley> yes
18:55 <Cale> I'm mixing up Haskell notation with the type theory notation I'm using here :)
18:56 <Cale> In the case of Sigma, you end up with elements of the form (False, p) where p : B(False), and (True, p) where p : B(True)
18:56 <Cale> which is effectively like Either (B(False)) (B(True))
18:57 kadoban joined
19:00 <MarcelineVQ> Cale: thank you
19:05 dni- joined
19:10 <Durbley> yes, thanks. notation confusing to read in irc i think
19:14 Boarders joined
19:16 hoffmeyer joined
19:16 <Boarders> not exactly haskell per se but I just got a copy of the first edition of the functional programming book by wadler and bird
19:16 <Boarders> and exercise 1.2.4 asks you the following: you have a language consisting of strings of zeroes and ones with the following reduction rules
19:16 <Boarders> 1 _ _ x = x 1 1 0 1
19:17 <Boarders> 0 _ _ x = x 0 0
19:17 <Boarders> you are meant to find a string where the reduction process doesn't terminate
19:17 <Boarders> does anyone have any tips on how to think about this
19:22 <Boarders> (tips can include where I can ask about this)
19:26 delexi joined
19:33 <mizu_no_oto_work> Borders: do you know how to show that something doesn't terminate?
19:33 <mizu_no_oto_work> ^Boarders
19:36 <mizu_no_oto_work> And for finding one that doesn't terminate, I'd start by just reducing a few terms until they either loop or reduce to zero.
19:37 <mizu_no_oto_work> 0000 obviously terminates after one step, so why not try 1111?
19:40 Zialus joined
19:42 <Boarders> mizu: thanks, I fooled myself by thinking I tried that earlier on!
19:50 haskelleksah joined
19:50 circ-user-IMNOF joined
19:52 iAmerikan joined
19:53 <circ-user-IMNOF> just starting chapter 5. haskellbook self learner elm/haskell . no formal cs -no former lang experience love to putter with repls :()
19:56 mariusz89016 joined
19:58 <circ-user-IMNOF> so 'data' key word in haskell is 'type' in elm correct? where elms 'type alias' , is haskell 'type'
20:02 haskelleksah joined
20:02 Urchin[emacs] joined
20:03 iAmerikan joined
20:05 <merijn> circ-user-IMNOF: Knowing Haskell, but not Elm, I'm willing to say "that sounds likely"
20:05 WarmCookie joined
20:07 Zialus joined
20:09 cschneid_ joined
20:14 taksuyu joined
20:18 mizu_no_oto_work joined
20:19 fDev2179 joined
20:22 haskelleksah joined
20:24 circ-user-IMNOF joined
20:25 peterbecich joined
20:26 tdfirth joined
20:29 cur8or joined
20:32 iAmerikan joined
20:34 malaclyps joined
20:36 takle joined
20:39 DrMentats joined
20:40 hoffmeyer joined
20:48 mariusz89016 joined
20:54 mariusz89016 joined
20:54 dni- joined
21:05 circ-user-IMNOF joined
21:19 mengu joined
21:24 cschneid_ joined
21:39 <mengu> hi guys
21:39 <mengu> i was reading this post https://aphyr.com/posts/342-typing-the-technical-interview
21:39 <mengu> that's the first time i'm seeing this "class First list x | list -> x "
21:40 <mengu> so those are called functional dependencies?
21:41 <MarcelineVQ> yep
21:41 <mengu> what do they do
21:41 hoffmeyer joined
21:42 <mengu> or what exactly is this doing? "class ListConcat a b c | a b -> c "
21:42 acarrico joined
21:43 <MarcelineVQ> I've not used them so I can't say much, in that example I believe it's defining a class where the type of c is uniquely determined by the types of a and b
21:44 <MarcelineVQ> I don't know the details beyond a link to a paper about them here http://web.cecs.pdx.edu/~mpj/pubs/fundeps-esop2000.pdf if you ask in #haskell there's likely someone who could explain them clearly
21:45 colt44 joined
21:46 <MarcelineVQ> Interesting this post does have a lot of details but it's pretty hard to follow, it would make a lot more sense if it wasn't written like a play :X
21:48 <MarcelineVQ> Actually I would say it's very difficult to follow
21:49 BamiGoreng joined
21:53 hiratara joined
21:55 mariusz89016 joined
22:10 justicefries joined
22:13 zero_byte joined
22:15 DataComputist joined
22:16 mariusz89016 joined
22:25 Rodya_ joined
22:31 hiratara joined
22:31 NoCreativity joined
22:38 mariusz89016 joined
22:42 hoffmeyer joined
22:43 dni- joined
22:45 Nik05 joined
22:50 karce joined
22:50 fDev2179 left
23:06 Pupnik joined
23:16 malaclyps joined
23:18 mariusz89016 joined
23:23 malaclyps joined
23:25 seagreen joined
23:31 malaclyps joined
23:32 Majiir joined
23:38 malaclyps joined
23:43 hoffmeyer joined
23:43 cschneid_ joined
23:47 acarrico joined
23:48 Majiir joined
23:52 malaclyps joined
23:59 hoffmeyer joined