Logs: freenode/#haskell
| 2021-05-13 08:47:52 | → | jamm_ joins (~jamm@unaffiliated/jamm) |
| 2021-05-13 08:47:58 | <xenon-> | hi. how do I support arbitrary number of arguments in optparse-applicative? so myprog <arg1> <arg2> .. <argN> should be stored to progOptionsArguments :: [String] |
| 2021-05-13 08:48:22 | <xenon-> | I only see argument Parser, not arguments or something similar |
| 2021-05-13 08:48:27 | <Taneb> | :t many |
| 2021-05-13 08:48:28 | <lambdabot> | Alternative f => f a -> f [a] |
| 2021-05-13 08:48:37 | <xenon-> | oh? nice |
| 2021-05-13 08:48:49 | × | mrus quits (~mrus@149.28.61.155) (Quit: Surfing the great wave off Kanagawa) |
| 2021-05-13 08:49:00 | → | mrus joins (~mrus@2001:19f0:5:3fd4:5400:3ff:fe48:1820) |
| 2021-05-13 08:49:19 | <xenon-> | that's many from base, not from optparse-aplicative, right? |
| 2021-05-13 08:49:25 | <Taneb> | Yes |
| 2021-05-13 08:50:20 | <Taneb> | If you want at least one, you can use 'some' instead |
| 2021-05-13 08:50:57 | × | NinjaTrappeur quits (~ninja@unaffiliated/ninjatrappeur) (Quit: WeeChat 3.1) |
| 2021-05-13 08:51:47 | → | NinjaTrappeur joins (~ninja@unaffiliated/ninjatrappeur) |
| 2021-05-13 08:52:13 | × | gzj quits (~gzj@unaffiliated/gzj) (Ping timeout: 240 seconds) |
| 2021-05-13 08:56:24 | → | wz1000 joins (~wz1000@static.11.113.47.78.clients.your-server.de) |
| 2021-05-13 08:57:28 | <xenon-> | it worked nicely |
| 2021-05-13 08:57:32 | <xenon-> | I love this library |
| 2021-05-13 09:00:10 | → | ram19890 joins (~ram@49.205.82.36) |
| 2021-05-13 09:00:13 | × | M9ndres[m] quits (m9ndresmat@gateway/shell/matrix.org/x-uatuolvhgiuajapn) (Quit: Idle for 30+ days) |
| 2021-05-13 09:00:34 | × | CrazyPython quits (~crazypyth@206.214.238.6) (Read error: Connection reset by peer) |
| 2021-05-13 09:00:40 | × | vchlup_ quits (~vchlup@nat.brnet.cz) (Remote host closed the connection) |
| 2021-05-13 09:01:56 | → | CrazyPython joins (~crazypyth@206.214.238.6) |
| 2021-05-13 09:03:16 | × | CrazyPython quits (~crazypyth@206.214.238.6) (Read error: Connection reset by peer) |
| 2021-05-13 09:03:20 | → | vchlup joins (~vchlup@nat.brnet.cz) |
| 2021-05-13 09:06:28 | → | ulidtko joins (~ulidtko@31.133.98.244) |
| 2021-05-13 09:07:27 | × | larsan1 quits (~larsan@37.120.211.188) (Remote host closed the connection) |
| 2021-05-13 09:07:58 | × | wz1000 quits (~wz1000@static.11.113.47.78.clients.your-server.de) (Ping timeout: 252 seconds) |
| 2021-05-13 09:10:41 | × | ulidtko quits (~ulidtko@31.133.98.244) (Ping timeout: 240 seconds) |
| 2021-05-13 09:11:42 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-05-13 09:12:11 | × | neiluj quits (~jco@unaffiliated/neiluj) (Quit: leaving) |
| 2021-05-13 09:13:58 | → | ddellacosta joins (ddellacost@gateway/vpn/mullvad/ddellacosta) |
| 2021-05-13 09:14:07 | → | wz1000 joins (~wz1000@static.11.113.47.78.clients.your-server.de) |
| 2021-05-13 09:16:14 | × | ixlun quits (~user@109.249.184.235) (Ping timeout: 265 seconds) |
| 2021-05-13 09:17:02 | → | DavidEichmann joins (~david@156.59.147.147.dyn.plus.net) |
| 2021-05-13 09:17:14 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 246 seconds) |
| 2021-05-13 09:17:44 | × | DavidEichmann quits (~david@156.59.147.147.dyn.plus.net) (Remote host closed the connection) |
| 2021-05-13 09:18:41 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 260 seconds) |
| 2021-05-13 09:19:57 | → | DavidEichmann joins (~david@156.59.147.147.dyn.plus.net) |
| 2021-05-13 09:21:34 | → | ixlun joins (~user@109.249.184.235) |
| 2021-05-13 09:22:51 | × | jamm_ quits (~jamm@unaffiliated/jamm) (Remote host closed the connection) |
| 2021-05-13 09:25:41 | → | pagnol joins (~user@014198154145.ctinets.com) |
| 2021-05-13 09:26:07 | × | ixlun quits (~user@109.249.184.235) (Ping timeout: 252 seconds) |
| 2021-05-13 09:28:53 | × | stree quits (~stree@68.36.8.116) (Ping timeout: 240 seconds) |
| 2021-05-13 09:29:12 | → | guest5 joins (5619784f@cpc143846-cosh20-2-0-cust78.6-1.cable.virginm.net) |
| 2021-05-13 09:29:35 | → | guest512 joins (561c8089@cpc143858-cosh20-2-0-cust136.6-1.cable.virginm.net) |
| 2021-05-13 09:30:19 | <guest512> | data City = City String Int Int [Int] |
| 2021-05-13 09:30:20 | <guest512> | deriving Show |
| 2021-05-13 09:30:20 | <guest512> | testData :: City |
| 2021-05-13 09:30:21 | <guest512> | testData = [ City "Amsterdam" 52 5 [1158, 1149, 1140, 1132] |
| 2021-05-13 09:30:21 | <guest512> | City "Athens" 38 23 [3153, 3153, 3154, 3156] |
| 2021-05-13 09:30:22 | <guest512> | City "Berlin" 53 13 [3567, 3562, 3557, 3552] |
| 2021-05-13 09:30:22 | <guest512> | City "Brussels" 51 4 [2096, 2081, 2065, 2050] |
| 2021-05-13 09:30:23 | × | guest512 quits (561c8089@cpc143858-cosh20-2-0-cust136.6-1.cable.virginm.net) (Killed (Sigyn (Spam is off topic on freenode.))) |
| 2021-05-13 09:30:36 | <Uniaika> | bwahaha |
| 2021-05-13 09:30:48 | <Uniaika> | that's why we ask to paste code in a dedicated service |
| 2021-05-13 09:30:49 | <deejaytee> | oof |
| 2021-05-13 09:31:08 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 2021-05-13 09:31:10 | <guest5> | where's that? |
| 2021-05-13 09:31:19 | <deejaytee> | in the topic |
| 2021-05-13 09:31:34 | <deejaytee> | paste.tomsmeding.com |
| 2021-05-13 09:32:23 | <guest5> | got you cheerrs |
| 2021-05-13 09:32:27 | <Uniaika> | let it be a reminder of proper IRC etiquette to read the topic before speaking :P |
| 2021-05-13 09:33:49 | → | Kaeipi joins (~Kaiepi@47.54.252.148) |
| 2021-05-13 09:34:09 | <guest5> | what do you do with the |
| 2021-05-13 09:34:15 | <guest5> | paste once you've made it? |
| 2021-05-13 09:34:25 | × | Merfont quits (~Kaiepi@47.54.252.148) (Read error: Connection reset by peer) |
| 2021-05-13 09:34:46 | × | Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection) |
| 2021-05-13 09:35:11 | → | pera_ joins (~pera_@94.0.111.239) |
| 2021-05-13 09:35:16 | → | Kaeipi joins (~Kaiepi@47.54.252.148) |
| 2021-05-13 09:36:00 | <deejaytee> | Copy the link into chat, it has an identifier in the link so it'll point to your paste and not someone else's |
| 2021-05-13 09:37:52 | <xenon-> | I have a function that returns IO, can I just stick error in there, or should I use throwIO? |
| 2021-05-13 09:38:42 | × | son0p quits (~ff@181.136.122.143) (Ping timeout: 245 seconds) |
| 2021-05-13 09:40:29 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2021-05-13 09:41:05 | × | Kaeipi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection) |
| 2021-05-13 09:41:30 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-05-13 09:42:27 | → | stree joins (~stree@68.36.8.116) |
| 2021-05-13 09:43:45 | <deejaytee> | I'm not terribly familiar with *all* the ways to throw errors in IO, but my assumption is that `error` ought to be used only for situations that cannot happen - if your use case is "rare but normal issue that should abort computation but be handled / recovered from later" use something else, e.g. throwIO |
| 2021-05-13 09:44:28 | Rembane | agrees with deejaytee |
| 2021-05-13 09:44:45 | × | Iceland_jack quits (~user@95.147.45.92) (Ping timeout: 265 seconds) |
| 2021-05-13 09:45:27 | <xenon-> | is there some exception in base that I can already use to report invalid program options (using two options that shouldn't be used together)? or some generic function that accepts a string? or should I just create my own exception |
| 2021-05-13 09:45:54 | <pagnol> | xenon-: you mean on the command line? |
| 2021-05-13 09:46:00 | <xenon-> | yes |
| 2021-05-13 09:46:05 | → | rond_ joins (531cdf3e@bmd62.neoplus.adsl.tpnet.pl) |
| 2021-05-13 09:46:06 | → | shiraeeshi joins (~shiraeesh@109.166.58.127) |
| 2021-05-13 09:47:32 | <pagnol> | can't you just have a branch in your main and abort further execution if both options are present? |
| 2021-05-13 09:47:39 | × | jjhoo quits (jahakala@dsl-trebng21-b048b5-171.dhcp.inet.fi) (Remote host closed the connection) |
| 2021-05-13 09:47:48 | <pagnol> | I don't see why you would need to work with exceptions at all |
| 2021-05-13 09:48:20 | → | ddellacosta joins (~ddellacos@86.106.143.228) |
| 2021-05-13 09:48:21 | <xenon-> | I guess I can report error and call exitFailure |
| 2021-05-13 09:49:23 | × | mikoto-chan quits (~mikoto-ch@gateway/tor-sasl/mikoto-chan) (Remote host closed the connection) |
| 2021-05-13 09:50:07 | → | mikoto-chan joins (~mikoto-ch@gateway/tor-sasl/mikoto-chan) |
| 2021-05-13 09:51:26 | → | jjhoo joins (~jahakala@dsl-trebng21-b048b5-171.dhcp.inet.fi) |
| 2021-05-13 09:51:32 | × | mrchampion quits (~mrchampio@38.18.109.23) (Ping timeout: 246 seconds) |
| 2021-05-13 09:52:33 | × | ddellacosta quits (~ddellacos@86.106.143.228) (Ping timeout: 240 seconds) |
| 2021-05-13 09:56:46 | × | shiraeeshi quits (~shiraeesh@109.166.58.127) (Ping timeout: 240 seconds) |
| 2021-05-13 09:56:50 | × | nut1 quits (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Quit: WeeChat 2.8) |
| 2021-05-13 09:57:54 | <guest5> | https://paste.tomsmeding.com/R6DugDL9#file-1 |
| 2021-05-13 09:58:04 | <guest5> | have I used the right custom class in this? |
| 2021-05-13 09:58:33 | <guest5> | custom data type* |
| 2021-05-13 10:01:31 | <deejaytee> | There are two issues with your code, and neither of them have to do with your data type. 1. You need commas between the elements in your array. 2. The type annotation `testData :: City` is wrong - testData is a list of City, not a City |
All times are in UTC.