Newest at the top
2025-03-21 20:41:30 +0100 | <EvanR> | calling that function doesn't execute anything |
2025-03-21 20:41:17 +0100 | <EvanR> | but you're calling the IO impure |
2025-03-21 20:41:10 +0100 | <EvanR> | that function is pure |
2025-03-21 20:41:06 +0100 | <EvanR> | sim590, well if you have putChar :: Char -> IO (), the important part here is the IO, not the -> |
2025-03-21 20:40:41 +0100 | <ski> | sim590 : "am I right to say that only IO is impure" -- `IO' is not impure |
2025-03-21 20:40:34 +0100 | <ski> | sim590 : "in the end, there were no side effects, just some computation abstracted away" -- you could perhaps phrase it like this, depending on what you mean by this. "calls of a function that is wrapped in a monad" is vague/confusing phrasing (specifically "wrapped in a monad", although also potentially "call") |
2025-03-21 20:40:32 +0100 | <sim590> | w`e mauke said is what I mean. Any function `f :: [[...] A -> ] IO a` if I can write it like that where `[]` means it's optional.. |
2025-03-21 20:40:24 +0100 | <ski> | sim590 : "\"side effects\" of monads are actually just behind the scene just like with the do operator, it is syntaxic sugar" -- `do' is indeed syntactic sugar, but you can't invoke that to claim something about side-effects or not of monads |
2025-03-21 20:40:18 +0100 | <EvanR> | and purity of functions is about... functions |
2025-03-21 20:40:13 +0100 | <ski> | sim590 : "this can only apply to IO and only IO is unpure" -- no, things like e.g. internal state, indeterminacy, continuations, could also cause being side-effects, not just Input/Output communication with the OS |
2025-03-21 20:40:07 +0100 | <EvanR> | it's just a thing that can be executed |
2025-03-21 20:39:58 +0100 | <EvanR> | but they don't take any arguments or input |
2025-03-21 20:39:48 +0100 | <EvanR> | IO actions are first class values you can pass around and store in structures |
2025-03-21 20:39:36 +0100 | <EvanR> | it's a big difference from imperative I/O code |
2025-03-21 20:39:05 +0100 | <EvanR> | any function wrapped inside IO |
2025-03-21 20:39:02 +0100 | <EvanR> | alskdjf |
2025-03-21 20:38:57 +0100 | <EvanR> | sim590, there's not necessarily any IO wrapped inside IO |
2025-03-21 20:38:51 +0100 | <sim590> | mauke: indeed. |
2025-03-21 20:38:31 +0100 | <mauke> | A -> IO B, I hope, not IO (A -> B) |
2025-03-21 20:38:30 +0100 | <EvanR> | "IO is/is not pure" doesn't fit this for categorical reasons |
2025-03-21 20:38:16 +0100 | <EvanR> | sim590, I'm trying to clarify your premise using traditional jargon |
2025-03-21 20:38:05 +0100 | <sim590> | Of course, when i said I was talking about IO, I was talking about the function which are warapped inside IO. |
2025-03-21 20:37:26 +0100 | <mauke> | I'm talking about the purity of functions like putStrLn, which is indeed a function, and not the purity of IO (), which is not a function |
2025-03-21 20:36:57 +0100 | <mauke> | we're not at odds, I think |
2025-03-21 20:36:11 +0100 | <mauke> | putStrLn is "pure" in the sense that whenever you call it with a particular string, it returns an IO value that is equivalent to any other IO value returned from putStrLn with the same argument |
2025-03-21 20:35:56 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-21 20:35:56 +0100 | <sim590> | EvanR, mauke: I'm not sure if I should understand that you are agreeing together or not. |
2025-03-21 20:35:31 +0100 | <tomsmeding> | laurapigeon: I know it's convenient to be able to get haskell tooling from the system package manager, but do consider using ghcup ( https://www.haskell.org/ghcup/ ) instead, if you haven't already -- besides being the main supported way to get haskell tooling these days, it also gives you much more flexibility with versions etc. |
2025-03-21 20:35:14 +0100 | <EvanR> | you don't give them input |
2025-03-21 20:35:13 +0100 | <mauke> | consider, for example: main1 = putStrLn "." >> putStrLn "." >> putStrLn "."; main2 = let x = putStrLn "." in x >> x >> x |
2025-03-21 20:35:03 +0100 | <EvanR> | so this doesn't directly apply |
2025-03-21 20:34:54 +0100 | <EvanR> | IO actions don't have a function type in the first place |
2025-03-21 20:34:50 +0100 | lxsameer | (~lxsameer@Serene/lxsameer) (Ping timeout: 252 seconds) |
2025-03-21 20:34:15 +0100 | <EvanR> | sim590, an impure function is a function that's not pure. A pure function is a (something) which only depends on the input and has side effects (that you care about) |
2025-03-21 20:34:00 +0100 | <mauke> | sim590: if you're taking that approach, then IO is pure, too |
2025-03-21 20:31:56 +0100 | <mauke> | <laurapigeon> [...] I'm new to IRC <- no worries, you're doing great so far |
2025-03-21 20:31:37 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-03-21 20:31:31 +0100 | <sim590> | function calls had indeed different arguments. Therefore, am I right to say that only IO is impure and that for example, the State monad or even the Maybe monad are not unpure. They are indeed pure? |
2025-03-21 20:31:29 +0100 | <sim590> | effects" of monads are actually just behind the scene just like with the do operator, it is syntaxic sugar, but in the end, there were no side effects, just some computation abstracted away, but this doesn't mean that in two separate calls of a function that is wrapped in a monad that we supply the same argument because the monad actually hides the abstracted some of the arguments and both |
2025-03-21 20:31:27 +0100 | <sim590> | I read on multiple posts on the Web that we categorize a function as "unpure" if it has side-effects and furturemore that when calling that function twice, if it doesn't produce the "same" ouptput for the both calls, then it is not pure. To me, this can only apply to IO and only IO is unpure. I read some places that people assume Monads are unpure, but to me it is not the case, because "side |
2025-03-21 20:29:03 +0100 | Square | (~Square@user/square) Square |
2025-03-21 20:24:34 +0100 | <laurapigeon> | oh a reading issue on my part, good to know this is here |
2025-03-21 20:23:37 +0100 | xeno11 | (~xeno11@c-69-140-170-168.hsd1.de.comcast.net) |
2025-03-21 20:22:30 +0100 | <yushyin> | laurapigeon: https://wiki.archlinux.org/title/Haskell#Static_linking for more information on the static approach |
2025-03-21 20:22:03 +0100 | <laurapigeon> | getting ghc-static from extra made the original command work too, nice! |
2025-03-21 20:20:56 +0100 | <laurapigeon> | Perfect- that worked, thanks a bunch |
2025-03-21 20:20:49 +0100 | <yushyin> | yeah, ghc-static |
2025-03-21 20:20:32 +0100 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 252 seconds) |
2025-03-21 20:20:31 +0100 | <geekosaur> | I think there's a package to get static libs for ghc bootlibs, but not for additional packages |
2025-03-21 20:19:32 +0100 | <geekosaur> | arch and derivatives don't ship static libs, which ghc uses by default. add `-dynamic` |