Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-25 04:57:34 <koz_> Given that this isn't #clean? I'm not sure anyone really knows here.
2020-11-25 04:57:36 <Axman6> I also disagree that monads are difficult to understand, particularly when it comes to IO - it is just an imperative language like any other bog standard language
2020-11-25 04:58:14 wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net)
2020-11-25 04:58:15 × texasmynsted quits (~texasmyns@212.102.45.121) (Remote host closed the connection)
2020-11-25 04:58:24 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-11-25 04:58:36 <koz_> Also, a word of diplomatic advice? Accusing us of 'mindless pedantry', and opening your so-called question with a very strong subjective claim, which _by your own admission isn't even the point_?
2020-11-25 04:58:41 <koz_> Not the best way to get responses.
2020-11-25 04:58:45 ocamler joins (3263cbdb@50.99.203.219)
2020-11-25 04:58:53 texasmynsted joins (~texasmyns@212.102.45.121)
2020-11-25 04:59:15 <ocamler> hey, simple question, how can i declare type ```Maybe Bifunctor [a] [a]```
2020-11-25 04:59:16 <Axman6> generally the phrase "of offence" is used when someone intends to cause offence
2020-11-25 04:59:24 <ocamler> this is giving me a compile error that I don't fully understand
2020-11-25 04:59:38 <Digit> Axman6: monads are difficult to understand, for many, given the explanations. would be nice if disagreeing with those who find monads a slippery concept was enough to help them find it easy to understand though.
2020-11-25 04:59:38 <Axman6> ocamler: I have no idea what that's supposed to represent, it's certainly not valid though
2020-11-25 04:59:41 Jonkimi727406120 joins (~Jonkimi@113.87.161.66)
2020-11-25 04:59:48 <koz_> ocamler: You've got a slight mixup here. 'Bifunctor' is a type class.
2020-11-25 04:59:55 <ocamler> ohhh
2020-11-25 05:00:00 <koz_> I too am not very sure what you're after here.
2020-11-25 05:00:03 <ocamler> I see
2020-11-25 05:00:14 <koz_> Digit: I feel it's a problem of people focusing too much on 'what is a monad' and less on 'why we care'.
2020-11-25 05:00:16 × cads quits (~cads@ip-64-72-99-232.lasvegas.net) (Ping timeout: 240 seconds)
2020-11-25 05:00:26 <Axman6> ocamler: what's the intent you're after?
2020-11-25 05:00:26 <ocamler> well I want some sort of wrapping type similar to a tuple, where I can fmap on either the first or second of the tuple
2020-11-25 05:00:39 <koz_> The answer to the question of 'what is a monad' is both uninteresting (unless you're a cat theorist) and doesn't really get you anywherre in terms of how to use them and what they enable.
2020-11-25 05:00:51 <koz_> ocamler: (a,b) is already a Bifunctor.
2020-11-25 05:00:54 <Axman6> sounds like Bifunctor to me
2020-11-25 05:00:55 <triteraflops> Let's try this again. Haskell uses monads to do IO. (You know what I mean. Save it.) Clean uses uniqueness types, and gets away with it. Is there some kind of catch?
2020-11-25 05:00:58 <koz_> You don't need to do anything to make that a thing.
2020-11-25 05:01:04 <triteraflops> A downside of using uniqueness types instead?
2020-11-25 05:01:31 <Axman6> ocamler: what's the Maybe in there supposed to be for?
2020-11-25 05:01:32 <dsal> haskell has the same problem git used to have back in the day. People focus on the weirdest things because they're the most interesting and then everyone thinks they have to understand it weirdest-first.
2020-11-25 05:01:41 <koz_> ocamler: Are you trying to write a data type, or a function that's meant to operate across multiple kinds of data?
2020-11-25 05:01:49 <Digit> s/uses/can use/ ... might help rubbing "pedants" the wrong way.
2020-11-25 05:02:17 <dsal> triteraflops: "you know what I mean" is not a very constructive way to explain yourself.
2020-11-25 05:02:18 <Axman6> triteraflops: I don't know enough about uniqueness types to be able to comment, I wonder if the work on linear types in Haskell might give us somethig similar though? (I would be surprised if it would replace our use of monadic IO or monads for requencing)
2020-11-25 05:02:26 <dsal> There are multiple effect systems in haskell.
2020-11-25 05:02:40 <koz_> Axman6: AFAIK, uniqueness types and linear types aren't the same thing, though they are similar.
2020-11-25 05:02:42 <triteraflops> Axman6: yes, it would, actually.
2020-11-25 05:02:44 × plutoniix quits (~q@ppp-27-55-83-62.revip3.asianet.co.th) (Ping timeout: 260 seconds)
2020-11-25 05:02:47 <dsal> There's also that thing lexi-lambda is working on.
2020-11-25 05:02:50 <koz_> However, I would be the first to admit that I dunno enough.
2020-11-25 05:02:54 <Axman6> eff?
2020-11-25 05:03:08 <dsal> Yeah, I forgot what the underlying theory was behind that.
2020-11-25 05:03:09 <Axman6> koz_: yeah I figured as much
2020-11-25 05:03:09 <ocamler> koz_ i just replaced that code with some functions that I wrote on my own, like `mapFirst :: (a -> b) -> (a, c) -> (b, c)`
2020-11-25 05:03:10 × texasmynsted quits (~texasmyns@212.102.45.121) (Ping timeout: 246 seconds)
2020-11-25 05:03:11 <dolio> Uniqueness types don't really make sense for IO.
2020-11-25 05:03:13 × wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 264 seconds)
2020-11-25 05:03:30 <dsal> :t first
2020-11-25 05:03:32 <lambdabot> Arrow a => a b c -> a (b, d) (c, d)
2020-11-25 05:03:42 <dsal> @hoogle first
2020-11-25 05:03:42 <lambdabot> Control.Arrow first :: Arrow a => a b c -> a (b, d) (c, d)
2020-11-25 05:03:42 <lambdabot> Data.Bifunctor first :: Bifunctor p => (a -> b) -> p a c -> p b c
2020-11-25 05:03:42 <lambdabot> Text.PrettyPrint.Annotated.HughesPJ first :: Doc a -> Doc a -> Doc a
2020-11-25 05:03:43 × merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds)
2020-11-25 05:03:44 <Axman6> @hoogle Bifunctor f => (a -> b) -> f a x -> f b x
2020-11-25 05:03:45 <lambdabot> Data.Bifunctor first :: Bifunctor p => (a -> b) -> p a c -> p b c
2020-11-25 05:03:45 <lambdabot> Data.Bifunctor.Apply first :: Bifunctor p => (a -> b) -> p a c -> p b c
2020-11-25 05:03:45 <lambdabot> Protolude first :: Bifunctor p => (a -> b) -> p a c -> p b c
2020-11-25 05:03:53 <dolio> At least, not for one of the purposes of IO in Haskell.
2020-11-25 05:04:13 <triteraflops> dolio: that's what I thought, but like I said, Clean gets away with it. I'm still wrapping my head around it. I'm reading this: https://www.mbsd.cs.ru.nl/publications/papers/cleanbook/CleanBookI.pdf
2020-11-25 05:04:18 <koz_> dsal: Delimited continuations IIRC?
2020-11-25 05:04:24 <dsal> Yeah, that's the thing.
2020-11-25 05:04:39 conal joins (~conal@64.71.133.70)
2020-11-25 05:04:45 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 240 seconds)
2020-11-25 05:04:57 <dolio> triteraflops: Yeah. It's making the world-passing hack safer. But it makes the semantics worse.
2020-11-25 05:05:01 <koz_> It's actually quite an old idea - that you can use delconts for effects.
2020-11-25 05:05:12 <koz_> dolio: Wait... is that basically it?
2020-11-25 05:05:16 <koz_> It's just RealWorld but safer?
2020-11-25 05:05:22 <dolio> Yeah.
2020-11-25 05:05:27 <koz_> Huh, TIL.
2020-11-25 05:05:41 <Axman6> well that doesn't sound like an improvement at all
2020-11-25 05:05:47 <triteraflops> dolio: makes the semantics worse?
2020-11-25 05:05:48 <koz_> Is it some kind of linearity in the RealWorld value or something?
2020-11-25 05:05:57 <dsal> koz_: Well, I meant new for haskell. She said it required a new primitive.
2020-11-25 05:06:04 <koz_> dsal: For efficiency.
2020-11-25 05:06:05 <triteraflops> dolio: like a usability and code cleanliness thing?
2020-11-25 05:06:14 × TooDifficult quits (~vg@139.59.59.230) (Quit: TooDifficult)
2020-11-25 05:06:24 spatchkaa joins (~spatchkaa@S010600fc8da47b63.gv.shawcable.net)
2020-11-25 05:06:24 <koz_> Because for many effects you don't need full continuation capture, but with the situation as it currently stands, you have to do it every time.
2020-11-25 05:06:28 <koz_> Which makes effect systems slow.
2020-11-25 05:06:32 TooDifficult joins (~vg@139.59.59.230)
2020-11-25 05:06:46 × TooDifficult quits (~vg@139.59.59.230) (Remote host closed the connection)
2020-11-25 05:07:02 TooDifficult joins (~vg@139.59.59.230)
2020-11-25 05:07:10 <koz_> triteraflops: Are you familiar with the RealWorld trick?
2020-11-25 05:07:17 × TooDifficult quits (~vg@139.59.59.230) (Remote host closed the connection)
2020-11-25 05:07:17 <koz_> (aka how IO actually works under the covers?)
2020-11-25 05:07:31 TooDifficult joins (~vg@139.59.59.230)
2020-11-25 05:07:38 × TooDifficult quits (~vg@139.59.59.230) (Remote host closed the connection)
2020-11-25 05:07:53 TooDifficult joins (~vg@139.59.59.230)
2020-11-25 05:08:02 <dolio> triteraflops: If you really think about it, it doesn't make sense to explain effects by passing around a 'world', because that can't explain the difference between an infinite loop that prints things and one that doesn't. They both have the same result value (bottom). So you actually need to add I/O to the semantics of all functions, even though only the ones that pass around a 'world' actually have effects.
2020-11-25 05:08:07 <triteraflops> koz_: I had just assumed IO was inherently unsafe and implementation-dependent under the covers, and did not dig deeper.
2020-11-25 05:08:53 <dolio> So it is a failure for partitioning things into a pure semantics and a separate IO semantics.
2020-11-25 05:09:50 <koz_> triteraflops: Basically, I would suggest reading Lazy Functional State Threads (the paper). You'll likely see parallels _very_ quickly, and it's eminently readable.
2020-11-25 05:10:04 SanchayanMaity joins (~Sanchayan@171.76.82.54)
2020-11-25 05:10:22 <dolio> If you're just implementing what IO does in a compiler, though, that doesn't matter.
2020-11-25 05:10:35 sord937 joins (~sord937@gateway/tor-sasl/sord937)
2020-11-25 05:10:58 <koz_> dolio: That's actually one of Edward's critiques from that thing he wrote where he came up with the Churched free monad.
2020-11-25 05:11:00 <triteraflops> Ah yes, I'm pretty sure clean will let me make a function with no return value that internally prints a thing, yeah.
2020-11-25 05:11:08 <triteraflops> That's a major sownside.

All times are in UTC.