Newest at the top
2024-07-05 21:37:33 +0200 | L29Ah | (~L29Ah@wikipedia/L29Ah) |
2024-07-05 21:31:11 +0200 | euleritian | (~euleritia@77.22.252.56) |
2024-07-05 21:30:52 +0200 | euleritian | (~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) (Read error: Connection reset by peer) |
2024-07-05 21:20:49 +0200 | <lambdabot> | prevents the constraint ‘(Show (m0 [Integer]))’ from being solved. |
2024-07-05 21:20:49 +0200 | <lambdabot> | • Ambiguous type variable ‘m0’ arising from a use of ‘show_M259786827563... |
2024-07-05 21:20:49 +0200 | <lambdabot> | error: |
2024-07-05 21:20:48 +0200 | <dmj`> | > let deck = [1..52] in do { nums <- replicateM 52 (randomRIO (1,100)); pure $ fmap fst $ sortBy (compare `on` snd) (zip deck nums) } |
2024-07-05 21:12:13 +0200 | target_i | (~target_i@user/target-i/x-6023099) |
2024-07-05 21:03:28 +0200 | <haskellbridge> | <iqubic (she/her)> I was thinking of doing something like a Fisher-Yates shuffle, but I'm not sure which of those 4 options I should use. |
2024-07-05 21:02:39 +0200 | <EvanR> | the classic shuffle algorithm requires a source of random dice rolls, which MonadRandom simplifies |
2024-07-05 20:53:41 +0200 | <haskellbridge> | <iqubic (she/her)> "RandomGenM", "StatefulGen", "MonadInterleve", and "MonadRandom" all exist, and I'm not sure what the differences are... |
2024-07-05 20:51:30 +0200 | rdcdr | (~rdcdr@user/rdcdr) (Ping timeout: 268 seconds) |
2024-07-05 20:50:30 +0200 | waleee | (~waleee@h-176-10-144-38.NA.cust.bahnhof.se) |
2024-07-05 20:49:16 +0200 | <haskellbridge> | <iqubic (she/her)> MonadRandom seems like half a dozen different but related things. |
2024-07-05 20:48:31 +0200 | <Leary> | Or MonadRandom. |
2024-07-05 20:48:05 +0200 | <lambdabot> | https://hackage.haskell.org/package/random |
2024-07-05 20:48:05 +0200 | <geekosaur> | @hackage random |
2024-07-05 20:47:53 +0200 | <haskellbridge> | <iqubic (she/her)> What is "random"? |
2024-07-05 20:47:22 +0200 | <geekosaur> | `random` is probably good enough for your use case |
2024-07-05 20:46:37 +0200 | <haskellbridge> | <iqubic (she/her)> hc: I'm writing a program to simulate playing card games, and I want a way shuffle a "deck of cards" (it's just a list/vector of cards) |
2024-07-05 20:45:12 +0200 | <darkling> | iqubic: 7 is a good number. Use that. |
2024-07-05 20:44:54 +0200 | <dmj`> | ¯\_(ツ)_/¯ |
2024-07-05 20:42:55 +0200 | <jle`> | dmj`: omg this whole time |
2024-07-05 20:41:05 +0200 | <hc> | Depends on what you want to use them for |
2024-07-05 20:39:25 +0200 | euleritian | (~euleritia@dynamic-176-002-131-122.176.2.pool.telefonica.de) |
2024-07-05 20:39:11 +0200 | <haskellbridge> | <iqubic (she/her)> What should I use for random numbers? |
2024-07-05 20:39:09 +0200 | euleritian | (~euleritia@ip4d16fc38.dynamic.kabel-deutschland.de) (Ping timeout: 255 seconds) |
2024-07-05 20:38:14 +0200 | <geekosaur> | yes |
2024-07-05 20:37:36 +0200 | <dmj`> | if its a function I think it needs parens $(myTH a b), o/w it can just be $myTH |
2024-07-05 20:37:02 +0200 | <geekosaur> | jle`, that's always ttbomk been permitted |
2024-07-05 20:32:22 +0200 | rdcdr | (~rdcdr@user/rdcdr) |
2024-07-05 20:27:14 +0200 | <jle`> | hi! i have been floating in and out for the past few months heh |
2024-07-05 20:26:37 +0200 | <haskellbridge> | <iqubic (she/her)> Jle`: You're back!!! |
2024-07-05 20:26:00 +0200 | <jle`> | was there a recent ghc version where $$(myTH) can now be written as $$myTH ? or was it always permitted and i just didn't know |
2024-07-05 20:21:46 +0200 | Lord_of_Life_ | Lord_of_Life |
2024-07-05 20:21:09 +0200 | noumenon | (~noumenon@2a01:799:cd8:e700:aa7e:eaff:fede:ff94) |
2024-07-05 20:19:10 +0200 | Lord_of_Life | (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 246 seconds) |
2024-07-05 20:18:49 +0200 | Lord_of_Life_ | (~Lord@user/lord-of-life/x-2819915) |
2024-07-05 20:17:52 +0200 | <haskellbridge> | <iqubic (she/her)> Overloaded strings are pretty OP. |
2024-07-05 20:17:19 +0200 | <probie> | Inst: "foo :: Text" is the same as if you'd written "(fromString "foo") :: Text", however that doesn't actually mean there will be a `String` in the compiled code. GHC normally does a very good job optimising it all away and just leaving you with the `Text` value you'd expect |
2024-07-05 20:16:04 +0200 | <haskellbridge> | <iqubic (she/her)> What do people recommend for generating random values? I know that some of this stuff will have to be in IO, but I think most of the functions can be pure by doing something like "generator -> (Int, generator)" |
2024-07-05 20:15:17 +0200 | fun-safe-math | (~fun-safe-@24.21.106.247) |
2024-07-05 20:15:07 +0200 | soverysour | (~soverysou@user/soverysour) (Ping timeout: 268 seconds) |
2024-07-05 20:13:00 +0200 | rdcdr | (~rdcdr@user/rdcdr) (Quit: ZNC 1.8.2+deb3.1 - https://znc.in) |
2024-07-05 20:02:22 +0200 | <geekosaur> | much as it does for numeric literals (fromInteger/fromRational) |
2024-07-05 20:02:01 +0200 | <geekosaur> | it compiles them to fromString/fromList called on a normal string/list |
2024-07-05 20:00:36 +0200 | nurupo | (~nurupo.ga@user/nurupo) |
2024-07-05 20:00:17 +0200 | nurupo | (~nurupo.ga@user/nurupo) (Quit: nurupo.ga) |
2024-07-05 19:57:40 +0200 | <Inst> | just curious, when you have isString or isList typeclasses, are these hardcoded literals or, when GHC gets to the literals, it generates a String or List and does the conversion as needed? |
2024-07-05 19:57:10 +0200 | Inst | (~Inst@user/Inst) |