Newest at the top
| 2025-11-28 20:10:03 +0100 | <EvanR> | note it wouldn't be a very good print function, for one thing you don't know the input has Show support |
| 2025-11-28 20:09:12 +0100 | ljdarj1 | ljdarj |
| 2025-11-28 20:09:08 +0100 | <lambdabot> | Num a => b -> a |
| 2025-11-28 20:09:07 +0100 | <EvanR> | :t const 1 |
| 2025-11-28 20:08:48 +0100 | <EvanR> | always returning 1 would be const 1 |
| 2025-11-28 20:08:40 +0100 | <EvanR> | while being a pure function |
| 2025-11-28 20:08:27 +0100 | <EvanR> | what behavior do you want the function to have again |
| 2025-11-28 20:08:10 +0100 | <milan> | No it always yields 1 |
| 2025-11-28 20:07:54 +0100 | <milan> | No I am asking why it returns Monad if it does not have to |
| 2025-11-28 20:07:48 +0100 | <EvanR> | i.e. print 3 yields the number 3 or something? |
| 2025-11-28 20:07:36 +0100 | <EvanR> | you're asking why the print function doesn't return a number |
| 2025-11-28 20:07:13 +0100 | <milan> | Why print does not have type a -> Int? And always produce number 1? Why is it IO? |
| 2025-11-28 20:06:57 +0100 | tzh | (~tzh@c-76-115-131-146.hsd1.or.comcast.net) |
| 2025-11-28 20:06:53 +0100 | ljdarj1 | (~Thunderbi@user/ljdarj) ljdarj |
| 2025-11-28 20:06:49 +0100 | ljdarj | (~Thunderbi@user/ljdarj) (Ping timeout: 246 seconds) |
| 2025-11-28 20:06:23 +0100 | <milan> | :D My apologies |
| 2025-11-28 20:06:03 +0100 | <EvanR> | have some* xD |
| 2025-11-28 20:05:51 +0100 | <EvanR> | also have to decorum and put a space between IO and () |
| 2025-11-28 20:05:19 +0100 | <EvanR> | (note you don't have to type print to see the result in the repl) |
| 2025-11-28 20:05:05 +0100 | <EvanR> | print has that type, why is that "yet" |
| 2025-11-28 20:04:51 +0100 | <milan> | EvanR: Agree |
| 2025-11-28 20:04:43 +0100 | <milan> | Yet print :: Show a => a -> IO() ? |
| 2025-11-28 20:04:12 +0100 | <EvanR> | which is good because there's a lot |
| 2025-11-28 20:03:52 +0100 | <EvanR> | the tower of machinery to get that on the screen has no effect on the program |
| 2025-11-28 20:03:41 +0100 | <EvanR> | easily |
| 2025-11-28 20:03:24 +0100 | <EvanR> | that is why you can type purely function programs in the repl and see the result |
| 2025-11-28 20:03:11 +0100 | <milan> | So simply printing to console should not be considered "impure" and thus in IO monad? |
| 2025-11-28 20:03:08 +0100 | infinity0 | (~infinity0@pwned.gg) (Quit: WeeChat 4.6.3) |
| 2025-11-28 20:02:41 +0100 | <milan> | Yes, but... I understand why reading from (external object) is not pure.. You can always read something else so now your function can return different things. But why writing to external object is also considered impure? Wheter it succeds or not can't affect my pure program right? |
| 2025-11-28 19:59:52 +0100 | <EvanR> | something behind the scenes just hooks it up |
| 2025-11-28 19:59:39 +0100 | <EvanR> | and data |
| 2025-11-28 19:59:33 +0100 | <EvanR> | if that's all it is then it's possible to get a lot done using only pure functions |
| 2025-11-28 19:59:01 +0100 | <milan> | Agree |
| 2025-11-28 19:58:32 +0100 | <EvanR> | like a terminal |
| 2025-11-28 19:58:26 +0100 | <EvanR> | think of a browser window as the final UI screen observable to the user, it's not a function, it's a thing you send content to be displayed |
| 2025-11-28 19:57:24 +0100 | <EvanR> | *meaningful |
| 2025-11-28 19:57:10 +0100 | <EvanR> | you'd have to specify what that even means, since data isn't a function |
| 2025-11-28 19:57:00 +0100 | <EvanR> | similar to "pure data" |
| 2025-11-28 19:56:57 +0100 | <EvanR> | so it's not necessarily meaning for you to call it pure or not |
| 2025-11-28 19:56:45 +0100 | <EvanR> | a client side framework isn't a function |
| 2025-11-28 19:56:43 +0100 | <milan> | That has no side effects right? |
| 2025-11-28 19:56:33 +0100 | <EvanR> | a pure function is a function |
| 2025-11-28 19:56:29 +0100 | <milan> | Eh |
| 2025-11-28 19:56:22 +0100 | <geekosaur> | you purely construct code the browser runs impurely |
| 2025-11-28 19:56:16 +0100 | <EvanR> | the word "pure" keeps growing more legs, people applying it into any situation ever |
| 2025-11-28 19:56:13 +0100 | <geekosaur> | it's not done by your code, it's done by the browser |
| 2025-11-28 19:55:56 +0100 | <milan> | But this "painting" showing cannot be possibly pure ever right? |
| 2025-11-28 19:55:40 +0100 | <geekosaur> | kinda like how IO can be done in a pure language by, in effect, purely constructing an impure program for the RTS to run impurely |
| 2025-11-28 19:55:29 +0100 | <EvanR> | just like the repl automatically shows you the answer to an evaluation, you don't have to "print" it |
| 2025-11-28 19:55:15 +0100 | <EvanR> | your code doesn't have to deal with that |