Logs: freenode/#haskell
| 2021-04-23 09:58:09 | → | __minoru__shirae joins (~shiraeesh@46.34.206.15) |
| 2021-04-23 09:58:09 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 09:58:56 | → | mikolaj_ joins (~mikolaj@purple.well-typed.com) |
| 2021-04-23 10:00:30 | × | Rudd0 quits (~Rudd0@185.189.115.108) (Read error: Connection reset by peer) |
| 2021-04-23 10:00:35 | → | Rudd0^ joins (~Rudd0@185.189.115.108) |
| 2021-04-23 10:03:37 | → | ClaudiusMaximus joins (~claude@cpc98210-croy26-2-0-cust137.19-2.cable.virginm.net) |
| 2021-04-23 10:03:39 | × | ClaudiusMaximus quits (~claude@cpc98210-croy26-2-0-cust137.19-2.cable.virginm.net) (Changing host) |
| 2021-04-23 10:03:40 | → | ClaudiusMaximus joins (~claude@unaffiliated/claudiusmaximus) |
| 2021-04-23 10:03:43 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2021-04-23 10:03:49 | → | thblt joins (~thblt@unaffiliated/thblt) |
| 2021-04-23 10:04:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:04:44 | → | junkicide joins (~user@37.164.172.175) |
| 2021-04-23 10:05:03 | × | milessabin quits (sid86799@gateway/web/irccloud.com/x-aurnquefvyorfrgg) (Ping timeout: 246 seconds) |
| 2021-04-23 10:05:12 | × | rslima_____ quits (sid26145@gateway/web/irccloud.com/x-goofybjtwpxkxwqn) (Ping timeout: 258 seconds) |
| 2021-04-23 10:05:12 | × | kyagrd__ quits (sid102627@gateway/web/irccloud.com/x-qbvavchptiwverik) (Ping timeout: 258 seconds) |
| 2021-04-23 10:05:27 | × | graingert quits (sid128301@gateway/web/irccloud.com/x-hbzbznvgopicjtxc) (Ping timeout: 260 seconds) |
| 2021-04-23 10:05:54 | → | rslima_____ joins (sid26145@gateway/web/irccloud.com/x-uuewewvxxbofrynk) |
| 2021-04-23 10:05:54 | → | kyagrd__ joins (sid102627@gateway/web/irccloud.com/x-rctrsarckkdvtebu) |
| 2021-04-23 10:05:57 | → | milessabin joins (sid86799@gateway/web/irccloud.com/x-yhagfzynbpqlfqnu) |
| 2021-04-23 10:06:56 | → | graingert joins (sid128301@gateway/web/irccloud.com/x-hzpuckilkrvcdlsz) |
| 2021-04-23 10:07:09 | × | mikoto-chan quits (~anass@gateway/tor-sasl/mikoto-chan) (Ping timeout: 240 seconds) |
| 2021-04-23 10:08:49 | × | geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 252 seconds) |
| 2021-04-23 10:09:22 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-23 10:09:55 | × | stree quits (~stree@68.36.8.116) (Ping timeout: 252 seconds) |
| 2021-04-23 10:10:10 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:10:30 | <junkicide> | hello, I have a question about defining the correct type signature for my main function |
| 2021-04-23 10:12:06 | <junkicide> | It takes 3 strings (which are just integers separated by spaces) as input and as output gives 1 float |
| 2021-04-23 10:13:22 | <junkicide> | So would the correct signature be main:: IO() String -> String -> String -> Float? |
| 2021-04-23 10:14:03 | <junkicide> | Could someone explain this please? |
| 2021-04-23 10:14:13 | <thblt> | junkicide: no, main doesn't take arguments. main :: IO () |
| 2021-04-23 10:14:17 | <gnumonic> | if it's the main function of the module it has to be IO () |
| 2021-04-23 10:14:38 | <thblt> | junkicide: if you want to read arguments from the command-line, use System.Environment.getArgs |
| 2021-04-23 10:15:47 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 265 seconds) |
| 2021-04-23 10:16:01 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:17:43 | <thblt> | junkicide: as an aside, () is a type, so IO () String would be invalid anyway. |
| 2021-04-23 10:18:09 | <junkicide> | thanks @gnumonic and @thblt |
| 2021-04-23 10:18:10 | → | heatsink joins (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 2021-04-23 10:18:42 | → | Guest6509 joins (~laudiacay@67.176.215.84) |
| 2021-04-23 10:18:49 | × | pyface quits (~me@about/security/contributor/pyface) (Remote host closed the connection) |
| 2021-04-23 10:19:35 | <gnumonic> | also, IO () means "this function doesn't return any values", so that's the type of every function that just performs an IO effect. an IO String function is a function that (might) perform IO effects but returns a string as well |
| 2021-04-23 10:20:10 | <junkicide> | i see, thanks for the explanations! |
| 2021-04-23 10:21:28 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-23 10:21:53 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:22:03 | <gnumonic> | and, just because this is useful to know if you're starting out, anything that's in IO has to *stay* in IO. So you can't (ok, you *shouldn't*, it's technically possible but almost always a bad idea) write a function of type IO String -> String. once something's IO-ified it stays that way. idk if that's useful atm but it's an important thing to be aware of |
| 2021-04-23 10:22:25 | → | stree joins (~stree@68.36.8.116) |
| 2021-04-23 10:22:44 | → | miklcct joins (quasselcor@2001:19f0:7402:d31:5400:3ff:fe51:a0cd) |
| 2021-04-23 10:22:45 | × | heatsink quits (~heatsink@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2021-04-23 10:23:07 | × | Guest6509 quits (~laudiacay@67.176.215.84) (Ping timeout: 252 seconds) |
| 2021-04-23 10:23:12 | <thblt> | junkicide: Also that's just me, but I'm not too fan of String -> String -> String -> Float. If your strings are lists of int waiting to be parsed, I'd have parseStr :: String -> Maybe Int and compute :: [Int] -> [Int] -> [Int] -> Float |
| 2021-04-23 10:24:13 | × | miklcct quits (quasselcor@2001:19f0:7402:d31:5400:3ff:fe51:a0cd) (Client Quit) |
| 2021-04-23 10:25:01 | <gnumonic> | or if for some reason you always have sets of 3 strings, make a data type for it. data ThreeStrings = ThreeStrings String String String or something. big strength of haskell is that it lets you organize data in a very well-defined way |
| 2021-04-23 10:25:35 | → | miklcct joins (quasselcor@2001:19f0:7402:d31:5400:3ff:fe51:a0cd) |
| 2021-04-23 10:25:52 | <gnumonic> | though probably thblt's suggestion is better for what you're trying to do |
| 2021-04-23 10:25:52 | <thblt> | (But maybe get your program to compile and run before you burden yourself with those design details) |
| 2021-04-23 10:26:21 | <thblt> | ((That's be parseStr :: String -> Maybe [Int] Sorry)) |
| 2021-04-23 10:28:07 | × | Sarcarean quits (4582bfd4@h69-130-191-212.bendor.broadband.dynamic.tds.net) (Quit: Connection closed) |
| 2021-04-23 10:28:27 | → | aVikingTrex joins (~aVikingTr@2001:8003:340d:d00:b2de:b98:7a93:b0ea) |
| 2021-04-23 10:28:48 | → | kiweun joins (~kiweun@2607:fea8:2a62:9600:d0ef:1415:4773:eee7) |
| 2021-04-23 10:31:31 | → | Synthetica joins (uid199651@gateway/web/irccloud.com/x-hcuaynfkuabsmonx) |
| 2021-04-23 10:32:32 | → | ddellacosta joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-04-23 10:32:33 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 2021-04-23 10:33:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:33:23 | × | kiweun quits (~kiweun@2607:fea8:2a62:9600:d0ef:1415:4773:eee7) (Ping timeout: 248 seconds) |
| 2021-04-23 10:34:17 | → | idhugo_ joins (~idhugo@87-49-147-45-mobile.dk.customer.tdc.net) |
| 2021-04-23 10:36:26 | × | junkicide quits (~user@37.164.172.175) (Remote host closed the connection) |
| 2021-04-23 10:37:42 | × | ddellacosta quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 260 seconds) |
| 2021-04-23 10:38:31 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-04-23 10:39:00 | × | ukari quits (~ukari@unaffiliated/ukari) (Remote host closed the connection) |
| 2021-04-23 10:39:10 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:39:32 | → | ukari joins (~ukari@unaffiliated/ukari) |
| 2021-04-23 10:42:04 | → | mikoto-chan joins (~anass@gateway/tor-sasl/mikoto-chan) |
| 2021-04-23 10:43:01 | → | philderbeast joins (~textual@bras-base-vldvpq5901w-grc-06-184-144-244-252.dsl.bell.ca) |
| 2021-04-23 10:44:06 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 2021-04-23 10:45:19 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-04-23 10:47:52 | × | Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Quit: WeeChat 2.8) |
| 2021-04-23 10:48:06 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 2021-04-23 10:48:09 | × | Mrbuck quits (~Mrbuck@gateway/tor-sasl/mrbuck) (Remote host closed the connection) |
| 2021-04-23 10:48:56 | → | Mrbuck joins (~Mrbuck@gateway/tor-sasl/mrbuck) |
| 2021-04-23 10:50:53 | × | nut quits (~gtk@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Quit: WeeChat 2.8) |
| 2021-04-23 10:50:54 | <gnumonic> | Is there anything like a typelevel strictness annotation or some other way to force typelevel "functions" (aka :: k ~> k, the defunctionalized thingies from singletons) into a normal form? |
| 2021-04-23 10:51:10 | → | nut joins (~gtk@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 2021-04-23 10:51:33 | × | jonathanx quits (~jonathan@h-176-109.A357.priv.bahnhof.se) (Remote host closed the connection) |
| 2021-04-23 10:51:36 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Remote host closed the connection) |
| 2021-04-23 10:52:21 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-04-23 10:52:53 | → | jonathanx joins (~jonathan@h-176-109.A357.priv.bahnhof.se) |
| 2021-04-23 10:54:49 | × | srk quits (~sorki@unaffiliated/srk) (Ping timeout: 250 seconds) |
| 2021-04-23 10:56:23 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 2021-04-23 10:56:53 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Ping timeout: 246 seconds) |
| 2021-04-23 10:57:27 | → | timCF joins (~i.tkachuk@200-149-20-81.sta.estpak.ee) |
| 2021-04-23 11:00:15 | → | srk joins (~sorki@unaffiliated/srk) |
| 2021-04-23 11:00:30 | <timCF> | Hello guys! I have a kinda weird question. Why mappend (<>) is working for Either exactly the same way like Alternative (<|>) for almost all other "types" like Maybe or ExceptT? |
| 2021-04-23 11:00:46 | → | Kaiepi joins (~Kaiepi@47.54.252.148) |
| 2021-04-23 11:01:45 | × | leah2 quits (~leah@2001:1410:200:eea::1) (Ping timeout: 250 seconds) |
| 2021-04-23 11:03:35 | <timCF> | I know that (<>) for Either fits types and law of Semigroup, but for me it personally feels like mode Alternative (<|>) according to what it's actually doing. |
| 2021-04-23 11:03:59 | × | Kaiepi quits (~Kaiepi@47.54.252.148) (Read error: Connection reset by peer) |
| 2021-04-23 11:03:59 | → | Kaeipi joins (~Kaiepi@47.54.252.148) |
| 2021-04-23 11:04:31 | → | idhugo__ joins (~idhugo@87-49-45-4-mobile.dk.customer.tdc.net) |
| 2021-04-23 11:05:27 | → | leah2 joins (~leah@vuxu.org) |
| 2021-04-23 11:05:47 | <merijn> | timCF: Fun fact, <|> *is* a monoid, but on a different type :p |
| 2021-04-23 11:05:49 | <enikar> | notice, ExceptT is build from Either, and (Maybe a) is equivalent to (Either () a) |
All times are in UTC.