Logs: freenode/#haskell
| 2020-09-27 13:32:24 | <p0a> | aha, thank you |
| 2020-09-27 13:32:32 | <p0a> | that makes sense |
| 2020-09-27 13:35:25 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-09-27 13:38:22 | <p0a> | how can I `let' a function? a named lambda? |
| 2020-09-27 13:38:40 | <p0a> | oh nevermind, let f = (\x -> ..) |
| 2020-09-27 13:39:04 | <xsperry> | which is the same as let f x = .. |
| 2020-09-27 13:39:39 | <xsperry> | > let f x = x * x in f 10 |
| 2020-09-27 13:39:42 | <lambdabot> | 100 |
| 2020-09-27 13:39:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-27 13:40:18 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2020-09-27 13:41:11 | → | snakemasterflex joins (~snakemast@213.100.206.23) |
| 2020-09-27 13:41:19 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-27 13:41:54 | <p0a> | oh thank you xsperry |
| 2020-09-27 13:42:13 | × | random quits (~random@185.219.70.106) (Ping timeout: 264 seconds) |
| 2020-09-27 13:42:26 | <xsperry> | np |
| 2020-09-27 13:43:55 | × | polyrain quits (~polyrain@2001:8003:e501:6901:5c8b:e3a:4e9b:3df8) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-09-27 13:44:36 | → | polyrain joins (~polyrain@2001:8003:e501:6901:5c8b:e3a:4e9b:3df8) |
| 2020-09-27 13:44:37 | × | xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 264 seconds) |
| 2020-09-27 13:44:55 | × | polyrain quits (~polyrain@2001:8003:e501:6901:5c8b:e3a:4e9b:3df8) (Client Quit) |
| 2020-09-27 13:45:03 | × | mirrorbird quits (~psutcliff@h85-8-41-6.cust.a3fiber.se) (Ping timeout: 265 seconds) |
| 2020-09-27 13:45:26 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds) |
| 2020-09-27 13:45:27 | × | snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 240 seconds) |
| 2020-09-27 13:45:40 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 246 seconds) |
| 2020-09-27 13:47:46 | × | rcdilorenzo quits (~rcdiloren@cpe-76-182-87-188.nc.res.rr.com) (Quit: rcdilorenzo) |
| 2020-09-27 13:48:00 | → | rcdilorenzo joins (~rcdiloren@cpe-76-182-87-188.nc.res.rr.com) |
| 2020-09-27 13:49:59 | → | geekosaur joins (ae68c070@cpe-174-104-192-112.neo.res.rr.com) |
| 2020-09-27 13:51:10 | → | Sheilong joins (uid293653@gateway/web/irccloud.com/x-zzdfhwhqcgnnihzq) |
| 2020-09-27 13:51:27 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-27 13:52:18 | × | rcdilorenzo quits (~rcdiloren@cpe-76-182-87-188.nc.res.rr.com) (Client Quit) |
| 2020-09-27 13:52:35 | → | rcdilorenzo joins (~rcdiloren@cpe-76-182-87-188.nc.res.rr.com) |
| 2020-09-27 13:53:26 | × | ksamak quits (~ksamak@178.162.212.214) (Remote host closed the connection) |
| 2020-09-27 13:55:07 | × | drbean quits (~drbean@TC210-63-209-205.static.apol.com.tw) (Ping timeout: 246 seconds) |
| 2020-09-27 13:55:47 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-09-27 13:56:23 | × | mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Ping timeout: 244 seconds) |
| 2020-09-27 13:57:21 | × | shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection) |
| 2020-09-27 13:57:49 | → | snakemasterflex joins (~snakemast@213.100.206.23) |
| 2020-09-27 13:58:07 | × | coot quits (~coot@37.30.52.6.nat.umts.dynamic.t-mobile.pl) (Quit: coot) |
| 2020-09-27 13:59:56 | → | mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh) |
| 2020-09-27 14:00:20 | × | andreas303 quits (~andreas@gateway/tor-sasl/andreas303) (Remote host closed the connection) |
| 2020-09-27 14:01:37 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-27 14:02:41 | → | Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-157-9.dhcp-dynamic.fibreop.nb.bellaliant.net) |
| 2020-09-27 14:03:09 | → | shatriff joins (~vitaliish@176.52.219.10) |
| 2020-09-27 14:03:44 | <p0a> | Is there a function f :: Maybe a -> a with f (Just x) = x? Partially defined |
| 2020-09-27 14:03:51 | <p0a> | or must I pattern match every time I want to do that? |
| 2020-09-27 14:03:52 | → | andreas303 joins (~andreas@gateway/tor-sasl/andreas303) |
| 2020-09-27 14:03:57 | <[exa]> | something like fromJust ? |
| 2020-09-27 14:04:02 | <p0a> | nice, thank you |
| 2020-09-27 14:04:27 | <[exa]> | there's a whole heap of such easy matchers in Data.Maybe |
| 2020-09-27 14:05:13 | <[exa]> | you might like fromMaybe which has "default a" |
| 2020-09-27 14:06:03 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-09-27 14:06:06 | <p0a> | sure. I like mapMaybe the best I think |
| 2020-09-27 14:08:59 | × | shatriff quits (~vitaliish@176.52.219.10) (Remote host closed the connection) |
| 2020-09-27 14:09:13 | → | shatriff joins (~vitaliish@176.52.219.10) |
| 2020-09-27 14:09:26 | <[exa]> | dodging manual conditions is great |
| 2020-09-27 14:09:45 | <[exa]> | also, Maybe monoids are monoids |
| 2020-09-27 14:10:03 | <p0a> | right now I'm having a bit of trouble figuring out how to dodge this |
| 2020-09-27 14:10:13 | <p0a> | but it's not hte end of the world I can just write some bad looking code |
| 2020-09-27 14:10:36 | <[exa]> | well after having something that works you can ask hlint for a hint |
| 2020-09-27 14:10:44 | <p0a> | that's a good idea |
| 2020-09-27 14:11:18 | <[exa]> | (...or just paste it here and have it torn to pieces and reduced to half-line combination of arrows and lens magic, as usual.) |
| 2020-09-27 14:11:45 | <[exa]> | (I forgot to add "incomprehensible" to the above description) |
| 2020-09-27 14:12:11 | <p0a> | Sure I can tell you |
| 2020-09-27 14:12:23 | <p0a> | I am searching a list for x and -x. Only one can be found (but one will certainly be present) |
| 2020-09-27 14:12:33 | <p0a> | and I want the result to be f x or (- f x) accordingly |
| 2020-09-27 14:12:44 | <p0a> | Sorry, I mean, either f x or (- f (- x)) |
| 2020-09-27 14:12:52 | <p0a> | Let's say f is only defined for x > 0 |
| 2020-09-27 14:13:48 | <p0a> | Maybe 2 'case of' will work out |
| 2020-09-27 14:14:03 | <[exa]> | so you have a list of whatever that contains at least one of (x) and (-x) for some specified x? |
| 2020-09-27 14:14:23 | <[exa]> | s/at least/exactly |
| 2020-09-27 14:14:26 | <p0a> | yeah |
| 2020-09-27 14:14:37 | <p0a> | well the list only contains positive x's. The x I have may be positive or negative |
| 2020-09-27 14:14:42 | <[exa]> | you might want to use list comprehensions |
| 2020-09-27 14:15:29 | × | BalterNotz quits (ca420871@202.66.8.113) (Ping timeout: 245 seconds) |
| 2020-09-27 14:15:37 | <[exa]> | or just filter with abs, that might be even neater |
| 2020-09-27 14:16:23 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-27 14:16:30 | <[exa]> | then extract head of the list (or patternmatch it to a singleton list if you wanna be triple-sure), apply `f`, done. |
| 2020-09-27 14:16:46 | <p0a> | I think I have a workable function I can paste now |
| 2020-09-27 14:16:50 | <[exa]> | ok |
| 2020-09-27 14:17:57 | <[exa]> | we've got a shiny new pastebing at https://paste.tomsmeding.com/ btw |
| 2020-09-27 14:18:02 | <[exa]> | *pastebin |
| 2020-09-27 14:18:08 | <p0a> | okay le tme use htat |
| 2020-09-27 14:18:35 | <p0a> | https://paste.tomsmeding.com/3PTXPmjI |
| 2020-09-27 14:19:03 | <[exa]> | oh noes this is with floats. :] |
| 2020-09-27 14:19:22 | <p0a> | floats? :) |
| 2020-09-27 14:19:38 | <p0a> | oh you mean it's not integers, right |
| 2020-09-27 14:19:43 | <p0a> | it's matrices in fact |
| 2020-09-27 14:19:54 | → | xerox_ joins (~xerox@unaffiliated/xerox) |
| 2020-09-27 14:20:45 | <p0a> | are you saying that == fails because they're Double's? maybe that's true, although the calculations are binary (either 0 or 1) |
| 2020-09-27 14:21:05 | × | kritzefitz quits (~kritzefit@212.86.56.80) (Ping timeout: 240 seconds) |
| 2020-09-27 14:21:49 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-27 14:22:28 | <[exa]> | if the calculation is binary you might really want to say it's Int |
| 2020-09-27 14:22:55 | <p0a> | yeah you are right |
| 2020-09-27 14:23:07 | <[exa]> | (==) tends to fail in completely non-algebraic ways with floats&doubles, more precisely you can forget that it holds through associative&distributive laws |
| 2020-09-27 14:24:20 | <p0a> | I remember my professor chewing me with questions from ieee754 before |
| 2020-09-27 14:24:37 | <[exa]> | general advice is to avoid ieee754 questions. :] |
| 2020-09-27 14:24:56 | <int-e> | "general" |
| 2020-09-27 14:25:52 | <p0a> | I held ground for a bit, but eventually resolved to saying something like "we need more bytes?" |
| 2020-09-27 14:26:05 | × | knupfer quits (~Thunderbi@200116b824c86d00d435c8b89e73e911.dip.versatel-1u1.de) (Quit: knupfer) |
| 2020-09-27 14:26:12 | → | knupfer joins (~Thunderbi@200116b824c86d008116bda35d13d85e.dip.versatel-1u1.de) |
| 2020-09-27 14:26:36 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 272 seconds) |
All times are in UTC.