Logs: freenode/#haskell
| 2021-03-18 12:17:41 | × | forgottenone quits (~forgotten@176.42.16.24) (Quit: Konversation terminated!) |
| 2021-03-18 12:18:10 | → | forgottenone joins (~forgotten@176.42.16.24) |
| 2021-03-18 12:21:19 | → | Gurkenglas_ joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2021-03-18 12:21:44 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 2021-03-18 12:22:29 | → | bahamas joins (~lucian@unaffiliated/bahamas) |
| 2021-03-18 12:23:37 | × | Sathiana quits (~kath@185-113-98-38.cust.bredband2.com) (Quit: WeeChat 3.0) |
| 2021-03-18 12:24:29 | → | geowiesnot_bis joins (~user@87-89-181-157.abo.bbox.fr) |
| 2021-03-18 12:24:58 | × | forgottenone quits (~forgotten@176.42.16.24) (Ping timeout: 260 seconds) |
| 2021-03-18 12:25:26 | manjaroi3 | is now known as InsideBreeze |
| 2021-03-18 12:27:21 | → | codygman__ joins (~user@47.186.207.161) |
| 2021-03-18 12:33:32 | → | Sathiana joins (~kath@185-113-98-38.cust.bredband2.com) |
| 2021-03-18 12:33:45 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Read error: Connection reset by peer) |
| 2021-03-18 12:37:44 | × | dramforever quits (~dram@unaffiliated/dramforever) (Remote host closed the connection) |
| 2021-03-18 12:38:36 | → | ph88 joins (~ph88@ip5f5af71a.dynamic.kabel-deutschland.de) |
| 2021-03-18 12:40:02 | <ph88> | does anyone know how to make the argument to an optparse-applicative option optional ? the default value that is available now works for when the option is not given. I would like to have 3 states though: option not given, option given without argument, option given with arguments |
| 2021-03-18 12:40:46 | → | Tario joins (~Tario@201.192.165.173) |
| 2021-03-18 12:42:09 | → | jumper149 joins (~jumper149@ip185225.wh.uni-hannover.de) |
| 2021-03-18 12:42:53 | → | rayyyy joins (~nanoz@gateway/tor-sasl/nanoz) |
| 2021-03-18 12:43:17 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-03-18 12:44:19 | ← | jakalx parts (~jakalx@base.jakalx.net) ("Disconnected: Replaced by new connection") |
| 2021-03-18 12:45:19 | <tomsmeding> | ph88: what if the argument to the option starts with a '-'? |
| 2021-03-18 12:45:51 | × | rayyyy quits (~nanoz@gateway/tor-sasl/nanoz) (Remote host closed the connection) |
| 2021-03-18 12:46:17 | → | rayyyy joins (~nanoz@gateway/tor-sasl/nanoz) |
| 2021-03-18 12:46:23 | <ph88> | same as whatever optparse-applicative does now when the argument start with "-" ... which i don't know |
| 2021-03-18 12:47:16 | <geekosaur> | tomsmeding is talking about a case that normally can't happen: is --foo --bar with --foo having your semantics --foo with parameter --bar, or --foo followed by --bar? |
| 2021-03-18 12:47:50 | <geekosaur> | basically your requested grammar is ambiguous, which it normally isn't |
| 2021-03-18 12:50:32 | → | peanut_ joins (~peanut@2a02:8388:a101:2600:8bb2:874c:9ad6:7619) |
| 2021-03-18 12:50:46 | → | heatsink joins (~heatsink@2600:1700:bef1:5e10:b5a7:9e26:9598:47de) |
| 2021-03-18 12:52:20 | → | __minoru__shirae joins (~shiraeesh@109.166.59.216) |
| 2021-03-18 12:54:25 | × | __minoru__shirae quits (~shiraeesh@109.166.59.216) (Read error: No route to host) |
| 2021-03-18 12:54:48 | × | royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed) |
| 2021-03-18 12:55:04 | <merijn> | ph88: You can't have optional arguments in optparse |
| 2021-03-18 12:55:20 | <merijn> | You have either flags (no argument) or options (argument) |
| 2021-03-18 12:55:28 | → | royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) |
| 2021-03-18 12:55:37 | → | supercoven joins (~Supercove@dsl-hkibng31-54fabd-233.dhcp.inet.fi) |
| 2021-03-18 12:55:50 | × | heatsink quits (~heatsink@2600:1700:bef1:5e10:b5a7:9e26:9598:47de) (Ping timeout: 264 seconds) |
| 2021-03-18 12:56:55 | → | ep1ctetus joins (~epictetus@ip72-194-215-136.sb.sd.cox.net) |
| 2021-03-18 12:57:08 | <iphy> | is there something like (a -> c -> (b, c)) -> [a] -> c -> [b]? I want to map [a] to [b], but also keep some state c in each iteration. basically foldr but I don't want to do the list append myself |
| 2021-03-18 12:57:09 | → | LKoen_ joins (~LKoen@194.250.88.92.rev.sfr.net) |
| 2021-03-18 12:58:16 | <mniip> | :t mapAccumL |
| 2021-03-18 12:58:16 | <geekosaur> | :t mapAccumL |
| 2021-03-18 12:58:18 | <lambdabot> | Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) |
| 2021-03-18 12:58:18 | <lambdabot> | Traversable t => (a -> b -> (a, c)) -> a -> t b -> (a, t c) |
| 2021-03-18 12:58:35 | <iphy> | perfect, thanks |
| 2021-03-18 12:58:52 | <iphy> | I tried hoogle with the above type signature and it yielded nothing |
| 2021-03-18 12:59:17 | <iphy> | should have generalised to Traversable maybe |
| 2021-03-18 12:59:28 | <mniip> | you could also traverse with State manually |
| 2021-03-18 12:59:38 | × | LKoen quits (~LKoen@194.250.88.92.rev.sfr.net) (Ping timeout: 245 seconds) |
| 2021-03-18 12:59:49 | × | Sathiana quits (~kath@185-113-98-38.cust.bredband2.com) (Quit: WeeChat 3.0) |
| 2021-03-18 12:59:54 | <mniip> | :t runState . traverse state |
| 2021-03-18 12:59:56 | <lambdabot> | Traversable t => t (s -> (b, s)) -> s -> (t b, s) |
| 2021-03-18 13:00:11 | <iphy> | yeah, I think mapAccumL is exactly what I want, though |
| 2021-03-18 13:00:16 | <mniip> | :t (runState .) . traverse . state |
| 2021-03-18 13:00:18 | <lambdabot> | (Traversable t, MonadState s1 ((->) a)) => (s1 -> (StateT s2 Identity b, s1)) -> t a -> s2 -> (t b, s2) |
| 2021-03-18 13:00:31 | <mniip> | :t (runState .) . traverse . (state .) |
| 2021-03-18 13:00:32 | <lambdabot> | Traversable t => (a -> s -> (b, s)) -> t a -> s -> (t b, s) |
| 2021-03-18 13:00:50 | <tomsmeding> | @hoogle (c -> a -> (c, b)) -> c -> [a] -> (c, [b]) |
| 2021-03-18 13:00:50 | <mniip> | this is also mapAccumL :P |
| 2021-03-18 13:00:51 | <lambdabot> | GHC.OldList mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y]) |
| 2021-03-18 13:00:51 | <lambdabot> | GHC.OldList mapAccumR :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y]) |
| 2021-03-18 13:00:51 | <lambdabot> | Data.List2010 mapAccumL :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y]) |
| 2021-03-18 13:00:53 | × | icebreak1r quits (michalc@freeshell.de) (Ping timeout: 265 seconds) |
| 2021-03-18 13:01:08 | → | forgottenone joins (~forgotten@176.42.16.24) |
| 2021-03-18 13:01:09 | <tomsmeding> | iphy: there's just too much variation in how you order the arguments |
| 2021-03-18 13:01:30 | <mniip> | I think the block here is the return value of (acc, [y]) |
| 2021-03-18 13:01:34 | <mniip> | as opposed to [y] |
| 2021-03-18 13:01:43 | <mniip> | runState not evalState |
| 2021-03-18 13:01:45 | <tomsmeding> | flipping the arguments to the lambda, the parts of the returned pair, the second and third args of mapAccumL, and adding the accumulator to the result lets hoogle find it :p |
| 2021-03-18 13:01:54 | <tomsmeding> | I believe all those mutations are necessary |
| 2021-03-18 13:02:19 | → | Sathiana joins (~kath@185-113-98-38.cust.bredband2.com) |
| 2021-03-18 13:03:43 | → | hyperisco joins (~hyperisco@d192-186-117-226.static.comm.cgocable.net) |
| 2021-03-18 13:08:09 | → | kav joins (~kari@dsl-hkibng42-56733f-225.dhcp.inet.fi) |
| 2021-03-18 13:09:42 | × | geekosaur quits (82650c7a@130.101.12.122) (Ping timeout: 240 seconds) |
| 2021-03-18 13:10:05 | → | codygman` joins (~user@209.251.131.98) |
| 2021-03-18 13:11:43 | × | justanotheruser quits (~justanoth@unaffiliated/justanotheruser) (Ping timeout: 244 seconds) |
| 2021-03-18 13:12:13 | × | codygman__ quits (~user@47.186.207.161) (Ping timeout: 260 seconds) |
| 2021-03-18 13:14:26 | → | carlomagno joins (~cararell@148.87.23.7) |
| 2021-03-18 13:17:05 | → | geekosaur joins (82650c7a@130.101.12.122) |
| 2021-03-18 13:17:35 | → | __minoru__shirae joins (~shiraeesh@109.166.59.216) |
| 2021-03-18 13:20:19 | × | Sathiana quits (~kath@185-113-98-38.cust.bredband2.com) (Quit: WeeChat 3.0) |
| 2021-03-18 13:21:18 | → | Sathiana joins (~kath@185-113-98-38.cust.bredband2.com) |
| 2021-03-18 13:22:18 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-ibeawnzzibcmilki) |
| 2021-03-18 13:23:23 | hackage | slist 0.2.0.0 - Sized list https://hackage.haskell.org/package/slist-0.2.0.0 (vrom911) |
| 2021-03-18 13:27:44 | → | idhugo_ joins (~idhugo@80-62-116-180-mobile.dk.customer.tdc.net) |
| 2021-03-18 13:29:54 | × | idhugo_ quits (~idhugo@80-62-116-180-mobile.dk.customer.tdc.net) (Read error: Connection reset by peer) |
| 2021-03-18 13:30:06 | × | __minoru__shirae quits (~shiraeesh@109.166.59.216) (Ping timeout: 260 seconds) |
| 2021-03-18 13:30:16 | → | idhugo joins (~idhugo@80-62-116-180-mobile.dk.customer.tdc.net) |
| 2021-03-18 13:30:34 | × | idhugo__ quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 260 seconds) |
| 2021-03-18 13:32:38 | → | Benzi-Junior joins (~BenziJuni@88-149-67-143.du.xdsl.is) |
| 2021-03-18 13:32:54 | → | willmoffat joins (~willmoffa@37.120.211.188) |
| 2021-03-18 13:36:35 | → | hjec joins (614e8662@rrcs-97-78-134-98.se.biz.rr.com) |
| 2021-03-18 13:37:27 | × | toorevitimirp quits (~tooreviti@117.182.183.55) (Remote host closed the connection) |
| 2021-03-18 13:37:53 | → | toorevitimirp joins (~tooreviti@117.182.183.55) |
| 2021-03-18 13:38:55 | × | stree quits (~stree@68.36.8.116) (Ping timeout: 276 seconds) |
| 2021-03-18 13:42:38 | <ph88> | merijn, what about a switch ? it also has --switch1 --switch2 no ? |
| 2021-03-18 13:44:02 | × | LKoen_ quits (~LKoen@194.250.88.92.rev.sfr.net) (Remote host closed the connection) |
| 2021-03-18 13:45:38 | → | __minoru__shirae joins (~shiraeesh@109.166.59.216) |
| 2021-03-18 13:46:34 | <merijn> | switches are just convenience version of flags where the result is boolean |
| 2021-03-18 13:50:45 | → | justanotheruser joins (~justanoth@unaffiliated/justanotheruser) |
| 2021-03-18 13:51:27 | × | son0p quits (~son0p@181.58.39.182) (Quit: Lost terminal) |
All times are in UTC.