Logs: freenode/#haskell
| 2021-04-22 07:14:08 | → | dilinger joins (~dilinger@spindle.queued.net) |
| 2021-04-22 07:15:38 | × | limbo quits (ar@45.63.9.236) (Ping timeout: 240 seconds) |
| 2021-04-22 07:17:33 | → | limbo joins (ar@45.63.9.236) |
| 2021-04-22 07:18:49 | → | nicholasbulka joins (~nicholasb@c-73-21-82-200.hsd1.ga.comcast.net) |
| 2021-04-22 07:22:52 | × | nicholasbulka quits (~nicholasb@c-73-21-82-200.hsd1.ga.comcast.net) (Ping timeout: 240 seconds) |
| 2021-04-22 07:27:08 | → | idhugo_ joins (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) |
| 2021-04-22 07:30:10 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-22 07:35:40 | nckx | is now known as raghavgururajan9 |
| 2021-04-22 07:35:50 | raghavgururajan9 | is now known as nckx |
| 2021-04-22 07:45:42 | → | kritzefitz joins (~kritzefit@212.86.56.80) |
| 2021-04-22 07:52:14 | × | vicfred quits (~vicfred@unaffiliated/vicfred) (Quit: Leaving) |
| 2021-04-22 08:02:51 | × | kritzefitz quits (~kritzefit@212.86.56.80) (Ping timeout: 245 seconds) |
| 2021-04-22 08:03:11 | → | idhugo__ joins (~idhugo@87-49-45-4-mobile.dk.customer.tdc.net) |
| 2021-04-22 08:03:19 | → | kritzefitz joins (~kritzefit@2003:5b:203b:200::10:49) |
| 2021-04-22 08:04:17 | → | gzj joins (~gzj@unaffiliated/gzj) |
| 2021-04-22 08:05:15 | → | Gurkenglas joins (~Gurkengla@unaffiliated/gurkenglas) |
| 2021-04-22 08:05:54 | × | idhugo_ quits (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) (Ping timeout: 260 seconds) |
| 2021-04-22 08:07:10 | → | hendursaga joins (~weechat@gateway/tor-sasl/hendursaga) |
| 2021-04-22 08:07:56 | × | hypercube quits (hypercube@gateway/vpn/protonvpn/hypercube) (Ping timeout: 246 seconds) |
| 2021-04-22 08:09:09 | × | hendursa1 quits (~weechat@gateway/tor-sasl/hendursaga) (Ping timeout: 240 seconds) |
| 2021-04-22 08:11:28 | → | sgibber2018 joins (d055ed90@208.85.237.144) |
| 2021-04-22 08:13:58 | × | plutoniix quits (~q@ppp-58-8-174-127.revip2.asianet.co.th) (Ping timeout: 252 seconds) |
| 2021-04-22 08:14:13 | → | faustind joins (8508bb0b@gateway/web/cgi-irc/kiwiirc.com/ip.133.8.187.11) |
| 2021-04-22 08:19:31 | → | raehik joins (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) |
| 2021-04-22 08:20:19 | × | RusAlex quits (~Chel@unaffiliated/rusalex) (Ping timeout: 268 seconds) |
| 2021-04-22 08:20:42 | → | aidecoe joins (~aidecoe@unaffiliated/aidecoe) |
| 2021-04-22 08:25:43 | → | RusAlex joins (~Chel@unaffiliated/rusalex) |
| 2021-04-22 08:27:44 | × | Tene quits (~tene@poipu/supporter/slacker/tene) (Ping timeout: 268 seconds) |
| 2021-04-22 08:28:37 | × | ByronJohnson quits (~bairyn@unaffiliated/bob0) (Ping timeout: 252 seconds) |
| 2021-04-22 08:32:14 | → | LKoen joins (~LKoen@11.160.9.109.rev.sfr.net) |
| 2021-04-22 08:32:40 | × | earthy quits (~arthurvl@deban2.xs4all.space) (Ping timeout: 252 seconds) |
| 2021-04-22 08:33:45 | → | guest421` joins (~user@49.5.6.87) |
| 2021-04-22 08:34:24 | → | Tene joins (~tene@poipu/supporter/slacker/tene) |
| 2021-04-22 08:34:27 | → | ByronJohnson joins (~bairyn@unaffiliated/bob0) |
| 2021-04-22 08:35:06 | × | sgibber2018 quits (d055ed90@208.85.237.144) (Quit: Connection closed) |
| 2021-04-22 08:35:09 | → | earthy joins (~arthurvl@deban2.xs4all.space) |
| 2021-04-22 08:35:45 | <guest421`> | MaybeT IO a, MaybeT IO is a monad, but to value [MaybeT IO a], is there a monad for it? |
| 2021-04-22 08:36:04 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2021-04-22 08:36:19 | <guest421`> | there's a List Transformer? |
| 2021-04-22 08:36:51 | <guest421`> | data ListT m a = ListT m [a]? |
| 2021-04-22 08:37:29 | <guest421`> | so we could have ListT (MaybeT IO) a? |
| 2021-04-22 08:38:16 | <guest421`> | or data ListT m a = ListT [m a]? |
| 2021-04-22 08:38:45 | <merijn> | You could, yes. But the semantics of ListT are...tricky |
| 2021-04-22 08:39:05 | <merijn> | guest421`: When you're looking for ListT you might want conduit/pipes instead |
| 2021-04-22 08:39:08 | <merijn> | @hackage conduit |
| 2021-04-22 08:39:09 | <lambdabot> | https://hackage.haskell.org/package/conduit |
| 2021-04-22 08:39:12 | <merijn> | @hackage pipes |
| 2021-04-22 08:39:12 | <lambdabot> | https://hackage.haskell.org/package/pipes |
| 2021-04-22 08:40:06 | <guest421`> | merijn: actually I'm thnking about using `traverse` to IO actions, for example there's [Url], and fetchUrl :: Url -> MaybeT IO ByteString, |
| 2021-04-22 08:40:09 | → | jess joins (jess@freenode/staff/jess) |
| 2021-04-22 08:40:09 | → | Lycurgus joins (~niemand@98.4.118.65) |
| 2021-04-22 08:40:29 | <guest421`> | traverse fetchUrl [Url] |
| 2021-04-22 08:41:40 | <merijn> | That doesn't need ListT, though? |
| 2021-04-22 08:41:59 | <merijn> | like, "traverse fetchUrl" works just fine on a list of URLs |
| 2021-04-22 08:43:00 | <guest421`> | merijn: but `traverse` "collect" that result, it product a type MaybeT IO (Maybe [a]) |
| 2021-04-22 08:43:17 | <guest421`> | merijn: what if I'd like [IO-Actions-Results] |
| 2021-04-22 08:43:31 | <merijn> | eh, that's just map? |
| 2021-04-22 08:43:45 | <merijn> | That doesn't look, right though |
| 2021-04-22 08:43:46 | <guest421`> | merijn: yes, but fmap doesn't do IO |
| 2021-04-22 08:44:22 | <merijn> | if "fetchUrl :: Url -> MaybeT IO ByteString" then "traverse fetchUrl :: MaybeT IO [ByteString]" |
| 2021-04-22 08:44:31 | <merijn> | eh |
| 2021-04-22 08:44:38 | <merijn> | Missing list argument, but you get the idea |
| 2021-04-22 08:45:13 | <guest421`> | merijn: <guest421`> traverse fetchUrl [Url] |
| 2021-04-22 08:45:28 | <merijn> | :t traverse `asAppliedTo` (undefined :: () -> MaybeT IO ByteString) |
| 2021-04-22 08:45:29 | <lambdabot> | error: |
| 2021-04-22 08:45:29 | <lambdabot> | Not in scope: type constructor or class ‘ByteString’ |
| 2021-04-22 08:45:29 | <lambdabot> | Perhaps you meant one of these: |
| 2021-04-22 08:45:35 | <merijn> | :t traverse `asAppliedTo` (undefined :: () -> MaybeT IO String) |
| 2021-04-22 08:45:36 | <lambdabot> | Traversable t => (() -> MaybeT IO String) -> t () -> MaybeT IO (t String) |
| 2021-04-22 08:46:29 | <guest421`> | merijn: why ListT is tricky? |
| 2021-04-22 08:46:39 | <merijn> | Well, what does it mean? |
| 2021-04-22 08:47:11 | <guest421`> | <merijn> You could, yes. But the semantics of ListT are...tricky |
| 2021-04-22 08:47:57 | <guest421`> | there's MaybeT, EitherT, StateT blabla, even ContT, but no ListT? |
| 2021-04-22 08:48:28 | <merijn> | There is a ListT, but it's definition is questionable |
| 2021-04-22 08:58:13 | × | pavonia quits (~user@unaffiliated/siracusa) (Quit: Bye!) |
| 2021-04-22 08:59:33 | × | dsrt^ quits (dsrt@ip98-184-89-2.mc.at.cox.net) () |
| 2021-04-22 09:00:05 | <lovesegfault> | Hi everyone, could someone review this small exercise program I wrote? https://github.com/lovesegfault/exercism/blob/main/haskell/leap/src/LeapYear.hs |
| 2021-04-22 09:00:05 | × | addem[m] quits (addemmatri@gateway/shell/matrix.org/x-dihufvgbnekkaxvh) (Quit: Idle for 30+ days) |
| 2021-04-22 09:00:28 | <lovesegfault> | Not sure if I'm doing this the right way :P |
| 2021-04-22 09:00:46 | <lovesegfault> | it works, I'm more concerned about it being idiomatic |
| 2021-04-22 09:00:52 | <guest421`> | merijn: traverse fetchUrl [Url] , when one of those IO actions return a MaybeT (return Nothing) :: MaybeT IO ByteString, what traverse will return? |
| 2021-04-22 09:02:35 | <merijn> | Nothing, but if you don't want that, then don't use MaybeT? |
| 2021-04-22 09:02:47 | <merijn> | Like, that's literally the only purpose of MaybeT |
| 2021-04-22 09:03:12 | <guest421`> | merijn: I should use fetchUrl :: Url -> IO (Maybe a)? |
| 2021-04-22 09:03:37 | <guest421`> | merijn: IO is too difficult on value level to express |
| 2021-04-22 09:08:49 | ← | jakalx parts (~jakalx@base.jakalx.net) ("Error from remote client") |
| 2021-04-22 09:10:05 | × | gzj quits (~gzj@unaffiliated/gzj) (Remote host closed the connection) |
| 2021-04-22 09:10:15 | → | Sorny joins (~Sornaensi@077213200034.dynamic.telenor.dk) |
| 2021-04-22 09:10:26 | → | gzj joins (~gzj@unaffiliated/gzj) |
| 2021-04-22 09:11:18 | × | malumore quits (~malumore@151.62.117.136) (Remote host closed the connection) |
| 2021-04-22 09:12:22 | → | jakalx joins (~jakalx@base.jakalx.net) |
| 2021-04-22 09:12:31 | ← | jakalx parts (~jakalx@base.jakalx.net) ("Error from remote client") |
| 2021-04-22 09:13:11 | × | Sorna quits (~Sornaensi@79.142.232.102.static.router4.bolignet.dk) (Ping timeout: 240 seconds) |
| 2021-04-22 09:13:54 | <wrunt> | lovesegfault: Looks ok. You may want to use Int rather than Integer, unless you anticipate the year exceeding 'maxBound :: Int'. You could also use logic rather than pattern matching, and use 'isDiv' infix, i.e. 'isLeapYear year = year `isDiv` 4 || (not $ year `isDiv` 100) || year `isDiv` 400' |
| 2021-04-22 09:14:27 | → | minoru_shiraeesh joins (~shiraeesh@46.34.207.53) |
| 2021-04-22 09:15:02 | <lovesegfault> | woah, what is $ in haskell? |
| 2021-04-22 09:15:12 | → | kiweun joins (~kiweun@2607:fea8:2a62:9600:5d11:937f:5f24:4c8b) |
| 2021-04-22 09:15:13 | <wrunt> | hm, my logic may be off there... |
| 2021-04-22 09:15:56 | <wrunt> | $ is called apply, and basically says evaluate everything on my right before passing it to the function on my left |
| 2021-04-22 09:16:09 | → | malumore joins (~malumore@151.62.117.136) |
All times are in UTC.