Logs: liberachat/#haskell
| 2021-07-11 20:18:17 | × | peterhil quits (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) (Ping timeout: 265 seconds) |
| 2021-07-11 20:19:54 | × | warnz quits (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) (Ping timeout: 240 seconds) |
| 2021-07-11 20:21:36 | × | Guest3525 quits (~Guest35@187.83.249.216.dyn.smithville.net) (Quit: Client closed) |
| 2021-07-11 20:21:49 | → | mikoto-chan joins (~mikoto-ch@ip-213-49-189-31.dsl.scarlet.be) |
| 2021-07-11 20:23:46 | chkno_ | is now known as chkno |
| 2021-07-11 20:28:29 | → | acidjnk joins (~acidjnk@p200300d0c72b95663cee14c44c3d676c.dip0.t-ipconnect.de) |
| 2021-07-11 20:30:46 | <sim590> | I have this simple example here: http://ix.io/3sHi (I have minimized as much as I could). I want to call function `someFunc2` which has three constraints on the monad. I manage to call `someFunc1` without issue. I can also call `someFunc3` since I removed the constraint on MonadState. But I can't call someFunc2. I don't know how. Any tips? |
| 2021-07-11 20:32:14 | <sim590> | I'm getting these errors: http://ix.io/3sHk |
| 2021-07-11 20:32:45 | armink | is now known as hiruji |
| 2021-07-11 20:33:11 | <sim590> | There's something I don't understand well about transformers stack. I don't know what I should do here. |
| 2021-07-11 20:35:17 | × | kenran quits (~kenran@200116b82b619d0007bee3441e0dba70.dip.versatel-1u1.de) (Quit: WeeChat info:version) |
| 2021-07-11 20:39:00 | × | martin02 quits (silas@hund.fs.lmu.de) (Ping timeout: 268 seconds) |
| 2021-07-11 20:40:51 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 2021-07-11 20:42:11 | <Guest93> | `genstr size nthf = (unfoldrN size (\a -> Just ((nthf a), (a + 1))) 0)` is this correct? is there a more idiomatic way to achieve this? |
| 2021-07-11 20:47:16 | → | warnz joins (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) |
| 2021-07-11 20:50:06 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Ping timeout: 268 seconds) |
| 2021-07-11 20:51:47 | × | warnz quits (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) (Ping timeout: 255 seconds) |
| 2021-07-11 20:55:38 | <monochrom> | sim590: Or perhaps it is simply $ being ineffective in saving parentheses, and if you wrote your own parentheses avoiding $, there would be no misunderstanding between you and the computer. |
| 2021-07-11 20:56:05 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) (Remote host closed the connection) |
| 2021-07-11 20:56:19 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a1-224.dhcp.inet.fi) |
| 2021-07-11 20:57:46 | <sim590> | I'm not sure I understand where's the error. |
| 2021-07-11 21:02:22 | <sim590> | I would expect this to work: http://ix.io/3sHt, but I get this: http://ix.io/3sHu. |
| 2021-07-11 21:02:45 | × | wallymathieu quits (~wallymath@81-234-151-21-no94.tbcn.telia.com) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-07-11 21:07:08 | × | xkuru quits (~xkuru@user/xkuru) (Remote host closed the connection) |
| 2021-07-11 21:07:33 | → | xkuru joins (~xkuru@user/xkuru) |
| 2021-07-11 21:08:38 | × | jumper149 quits (~jumper149@80.240.31.34) (Quit: WeeChat 3.2) |
| 2021-07-11 21:08:45 | × | Guest91 quits (~Guest91@pool-71-163-166-229.washdc.fios.verizon.net) (Quit: Client closed) |
| 2021-07-11 21:09:24 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b) (Remote host closed the connection) |
| 2021-07-11 21:10:09 | → | wroathe joins (~wroathe@96-88-30-181-static.hfc.comcastbusiness.net) |
| 2021-07-11 21:11:35 | × | azeem quits (~azeem@dynamic-adsl-84-220-226-129.clienti.tiscali.it) (Ping timeout: 255 seconds) |
| 2021-07-11 21:13:24 | <hololeap> | Guest93: you would know better than anyone if it's correct, because we don't know what you're trying to do. I assume it typechecks... |
| 2021-07-11 21:14:34 | <monochrom> | Perhaps map nthf [0 .. n-1] |
| 2021-07-11 21:14:40 | × | Gurkenglas quits (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) (Read error: Connection reset by peer) |
| 2021-07-11 21:14:46 | <hololeap> | yeah that seems more idiiomatic |
| 2021-07-11 21:15:03 | → | Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) |
| 2021-07-11 21:15:26 | → | azeem joins (~azeem@dynamic-adsl-84-220-226-129.clienti.tiscali.it) |
| 2021-07-11 21:18:34 | → | warnz joins (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) |
| 2021-07-11 21:21:41 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-07-11 21:23:06 | × | warnz quits (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) (Ping timeout: 240 seconds) |
| 2021-07-11 21:24:38 | × | yoctocell quits (~user@h87-96-130-155.cust.a3fiber.se) (Ping timeout: 268 seconds) |
| 2021-07-11 21:25:20 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:6d00:2ab2:6519:235b) |
| 2021-07-11 21:26:28 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-07-11 21:27:58 | → | hseg joins (~gesh@185.120.126.10) |
| 2021-07-11 21:29:53 | <hseg> | am simulating sorted lists by a newtype on [] that checks (==) on the sorted version |
| 2021-07-11 21:30:23 | <hseg> | but it appears that i can have x == y but HashSet.fromList x /= HashSet.fromList y this way |
| 2021-07-11 21:31:23 | <monochrom> | That is fully expected of hash tables. |
| 2021-07-11 21:31:32 | → | Codaraxis joins (~Codaraxis@user/codaraxis) |
| 2021-07-11 21:31:32 | <Hecate> | yes |
| 2021-07-11 21:31:34 | <hseg> | oh? |
| 2021-07-11 21:32:03 | <hseg> | ah, because I didn't make sure to make them hash equally too? |
| 2021-07-11 21:32:07 | <hseg> | oops |
| 2021-07-11 21:32:31 | <hseg> | should've written the Hashable instance explicitly then |
| 2021-07-11 21:32:58 | <monochrom> | No, because hash table "order" is expected to be full of flukes from artifacts of, e.g., history of insert and remove. |
| 2021-07-11 21:34:40 | <hseg> | ok, sure, but I expect HashSet's Eq instance hides those artifacts? |
| 2021-07-11 21:35:21 | <hseg> | docs explicitly state that while you may have x == y, their toList may differ by a permutation |
| 2021-07-11 21:35:22 | <monochrom> | Err nevermind, misread. I was thinking toList. |
| 2021-07-11 21:35:35 | <hseg> | yeah. i did a different dumb |
| 2021-07-11 21:36:02 | <hseg> | of mixing self-defined and derived instances without checking inter-instance contracts |
| 2021-07-11 21:37:37 | <hseg> | and yes, that fixed it |
| 2021-07-11 21:38:09 | <monochrom> | :) |
| 2021-07-11 21:38:38 | × | Pickchea quits (~private@user/pickchea) (Quit: Leaving) |
| 2021-07-11 21:38:47 | <hseg> | wish there was a way to reduce boilerplate on types ~ a / (a -> q) |
| 2021-07-11 21:39:31 | <hseg> | basically, for every instance of a in negative position, map with the projection, then fall through to q's instance |
| 2021-07-11 21:39:46 | <dexterfoo> | should the "stm-chans" package be used? is it still good? |
| 2021-07-11 21:42:27 | <c_wraith> | it's a dependency of git-annex, so it's at least not causing problems for them |
| 2021-07-11 21:43:38 | <hseg> | actually, guess you could do something like http://ix.io/3sHH and derive via Quotient s a for appropriate s |
| 2021-07-11 21:44:07 | <hseg> | overengineered for my single use case, but a useful snippet |
| 2021-07-11 21:47:48 | <hseg> | thanks! |
| 2021-07-11 21:47:49 | × | hseg quits (~gesh@185.120.126.10) (Quit: WeeChat 3.2) |
| 2021-07-11 21:50:05 | × | silverwhitefish quits (~hidden@47.202.102.10) (Quit: One for all, all for One (2 Corinthians 5)) |
| 2021-07-11 21:50:16 | → | warnz joins (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) |
| 2021-07-11 21:50:44 | → | silverwhitefish joins (~hidden@47.202.102.10) |
| 2021-07-11 21:50:53 | silverwhitefish | is now known as Guest4772 |
| 2021-07-11 21:53:52 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 2021-07-11 21:53:52 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 2021-07-11 21:54:18 | × | warnz quits (~warnz@2600:1700:77c0:5610:acd9:fdbc:f96e:2452) (Ping timeout: 240 seconds) |
| 2021-07-11 21:54:47 | allbery_b | is now known as geekosaur |
| 2021-07-11 22:02:15 | × | theproffesor quits (~theproffe@user/theproffesor) (Ping timeout: 252 seconds) |
| 2021-07-11 22:05:29 | → | theproffesor joins (~theproffe@2601:282:847f:8010::3a29) |
| 2021-07-11 22:08:54 | × | Guest4772 quits (~hidden@47.202.102.10) (Quit: One for all, all for One (2 Corinthians 5)) |
| 2021-07-11 22:11:21 | × | oxide quits (~lambda@user/oxide) (Quit: oxide) |
| 2021-07-11 22:13:50 | ← | jakalx parts (~jakalx@base.jakalx.net) () |
| 2021-07-11 22:16:50 | × | neceve quits (~quassel@2a02:c7f:607e:d600:f762:20dd:304e:4b1f) (Ping timeout: 255 seconds) |
| 2021-07-11 22:16:50 | <Atum_> | Hey, I'm trying to understand an example code from LYAH, it says that I can drop the xs parameter on: "sum' xs = foldl (\acc x -> acc + x) 0 xs" to be "sum' = foldl (\acc x -> acc + x)" |
| 2021-07-11 22:17:14 | <geekosaur> | there should be a 0 at the end of that |
| 2021-07-11 22:17:15 | <Atum_> | how does the xs parameter gets to the foldl, when I call "sum' [1,2,3]"? |
| 2021-07-11 22:17:33 | <Atum_> | oh, yea, it was a typo |
| 2021-07-11 22:17:34 | <geekosaur> | the xs is on the right of both sides so you can factor it out |
| 2021-07-11 22:17:48 | → | silverwhitefish joins (~hidden@47.202.102.10) |
| 2021-07-11 22:17:50 | <geekosaur> | haskell will still figure out it's needed |
| 2021-07-11 22:17:56 | silverwhitefish | is now known as Guest1016 |
| 2021-07-11 22:18:03 | <Atum_> | but wouldn't "sum' [1,2,3]" just ignore the parameter? |
| 2021-07-11 22:18:07 | <dibblego> | I get this question a lot irl. I then defer to explaining that all functions in Haskell take exactly one argument, including foldl |
| 2021-07-11 22:18:25 | <Atum_> | oh |
| 2021-07-11 22:18:50 | <Atum_> | It would be something like this, in JS: "let a = () => arr => arr.reduce((acc, curr) => acc + curr, 0)" |
| 2021-07-11 22:18:54 | <dibblego> | explaining that fact over IRC is a little more difficult |
| 2021-07-11 22:19:02 | <Atum_> | so I would invoke it like a()([1, 2,3]) |
| 2021-07-11 22:19:18 | ← | Guest1016 parts (~hidden@47.202.102.10) () |
| 2021-07-11 22:19:19 | <dibblego> | here is the type of the only argument of foldl :: (b -> a -> a) |
| 2021-07-11 22:19:30 | <dibblego> | here is its return type :: b -> [a] -> b |
All times are in UTC.