Logs on 2021-12-29 (liberachat/#haskell)
| 00:01:37 | × | max22- quits (~maxime@2a01cb088335980068088847c57fd3ba.ipv6.abo.wanadoo.fr) (Remote host closed the connection) |
| 00:07:16 | <monochrom> | Well, it is always important to consider the whole file. |
| 00:07:43 | <monochrom> | Equivalently, if other people can't reproduce the error, no one can diagnose it. |
| 00:09:26 | × | rito_ quits (~rito_gh@45.112.243.151) (Ping timeout: 268 seconds) |
| 00:09:46 | → | stef204 joins (~stef204@user/stef204) |
| 00:11:06 | × | sirlensalot quits (~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot) |
| 00:11:45 | dan-so | is now known as danso |
| 00:11:50 | → | sirlensalot joins (~sirlensal@ool-44c5f8c9.dyn.optonline.net) |
| 00:17:28 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 00:19:39 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 00:20:47 | × | Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 256 seconds) |
| 00:22:51 | <madjestic> | edwardk: do you know a code example, using Capretta's iterative monad? https://hackage.haskell.org/package/free-5.1.7/docs/Control-Monad-Trans-Iter.html#g:2 |
| 00:25:35 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 00:25:35 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 00:25:35 | → | wroathe joins (~wroathe@user/wroathe) |
| 00:26:24 | × | vicfred quits (~vicfred@user/vicfred) (Quit: Leaving) |
| 00:26:32 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.3) |
| 00:28:57 | × | otherwise quits (~otherwise@c-71-231-39-206.hsd1.wa.comcast.net) (Ping timeout: 240 seconds) |
| 00:29:23 | × | superstar64 quits (~superstar@2600:1700:ed80:50a0:d250:99ff:fe2c:53c4) (Quit: Leaving) |
| 00:33:54 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 00:34:23 | → | otherwise joins (~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) |
| 00:40:32 | → | ksqsf joins (~user@134.209.106.31) |
| 00:41:02 | <edwardk> | madjestic: interleaving computations is always a winner |
| 00:41:33 | <edwardk> | also running 'divergent' computations with a fixed amount of gas. |
| 00:41:42 | <edwardk> | er potentially divergent |
| 00:45:02 | <madjestic> | edwardk: that sounds cool. I noticed that there's a link to a paper on the topic, is that the best source of relevant code examples? |
| 00:47:38 | → | zincy joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com) |
| 00:52:02 | × | zincy quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Ping timeout: 240 seconds) |
| 00:56:57 | × | YoungFrog quits (~youngfrog@39.129-180-91.adsl-dyn.isp.belgacom.be) (Ping timeout: 240 seconds) |
| 00:57:21 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 01:00:23 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 01:02:11 | <ksqsf> | just discovered #haskell-in-depth, but it does not appear to have any public logging? |
| 01:04:16 | <geekosaur> | only #haskell ever has |
| 01:04:46 | <geekosaur> | it could probably be added but it doesn't get used much, was basically copied over from freenode where it also wasn't used much |
| 01:05:09 | <ksqsf> | :( |
| 01:05:18 | <geekosaur> | it was an attempt to get the category theory / dependent types / etc. folks to leave #haskell alone, which failed |
| 01:08:15 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 01:08:38 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 01:08:57 | × | raehik quits (~raehik@cpc95906-rdng25-2-0-cust156.15-3.cable.virginm.net) (Ping timeout: 256 seconds) |
| 01:11:54 | × | albet70 quits (~xxx@2400:8902::f03c:92ff:fe60:98d8) (Remote host closed the connection) |
| 01:12:03 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Quit: WeeChat 3.3) |
| 01:12:31 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 01:13:13 | × | acidjnk quits (~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 01:17:02 | × | nattiestnate quits (~nate@114.122.107.61) (Quit: WeeChat 3.4) |
| 01:17:23 | → | nattiestnate joins (~nate@114.122.107.61) |
| 01:17:35 | <davean> | Oooh, this is where we can talk about Linear Haskell? |
| 01:17:55 | <monochrom> | Yeah! :) |
| 01:18:01 | → | albet70 joins (~xxx@2400:8902::f03c:92ff:fe60:98d8) |
| 01:18:16 | <albet70> | how to split a list [1..6] to [[1,2], [3,4]...] |
| 01:18:36 | <geekosaur> | > chunksOf 2 [1..6] |
| 01:18:38 | <lambdabot> | [[1,2],[3,4],[5,6]] |
| 01:18:54 | <geekosaur> | (Data.List/Split in the split package) |
| 01:19:04 | <geekosaur> | er. Data.List.Split |
| 01:21:39 | <albet70> | thanks |
| 01:22:49 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 01:26:06 | <dsal> | > let chunky n = unfoldr (\b -> if null b then Nothing else let (x,xs) = splitAt n b in Just (x,xs)) in chunk 2 [1..9] |
| 01:26:08 | <lambdabot> | [[1,2],[3,4],[5,6],[7,8],[9]] |
| 01:26:30 | <dsal> | :t chunk |
| 01:26:31 | <lambdabot> | Int -> [e] -> [[e]] |
| 01:26:33 | <dsal> | ha. weird |
| 01:26:42 | <dsal> | > let chunky n = unfoldr (\b -> if null b then Nothing else let (x,xs) = splitAt n b in Just (x,xs)) in chunky 2 [1..9] |
| 01:26:44 | <lambdabot> | [[1,2],[3,4],[5,6],[7,8],[9]] |
| 01:27:47 | <dsal> | > let chunky n = unfoldr (\b -> if null b then Nothing else Just (splitAt n b)) in chunky 2 [1..9] |
| 01:27:48 | <lambdabot> | [[1,2],[3,4],[5,6],[7,8],[9]] |
| 01:29:34 | <dsal> | That if is not very satisfying. |
| 01:29:46 | × | Midjak quits (~Midjak@may53-1-78-226-116-92.fbx.proxad.net) (Quit: Leaving) |
| 01:31:15 | × | nattiestnate quits (~nate@114.122.107.61) (Quit: WeeChat 3.4) |
| 01:31:38 | → | nattiestnate joins (~nate@114.122.107.61) |
| 01:33:29 | <albet70> | > let _ arr = foldl1 (<>) $ (\x -> [x,x]) <$> [1..6] in (chunksOf 2) . init . tail $ _arr |
| 01:33:31 | <lambdabot> | <hint>:1:5: error: Parse error in pattern: _ |
| 01:34:04 | <albet70> | > let _arr = foldl1 (<>) $ (\x -> [x,x]) <$> [1..6] in (chunksOf 2) . init . tail $ _arr |
| 01:34:06 | <lambdabot> | [[1,2],[2,3],[3,4],[4,5],[5,6]] |
| 01:35:09 | <dsal> | > let l = [1..6] in zipWith (\a b -> [a,b]) l (tail l) |
| 01:35:11 | <lambdabot> | [[1,2],[2,3],[3,4],[4,5],[5,6]] |
| 01:35:30 | <dsal> | > let l = [1..6] in zip l (tail l) -- I'd just do this, though. |
| 01:35:31 | <lambdabot> | [(1,2),(2,3),(3,4),(4,5),(5,6)] |
| 01:37:14 | <ksqsf> | smth like well-founded recursion will probably be useful |
| 01:37:21 | <ksqsf> | chunksOf n = wf_recurse (take n) (drop n) |
| 01:37:43 | <dsal> | @hoogle wf_recurse |
| 01:37:44 | <lambdabot> | No results found |
| 01:37:52 | <ksqsf> | i just made it up |
| 01:38:04 | <dsal> | heh. I assumed, because who'd put a _ in a function name? :) |
| 01:38:45 | <dsal> | The anamorphism that I initially thought of above seems like a good starting point. That's basically splitAt. |
| 01:41:31 | <dsal> | > let wf_recurse f1 f2 = unfoldr (\b -> if null b then Nothing else Just (f1 b, f2 b)) ; cwf n = wf_recurse (take n) (drop n) in cwf 2 [1..6] |
| 01:41:33 | <lambdabot> | [[1,2],[3,4],[5,6]] |
| 01:42:38 | <albet70> | zip is better |
| 01:43:49 | <dsal> | Sure, zip will do the exact pairings thing, but this is more a series of thought experiments on reusable abstractions. :) |
| 01:46:02 | <albet70> | zip l (tail l) could express by <=< ? |
| 01:46:15 | <albet70> | :t (<=<) |
| 01:46:16 | <lambdabot> | Monad m => (b -> m c) -> (a -> m b) -> a -> m c |
| 01:47:15 | <albet70> | or >>= |
| 01:50:31 | <dsal> | > let l = [1..6] in [(a,b) | (a:xs) <- l, b <- xs] |
| 01:50:32 | <lambdabot> | error: |
| 01:50:32 | <lambdabot> | • No instance for (Num [()]) arising from a use of ‘e_116’ |
| 01:50:32 | <lambdabot> | • In the expression: e_116 |
| 01:50:35 | <dsal> | doh. |
| 01:50:46 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 01:51:27 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 01:51:50 | <dsal> | That requires listing the list elements. |
| 01:52:50 | <albet70> | (tail >>= zip) l == zip (tail l) l, how to change it to zip l (tail l)? flip (tail >>= zip) l? |
| 01:53:01 | → | ksqsf joins (~user@134.209.106.31) |
| 01:54:23 | <pfurla-matrix> | `(a:xs) <- l` is the same as `(a:xs) <- [1..6]`, do you see the problem here? |
| 01:54:35 | <otherwise> | is it possible to collapse comment blocks in .hs file? by this I mean, make them expandable and collapsable (like in Matlab) ? |
| 01:54:57 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds) |
| 01:55:21 | <pfurla-matrix> | otherwise: this on the editor not the language |
| 01:55:28 | <otherwise> | im using vim, so maybe that would be a feature in vim, rather than haskell specific? |
| 01:56:04 | <pfurla-matrix> | yep |
| 01:56:05 | <otherwise> | pfurla-matrix: aww, you beat me to it. yeah that makes sense. |
| 01:56:17 | <albet70> | f >>= g = \a -> g (f a) a, is there a function do \a -> g a (f a)? |
| 02:02:52 | <ksqsf> | :t (<*>) @((->) _) |
| 02:02:53 | <lambdabot> | error: parse error on input ‘->’ |
| 02:04:26 | <dsal> | @pl \a -> g a (f a) |
| 02:04:27 | <lambdabot> | ap g f |
| 02:04:37 | <ksqsf> | but it should parse though :( |
| 02:04:58 | <ksqsf> | this is the S combinator from SKI, and it corresponds to Applicative's (<*>) |
| 02:05:02 | <otherwise> | if you had to decide what the math prerequisites are for learning haskell, what would be your decree? |
| 02:05:20 | <dsal> | otherwise: I can barely add |
| 02:05:46 | <dsal> | :t ap |
| 02:05:47 | <lambdabot> | Monad m => m (a -> b) -> m a -> m b |
| 02:05:53 | <otherwise> | dsal says addition, fair enough. |
| 02:05:59 | <dsal> | :t (<@>) |
| 02:06:00 | <lambdabot> | error: |
| 02:06:00 | <lambdabot> | • Variable not in scope: <@> |
| 02:06:00 | <lambdabot> | • Perhaps you meant one of these: |
| 02:06:08 | <monochrom> | otherwise: My http://www.vex.net/~trebla/haskell/prerequisite.xhtml |
| 02:06:12 | <dsal> | Argh. Phone coding is hard |
| 02:06:28 | <monochrom> | "You can barely type." >:) |
| 02:06:36 | <dsal> | :t (<$>) |
| 02:06:37 | <lambdabot> | Functor f => (a -> b) -> f a -> f b |
| 02:06:43 | <dsal> | monochrom: ++ |
| 02:09:36 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 02:11:32 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Ping timeout: 240 seconds) |
| 02:13:32 | × | mmhat quits (~mmh@55d4c35d.access.ecotel.net) (Ping timeout: 240 seconds) |
| 02:14:29 | <albet70> | dsl, what is ap? applicative? |
| 02:15:49 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 02:17:05 | × | aplainze1akind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net) |
| 02:21:06 | × | Tuplanolla quits (~Tuplanoll@91-159-68-119.elisa-laajakaista.fi) (Quit: Leaving.) |
| 02:22:31 | <otherwise> | > rand(1) |
| 02:22:32 | <lambdabot> | error: |
| 02:22:32 | <lambdabot> | • Variable not in scope: rand :: t0 -> t |
| 02:22:32 | <lambdabot> | • Perhaps you meant ‘and’ (imported from Data.List) |
| 02:25:49 | × | sirlensalot quits (~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot) |
| 02:26:32 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds) |
| 02:27:11 | → | mmhat joins (~mmh@55d4bdde.access.ecotel.net) |
| 02:37:37 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds) |
| 02:39:57 | × | neurocyte0132889 quits (~neurocyte@user/neurocyte) (Ping timeout: 240 seconds) |
| 02:46:57 | → | sirlensalot joins (~sirlensal@ool-44c5f8c9.dyn.optonline.net) |
| 02:47:14 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 02:47:18 | × | xff0x quits (~xff0x@2001:1a81:5206:b200:83f6:7a30:b822:7720) (Ping timeout: 268 seconds) |
| 02:47:45 | × | nattiestnate quits (~nate@114.122.107.61) (Quit: WeeChat 3.4) |
| 02:48:06 | → | nattiestnate joins (~nate@114.122.107.61) |
| 02:48:38 | → | jinsun joins (~quassel@user/jinsun) |
| 02:48:46 | → | xff0x joins (~xff0x@2001:1a81:5243:1200:5225:5648:394c:3e8f) |
| 02:55:41 | × | lbseale quits (~ep1ctetus@user/ep1ctetus) (Read error: Connection reset by peer) |
| 02:55:47 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 02:58:02 | <dsal> | albet70: It's related, but the constraint is Monad |
| 02:58:50 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 03:00:22 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 260 seconds) |
| 03:01:04 | × | _xor quits (~xor@dsl-50-5-233-169.fuse.net) (Read error: Connection reset by peer) |
| 03:01:29 | → | _xor joins (~xor@dsl-50-5-233-169.fuse.net) |
| 03:01:55 | × | danso quits (~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Quit: WeeChat 3.3) |
| 03:04:27 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 03:06:17 | × | JimL quits (~quassel@89-162-2-132.fiber.signal.no) (Ping timeout: 240 seconds) |
| 03:09:45 | → | danso joins (~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) |
| 03:14:22 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 03:20:59 | × | kaph_ quits (~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Ping timeout: 256 seconds) |
| 03:21:34 | × | mmhat quits (~mmh@55d4bdde.access.ecotel.net) (Quit: WeeChat 3.4) |
| 03:21:39 | × | zaquest quits (~notzaques@5.130.79.72) (Remote host closed the connection) |
| 03:23:00 | → | zaquest joins (~notzaques@5.130.79.72) |
| 03:23:09 | × | nattiestnate quits (~nate@114.122.107.61) (Quit: WeeChat 3.4) |
| 03:25:06 | → | nattiestnate joins (~nate@114.122.104.173) |
| 03:26:01 | → | kaph joins (~kaph@net-2-38-107-19.cust.vodafonedsl.it) |
| 03:27:38 | → | lavaman joins (~lavaman@98.38.249.169) |
| 03:31:17 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds) |
| 03:32:08 | <albet70> | dsal, ap is related to >>=? |
| 03:32:12 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 03:32:12 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 03:32:12 | finn_elija | is now known as FinnElija |
| 03:32:19 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 03:33:22 | → | ksqsf joins (~user@134.209.106.31) |
| 03:36:43 | → | mbuf joins (~Shakthi@27.58.131.180) |
| 03:38:33 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 03:43:17 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds) |
| 03:44:44 | → | zebrag joins (~chris@user/zebrag) |
| 03:45:39 | <dsal> | albet70: ap is <*> with different constraints. |
| 03:47:02 | × | jinsun quits (~quassel@user/jinsun) (Ping timeout: 240 seconds) |
| 03:47:15 | → | ksqsf joins (~user@134.209.106.31) |
| 03:49:19 | × | werneta quits (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 03:51:02 | → | werneta joins (~werneta@70-142-214-115.lightspeed.irvnca.sbcglobal.net) |
| 03:52:40 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds) |
| 03:56:20 | <albet70> | dsal, ap g f = \a -> g a (f a), f >>= g = \a -> g (f a) a, how similar |
| 03:57:15 | × | td_ quits (~td@muedsl-82-207-238-177.citykom.de) (Ping timeout: 256 seconds) |
| 03:57:40 | <albet70> | g a (f a) = flip g (f a) a |
| 03:58:01 | → | jinsun joins (~quassel@user/jinsun) |
| 03:58:37 | <albet70> | wonder if >>= can be expressed with ap |
| 03:58:50 | → | td_ joins (~td@muedsl-82-207-238-009.citykom.de) |
| 03:59:54 | → | yauhsien joins (~yauhsien@118-167-42-25.dynamic-ip.hinet.net) |
| 04:00:27 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 04:01:18 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 268 seconds) |
| 04:03:53 | × | nattiestnate quits (~nate@114.122.104.173) (Quit: WeeChat 3.4) |
| 04:08:42 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 268 seconds) |
| 04:09:13 | → | ksqsf joins (~user@134.209.106.31) |
| 04:12:15 | <dsal> | albet70: monadic binding is more restrictive than applicative applicatating. |
| 04:14:52 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 268 seconds) |
| 04:16:57 | × | notzmv quits (~zmv@user/notzmv) (Ping timeout: 240 seconds) |
| 04:18:41 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 250 seconds) |
| 04:25:33 | × | pretty_dumm_guy quits (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) (Quit: WeeChat 3.4) |
| 04:26:27 | → | ksqsf joins (~user@134.209.106.31) |
| 04:28:05 | → | kotshie joins (~kotshie@68.72.208.140) |
| 04:29:26 | × | ksqsf quits (~user@134.209.106.31) (Remote host closed the connection) |
| 04:29:51 | → | ksqsf joins (~user@134.209.106.31) |
| 04:29:57 | × | jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 240 seconds) |
| 04:32:14 | → | jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com) |
| 04:38:55 | × | zebrag quits (~chris@user/zebrag) (Quit: Konversation terminated!) |
| 04:39:33 | <mjrosenb> | what's the relationship between haskell-language-server and ghcide? |
| 04:40:11 | × | hud quits (~hud@uwyo-129-72-161-67.uwyo.edu) (Ping timeout: 256 seconds) |
| 04:40:45 | <mjrosenb> | I'm asking in the context of bugs on hls discussing if something should go into ghcide or hls. |
| 04:47:35 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 04:52:30 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 04:57:38 | → | dolio joins (~dolio@130.44.130.54) |
| 05:00:17 | × | yauhsien quits (~yauhsien@118-167-42-25.dynamic-ip.hinet.net) (Ping timeout: 240 seconds) |
| 05:00:22 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 05:01:14 | × | bliminse quits (~bliminse@host86-186-4-210.range86-186.btcentralplus.com) (Ping timeout: 260 seconds) |
| 05:03:06 | → | bliminse joins (~bliminse@host86-186-17-7.range86-186.btcentralplus.com) |
| 05:04:27 | → | zincy joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com) |
| 05:05:04 | → | lavaman joins (~lavaman@98.38.249.169) |
| 05:13:21 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Remote host closed the connection) |
| 05:15:54 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 05:16:14 | → | geekosaur joins (~geekosaur@xmonad/geekosaur) |
| 05:23:35 | <otherwise> | can we make type declarations in prelude? |
| 05:25:40 | <dsal> | otherwise: sure, but things are going to get painful |
| 05:26:06 | <dsal> | (although… what do you mean by "prelude" here?") |
| 05:26:14 | <dsal> | Do you mean you want to modify Prelude? |
| 05:26:29 | <otherwise> | as in, with no .hs file loaded |
| 05:26:35 | <dsal> | You mean ghci? |
| 05:27:15 | <otherwise> | yes, in ghci |
| 05:27:38 | <dsal> | I assumed that's what you meant. You can do it, but you really shouldn't. Just do things in files. If you try to do things in ghci, it starts getting painful really quickly. |
| 05:27:40 | <otherwise> | I'm thinking "what else is there?", cause i'm a noob |
| 05:28:38 | <dsal> | ghci is just the interactive environment for messing around. It works similarly to what you might expect from a real program, but it's not the same, and it's not how you write useful programs. |
| 05:29:23 | <otherwise> | isnt ghci also what runs the real program? as in, the .hs file |
| 05:30:51 | × | zincy quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Ping timeout: 250 seconds) |
| 05:31:00 | <dsal> | No, none of my programs run using ghci. |
| 05:31:41 | <dsal> | A .hs file just defines a module. A program may consist of many modules which are compiled and tied together with a Main module which has a main function where execution begins. |
| 05:32:53 | <otherwise> | ... so do you execute you programs directly in terminal? |
| 05:32:57 | × | n3rdy1 quits (~n3rdy1@2601:281:c780:a510:9005:8349:e7c7:a7ad) (Ping timeout: 240 seconds) |
| 05:33:14 | <monochrom> | Are you asking the equivalent of: If you are learning C, you ask "can I modify my copy of /usr/include/stdio.h to add my own declarations so that every time I #include <stdio.h> I get my own additional declarations too so that I don't have to create my own .h file in my own directory and add a 2nd #include for it" |
| 05:33:57 | <monochrom> | The answer would be "it's your computer, but why such a fragile method" in the case of C. |
| 05:34:29 | <monochrom> | In the case of GHC, not easily. |
| 05:35:35 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 05:37:01 | <otherwise> | Hmm, I didn't really understand that to be honest. i figured since :t it shows the last value, there must be a similar memory bank in ghci that I can update with a type declaration for the sole purpose of practicing writing type declarartions. |
| 05:37:20 | <otherwise> | But it is easy enough to just make a new .hs file and mess around that way. |
| 05:37:43 | <monochrom> | You can enter "data F = G1 | G2 Int" into ghci. |
| 05:37:57 | <monochrom> | That is still not adding to Prelude. |
| 05:38:03 | <monochrom> | What an XY problem. |
| 05:38:06 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds) |
| 05:38:17 | <otherwise> | I'm afraid to based on dsals warning. haha |
| 05:38:42 | <monochrom> | Oh, I don't like to suggest it either. It doesn't scale. |
| 05:39:57 | <otherwise> | although data f = ... doesnt look like a type declaration that I recognize. I would have expected it to be data f :: ... |
| 05:40:02 | × | xff0x quits (~xff0x@2001:1a81:5243:1200:5225:5648:394c:3e8f) (Ping timeout: 240 seconds) |
| 05:40:57 | → | xff0x joins (~xff0x@2001:1a81:5243:1200:1c6b:9a74:5f29:30c0) |
| 05:41:42 | <otherwise> | i'm abandoning that idea for now. haha. There are better things to work on than that |
| 05:43:01 | → | mvk joins (~mvk@2607:fea8:5cdd:f000::917a) |
| 05:44:41 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 05:46:15 | → | deadmarshal joins (~deadmarsh@95.38.229.126) |
| 05:49:13 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 05:49:23 | <dsal> | otherwise: You just want to do it in a file. Same as other language with repls. You can do a lot of stuff in a python repl, but you don't run your program in a python repl. |
| 05:50:53 | <dsal> | But when you actually want to run a program, you'll compile it and have a normal binary like any other compiled language. |
| 05:51:53 | × | sirlensalot quits (~sirlensal@ool-44c5f8c9.dyn.optonline.net) (Quit: sirlensalot) |
| 05:55:01 | × | xff0x quits (~xff0x@2001:1a81:5243:1200:1c6b:9a74:5f29:30c0) (Ping timeout: 240 seconds) |
| 05:55:24 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 05:55:24 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 05:55:24 | → | wroathe joins (~wroathe@user/wroathe) |
| 05:56:09 | → | xff0x joins (~xff0x@2001:1a81:5243:1200:5779:89a5:a3f8:38a5) |
| 06:00:13 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 06:02:27 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 06:05:29 | → | alfonsox joins (~quassel@103.92.42.90) |
| 06:08:11 | <otherwise> | weird, I just did ghc file.hs. then ./file to run the executable, but I wasnt able to interact with it at all, it just printed a single line of text and I couldn't call any of the functions. |
| 06:08:43 | <dsal> | otherwise: What did you write your program to do? |
| 06:08:46 | <dsal> | Did you write a repl? |
| 06:08:57 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 06:10:29 | <otherwise> | https://paste.tomsmeding.com/ZDhJxIVt |
| 06:10:41 | <otherwise> | just a print line and a quicksort function |
| 06:10:49 | <dsal> | > putStrLn "Hello World" |
| 06:10:50 | <lambdabot> | <IO ()> |
| 06:10:55 | <dsal> | % putStrLn "Hello World" |
| 06:10:56 | <yahb> | dsal: Hello World |
| 06:11:02 | <dsal> | That's all your program is instructed to do. |
| 06:11:17 | <dsal> | It's not going to do things you don't tell it to do. :) |
| 06:11:53 | <otherwise> | Why doesn't it know what I want! |
| 06:11:57 | <otherwise> | j/k |
| 06:12:12 | <dsal> | If you want to write a repl for something, that's a harder problem. |
| 06:12:21 | <dsal> | Even ghci doesn't work correctly on my machine right now. :) |
| 06:18:42 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 260 seconds) |
| 06:31:33 | <ksqsf> | otherwise: It's much easier to use ghci in a properly configured editor. Like in Emacs, you can open a .hs file anywhere and press C-c C-l to start a ghci session. |
| 06:31:36 | → | KvL joins (~KvL@user/KvL) |
| 06:32:07 | <otherwise> | well, I tried to use emacs, yesterday, but now it is perpetually frozen open |
| 06:32:17 | <otherwise> | so my first impressions of emacs are not good |
| 06:32:23 | × | stef204 quits (~stef204@user/stef204) (Ping timeout: 268 seconds) |
| 06:32:40 | <otherwise> | I homebrew installed it, opened it, and then it was frozen |
| 06:33:50 | <otherwise> | ksqsf: despite my complaining, I'll certainly give a try what you explained, that sounds useful. |
| 06:34:28 | → | notzmv joins (~zmv@user/notzmv) |
| 06:35:10 | → | takuan joins (~takuan@178-116-218-225.access.telenet.be) |
| 06:35:32 | <otherwise> | for now I have Emacs minimized and I act like its not there, frozen... |
| 06:39:41 | → | jtomas joins (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) |
| 06:42:25 | × | spaceseller quits (~spacesell@31.147.205.13) (Quit: Leaving) |
| 06:47:12 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 06:49:27 | → | whatsupdoc joins (uid509081@id-509081.hampstead.irccloud.com) |
| 06:52:07 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 06:54:47 | <mjrosenb> | otherwise: I've found graphical emacs on MacOS to be a bit fiddly. |
| 06:54:57 | <mjrosenb> | otherwise: it works great in the terminal though. |
| 06:55:42 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 06:55:42 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 06:55:42 | → | wroathe joins (~wroathe@user/wroathe) |
| 06:58:21 | <otherwise> | oh I didnt know I could load in terminal. thanks! :) |
| 07:00:45 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 07:02:22 | <mjrosenb> | emacs -nw will open it in the terminal. |
| 07:02:26 | × | burnsidesLlama quits (~burnsides@dhcp168-010.wadham.ox.ac.uk) (Remote host closed the connection) |
| 07:02:28 | × | shriekingnoise quits (~shrieking@186.137.144.80) (Quit: Quit) |
| 07:02:58 | → | burnsidesLlama joins (~burnsides@client-8-79.eduroam.oxuni.org.uk) |
| 07:04:44 | × | slowButPresent quits (~slowButPr@user/slowbutpresent) (Quit: leaving) |
| 07:06:26 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 07:07:32 | × | burnsidesLlama quits (~burnsides@client-8-79.eduroam.oxuni.org.uk) (Ping timeout: 268 seconds) |
| 07:11:37 | <otherwise> | mjrosenb: it works! :) |
| 07:11:53 | <mjrosenb> | Is there a way to "tweak" the show instance auto-generated by deriving Show? I have a datatype with like 20 cases, 19 of which I want the default, and the other one, I need some custom logic. |
| 07:12:47 | → | YoungFrog joins (~youngfrog@2a02:a03f:c21b:f900:75de:a4d8:aac6:c5de) |
| 07:16:45 | <cheater> | deriving via? |
| 07:22:21 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 268 seconds) |
| 07:23:38 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 07:24:00 | mjrosenb | investigates deriving via |
| 07:24:36 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Client Quit) |
| 07:31:17 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds) |
| 07:35:42 | × | jle` quits (~jle`@cpe-23-240-75-236.socal.res.rr.com) (Ping timeout: 260 seconds) |
| 07:37:31 | → | jle` joins (~jle`@cpe-23-240-75-236.socal.res.rr.com) |
| 07:39:30 | → | falafel joins (~falafel@2603-8000-d800-688c-6db4-c125-f693-41cb.res6.spectrum.com) |
| 07:44:09 | <alfonsox> | what is correct way to load read say first 10 lines from txt file in ghci ? |
| 07:44:32 | <alfonsox> | im <- readFile "hello.txt" |
| 07:44:38 | <alfonsox> | above line works |
| 07:44:56 | <xerox> | :t \filename -> take 10 . lines <$> readFile filename |
| 07:44:56 | <alfonsox> | take 10 $ lines im |
| 07:44:57 | <lambdabot> | FilePath -> IO [String] |
| 07:45:00 | <alfonsox> | this also works |
| 07:45:40 | <alfonsox> | but the moment I try to assign it to some var using let, I get error. |
| 07:45:58 | → | Gurkenglas joins (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) |
| 07:46:16 | <alfonsox> | let ilines = take 10 $ lines im |
| 07:46:21 | <alfonsox> | then I get parse error |
| 07:47:05 | <xerox> | alfonsox: something like this? https://pastebin.com/raw/wHZSYdVB |
| 07:49:28 | × | jtomas quits (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) (Ping timeout: 268 seconds) |
| 07:49:52 | → | alan[m]1 joins (~alangmatr@2001:470:69fc:105::b489) |
| 07:50:48 | <alfonsox> | thanks. that works. |
| 07:53:54 | → | _ht joins (~quassel@82-169-194-8.biz.kpn.net) |
| 07:54:03 | × | amk quits (~amk@109.255.169.126) (Ping timeout: 250 seconds) |
| 07:54:50 | <xerox> | wonder what was going wrong for you, I did the same thing you said |
| 07:56:12 | → | amk joins (~amk@109.255.169.126) |
| 07:56:54 | → | coolnickname joins (uid531864@user/coolnickname) |
| 07:58:29 | <alfonsox> | running ghci in emacs |
| 07:58:42 | <alfonsox> | was not working first time |
| 07:59:29 | → | paolino joins (~paolo@5.157.115.53) |
| 08:00:17 | × | paolino quits (~paolo@5.157.115.53) (Client Quit) |
| 08:02:12 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 08:02:20 | alan[m]1 | is now known as grabb0id[m] |
| 08:02:43 | × | KvL quits (~KvL@user/KvL) (Ping timeout: 250 seconds) |
| 08:05:44 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 08:07:29 | × | zmt01 quits (~zmt00@user/zmt00) (Ping timeout: 250 seconds) |
| 08:09:50 | × | Akiva quits (~Akiva@user/Akiva) (Ping timeout: 268 seconds) |
| 08:12:04 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 08:27:05 | × | kaph quits (~kaph@net-2-38-107-19.cust.vodafonedsl.it) (Read error: Connection reset by peer) |
| 08:27:17 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Ping timeout: 240 seconds) |
| 08:27:22 | <albet70> | f >>= g = \a -> g (f a) a, is there \a -> g a (f a) |
| 08:29:52 | → | ksqsf joins (~user@134.209.106.31) |
| 08:30:05 | <albet70> | ap f g = \a -> f a (g a), is there \a -> f (g a) a? |
| 08:31:13 | <ksqsf> | @pl \a -> f (g a) a |
| 08:31:13 | <lambdabot> | f =<< g |
| 08:32:22 | <albet70> | @pl \a -> g a (f a) |
| 08:32:22 | <lambdabot> | ap g f |
| 08:32:24 | → | kaph joins (~kaph@net-2-38-107-19.cust.vodafonedsl.it) |
| 08:32:37 | × | Sgeo quits (~Sgeo@user/sgeo) (Read error: Connection reset by peer) |
| 08:39:25 | <dibblego> | f <*> g |
| 08:39:49 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 08:40:00 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 08:43:17 | × | falafel quits (~falafel@2603-8000-d800-688c-6db4-c125-f693-41cb.res6.spectrum.com) (Ping timeout: 240 seconds) |
| 08:43:40 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection) |
| 08:43:51 | → | zincy joins (~zincy@host86-151-99-97.range86-151.btcentralplus.com) |
| 08:45:27 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 08:49:38 | → | nhatanh02 joins (~satori@123.24.172.30) |
| 08:55:49 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 08:56:29 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 08:56:29 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 08:56:29 | → | wroathe joins (~wroathe@user/wroathe) |
| 09:00:53 | → | acidjnk joins (~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) |
| 09:01:33 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 09:02:10 | × | zincy quits (~zincy@host86-151-99-97.range86-151.btcentralplus.com) (Remote host closed the connection) |
| 09:02:27 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 09:02:31 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 09:03:17 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 09:08:55 | × | vglfr quits (~vglfr@46.96.129.172) (Ping timeout: 256 seconds) |
| 09:14:35 | → | jtomas joins (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) |
| 09:14:59 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 09:17:42 | → | allbery_b joins (~geekosaur@xmonad/geekosaur) |
| 09:17:42 | × | geekosaur quits (~geekosaur@xmonad/geekosaur) (Killed (NickServ (GHOST command used by allbery_b))) |
| 09:17:45 | allbery_b | is now known as geekosaur |
| 09:19:11 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 09:23:17 | × | jonathanx quits (~jonathan@h-178-174-176-109.A357.priv.bahnhof.se) (Ping timeout: 240 seconds) |
| 09:25:11 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 09:25:24 | → | Vajb joins (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) |
| 09:28:17 | × | machinedgod quits (~machinedg@24.105.81.50) (Ping timeout: 240 seconds) |
| 09:29:41 | × | Vajb quits (~Vajb@hag-jnsbng11-58c3a8-176.dhcp.inet.fi) (Read error: Connection reset by peer) |
| 09:30:27 | × | deadmarshal quits (~deadmarsh@95.38.229.126) (Ping timeout: 256 seconds) |
| 09:30:40 | × | SoF quits (~skius@user/skius) (Remote host closed the connection) |
| 09:30:50 | → | gehmehgeh joins (~user@user/gehmehgeh) |
| 09:30:53 | → | deadmarshal joins (~deadmarsh@95.38.116.44) |
| 09:41:17 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds) |
| 09:45:33 | → | lavaman joins (~lavaman@98.38.249.169) |
| 09:46:36 | → | max22- joins (~maxime@2a01cb08833598005a91b2768a285f6e.ipv6.abo.wanadoo.fr) |
| 09:49:19 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 09:49:24 | × | spaceseller quits (~spacesell@31.147.205.13) (Remote host closed the connection) |
| 09:49:42 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Quit: Leaving) |
| 09:50:17 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 09:55:43 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection) |
| 09:56:51 | → | MoC joins (~moc@user/moc) |
| 10:00:11 | → | cosimone joins (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) |
| 10:00:53 | → | jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net) |
| 10:03:23 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 10:06:57 | × | joo-_ quits (~joo-_@fsf/member/joo--) (Ping timeout: 240 seconds) |
| 10:07:44 | × | tzh quits (~tzh@c-24-21-73-154.hsd1.wa.comcast.net) (Quit: zzz) |
| 10:09:08 | → | joo-_ joins (~joo-_@80-62-117-1-mobile.dk.customer.tdc.net) |
| 10:09:08 | × | joo-_ quits (~joo-_@80-62-117-1-mobile.dk.customer.tdc.net) (Changing host) |
| 10:09:08 | → | joo-_ joins (~joo-_@fsf/member/joo--) |
| 10:11:41 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 10:18:42 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 10:19:13 | × | jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 250 seconds) |
| 10:25:59 | → | Lord_of_Life_ joins (~Lord@user/lord-of-life/x-2819915) |
| 10:26:32 | → | cfricke joins (~cfricke@user/cfricke) |
| 10:26:32 | × | Lord_of_Life quits (~Lord@user/lord-of-life/x-2819915) (Ping timeout: 240 seconds) |
| 10:26:55 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 10:27:16 | Lord_of_Life_ | is now known as Lord_of_Life |
| 10:28:50 | × | nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 260 seconds) |
| 10:29:13 | → | nhatanh02 joins (~satori@123.24.172.30) |
| 10:35:36 | → | __monty__ joins (~toonn@user/toonn) |
| 10:38:46 | → | neurocyte0132889 joins (~neurocyte@user/neurocyte) |
| 10:43:46 | → | rito_ joins (~rito_gh@45.112.243.151) |
| 10:43:52 | × | otherwise quits (~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) () |
| 10:45:58 | × | coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity) |
| 10:46:06 | → | cstml joins (~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) |
| 10:47:12 | × | cstml quits (~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) (Client Quit) |
| 10:48:09 | × | jinsun quits (~quassel@user/jinsun) (Read error: Connection reset by peer) |
| 10:50:23 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 10:51:15 | → | coolnickname joins (uid531864@user/coolnickname) |
| 10:53:15 | → | jinsun joins (~quassel@user/jinsun) |
| 10:55:40 | → | cstml joins (~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) |
| 10:57:16 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 10:57:16 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 10:57:16 | → | wroathe joins (~wroathe@user/wroathe) |
| 11:01:12 | × | cstml quits (~cstml@2a02:a58:8561:af00:11b5:cd98:e383:e8bd) (Quit: WeeChat 2.9) |
| 11:01:32 | × | foul_owl quits (~kerry@212.102.47.57) (Ping timeout: 252 seconds) |
| 11:02:15 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 11:02:44 | → | otherwise joins (~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) |
| 11:03:59 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 11:04:34 | → | Tuplanolla joins (~Tuplanoll@91-159-68-119.elisa-laajakaista.fi) |
| 11:05:49 | × | otherwise quits (~otherwise@2601:602:880:90f0:a9ed:d903:65ec:579d) (Client Quit) |
| 11:08:21 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 11:08:30 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 11:09:46 | → | SoF joins (~skius@user/skius) |
| 11:18:36 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 11:22:34 | → | arjun joins (~arjun@user/arjun) |
| 11:23:58 | <arjun> | is there a prefered library to make http(s) requests? i see a bunch on hackage |
| 11:27:01 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 240 seconds) |
| 11:28:04 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 11:28:04 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 11:28:04 | → | wroathe joins (~wroathe@user/wroathe) |
| 11:31:39 | → | jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net) |
| 11:32:51 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 11:33:50 | → | vglfr joins (~vglfr@88.155.24.19) |
| 11:35:30 | → | foul_owl joins (~kerry@212.102.47.57) |
| 11:36:15 | × | darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection) |
| 11:37:39 | → | darkstardevx joins (~darkstard@50.39.115.145) |
| 11:37:53 | × | acidjnk quits (~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Ping timeout: 250 seconds) |
| 11:39:08 | × | darkstardevx quits (~darkstard@50.39.115.145) (Remote host closed the connection) |
| 11:40:37 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds) |
| 11:40:43 | × | vglfr quits (~vglfr@88.155.24.19) (Ping timeout: 268 seconds) |
| 11:41:31 | → | vglfr joins (~vglfr@88.155.24.19) |
| 11:41:49 | → | darkstardevx joins (~darkstard@50.39.115.145) |
| 11:43:59 | <Taneb> | arjun: probably http-client/http-client-tls |
| 11:44:19 | × | darkstardevx quits (~darkstard@50.39.115.145) (Max SendQ exceeded) |
| 11:46:06 | <arjun> | i see, thx Taneb |
| 11:46:58 | × | timCF quits (~timCF@m91-129-100-224.cust.tele2.ee) (Quit: leaving) |
| 11:48:40 | → | fef joins (~thedawn@user/thedawn) |
| 11:49:02 | × | arjun quits (~arjun@user/arjun) (Remote host closed the connection) |
| 11:49:37 | → | jco joins (~jco@90-228-194-139-no542.tbcn.telia.com) |
| 11:52:32 | <maerwald[m]> | arjun: https://hackage.haskell.org/package/http-client-openssl |
| 11:52:44 | <maerwald[m]> | I'd not use http-client-tls |
| 11:53:17 | <maerwald[m]> | haskell tls is not audited and there's not enough research whether it's even an appropriate language for that |
| 11:53:53 | × | syrkis quits (~syrkis@82.192.167.70) (Quit: Client closed) |
| 11:54:00 | <jco> | Hello, trying to learn some basics about GADTs, and I'm running into a problem when trying to add a type class constraint. It works when adding a type class constraint like `(Eq a =>)` or `(Show a =>)`, but when trying to use my own type class, it gives a compilation error that I don't really understand. Gist here: https://gist.github.com/joncol/50461ec618fe1fb7b7245c5d7869e3ed |
| 11:58:52 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 11:58:52 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 11:58:52 | → | wroathe joins (~wroathe@user/wroathe) |
| 12:01:05 | <jco> | Oh, it seems to be related to my `(a :: Subject)` restriction in the type class itself... Interesting. |
| 12:02:07 | → | mmhat joins (~mmh@55d4bdde.access.ecotel.net) |
| 12:02:07 | → | shriekingnoise joins (~shrieking@186.137.144.80) |
| 12:02:35 | × | Jing quits (~hedgehog@2604:a840:3::1067) (Remote host closed the connection) |
| 12:03:10 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 12:03:36 | → | biberu\ joins (~biberu@user/biberu) |
| 12:03:37 | × | biberu quits (~biberu@user/biberu) (Ping timeout: 240 seconds) |
| 12:03:39 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 250 seconds) |
| 12:03:40 | → | Jing joins (~hedgehog@125.105.9.103) |
| 12:04:13 | → | Vajb joins (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) |
| 12:04:33 | biberu\ | is now known as biberu |
| 12:04:45 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 12:05:04 | → | DNH joins (~DNH@2a02:8108:1100:16d8:7898:e7cb:a448:daff) |
| 12:05:29 | × | Jing quits (~hedgehog@125.105.9.103) (Client Quit) |
| 12:05:50 | × | forell quits (~forell@user/forell) (Quit: ZNC - https://znc.in) |
| 12:06:11 | × | shriekingnoise quits (~shrieking@186.137.144.80) (Client Quit) |
| 12:06:45 | → | forell joins (~forell@user/forell) |
| 12:08:51 | → | shriekingnoise joins (~shrieking@186.137.144.80) |
| 12:11:30 | × | Tuplanolla quits (~Tuplanoll@91-159-68-119.elisa-laajakaista.fi) (Ping timeout: 260 seconds) |
| 12:13:10 | × | phma quits (phma@2001:5b0:211c:1148:bf01:ab8f:863f:c9a8) (Read error: Connection reset by peer) |
| 12:14:37 | → | phma joins (~phma@2001:5b0:211f:d0f8:a0d5:904f:4002:7904) |
| 12:15:41 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 12:19:01 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 240 seconds) |
| 12:20:54 | → | tv1 joins (~tv@user/tv) |
| 12:21:01 | × | tv quits (~tv@user/tv) (Ping timeout: 256 seconds) |
| 12:24:36 | → | Tuplanolla joins (~Tuplanoll@91-159-69-90.elisa-laajakaista.fi) |
| 12:25:02 | × | nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 260 seconds) |
| 12:29:39 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 12:29:39 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 12:29:39 | → | wroathe joins (~wroathe@user/wroathe) |
| 12:30:08 | → | Rum joins (~bourbon@user/rum) |
| 12:30:52 | → | cfricke joins (~cfricke@user/cfricke) |
| 12:31:56 | → | pretty_dumm_guy joins (trottel@gateway/vpn/protonvpn/prettydummguy/x-88029655) |
| 12:34:50 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 260 seconds) |
| 12:34:59 | × | mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 268 seconds) |
| 12:38:20 | × | Rum quits (~bourbon@user/rum) (Quit: WeeChat 3.4) |
| 12:41:17 | × | mvk quits (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds) |
| 12:44:40 | → | CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 12:49:35 | × | max22- quits (~maxime@2a01cb08833598005a91b2768a285f6e.ipv6.abo.wanadoo.fr) (Ping timeout: 250 seconds) |
| 12:49:37 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 12:51:47 | × | hololeap quits (~hololeap@user/hololeap) (Remote host closed the connection) |
| 12:53:21 | → | hololeap joins (~hololeap@user/hololeap) |
| 13:05:50 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 13:06:27 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 13:07:20 | → | nunggu joins (~q@gateway/tor-sasl/nunggu) |
| 13:09:32 | → | ubert joins (~Thunderbi@p200300ecdf099447b83e75261410a8dd.dip0.t-ipconnect.de) |
| 13:09:39 | → | jinsun__ joins (~quassel@user/jinsun) |
| 13:10:53 | × | jinsun quits (~quassel@user/jinsun) (Ping timeout: 256 seconds) |
| 13:11:21 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 13:11:22 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 13:12:50 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 13:16:31 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 13:16:31 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 13:16:31 | → | wroathe joins (~wroathe@user/wroathe) |
| 13:21:01 | → | nhatanh02 joins (~satori@123.24.172.30) |
| 13:21:51 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 13:25:43 | × | spaceseller quits (~spacesell@31.147.205.13) (Quit: Leaving) |
| 13:28:01 | × | tv1 quits (~tv@user/tv) (Quit: derp) |
| 13:28:15 | → | tv joins (~tv@user/tv) |
| 13:30:27 | <albet70> | what Reader Applicative is used for? like fmap is function compose about Reader, what <*> mean? |
| 13:35:11 | <int-e> | Hmm, it's the S combinator. |
| 13:36:42 | <int-e> | > ((-) <$> (`div` 100) <*> (`mod` 100)) 4223 |
| 13:36:43 | <lambdabot> | 19 |
| 13:37:53 | → | lavaman joins (~lavaman@98.38.249.169) |
| 13:39:12 | × | nunggu quits (~q@gateway/tor-sasl/nunggu) (Remote host closed the connection) |
| 13:39:33 | → | nunggu joins (~q@gateway/tor-sasl/nunggu) |
| 13:41:29 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 13:42:08 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 13:42:32 | × | ubert quits (~Thunderbi@p200300ecdf099447b83e75261410a8dd.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 13:43:17 | → | kupi joins (uid212005@id-212005.hampstead.irccloud.com) |
| 13:45:08 | → | stef204 joins (~stef204@user/stef204) |
| 13:46:28 | <jco> | > ((\x y -> x + y) <*> (\x -> x*10)) 100 |
| 13:46:29 | <lambdabot> | 1100 |
| 13:47:23 | <jco> | S combinator = fusion function that reduces the number of occurrences of a variable from several to a single one: S f g x = (f x) (g x) |
| 13:48:37 | × | tv quits (~tv@user/tv) (Ping timeout: 240 seconds) |
| 13:50:14 | <geekosaur> | not that I'd say it's used often |
| 13:50:31 | <geekosaur> | sometimes a type or typeclass instance is just a stepping stone to something else |
| 13:50:57 | <geekosaur> | the Reader Monad is widely used, but you have to define the Applicative to get there |
| 13:52:25 | → | max22- joins (~maxime@2a01cb0883359800fee411993e60211d.ipv6.abo.wanadoo.fr) |
| 13:54:43 | → | machinedgod joins (~machinedg@24.105.81.50) |
| 13:56:01 | → | tv joins (~tv@user/tv) |
| 13:58:42 | → | alx741 joins (~alx741@157.100.93.160) |
| 14:03:19 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 14:03:23 | → | yauhsien joins (~yauhsien@118-167-42-25.dynamic-ip.hinet.net) |
| 14:03:54 | × | fef quits (~thedawn@user/thedawn) (Remote host closed the connection) |
| 14:05:45 | × | stiell quits (~stiell@gateway/tor-sasl/stiell) (Ping timeout: 276 seconds) |
| 14:06:08 | → | stiell joins (~stiell@gateway/tor-sasl/stiell) |
| 14:06:21 | → | fef joins (~thedawn@user/thedawn) |
| 14:08:43 | × | yauhsien quits (~yauhsien@118-167-42-25.dynamic-ip.hinet.net) (Ping timeout: 268 seconds) |
| 14:09:47 | → | waleee joins (~waleee@h-98-128-229-110.NA.cust.bahnhof.se) |
| 14:13:09 | <alfonsox> | any one using this setting in emacs > -- To disable popups, customize `haskell-interactive-popup-errors' ? |
| 14:13:14 | → | slowButPresent joins (~slowButPr@user/slowbutpresent) |
| 14:14:00 | <alfonsox> | new buffer opens up in emacs when there is error in emacs ghci shell |
| 14:14:18 | × | xsperry quits (~xs@user/xsperry) (Remote host closed the connection) |
| 14:20:23 | × | stef204 quits (~stef204@user/stef204) (Quit: WeeChat 3.4) |
| 14:21:14 | → | alx741 joins (~alx741@157.100.93.160) |
| 14:26:36 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 14:27:15 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 14:30:32 | × | qwedfg quits (~qwedfg@user/qwedfg) (Ping timeout: 240 seconds) |
| 14:30:42 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 14:32:01 | → | jumper149 joins (~jumper149@static.6.71.203.116.clients.your-server.de) |
| 14:32:44 | → | qwedfg joins (~qwedfg@user/qwedfg) |
| 14:33:45 | → | ksqsf joins (~user@134.209.106.31) |
| 14:36:34 | → | epolanski joins (uid312403@id-312403.helmsley.irccloud.com) |
| 14:43:32 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Quit: Reconnecting) |
| 14:43:44 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 14:44:21 | × | mmhat quits (~mmh@55d4bdde.access.ecotel.net) (Quit: WeeChat 3.4) |
| 14:44:25 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 14:44:25 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 14:44:25 | → | wroathe joins (~wroathe@user/wroathe) |
| 14:44:47 | → | mmhat joins (~mmh@55d4bdde.access.ecotel.net) |
| 14:44:54 | → | alx741 joins (~alx741@157.100.93.160) |
| 14:45:41 | × | mmhat quits (~mmh@55d4bdde.access.ecotel.net) (Client Quit) |
| 14:46:00 | → | mmhat joins (~mmh@55d4bdde.access.ecotel.net) |
| 14:46:12 | × | mmhat quits (~mmh@55d4bdde.access.ecotel.net) (Client Quit) |
| 14:46:38 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 14:46:43 | → | doyougnu joins (~doyougnu@c-73-25-202-122.hsd1.or.comcast.net) |
| 14:47:37 | × | shriekingnoise quits (~shrieking@186.137.144.80) (Ping timeout: 240 seconds) |
| 14:49:11 | × | max22- quits (~maxime@2a01cb0883359800fee411993e60211d.ipv6.abo.wanadoo.fr) (Quit: Leaving) |
| 14:53:35 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 14:53:39 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 14:53:58 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 14:54:08 | <tomsmeding> | jco: in your example, what's going wrong is that the constraint 'MathOrEnglish a' means that the kind of 'a' is 'Subject', but you're also taking an argument of type 'a' -- which means that 'a' has kind 'Type'. Type is not Subject, hence kind error. |
| 14:54:28 | <tomsmeding> | in other words, if 'a' is MathOrEnglish, then the type 'a' doesn't have any values! |
| 14:56:26 | <tomsmeding> | even without the argument of type 'a', it still won't work if you don't remove the existing Student constructor, since the kind of the type variable 'a' of 'User' is not polymorphic: it's either Type or Subject, and then two constructors let ghc infer two different kinds. Writing 'data User (a :: k) where' fixes that, because now 'a' is poly-kinded! |
| 15:02:31 | <albet70> | "jco :S combinator = fusion function that reduces the number of occurrences of a variable from several to a single one: S f g x = (f x) (g x)", S f g = \x -> f x (g x) |
| 15:02:51 | <tomsmeding> | same thing, different notation :) |
| 15:02:59 | → | Kaiepi joins (~Kaiepi@216.208.243.198) |
| 15:03:23 | <tomsmeding> | @pl \f g x -> f x (g x) |
| 15:03:23 | <lambdabot> | ap |
| 15:04:20 | <albet70> | so ap is <*> like (.) is <$>? |
| 15:04:21 | <int-e> | @pl heralds from the monadic age |
| 15:04:41 | <int-e> | so it knows about `ap` but not `<*>` ;) |
| 15:05:19 | <int-e> | ap = <*> should hold for law-abiding Monad instances |
| 15:06:11 | <albet70> | @pl \x -> f (g x) x |
| 15:06:11 | <lambdabot> | f =<< g |
| 15:08:00 | <tomsmeding> | albet70: ap = <*> is actually true for law-abiding Monad/Applicative instances as int-e says; (.) is the implementation of (<$>) = fmap for the reader monad (r ->) |
| 15:08:12 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 15:11:31 | → | alx741 joins (~alx741@157.100.93.160) |
| 15:12:52 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 268 seconds) |
| 15:13:03 | → | Sgeo joins (~Sgeo@user/sgeo) |
| 15:15:43 | <albet70> | 42 - (42 +1) == (-) <*> (+1) $ 42 |
| 15:16:16 | <albet70> | (42 +1) - 42 == (+1) >>= (-) $ 42 |
| 15:16:35 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 15:16:47 | → | shapr` joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 15:16:57 | × | waleee quits (~waleee@h-98-128-229-110.NA.cust.bahnhof.se) (Ping timeout: 240 seconds) |
| 15:17:17 | <xerox> | . being an fmap is also the basis for lens |
| 15:17:38 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Read error: Connection reset by peer) |
| 15:18:18 | → | max22- joins (~maxime@2a01cb0883359800f9d8f30ac05a4f67.ipv6.abo.wanadoo.fr) |
| 15:19:37 | × | jco quits (~jco@90-228-194-139-no542.tbcn.telia.com) (Ping timeout: 240 seconds) |
| 15:19:49 | <tomsmeding> | :t fmap fmap fmap |
| 15:19:51 | <lambdabot> | (Functor f1, Functor f2) => (a -> b) -> f1 (f2 a) -> f1 (f2 b) |
| 15:19:51 | → | xsperry joins (~xs@user/xsperry) |
| 15:20:15 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 268 seconds) |
| 15:21:14 | shapr` | is now known as shapr |
| 15:22:14 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 252 seconds) |
| 15:22:47 | × | jgeerds quits (~jgeerds@55d4ac73.access.ecotel.net) (Ping timeout: 252 seconds) |
| 15:26:40 | <albet70> | (42 + 21) - 21 == ((+) >=> (-)) 42 $ 21 |
| 15:26:53 | <albet70> | this seems pointless... |
| 15:32:39 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 15:35:11 | → | alx741 joins (~alx741@157.100.93.160) |
| 15:35:32 | × | shapr quits (~user@pool-100-36-247-68.washdc.fios.verizon.net) (Remote host closed the connection) |
| 15:35:56 | → | shapr joins (~user@pool-100-36-247-68.washdc.fios.verizon.net) |
| 15:37:12 | → | wroathe joins (~wroathe@user/wroathe) |
| 15:37:51 | <albet70> | what's wrong with (-) <*> ((-2) <$> (+1)) $ 42? |
| 15:39:32 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 15:40:10 | → | curiousgay joins (~curiousga@77-120-141-90.kha.volia.net) |
| 15:43:27 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 15:46:37 | × | CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 15:48:34 | → | zer0bitz joins (~zer0bitz@196.244.192.57) |
| 15:49:53 | <albet70> | oh flip |
| 15:52:03 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 15:52:42 | → | acidjnk joins (~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) |
| 15:54:59 | <tomsmeding> | albet70: the point is not that this is more readable than the direct alternative, but that the reader monad is useful and induces (<*>) = ap :p |
| 15:56:21 | → | alx741 joins (~alx741@157.100.93.160) |
| 15:56:55 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 15:57:31 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 15:57:49 | → | ProfSimm joins (~ProfSimm@87.227.196.109) |
| 16:01:03 | <albet70> | ok |
| 16:04:39 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 268 seconds) |
| 16:06:04 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 16:06:04 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 16:06:04 | → | wroathe joins (~wroathe@user/wroathe) |
| 16:06:04 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:09:09 | → | ksqsf joins (~user@134.209.106.31) |
| 16:09:51 | → | mc47 joins (~mc47@xmonad/TheMC47) |
| 16:10:50 | → | nschoe joins (~quassel@178.251.84.79) |
| 16:10:58 | → | sirlensalot joins (~sirlensal@ool-44c5f8c9.dyn.optonline.net) |
| 16:11:05 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 256 seconds) |
| 16:11:32 | → | zebrag joins (~chris@user/zebrag) |
| 16:11:44 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 16:11:44 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 16:11:44 | → | wroathe joins (~wroathe@user/wroathe) |
| 16:15:03 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 16:16:59 | × | Morrow quits (~quassel@bzq-110-168-31-106.red.bezeqint.net) (Ping timeout: 268 seconds) |
| 16:17:01 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds) |
| 16:20:40 | → | gdd joins (~gdd@129.199.146.230) |
| 16:23:54 | → | alx741 joins (~alx741@157.100.93.160) |
| 16:27:23 | → | shriekingnoise joins (~shrieking@186.137.144.80) |
| 16:28:37 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:29:58 | → | [itchyjunk] joins (~itchyjunk@user/itchyjunk/x-7353470) |
| 16:33:01 | × | kupi quits (uid212005@id-212005.hampstead.irccloud.com) (Quit: Connection closed for inactivity) |
| 16:41:22 | → | jco joins (~jco@90-228-194-139-no542.tbcn.telia.com) |
| 16:42:56 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 16:43:07 | → | nattiestnate joins (~nate@2001:448a:20a0:4134:25e:715f:d637:5263) |
| 16:45:03 | → | alx741 joins (~alx741@157.100.93.160) |
| 16:47:57 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 240 seconds) |
| 16:48:21 | → | ksqsf joins (~user@134.209.106.31) |
| 16:49:41 | × | vglfr quits (~vglfr@88.155.24.19) (Ping timeout: 252 seconds) |
| 16:49:52 | → | zmt00 joins (~zmt00@user/zmt00) |
| 16:50:10 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 16:50:13 | → | vglfr joins (~vglfr@88.155.24.19) |
| 16:50:29 | → | kmein joins (~weechat@user/kmein) |
| 16:51:12 | × | nattiestnate quits (~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Quit: WeeChat 3.4) |
| 16:51:34 | → | nattiestnate joins (~nate@2001:448a:20a0:4134:25e:715f:d637:5263) |
| 16:51:48 | → | lavaman joins (~lavaman@98.38.249.169) |
| 16:52:09 | × | ChaiTRex quits (~ChaiTRex@user/chaitrex) (Ping timeout: 276 seconds) |
| 16:53:29 | → | Morrow joins (~quassel@5.28.131.86) |
| 16:53:59 | × | euandreh quits (~euandreh@2804:14c:33:9fe5:5d5c:8c41:79c4:9b80) (Ping timeout: 250 seconds) |
| 16:54:06 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 245 seconds) |
| 16:54:53 | → | ChaiTRex joins (~ChaiTRex@user/chaitrex) |
| 16:55:17 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 16:55:57 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 16:56:30 | × | nattiestnate quits (~nate@2001:448a:20a0:4134:25e:715f:d637:5263) (Quit: WeeChat 3.4) |
| 16:57:16 | → | euandreh joins (~euandreh@191.181.59.160) |
| 16:58:18 | × | zebrag quits (~chris@user/zebrag) (Remote host closed the connection) |
| 17:01:57 | → | zebrag joins (~chris@user/zebrag) |
| 17:04:10 | → | burnsidesLlama joins (~burnsides@dhcp168-010.wadham.ox.ac.uk) |
| 17:06:32 | × | Vajb quits (~Vajb@2001:999:62:e042:be01:afcc:85c5:1e46) (Ping timeout: 240 seconds) |
| 17:07:00 | → | Vajb joins (~Vajb@nabiicwveotvxswi5-2.v6.elisa-mobile.fi) |
| 17:13:24 | → | spaceseller joins (~spacesell@31.147.205.13) |
| 17:13:30 | → | alx741 joins (~alx741@157.100.93.160) |
| 17:14:00 | × | alfonsox quits (~quassel@103.92.42.90) (Remote host closed the connection) |
| 17:16:09 | → | Akiva joins (~Akiva@user/Akiva) |
| 17:16:45 | <glguy> | For anyone who did AoC 2021 day 22 (the one with commands that turned on/off cuboids of lights) I think I've got a solution that breaks it down into pretty simple steps: https://glguy.net/advent/sln_2021_22/Main.html (I've just been hammering on this one and I'm pretty happy with where it's gotten to) |
| 17:16:52 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 17:18:15 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 17:18:16 | × | spaceseller quits (~spacesell@31.147.205.13) (Client Quit) |
| 17:21:19 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.3) |
| 17:23:40 | → | mvk joins (~mvk@2607:fea8:5cdd:f000::917a) |
| 17:28:00 | <int-e> | glguy: Hmm, how hard would it be to modify that to produce at most 2 extra pieces per dimension when cutting boxes? (after splitting in one dimension, only one of the resulting parts will overlap with the `overlap`) |
| 17:29:14 | × | eggplantade quits (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection) |
| 17:29:27 | <int-e> | (not really hard, but I think it doesn't quite fit the `traverseBox2` abstraction) |
| 17:30:25 | × | nschoe quits (~quassel@178.251.84.79) (Ping timeout: 256 seconds) |
| 17:30:34 | → | eggplantade joins (~Eggplanta@108-201-191-115.lightspeed.sntcca.sbcglobal.net) |
| 17:31:40 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 17:32:37 | <g> | I'll have to think about it, maybe I can treat the first dimension specially |
| 17:34:06 | <lechner> | Thanks to whomever worked on the UTF-8 implementation of Data::Text! I'm sure it was a tough thing to do. https://discourse.haskell.org/t/text-2-0-with-utf8-is-finally-released/3840 |
| 17:36:01 | → | alx741 joins (~alx741@157.100.93.160) |
| 17:36:09 | <g> | int-e: it runs in 70ms so I haven't tried any optimizations yet |
| 17:37:46 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 17:38:27 | → | ksqsf joins (~user@134.209.106.31) |
| 17:42:09 | → | Lycurgus joins (~juan@98.4.112.204) |
| 17:42:38 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 17:44:01 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 17:44:49 | → | ksqsf joins (~user@134.209.106.31) |
| 17:45:16 | × | kmein quits (~weechat@user/kmein) (Quit: ciao kakao) |
| 17:45:34 | → | kmein joins (~weechat@user/kmein) |
| 17:45:52 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 17:48:17 | × | xff0x quits (~xff0x@2001:1a81:5243:1200:5779:89a5:a3f8:38a5) (Ping timeout: 240 seconds) |
| 17:48:21 | × | Lycurgus quits (~juan@98.4.112.204) (Quit: Exeunt) |
| 17:49:17 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 240 seconds) |
| 17:49:20 | → | xff0x joins (~xff0x@2001:1a81:5243:1200:68a2:b42f:5a9a:d157) |
| 17:49:20 | → | wroathe joins (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) |
| 17:49:20 | × | wroathe quits (~wroathe@c-68-54-25-135.hsd1.mn.comcast.net) (Changing host) |
| 17:49:20 | → | wroathe joins (~wroathe@user/wroathe) |
| 17:50:09 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 17:50:39 | → | lavaman joins (~lavaman@98.38.249.169) |
| 17:50:45 | × | cosimone quits (~user@2001:b07:ae5:db26:c24a:d20:4d91:1e20) (Ping timeout: 250 seconds) |
| 17:51:23 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 256 seconds) |
| 17:51:46 | <int-e> | g: completely untested: https://paste.tomsmeding.com/EMK8rNF0 |
| 17:53:01 | <glguy> | int-e: Time (mean ± σ): 41.3 ms ± 3.1 ms [User: 25.1 ms, System: 5.2 ms] |
| 17:53:07 | <glguy> | (and the answer is preserved |
| 17:53:28 | <int-e> | g: Yeah it doesn't really make a difference for the task... in my input, I got only about 3x more boxes from splitting in all dimensions simultaneously. When generalizing to more dimensions though this should pay off quickly |
| 17:54:07 | <glguy> | Oh, I was thinking it makes a noticable difference, not that it made none :) |
| 17:54:30 | <int-e> | well it's both "instantaneous" |
| 17:54:37 | × | wroathe quits (~wroathe@user/wroathe) (Ping timeout: 240 seconds) |
| 17:54:56 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 245 seconds) |
| 17:55:59 | <mjrosenb> | is this the AoC cube problem? |
| 17:56:06 | <int-e> | yes |
| 17:56:32 | <int-e> | well, cuboid... unless you mean the Dirac dice one ;) |
| 17:59:19 | <mjrosenb> | a coworker of mine was actually on the leaderboard for that problem, he didn't really do splitting. |
| 18:01:17 | <int-e> | I did wonder whether inclusion/exclusion would work out well (because it only needs intersections, no splitting), but the presence of both deletions and additions put me off. |
| 18:01:38 | <glguy> | inclusion/exclusion ends up being more complicated and slower, from what I've seen people do |
| 18:02:44 | × | acidjnk quits (~acidjnk@p200300d0c7271e865819ff1869a0a668.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 18:03:07 | → | acidjnk joins (~acidjnk@p200300d0c7271e860dd3763164487397.dip0.t-ipconnect.de) |
| 18:03:35 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:04:02 | <monochrom> | Ugh Dirac dice, is that like dice that is uniformly random almost everywhere under a Dirac measure? >:) |
| 18:04:15 | <int-e> | The stupidest thing I've got to work is http://paste.debian.net/1225160/ (which starts with a [-2^20...2^20]^3 box and subdivides it evenly until the box is added and deleted uniformly by the sequence of operations |
| 18:04:32 | <int-e> | And it's slow, takes several minutes to finish. |
| 18:05:07 | × | mbuf quits (~Shakthi@27.58.131.180) (Quit: Leaving) |
| 18:05:14 | <int-e> | monochrom: no, it just spawns parallel universes for each outcome |
| 18:05:53 | <monochrom> | That's like a pop sci version of a quantum interpretation >_> |
| 18:06:18 | <int-e> | we like our wave functions discrete |
| 18:07:49 | × | acidjnk quits (~acidjnk@p200300d0c7271e860dd3763164487397.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 18:08:45 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:08:49 | jinsun__ | is now known as jinsun |
| 18:10:37 | × | Megant quits (megant@user/megant) (Ping timeout: 240 seconds) |
| 18:11:39 | <mjrosenb> | I may have over-optimized my dirac dice. |
| 18:12:01 | <monochrom> | It now always gives 4 as per the xkcd? :) |
| 18:12:16 | <mjrosenb> | it was able to handle games that lasted until score 500 in a reasonable amount of time |
| 18:12:44 | → | Megant joins (megant@user/megant) |
| 18:12:47 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 18:17:27 | × | Akiva quits (~Akiva@user/Akiva) (Ping timeout: 256 seconds) |
| 18:19:35 | <int-e> | mjrosenb: Is that dynamic programming with about (500*10)^2 values? |
| 18:21:30 | <mjrosenb> | it is not super dynamic, and it uss (500*10)*2 values |
| 18:22:35 | <int-e> | I did something weird that effectively adds the current turn number to the state space. |
| 18:22:41 | → | tzh joins (~tzh@c-24-21-73-154.hsd1.or.comcast.net) |
| 18:22:55 | <int-e> | And unsurprisingly that causes it to scale worse :) |
| 18:23:37 | <glguy> | int-e: minor tweak that threads the intersection cube through (it's not faster, but it's fewer tokens) https://gist.github.com/glguy/c51bb1e01e964f780e9255eaad77ca69 |
| 18:24:26 | <int-e> | Ah, no min/max anymore. makes sense. |
| 18:25:38 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:25:45 | × | fef quits (~thedawn@user/thedawn) (Ping timeout: 276 seconds) |
| 18:25:46 | <EvanR> | I tried to solve the cuboids of lights with algebra |
| 18:26:08 | <EvanR> | but it's too slow |
| 18:27:10 | <EvanR> | figured the superfast method I ended up with is what everyone else did |
| 18:29:56 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 18:30:19 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:30:51 | <int-e> | mjrosenb: Oh can you exploit the independence of the two players? Hmmmmm. Of course you can. |
| 18:32:51 | <EvanR> | monochrom, the dice only result in 1 2 or 3... |
| 18:33:06 | <EvanR> | 3 sided dice |
| 18:33:13 | → | ksqsf joins (~user@134.209.106.31) |
| 18:33:23 | <EvanR> | plato would like a word |
| 18:33:24 | <int-e> | KISS resulted in [d1,d2,d3] <- replicateM 3 [1..3] for me |
| 18:33:30 | geekosaur | wonders what kind of geometry leads to that |
| 18:33:53 | <int-e> | (3^3 is 27, that's a small constant factor ;-) ) |
| 18:34:24 | <int-e> | > M.assocs $ M.fromListWith (+) [(d1+d2+d3, 1) | [d1,d2,d3] <- replicateM 3 [1..3]] |
| 18:34:25 | <lambdabot> | [(3,1),(4,3),(5,6),(6,7),(7,6),(8,3),(9,1)] |
| 18:34:38 | <int-e> | > 27/7 |
| 18:34:39 | <lambdabot> | 3.857142857142857 |
| 18:34:40 | <EvanR> | nice bell curve |
| 18:36:06 | <glguy> | int-e: OH, I wasn't even *using* the first argument to subtractBox' |
| 18:36:30 | <int-e> | oh, hehe |
| 18:36:52 | <int-e> | (I missed that too, despite checking the code) |
| 18:37:20 | <glguy> | updated gist |
| 18:37:26 | <int-e> | But it makes sense, since the overlap is all we're really removing, so who cares about the original box at that point |
| 18:39:26 | <monochrom> | In Flatland you can have 3-sided dice. :) |
| 18:39:30 | <EvanR> | the three cases for applying a cuboid to the existing cuboids are "totally outside" "totally inside" and "it's complicated", it's complicate is the only one where any real work happens |
| 18:40:01 | × | qwedfg quits (~qwedfg@user/qwedfg) (Quit: ZNC - https://znc.in) |
| 18:40:41 | <EvanR> | a subset b, b subset a, or neither |
| 18:40:50 | <EvanR> | wait no |
| 18:40:52 | → | qwedfg joins (~qwedfg@user/qwedfg) |
| 18:41:24 | <EvanR> | subset, empty intersection, or other |
| 18:42:23 | × | ksqsf quits (~user@134.209.106.31) (Ping timeout: 256 seconds) |
| 18:46:34 | → | alx741 joins (~alx741@157.100.93.160) |
| 18:48:33 | <glguy> | int-e: thanks. updated https://glguy.net/advent/sln_2021_22/Main.html and credited your insight in the commit |
| 18:50:44 | → | econo joins (uid147250@user/econo) |
| 18:51:09 | × | mikoto-chan quits (~mikoto-ch@esm-84-240-99-143.netplaza.fi) (Ping timeout: 268 seconds) |
| 18:51:21 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 18:52:17 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 240 seconds) |
| 18:54:42 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 18:55:27 | <lechner> | Hi, what do the words "in anger" mean on this website, please? https://github.com/haskell-works/avro#native-haskell-implementation-of-avro |
| 18:56:08 | <dsal> | lechner: it's a colloquialism that means "I needed this in a real situation" |
| 18:56:12 | <geekosaur> | it's a britishism. originally7 "used in anger" meant "used in battle", now it's somewhat more general |
| 18:56:49 | <EvanR> | needed in a real situation? hmmmm not how I read it |
| 18:57:17 | <geekosaur> | seems a sensible interpretation to me |
| 18:57:28 | <dsal> | It's the opposite of using it in an exercise just to try it out. |
| 18:57:54 | <geekosaur> | https://www.google.com/search?q=used+in+anger&oq=used+in+anger&aqs=chrome.0.0i512l2j0i22i30l7j0i22i30i457.2019j0j1&sourceid=chrome&ie=UTF-8 |
| 18:58:06 | <dsal> | Like, I got angry trying to use a zipper to solve part of an AoC thing, but I've never used a zipper in anger. |
| 18:58:08 | <lechner> | tfd lists "Obs. grief; trouble." https://www.thefreedictionary.com/anger |
| 18:58:33 | <geekosaur> | that's just the word anger, though. the phrase "used in anger" has a colloquial meaning |
| 18:58:55 | <EvanR> | ah britishisms stackoverflow |
| 18:59:03 | <lechner> | dsal got it http://onlineslangdictionary.com/meaning-definition-of/use-in-anger |
| 18:59:28 | → | kupi joins (uid212005@id-212005.hampstead.irccloud.com) |
| 19:02:03 | <lechner> | thanks so much, everyone! you made me feel a lot better |
| 19:03:00 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 19:03:30 | × | neurocyte0132889 quits (~neurocyte@user/neurocyte) (Quit: The Lounge - https://thelounge.chat) |
| 19:04:32 | → | Akiva joins (~Akiva@user/Akiva) |
| 19:04:34 | <int-e> | mjrosenb: that's pretty cool, https://paste.tomsmeding.com/9wVXFc8h runs in under 10 seconds for me compiled |
| 19:07:27 | <int-e> | (for day 21) |
| 19:07:37 | → | neurocyte0132889 joins (~neurocyte@94.46.64.245) |
| 19:07:37 | × | neurocyte0132889 quits (~neurocyte@94.46.64.245) (Changing host) |
| 19:07:37 | → | neurocyte0132889 joins (~neurocyte@user/neurocyte) |
| 19:09:06 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:09:18 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds) |
| 19:12:47 | → | CiaoSen joins (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) |
| 19:13:47 | <int-e> | oh line 19 isn't needed |
| 19:13:54 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:15:20 | <mjrosenb> | that is way more compact than mine was :-O |
| 19:20:26 | → | tromp joins (~textual@dhcp-077-249-230-040.chello.nl) |
| 19:20:57 | × | mvk quits (~mvk@2607:fea8:5cdd:f000::917a) (Ping timeout: 240 seconds) |
| 19:22:37 | × | deadmarshal quits (~deadmarsh@95.38.116.44) (Ping timeout: 256 seconds) |
| 19:27:17 | × | Morrow quits (~quassel@5.28.131.86) (Ping timeout: 240 seconds) |
| 19:29:11 | <Henson> | I'm encountering a problem with a Haskell program I'm writing that interfaces with a camera. The images are captured by the camera and placed in a doubly-linked list I made that uses TVars. The images are then read from this list and information is printed. The cameras time out 7 times out of 10 when operating with this TVar buffer. However, when I print information about the image size... |
| 19:30:03 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:30:19 | <Henson> | BEFORE adding it to the TVar linked list, it works perfectly and times out 0 out of 10 times. There is something happening with Haskell's laziness that is causing a problem here. Does anybody have any suggestions? I've tried using BangPatterns to evaluate the camera image data type, and using "seq" to evaluate the image size, but that doesn't help. Printing the size to the screen does help. |
| 19:31:14 | <geekosaur> | note that seq only helps if the value on the right is evaluated in a timely way |
| 19:31:20 | <Henson> | but obviously I don't want to print information to the screen just to resolve this problem, there's something else that I'm missing that will have the same effect |
| 19:31:24 | <geekosaur> | so we'd have to see some code |
| 19:33:21 | <sm> | the dumb workaround: print the length to /dev/null :) |
| 19:33:41 | <EvanR> | I'm sure a doubly linked list of TVars is possible but I'm skeptical it's worth it |
| 19:33:47 | <Henson> | geekosaur: unfortunately the code is proprietary, so I can't share it. I thought seq forced the evaluation to HWNF of whatever variable was its first argument. |
| 19:34:21 | <EvanR> | a `seq` b will at best only evaluate a if a `seq` b itself is evaluated |
| 19:34:33 | <Henson> | EvanR: the purpose for the double-linked TVar list is to allow concurrent readers to a list that is being written to, and for searching forward and backward in a potentially large list. |
| 19:34:33 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:34:53 | <EvanR> | you can do that with a Data.Sequence |
| 19:34:59 | <EvanR> | or other structure in a single TVar |
| 19:36:23 | × | epolanski quits (uid312403@id-312403.helmsley.irccloud.com) (Quit: Connection closed for inactivity) |
| 19:38:46 | <Henson> | are there any other options other than seq, or suggestions of the kinds of things I should be looking for to track down this problem? |
| 19:39:57 | <Henson> | anything equivalent to evaluating a variable for printing that doesn't involve printing it? |
| 19:40:23 | → | xb0o2 joins (~xb0o2@user/xb0o2) |
| 19:40:41 | <EvanR> | another way to evaluate something is to use evaluate from Control.Exception |
| 19:41:03 | <EvanR> | it has no other side effect |
| 19:41:29 | <monochrom> | Control.DeepSeq has rnf and friends. Combine with Control.Exception's evaluate if necessary. |
| 19:41:55 | <EvanR> | DeepSeq seems especially inappropriate here since everything is linked through TVar contents |
| 19:42:06 | <EvanR> | force can't see that |
| 19:42:29 | <monochrom> | Perhaps the content is a huge lazy expression. |
| 19:42:39 | <EvanR> | but yeah, too bad we can't get the code |
| 19:42:51 | <monochrom> | Perhaps I shouldn't answer. |
| 19:43:20 | <monochrom> | Nothing good comes out of answering a question that requires double blind answering. |
| 19:43:57 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Ping timeout: 240 seconds) |
| 19:45:17 | <geekosaur> | to expand on what EvanR said, a `seq` b means that a will be evaluated when b is. If b never gets evaluated, now you have *two* big thunks |
| 19:45:19 | → | qwedfg_ joins (~qwedfg@user/qwedfg) |
| 19:45:51 | × | qwedfg quits (~qwedfg@user/qwedfg) (Ping timeout: 256 seconds) |
| 19:46:10 | <Henson> | geekosaur: ahh, I didn't know that |
| 19:46:19 | <Henson> | I'm trying to evaluate function now |
| 19:47:33 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 19:47:45 | <geekosaur> | there are also sledgehammer approaches: you can try {-# LANGUAGE StrictData #-} |
| 19:48:12 | <glguy> | int-e: inlining "segments" into Box takes the runtime down from 41 to 33ms (and all the old segment definitions were used at exactly one place before, so there was no duplication from inlining |
| 19:48:35 | <EvanR> | in clojure they like to put entire databases into their equivalent of a tvar |
| 19:48:52 | <EvanR> | (rather than N TVars referencing each other) |
| 19:49:42 | <monochrom> | Most of us get close to doing that too. Not an entire database but certainly an entire Map for example. |
| 19:50:29 | <monochrom> | Atomicity comes for free if the content is an immutable data structure. (So, true of both Clojure users and Haskell users.) |
| 19:50:35 | <Henson> | EvanR: the Data.Sequence doesn't seem to be quite what I'm looking for. The purpose of the TVar doubly-linked list was to allow constant time appending, and constant time reading of items off the list from multiple concurrent readers. |
| 19:50:55 | <EvanR> | well, Sequence has constant time appending |
| 19:51:08 | <EvanR> | and constant time ... starting to read the list |
| 19:51:12 | → | alx741 joins (~alx741@157.100.93.160) |
| 19:51:19 | <EvanR> | reading the whole thing depends on the size of the list of course |
| 19:51:22 | <geekosaur> | but it has only one focal point, not one per reader which seems implied |
| 19:52:45 | <Henson> | EvanR: it's similar to this library https://hackage.haskell.org/package/stm-linkedlist but for some reason I can't recall at the moment that library didn't do what I wanted, so I wrote my own. |
| 19:53:29 | <EvanR> | what are the exact features needed? |
| 19:53:46 | <EvanR> | append to the end and |
| 19:55:52 | <int-e> | glguy: "inlining"... oh you're changing the datatype, as in this? (:*) :: {-# UNPACK #-} !Seg -> Box n -> Box ('S n) |
| 19:55:57 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 19:56:54 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 19:57:17 | <int-e> | glguy: Maybe I'll just wait for the inevitable commit to land :P |
| 19:57:54 | <glguy> | int-e: https://glguy.net/advent/sln_2021_22/Main.html |
| 19:59:34 | <int-e> | I guess I guessed correctly then |
| 20:00:32 | <EvanR> | that's really cool |
| 20:00:47 | <EvanR> | type level number for fun and profit |
| 20:01:00 | <glguy> | it made sense to me to split out segments when the logic was on segments that just "happened" to be stacked up into boxes |
| 20:01:12 | <glguy> | with with this more efficient box subtraction the value is lost |
| 20:01:50 | <int-e> | sorry :) |
| 20:03:32 | <EvanR> | to subdivide a 3D box I didn't end up using 2D support ... I wonder if you could so you can justify induction xD |
| 20:03:39 | → | Morrow joins (~quassel@bzq-110-168-31-106.red.bezeqint.net) |
| 20:04:11 | <EvanR> | my 2D code went unused |
| 20:05:02 | × | juhp quits (~juhp@128.106.188.82) (Ping timeout: 240 seconds) |
| 20:08:26 | → | juhp joins (~juhp@128.106.188.82) |
| 20:08:36 | <glguy> | I don't understand what you mean |
| 20:09:23 | → | lavaman joins (~lavaman@98.38.249.169) |
| 20:10:13 | <EvanR> | hmm maybe the subdivision could just work for any dimension |
| 20:10:18 | <EvanR> | like everything else |
| 20:10:49 | <EvanR> | still, keeping the dimensions straight with the type level number is cool |
| 20:12:51 | <glguy> | yeah, the subtraction works for any dimension, and tracking the dimension in the type ensures that only n-d things can be subtracted from n-d things |
| 20:13:05 | <glguy> | the recursive case happens at a lower dimension |
| 20:13:37 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 20:13:44 | → | alx741 joins (~alx741@157.100.93.160) |
| 20:14:00 | <glguy> | so subtracting cuboids is in terms of subtracting squares is in terms of subtracting segments is in terms of subtracting single points |
| 20:15:58 | <EvanR> | i avoided fencepost issues imagining only cuboids, in 1D they would be line segments centered on the index |
| 20:16:38 | <EvanR> | size = b - a + 1 |
| 20:16:41 | <glguy> | I avoided fencepost issues by using an inclusive lower bound and exclusive upper bound |
| 20:16:46 | <EvanR> | i saw that |
| 20:16:53 | <EvanR> | sounds confusing xD |
| 20:17:46 | <Henson> | ugh, when I replace the complex TVar buffer with just a simple list inside a single TVar, the same problem happens. |
| 20:17:50 | <glguy> | it's the most common way to do ranges, really |
| 20:18:08 | <glguy> | note how Python does range(), how Rust does its .. enumeration |
| 20:18:34 | <glguy> | C arrays, etc |
| 20:18:34 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 20:19:43 | <EvanR> | makes sense for topology, you can juxtapose a doubly closed interval without overlapping |
| 20:19:47 | <EvanR> | can't* |
| 20:19:55 | <int-e> | EvanR: it's not confusing if you treat the boundaries as *real* coordinates of cuboids (composed from unit cubes) |
| 20:20:24 | <EvanR> | since we're not on the real line, it seems more like school blocks lined up |
| 20:20:28 | <int-e> | EvanR: which also means we're computing an actual volume rather than counting lattice points |
| 20:20:47 | <EvanR> | me too, b - a + 1 |
| 20:21:03 | <EvanR> | I'm working with volumes xD |
| 20:21:09 | <EvanR> | not points |
| 20:21:31 | <EvanR> | (since the problem went out of their way to describe it like that) |
| 20:21:55 | <int-e> | EvanR: but you're doing it wrong :-D |
| 20:21:58 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 260 seconds) |
| 20:22:17 | × | jco quits (~jco@90-228-194-139-no542.tbcn.telia.com) (Ping timeout: 240 seconds) |
| 20:22:29 | <int-e> | (I added 1 to all upper bounds because I was afraid of fencepost errors. YMMV) |
| 20:22:35 | <EvanR> | > [0..10] |
| 20:22:37 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9,10] |
| 20:22:49 | <EvanR> | I'm so glad haskell does it wrong, I hate the python way |
| 20:22:57 | <int-e> | I didn't do it for part 1 though |
| 20:23:12 | <int-e> | EvanR: have you seen the Rust way? |
| 20:23:15 | <EvanR> | no |
| 20:23:18 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection) |
| 20:23:40 | <int-e> | they have two types of ranges: a..b excludes b; a..=b includes b |
| 20:23:48 | <int-e> | awkward... well... until you get used to it |
| 20:23:50 | → | zincy joins (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) |
| 20:25:01 | <kuribas> | > init [0..10] |
| 20:25:03 | <lambdabot> | [0,1,2,3,4,5,6,7,8,9] |
| 20:25:18 | <EvanR> | > [(-1) .. 1] |
| 20:25:19 | <lambdabot> | [-1,0,1] |
| 20:25:25 | <EvanR> | nicely symmetric |
| 20:25:43 | <EvanR> | IT JUST MAKES SENSE |
| 20:26:03 | <int-e> | > [-1..1] |
| 20:26:04 | <lambdabot> | [-1,0,1] |
| 20:26:18 | <geekosaur> | > [ 0.01 .. 0.1 ] |
| 20:26:20 | <lambdabot> | [1.0e-2] |
| 20:26:33 | <EvanR> | > [-(1..1)] |
| 20:26:33 | <int-e> | > [-2.. -1] -- this is the nasty case |
| 20:26:34 | <geekosaur> | > [ 0.01, 0.02 .. 0.1 ] |
| 20:26:34 | <lambdabot> | [-2,-1] |
| 20:26:34 | <lambdabot> | <hint>:1:5: error: parse error on input ‘..’ |
| 20:26:36 | <lambdabot> | [1.0e-2,2.0e-2,3.0e-2,4.0e-2,5.0e-2,6.0000000000000005e-2,6.999999999999999e... |
| 20:26:48 | <EvanR> | -2 to -1 worked |
| 20:27:05 | <int-e> | > [-2..-1] -- well, consider this |
| 20:27:07 | <lambdabot> | error: |
| 20:27:07 | <lambdabot> | • Variable not in scope: (..-) :: t0 -> t1 -> a |
| 20:27:07 | <lambdabot> | • Perhaps you meant ‘...’ (imported from Control.Lens) |
| 20:27:13 | <EvanR> | oof |
| 20:27:17 | <int-e> | EvanR: I avoided the trap |
| 20:27:40 | <glguy> | > [2, 1 .. 1] |
| 20:27:42 | <lambdabot> | [2,1] |
| 20:27:47 | <glguy> | I wish we had a nicer syntax for counting down |
| 20:28:08 | <geekosaur> | even more fun is when you trip parsing of .. as qualified (.) |
| 20:28:11 | <int-e> | geekosaur: yeah the behavior on floats is kind of awful |
| 20:28:27 | <glguy> | I think I've only ever wanted to provide the delta rather than the next element forcing the code to then recompute the delta for me |
| 20:28:28 | <geekosaur> | > [False..True] -- ick |
| 20:28:30 | <lambdabot> | error: |
| 20:28:30 | <lambdabot> | Not in scope: ‘False..’ |
| 20:28:30 | <lambdabot> | No module named ‘False’ is imported.error: |
| 20:28:43 | <glguy> | especially since I'm almost always computing the next element by adding the delta manually |
| 20:28:46 | <int-e> | geekosaur: yeah that one also gets me on occasion |
| 20:29:04 | <glguy> | [x, x+1, ..] --- and then the library has to do: x-(x+1) to get the 1 back when I had the 1 in the first place |
| 20:29:08 | <EvanR> | yes [1, 3, ..] is cool but gimmicky |
| 20:29:23 | <glguy> | I'd much rather write something like: [1, +2 ..] |
| 20:29:33 | <int-e> | too mant commas |
| 20:29:36 | <int-e> | *many |
| 20:29:38 | <EvanR> | yes |
| 20:29:42 | × | kuribas quits (~user@ptr-25vy0i81bhacxv5d2f4.18120a2.ip6.access.telenet.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 20:29:43 | <EvanR> | caught too late |
| 20:29:48 | <geekosaur> | also with the float one I was hoping to trigger the overshoot behavior with floats, but lb chopped it off |
| 20:30:15 | <int-e> | > last [ 0.01, 0.02 .. 0.1 ] |
| 20:30:17 | <lambdabot> | 9.999999999999999e-2 |
| 20:30:51 | <int-e> | > last [ 0.01, 0.03 .. 0.1 ] |
| 20:30:52 | <lambdabot> | 0.10999999999999997 |
| 20:31:01 | <EvanR> | > showFFloat (Just 3) 9.999999999999999e-2 "" |
| 20:31:03 | <lambdabot> | "0.100" |
| 20:31:11 | <EvanR> | > showFFloat (Just 33) 9.999999999999999e-2 "" |
| 20:31:13 | <lambdabot> | "0.099999999999999990000000000000000" |
| 20:31:48 | → | lavaman joins (~lavaman@98.38.249.169) |
| 20:31:50 | <EvanR> | well that's basically 0.1 |
| 20:32:03 | <EvanR> | ship it |
| 20:33:32 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 252 seconds) |
| 20:34:59 | <g> | int-e: thinking in terms of lattice points makes sense to me for the size of a 0D box being 1. What's the interpretation for coordinates? |
| 20:35:37 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 20:36:15 | <int-e> | @check \a b -> let a' = fromIntegral (getPositive a); b' = fromIntegral (getPositive b) in last [0,a'/b'..a'] <= a' |
| 20:36:16 | → | alx741 joins (~alx741@157.100.93.160) |
| 20:36:17 | <lambdabot> | *** Failed! Falsifiable (after 50 tests and 2 shrinks): |
| 20:36:17 | <lambdabot> | Positive {getPositive = 29} Positive {getPositive = 27} |
| 20:36:41 | <int-e> | g: product [] = 1 |
| 20:36:57 | <EvanR> | for the 0D box of 1 you'd need the coordinates of both ends |
| 20:37:08 | <EvanR> | instead of coordinate of center |
| 20:37:24 | <g> | 0D boxes don't have coordinates |
| 20:37:25 | <int-e> | there are no coordinates |
| 20:37:33 | <EvanR> | oh, I mixed it up with 1D |
| 20:37:52 | <g> | int-e: I agree that it "is" 1. I'm trying to think of what that"means" |
| 20:38:16 | <int-e> | g: well, your measure is discrete here; the set containing the sole point has measure 1 |
| 20:38:18 | <g> | The best I can do is that 1 is the identify element? |
| 20:38:24 | <int-e> | the empty set has measure 0 |
| 20:38:25 | <EvanR> | it's because our cuboids of whatever dimension are all slices of an infinite dimensional space of hypercuboids |
| 20:38:26 | int-e | shrugs |
| 20:38:49 | <EvanR> | and the smallest of any of them has size 1 |
| 20:39:21 | <EvanR> | flatland |
| 20:39:41 | × | danso quits (~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) (Ping timeout: 268 seconds) |
| 20:40:49 | → | azimut joins (~azimut@gateway/tor-sasl/azimut) |
| 20:41:17 | × | nhatanh02 quits (~satori@123.24.172.30) (Ping timeout: 240 seconds) |
| 20:41:39 | <int-e> | g: it really comes down to the same thing that motivates product [] = 1: we want product (xs ++ ys) = product xs * product ys, and we want the same thing when we split the dimensions of a cuboid into two independent parts (ala R^(n+m) = R^n x R^m). |
| 20:41:55 | → | pavonia joins (~user@user/siracusa) |
| 20:42:18 | <int-e> | Counting is a bit easier for 0D, I agree. |
| 20:42:31 | <int-e> | (as intuition) |
| 20:45:38 | → | ph88 joins (~ph88@2a02:8109:9e00:71d0::7e04) |
| 20:45:55 | × | shailangsa quits (~shailangs@host109-159-108-207.range109-159.btcentralplus.com) (Ping timeout: 256 seconds) |
| 20:47:17 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 20:48:26 | <EvanR> | given n D set of (size 1) cuboids, there's an n-1 D slice one for each 'i', each one still has size 1. The zero D slice ends up being like Bool, size 1 or size 0 (outside a cuboid) |
| 20:49:18 | <EvanR> | screw R^n xD |
| 20:49:48 | <EvanR> | banach tarski paradox not invited |
| 20:50:56 | → | danso joins (~danso@2001:1970:52e7:d000:96b8:6dff:feb3:c009) |
| 20:51:59 | <g> | I guess part of the confusion is that with counting the unit is the same; you're counting points |
| 20:52:47 | <g> | But under the other interpretation its lengths, areas, volumes, etc |
| 20:53:27 | <g> | So then with 0D it's not just 1, but it's 1 unit^0 |
| 20:53:31 | <int-e> | yes, you get n-dimensional measures for various n |
| 20:54:16 | <int-e> | I feel it helps. |
| 20:54:19 | int-e | shrugs |
| 20:56:02 | <int-e> | (As usual the thing about intuitions is that there's no right one... whatever works for you is best for you.) |
| 20:56:06 | <g> | So it's very literally a dimensionless number :) |
| 20:57:03 | <EvanR> | 3 m^2, 3 m^1, 3 xD |
| 20:57:37 | <int-e> | 3 rad, almost half a circle |
| 21:01:08 | → | InternetCitizen joins (~fuzzypixe@eth-west-pareq2-46-193-4-100.wb.wifirst.net) |
| 21:01:16 | <InternetCitizen> | ,lambda 1 |
| 21:01:33 | <InternetCitizen> | how do I use the bot? |
| 21:02:07 | <geekosaur> | what are you trying to do with it? |
| 21:02:29 | <InternetCitizen> | write an example for my question :) |
| 21:03:04 | <geekosaur> | > (\x -> x+1) 3 |
| 21:03:05 | <lambdabot> | 4 |
| 21:03:26 | → | mikoto-chan joins (~mikoto-ch@esm-84-240-99-143.netplaza.fi) |
| 21:03:45 | <int-e> | (you can test these in private chat (/query lambdabot in a typical irc client)) |
| 21:03:52 | <ProfSimm> | Consider how we humans interact with one another. We more often than not don't have clear input and output. We have a partially abstract input (i.e. with placeholders) and we're told to solve and fill-in the placeholders. We do this when given a paper form, or a test. |
| 21:04:05 | <ProfSimm> | Is this more fundamental than a function with input and output I wonder? |
| 21:04:13 | <InternetCitizen> | let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3] |
| 21:04:27 | <InternetCitizen> | let lengthr' xs = foldr (const (+ 1)) 0 xs in lengthr' [1, 2, 3] |
| 21:04:44 | <int-e> | InternetCitizen: the prefix is '> ' |
| 21:04:51 | <geekosaur> | more abstract, I'd say. humans are abstraction machines |
| 21:04:57 | × | CiaoSen quits (~Jura@p200300c957347b002a3a4dfffe84dbd5.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 21:04:57 | <InternetCitizen> | >let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3] |
| 21:05:06 | <geekosaur> | the space was not there for show |
| 21:05:06 | <pragma-> | I'm just a walking Chinese Room. |
| 21:05:07 | <InternetCitizen> | > let lengthl' xs = foldl (const (+ 1)) 0 xs in lengthl' [1, 2, 3] |
| 21:05:09 | <lambdabot> | 4 |
| 21:05:14 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 21:05:17 | <InternetCitizen> | > let lengthr' xs = foldr (const (+ 1)) 0 xs in lengthr' [1, 2, 3] |
| 21:05:19 | <lambdabot> | 3 |
| 21:05:46 | <InternetCitizen> | I guess you know what my question is, why does one work and the other doesn't? |
| 21:05:50 | → | coot joins (~coot@89-64-85-93.dynamic.chello.pl) |
| 21:05:51 | → | alx741 joins (~alx741@181.199.42.79) |
| 21:06:01 | <int-e> | InternetCitizen: look at the types? |
| 21:06:08 | <InternetCitizen> | the elements in the list shouldn't matter, let alone their order |
| 21:06:24 | <int-e> | well, one of the functions violates that expectations |
| 21:06:26 | <int-e> | -s |
| 21:06:45 | <EvanR> | that order matters is what distinguishes a list from a set |
| 21:07:07 | <int-e> | :t foldl (const (+ 1)) 0 |
| 21:07:09 | <lambdabot> | (Foldable t, Num b) => t b -> b |
| 21:07:11 | <int-e> | :t foldr (const (+ 1)) 0 |
| 21:07:12 | <lambdabot> | (Foldable t, Num b1) => t b2 -> b1 |
| 21:07:14 | <EvanR> | that's not what causes the type error though |
| 21:07:32 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 21:07:46 | <int-e> | (oops... the former restricts the list type... that's a strong hint as to what's going on) |
| 21:08:28 | <InternetCitizen> | it's somehow adding the elements of the list into the acc |
| 21:08:41 | × | kritzefitz quits (~kritzefit@debian/kritzefitz) (Ping timeout: 268 seconds) |
| 21:08:45 | <int-e> | :t foldl |
| 21:08:45 | <InternetCitizen> | oh wait! |
| 21:08:46 | <lambdabot> | Foldable t => (b -> a -> b) -> b -> t a -> b |
| 21:08:47 | <int-e> | :t foldr |
| 21:08:48 | <lambdabot> | Foldable t => (a -> b -> b) -> b -> t a -> b |
| 21:09:03 | <InternetCitizen> | I just typed the same thing into my GHCi ... |
| 21:09:06 | <int-e> | note also that those two types are different, which provides further clues. |
| 21:09:23 | <InternetCitizen> | I thought the two were different in their order of traversal! |
| 21:09:28 | <geekosaur> | nope |
| 21:09:42 | <geekosaur> | common misapprehension |
| 21:09:51 | <geekosaur> | they're different in their order of *association* |
| 21:10:03 | <geekosaur> | a list can only be traversed in one direction |
| 21:10:21 | → | kritzefitz joins (~kritzefit@debian/kritzefitz) |
| 21:10:41 | <geekosaur> | > foldl f z [a,b,c] |
| 21:10:41 | × | alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer) |
| 21:10:43 | <lambdabot> | f (f (f z a) b) c |
| 21:10:45 | <InternetCitizen> | this makes more sense now, I was mistaken to think one of them use tail recursion or some black magic |
| 21:10:47 | <geekosaur> | > foldr f z [a,b,c] |
| 21:10:49 | <lambdabot> | f a (f b (f c z)) |
| 21:11:03 | <EvanR> | one of them does use tail recursion |
| 21:11:08 | <EvanR> | @src foldl |
| 21:11:08 | <lambdabot> | foldl f z [] = z |
| 21:11:08 | <lambdabot> | foldl f z (x:xs) = foldl f (f z x) xs |
| 21:11:21 | → | alx741 joins (~alx741@157.100.93.160) |
| 21:11:57 | → | jgeerds joins (~jgeerds@55d4ac73.access.ecotel.net) |
| 21:12:00 | <EvanR> | make sure you use lazy evaluation to understand that |
| 21:14:17 | <InternetCitizen> | well in `f (f (f z a) b) c` `f z a` is evaluated first, I'm just not sure if it's evaluated before or after building the whole expression |
| 21:14:29 | <InternetCitizen> | after probably |
| 21:14:36 | <InternetCitizen> | @src foldr |
| 21:14:36 | <lambdabot> | foldr f z [] = z |
| 21:14:36 | <lambdabot> | foldr f z (x:xs) = f x (foldr f z xs) |
| 21:14:53 | <EvanR> | f z a may not even be evaluated, it depends |
| 21:15:16 | × | _ht quits (~quassel@82-169-194-8.biz.kpn.net) (Remote host closed the connection) |
| 21:15:31 | <g> | InternetCitizen: no, f z a isn't evaluated first in that expression |
| 21:16:05 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 21:16:36 | <g> | It's only evaluated if f (f z a) b needs to evaluate it |
| 21:17:07 | <geekosaur> | note that f may be lazy in its first parameter |
| 21:17:10 | <EvanR> | that expression by itself doesn't reflect foldl's limitation, that you even if you don't look at c, you can't do f _ c until going to the end of the list |
| 21:21:14 | <EvanR> | and the nested stuff in the first parameter has to be prepared in case you look at it, unlike foldr which can bypass all that |
| 21:21:35 | <jackdk> | http://data.tmorris.net/talks/list-folds/b30aa0fdff296c731bc5b1c824adf1d02b3b69d9/list-folds.pdf foldr performs constructor replacement, foldl is basically a loop |
| 21:21:49 | → | azimut_ joins (~azimut@gateway/tor-sasl/azimut) |
| 21:22:33 | × | azimut quits (~azimut@gateway/tor-sasl/azimut) (Ping timeout: 276 seconds) |
| 21:25:06 | <EvanR> | after internalizing lazy evaluation you can tell from the code there for foldr that you can get instant gratification, since it applies your f immediately, and you're free to ignore or not the "accumulator" (is there a better name for that thing) |
| 21:25:26 | → | shailangsa_ joins (~shailangs@host86-186-142-101.range86-186.btcentralplus.com) |
| 21:25:37 | <EvanR> | foldl is frustrated by looping to the end of the list first |
| 21:25:38 | <geekosaur> | I think of it as state, not an accumulator |
| 21:26:37 | <InternetCitizen> | > myFoldr f acc (x:xs) = myFoldr f (f x acc) xs |
| 21:26:39 | <lambdabot> | <hint>:1:22: error: parse error on input ‘=’ |
| 21:26:49 | × | rito_ quits (~rito_gh@45.112.243.151) (Quit: Leaving) |
| 21:26:56 | <InternetCitizen> | > let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs |
| 21:26:58 | <lambdabot> | <no location info>: error: |
| 21:26:58 | <lambdabot> | not an expression: ‘let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs’ |
| 21:26:59 | <EvanR> | @let doesThisWork = 3 |
| 21:27:01 | <lambdabot> | Defined. |
| 21:27:04 | <EvanR> | > doesThisWork |
| 21:27:06 | <lambdabot> | 3 |
| 21:27:20 | <InternetCitizen> | @let myFoldr f acc (x:xs) = myFoldr f (f x acc) xs |
| 21:27:21 | <lambdabot> | Defined. |
| 21:27:29 | <InternetCitizen> | @let my_foldr f acc [] = acc |
| 21:27:30 | <lambdabot> | Defined. |
| 21:27:44 | <InternetCitizen> | couldn't foldr be implemented this way too? |
| 21:27:53 | <EvanR> | that's foldl |
| 21:28:40 | <InternetCitizen> | but f takes x first and acc second |
| 21:28:41 | <EvanR> | in myFoldr f (f x acc) xs, the f x acc is not evaluated first (potentially not at all) |
| 21:29:17 | <EvanR> | the order of arguments doesn't matter as much as your recursion |
| 21:29:35 | × | hololeap quits (~hololeap@user/hololeap) (Quit: Bye) |
| 21:33:37 | <InternetCitizen> | @let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x |
| 21:33:38 | <lambdabot> | /sandbox/tmp/.L.hs:159:1: error: [-Woverlapping-patterns, -Werror=overlappin... |
| 21:33:38 | <lambdabot> | Pattern match is redundant |
| 21:33:38 | <lambdabot> | In an equation for ‘myFoldr’: myFoldr f acc (x : xs) = ... |
| 21:33:50 | → | alx741 joins (~alx741@157.100.93.160) |
| 21:33:59 | <EvanR> | @undefine |
| 21:33:59 | <lambdabot> | Undefined. |
| 21:34:03 | <EvanR> | try again |
| 21:34:14 | <InternetCitizen> | @let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x |
| 21:34:15 | <lambdabot> | Defined. |
| 21:34:23 | <InternetCitizen> | @let myFoldr f acc [] = [] |
| 21:34:24 | <lambdabot> | Defined. |
| 21:34:53 | <InternetCitizen> | so we can define them both in both orders of f's arguments |
| 21:34:56 | <EvanR> | that doesn't seem right |
| 21:35:19 | <InternetCitizen> | > myFoldr (+) 0 [1, 2, 3] |
| 21:35:20 | <EvanR> | use ; to put both cases in the def at the same time |
| 21:35:21 | <lambdabot> | error: |
| 21:35:21 | <lambdabot> | • No instance for (Num [()]) arising from a use of ‘e_10123’ |
| 21:35:21 | <lambdabot> | • In the expression: e_10123 |
| 21:35:48 | <InternetCitizen> | @let myFoldr f acc [] = []; let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x |
| 21:35:49 | <lambdabot> | Parse failed: Parse error: EOF |
| 21:35:54 | <EvanR> | i.e. foo 0 = 1; foo i = i + 1 |
| 21:35:55 | <InternetCitizen> | @let myFoldr f acc [] = []; let myFoldr f acc (x:xs) = f (myFoldr f acc xs) x; |
| 21:35:55 | <lambdabot> | Parse failed: Parse error: EOF |
| 21:36:16 | <EvanR> | @undefine |
| 21:36:16 | <lambdabot> | Undefined. |
| 21:36:40 | <EvanR> | maybe try this in a source file first and get the bugs out |
| 21:37:37 | <geekosaur> | well, some of this is just not using the bot right. @let is not the same as "let", it just defines styuff at "top level" for lambdabot instead of being an expression. note that you never use "let" at top level in a file |
| 21:38:23 | → | _73 joins (~user@pool-108-49-252-36.bstnma.fios.verizon.net) |
| 21:38:32 | <InternetCitizen> | > @let ah well it's `myFoldr :: ([a] -> t1 -> [a]) -> t2 -> [t1] -> [a]` |
| 21:38:34 | <lambdabot> | <hint>:1:1: error: parse error on input ‘@’ |
| 21:38:46 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 21:38:50 | <int-e> | :t let myFoldr f acc [] = []; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr |
| 21:38:51 | <lambdabot> | ([a] -> t1 -> [a]) -> t2 -> [t1] -> [a] |
| 21:39:13 | <geekosaur> | now it may be time to switch to /query until you figure out how the bot works |
| 21:39:21 | <int-e> | yeah that looks suspicious. |
| 21:39:41 | <int-e> | (the type, that is) |
| 21:39:49 | <geekosaur> | (and yet again I want to finish the documentation I wrote a decade ago minus the haskell plugins, but I still have nowhere to host it except maybe dropbox) |
| 21:40:25 | <EvanR> | InternetCitizen, foldr ought to return various types, not just lists |
| 21:40:26 | <int-e> | (note how there's a t2 in just one place... hmm...) |
| 21:40:26 | <geekosaur> | of course I could contribute it back and see if it ever shows up in a release… |
| 21:40:46 | <InternetCitizen> | :t let myFoldr f acc [] = acc; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr |
| 21:40:47 | <lambdabot> | (t1 -> t2 -> t1) -> t1 -> [t2] -> t1 |
| 21:40:53 | <EvanR> | better |
| 21:41:47 | <InternetCitizen> | > let myFoldr f acc [] = acc; myFoldr f acc (x:xs) = f (myFoldr f acc xs) x in myFoldr (+) 0 [1..3] |
| 21:41:49 | <lambdabot> | 6 |
| 21:41:53 | <int-e> | :t foldr . flip |
| 21:41:54 | <lambdabot> | Foldable t => (b -> a -> b) -> b -> t a -> b |
| 21:42:16 | <int-e> | (it's not quite the standard foldr) |
| 21:42:33 | <EvanR> | same thing but takes arguments in another order |
| 21:42:44 | × | MoC quits (~moc@user/moc) (Quit: Konversation terminated!) |
| 21:43:06 | <InternetCitizen> | yes my question is why does prelude flip the arguments for foldr |
| 21:43:13 | <InternetCitizen> | or foldl depending on how you see it |
| 21:43:38 | <int-e> | > foldr f z [a,b,c] -- note how the order of the list is preserved in the expression |
| 21:43:40 | <InternetCitizen> | it's clearly just as easy to do it this way |
| 21:43:40 | <lambdabot> | f a (f b (f c z)) |
| 21:43:46 | <InternetCitizen> | ah |
| 21:43:47 | <int-e> | > foldl f z [a,b,c] -- ditto |
| 21:43:49 | <lambdabot> | f (f (f z a) b) c |
| 21:44:41 | <EvanR> | in the foldr "callback" you can think of "the rest of the fold" being to the right, so it's second |
| 21:45:04 | <EvanR> | in foldl it's the opposite |
| 21:45:05 | <_73> | could the argument order have to do with making it easier to partially apply foldr? |
| 21:46:37 | <EvanR> | yeah it often is easier |
| 21:46:46 | <int-e> | _73: for the second and third argument you mean? yes, (a -> b -> b) -> [a] -> b -> b would be harder to partially apply when you want a function from lists |
| 21:46:50 | <EvanR> | but just as often my functions are backward xD |
| 21:47:39 | <InternetCitizen> | oh so the order the argument reflects the order of evaluation, it's genius |
| 21:47:41 | <int-e> | There's also foldr (:) [] = id to consider, I guess. |
| 21:48:07 | <EvanR> | I'm not sure about that theory |
| 21:48:50 | <EvanR> | it's more about which way the associativity leans than order of evaluation |
| 21:49:15 | <EvanR> | you should know, laziness lets you play around with evaluation order |
| 21:51:10 | <InternetCitizen> | oh right, well the associativity makes for a good mnemonic too |
| 21:51:14 | × | shailangsa_ quits (~shailangs@host86-186-142-101.range86-186.btcentralplus.com) (Ping timeout: 268 seconds) |
| 21:52:09 | × | jtomas quits (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 21:52:33 | → | jtomas joins (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) |
| 21:52:51 | <EvanR> | that slide show linked earlier by jackdk is really good for getting to the practical difference between them, carefully not mentioning any weirdness caused by haskell, and still being technically right xD |
| 21:55:54 | → | alx741 joins (~alx741@181.199.42.79) |
| 22:03:46 | <InternetCitizen> | the order of the args makes it awkaward to define `reverse` using foldl and it's impossible to do it with foldr |
| 22:04:18 | <EvanR> | you should be able to do anything you can do with foldl with foldr |
| 22:04:22 | <InternetCitizen> | I consider `reverse = foldl (:) []` a missed opportunity |
| 22:04:40 | <EvanR> | > foldl (:) [] [1,2,3,4,5] |
| 22:04:41 | <lambdabot> | error: |
| 22:04:41 | <lambdabot> | • Occurs check: cannot construct the infinite type: a ~ [a] |
| 22:04:41 | <lambdabot> | Expected type: [a] -> [a] -> [a] |
| 22:05:00 | <InternetCitizen> | it needs a flipped cons |
| 22:05:00 | <EvanR> | > foldl (flip (:)) [] [1,2,3,4,5] |
| 22:05:03 | <lambdabot> | [5,4,3,2,1] |
| 22:05:17 | <EvanR> | honestly not a big deal |
| 22:05:41 | × | coot quits (~coot@89-64-85-93.dynamic.chello.pl) (Quit: coot) |
| 22:05:49 | × | alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer) |
| 22:05:55 | <geekosaur> | it could have been defined that way, but keeping the order of parameters makes more sense (see earlier examples) |
| 22:05:59 | <InternetCitizen> | I'm joking :^) |
| 22:06:09 | <geekosaur> | I mena, it's not a real big opportunity to be missed |
| 22:06:25 | → | alx741 joins (~alx741@181.199.42.79) |
| 22:07:03 | × | [itchyjunk] quits (~itchyjunk@user/itchyjunk/x-7353470) (Remote host closed the connection) |
| 22:08:00 | → | acidjnk joins (~acidjnk@pd9e0bdc0.dip0.t-ipconnect.de) |
| 22:08:19 | × | Ankhers quits (~Ankhers@ec2-54-196-233-138.compute-1.amazonaws.com) (Quit: ZNC 1.8.2 - https://znc.in) |
| 22:11:56 | × | alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer) |
| 22:12:13 | <InternetCitizen> | > let k x y = 0 in foldl k 0 [1..] |
| 22:12:19 | <lambdabot> | mueval-core: Time limit exceeded |
| 22:12:31 | × | lavaman quits (~lavaman@98.38.249.169) (Remote host closed the connection) |
| 22:12:45 | × | ProfSimm quits (~ProfSimm@87.227.196.109) (Remote host closed the connection) |
| 22:13:06 | <InternetCitizen> | hah well clearly I don't understand lazy evaluation |
| 22:13:24 | <EvanR> | that one doesn't depend on lazy evaluation actually |
| 22:13:40 | <EvanR> | > foldl' (\x y -> 0) 0 [1..] |
| 22:13:46 | <lambdabot> | mueval-core: Time limit exceeded |
| 22:14:08 | <InternetCitizen> | > let k x y = 0 in foldr k 0 [1..] |
| 22:14:10 | <lambdabot> | 0 |
| 22:14:21 | <EvanR> | "foldl loops through the list" theory explains why it doesn't work on infinite lists |
| 22:14:53 | <InternetCitizen> | > let k x y = 0 in foldr' k 0 [1..] |
| 22:15:02 | <lambdabot> | mueval.real: ExitFailure 1 |
| 22:15:22 | <EvanR> | i'll let someone else explain that one xD |
| 22:15:55 | <InternetCitizen> | I expect foldr to reach in for the end of the list and find nothing |
| 22:16:06 | <InternetCitizen> | s,foldr,foldr' |
| 22:16:27 | <EvanR> | at least understand foldr first, for real. Since it's way more important |
| 22:17:12 | <geekosaur> | foldr may never reach the end of the list |
| 22:18:00 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 22:21:03 | <InternetCitizen> | > foldr (&&) True ([False] ++ repeat True) |
| 22:21:05 | <lambdabot> | False |
| 22:21:09 | <InternetCitizen> | like this? |
| 22:23:05 | <EvanR> | > False && (error "bomb") |
| 22:23:07 | <lambdabot> | False |
| 22:23:20 | <EvanR> | > False && (let x = x in x) |
| 22:23:21 | <lambdabot> | False |
| 22:23:52 | → | otherwise joins (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) |
| 22:24:19 | <EvanR> | that actually works in a lot of languages xD |
| 22:24:28 | <EvanR> | in haskell it's just lazy evaluation |
| 22:26:32 | → | ankhers joins (e99e97ef8e@2604:bf00:561:2000::2a2) |
| 22:27:43 | × | zincy quits (~zincy@2a00:23c8:970c:4801:c17f:9983:e5a5:ab71) (Remote host closed the connection) |
| 22:28:50 | → | alx741 joins (~alx741@157.100.93.160) |
| 22:29:17 | × | FinnElija quits (~finn_elij@user/finn-elija/x-0085643) (Killed (NickServ (Forcing logout FinnElija -> finn_elija))) |
| 22:29:17 | → | finn_elija joins (~finn_elij@user/finn-elija/x-0085643) |
| 22:29:17 | finn_elija | is now known as FinnElija |
| 22:30:25 | → | shailangsa joins (~shailangs@host86-162-150-202.range86-162.btcentralplus.com) |
| 22:30:46 | <dsal> | It works in Haskell without having a special case in the language. :) |
| 22:30:56 | <dsal> | You can define your own booleans with your own `and` operator and do the same thing. |
| 22:31:03 | <geekosaur> | @src (&&) |
| 22:31:04 | <lambdabot> | True && x = x |
| 22:31:04 | <lambdabot> | False && _ = False |
| 22:35:55 | geekosaur | wonders why the second case isn't _ && _ = False |
| 22:35:59 | → | deadmarshal joins (~deadmarsh@95.38.115.121) |
| 22:39:37 | <monochrom> | That's the religious war between two opposite interpretations of "future-proof". |
| 22:40:35 | × | deadmarshal quits (~deadmarsh@95.38.115.121) (Ping timeout: 252 seconds) |
| 22:40:35 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 22:41:35 | <monochrom> | Both camps begin with the premise "if, one day, we add one more constructor to Bool..." (OK Bool is a silly example but there are real examples.) |
| 22:41:51 | × | bitdex quits (~bitdex@gateway/tor-sasl/bitdex) (Ping timeout: 276 seconds) |
| 22:41:58 | × | mc47 quits (~mc47@xmonad/TheMC47) (Remote host closed the connection) |
| 22:42:45 | <monochrom> | One camp concludes "the patterns list all known constructors, so that when I turn on -Wall -Werror, I now receive a full list of functions that have not handled the additional constructor". |
| 22:43:03 | → | lavaman joins (~lavaman@98.38.249.169) |
| 22:43:11 | <geekosaur> | ob FileNotFound |
| 22:43:50 | <monochrom> | The other camp concludes "there is always a wildcard pattern, so that there is always a fall-through case, the function is total forever and ever". |
| 22:45:22 | <EvanR> | putting False explicitly expresses the behavior of && as equational laws and doesn't rely on "case checking order" |
| 22:45:31 | <EvanR> | for what that's worth |
| 22:46:17 | × | zer0bitz quits (~zer0bitz@196.244.192.57) (Ping timeout: 250 seconds) |
| 22:47:17 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 240 seconds) |
| 22:47:26 | × | takuan quits (~takuan@178-116-218-225.access.telenet.be) (Remote host closed the connection) |
| 22:51:57 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 240 seconds) |
| 22:52:02 | × | otherwise quits (~otherwise@c-73-221-44-172.hsd1.wa.comcast.net) (Remote host closed the connection) |
| 22:54:21 | × | gehmehgeh quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 22:56:17 | × | xff0x quits (~xff0x@2001:1a81:5243:1200:68a2:b42f:5a9a:d157) (Ping timeout: 240 seconds) |
| 22:56:38 | × | tromp quits (~textual@dhcp-077-249-230-040.chello.nl) (Quit: My iMac has gone to sleep. ZZZzzz…) |
| 22:56:52 | → | alx741 joins (~alx741@157.100.93.160) |
| 22:57:34 | → | xff0x joins (~xff0x@port-92-193-205-13.dynamic.as20676.net) |
| 23:01:45 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 23:05:21 | × | jumper149 quits (~jumper149@static.6.71.203.116.clients.your-server.de) (Quit: WeeChat 3.3) |
| 23:06:22 | × | jinsun quits (~quassel@user/jinsun) (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
| 23:15:15 | → | otherwise joins (~otherwise@c-71-231-39-206.hsd1.wa.comcast.net) |
| 23:15:55 | × | __monty__ quits (~toonn@user/toonn) (Quit: leaving) |
| 23:19:25 | → | alx741 joins (~alx741@157.100.93.160) |
| 23:20:02 | × | waleee quits (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) (Ping timeout: 268 seconds) |
| 23:21:03 | → | waleee joins (~waleee@2001:9b0:21d:fc00:398f:b003:b90d:acf4) |
| 23:21:16 | × | xb0o2 quits (~xb0o2@user/xb0o2) (Quit: Client closed) |
| 23:21:25 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 23:21:42 | → | incertia_ joins (~incertia@24.42.241.219) |
| 23:22:19 | × | incertia quits (~incertia@d4-50-26-103.nap.wideopenwest.com) (Ping timeout: 256 seconds) |
| 23:22:19 | incertia_ | is now known as incertia |
| 23:24:02 | <glguy> | int-e: is this the kind of solution you found for 21 using the independence of the two players? https://gist.github.com/glguy/f0352539902343a616663f61b4684f57#file-21-hs-L60 |
| 23:24:29 | <glguy> | doing that runs in Time (mean ± σ): 20.7 ms ± 1.5 ms [User: 3.2 ms, System: 5.2 ms] -- which is a few ms off the RTS startup time |
| 23:25:58 | × | coolnickname quits (uid531864@user/coolnickname) (Quit: Connection closed for inactivity) |
| 23:25:59 | <mjrosenb> | ooh, replicateM, I'll need to remember that. |
| 23:27:19 | <mjrosenb> | glguy: that looks about like my solution |
| 23:28:39 | × | madjestic quits (~madjestic@88-159-247-120.fixed.kpn.net) (Ping timeout: 268 seconds) |
| 23:30:40 | → | AlexNoo_ joins (~AlexNoo@94.233.241.181) |
| 23:30:40 | × | alx741 quits (~alx741@157.100.93.160) (Read error: Connection reset by peer) |
| 23:33:05 | × | Alex_test quits (~al_test@178.34.163.120) (Ping timeout: 256 seconds) |
| 23:33:17 | × | AlexZenon quits (~alzenon@178.34.163.120) (Ping timeout: 240 seconds) |
| 23:34:02 | × | AlexNoo quits (~AlexNoo@178.34.163.120) (Ping timeout: 240 seconds) |
| 23:35:33 | → | lavaman joins (~lavaman@98.38.249.169) |
| 23:37:03 | → | Alex_test joins (~al_test@94.233.241.181) |
| 23:37:43 | → | AlexZenon joins (~alzenon@94.233.241.181) |
| 23:38:19 | <otherwise> | it seems like type signature for length should show a list as the input. but it does not. I think this has to do with the nature of a foldable being applied one element at a time, but regardless of that it still takes a list as the input, right? |
| 23:38:28 | <otherwise> | :t length |
| 23:38:30 | <lambdabot> | Foldable t => t a -> Int |
| 23:38:37 | × | Gurkenglas quits (~Gurkengla@dslb-002-203-144-204.002.203.pools.vodafone-ip.de) (Ping timeout: 240 seconds) |
| 23:38:47 | <otherwise> | length 3 |
| 23:38:52 | <otherwise> | > length 3 |
| 23:38:54 | <lambdabot> | error: |
| 23:38:54 | <lambdabot> | • No instance for (Num [a0]) arising from the literal ‘3’ |
| 23:38:54 | <lambdabot> | • In the first argument of ‘length’, namely ‘3’ |
| 23:39:17 | <otherwise> | > length 3:[] |
| 23:39:19 | <lambdabot> | error: |
| 23:39:19 | <lambdabot> | • No instance for (Num [a0]) arising from the literal ‘3’ |
| 23:39:19 | <lambdabot> | • In the first argument of ‘length’, namely ‘3’ |
| 23:39:26 | <geekosaur> | parentheses |
| 23:39:26 | <otherwise> | > length (3:[]) |
| 23:39:28 | <lambdabot> | 1 |
| 23:39:53 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 256 seconds) |
| 23:39:53 | <geekosaur> | what it shows is "t a", where t is any Foldable. Lists are just one type of Foldable |
| 23:40:11 | <geekosaur> | you can, btw, write list types that way as well |
| 23:40:21 | <geekosaur> | :t [] Int |
| 23:40:22 | <lambdabot> | error: |
| 23:40:22 | <lambdabot> | • Data constructor not in scope: Int |
| 23:40:22 | <lambdabot> | • Perhaps you meant variable ‘int’ (imported from Text.PrettyPrint.HughesPJ) |
| 23:40:30 | <geekosaur> | right, duh |
| 23:40:51 | <_73> | > length (Just 7) |
| 23:40:53 | <lambdabot> | 1 |
| 23:40:56 | × | Bartol_ quits (~Bartol@user/Bartol) (Remote host closed the connection) |
| 23:41:06 | <geekosaur> | anyway `[] Int` is a valid way to write `[Int]` and looks more like the definition using Foldable |
| 23:41:25 | <geekosaur> | with t ~ [] (you can think of ~ as equality for types) |
| 23:41:57 | <geekosaur> | > length Nothing |
| 23:41:59 | <lambdabot> | 0 |
| 23:43:26 | <otherwise> | okay that is making more sense. |
| 23:43:34 | <EvanR> | otherwise, at some point length only worked on lists. Now it's more general. Same as sort works on list of anything with an Ord instance, not just [Int] or [Float] |
| 23:43:43 | <EvanR> | :t sort |
| 23:43:45 | <lambdabot> | Ord a => [a] -> [a] |
| 23:44:41 | <EvanR> | just that t in Foldable t is a type constructor so it's applied to something |
| 23:45:10 | <otherwise> | I struggle with the dissparate documentation. If I want to find the type for foldl, I type :t foldl in ghci, then I can type :doc foldl to get more valuable information, but then there is a schism. How do I find out what foldable t is? there is no command for pulling up documentation on that. |
| 23:45:29 | <geekosaur> | t is whatever Foldable you choose |
| 23:45:40 | <EvanR> | :i Foldable |
| 23:45:44 | <geekosaur> | you can use :info Foldable to find types with Foldable instances |
| 23:45:58 | → | madjestic joins (~madjestic@88-159-247-120.fixed.kpn.net) |
| 23:46:43 | <EvanR> | :doc Foldable |
| 23:46:47 | <EvanR> | cool beans |
| 23:46:52 | <geekosaur> | also that list will get longer as you import more things |
| 23:48:20 | <otherwise> | oh, I just didnt capitalize foldable ('smacks forhead') |
| 23:48:48 | <otherwise> | also I forgot about :i |
| 23:48:57 | <geekosaur> | conceptually, a Foldable type is any type that can be flattened to a list |
| 23:49:00 | → | alx741 joins (~alx741@181.199.42.79) |
| 23:49:02 | × | DNH quits (~DNH@2a02:8108:1100:16d8:7898:e7cb:a448:daff) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 23:49:59 | <monochrom> | Eventually you need to migrate to the web browser and read the HTML doc version. There is an online copy and there is also a copy on your disk. |
| 23:50:42 | <mjrosenb> | I don't think I've ever looked at the copy on my disk |
| 23:50:47 | <monochrom> | Doing everything at the REPL is self-defeating, given that "REPL" in this case means not exceeding a VT100 via a 300-baud modem. |
| 23:50:54 | <EvanR> | > toList ('a','b') -- horrible example of Foldable converting something to a list xD |
| 23:50:55 | <lambdabot> | "b" |
| 23:51:10 | → | DNH joins (~DNH@2a02:8108:1100:16d8:7898:e7cb:a448:daff) |
| 23:51:14 | <mjrosenb> | although, that would probably solve the problem of "the thing I get when I search for Data.Map is the docs for containers-0.4.0.0" |
| 23:51:20 | <geekosaur> | the instance everyone loves to hate |
| 23:51:32 | <monochrom> | I mean, it's not like ghci is equivalent to DrRacket or Mathematica notebooks. |
| 23:51:39 | <geekosaur> | mjrosenb, there's usually a link at the top that will take you to the latest version |
| 23:51:57 | × | max22- quits (~maxime@2a01cb0883359800f9d8f30ac05a4f67.ipv6.abo.wanadoo.fr) (Remote host closed the connection) |
| 23:52:03 | <geekosaur> | although if what it shows you is old enough there won't be. but you can take that itself as a warning |
| 23:52:40 | × | jtomas quits (~jtomas@153.red-83-53-252.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 23:52:50 | <geekosaur> | also, try searching hoogle instead of a general search engine |
| 23:54:33 | × | perrierjouet quits (~perrier-j@modemcable012.251-130-66.mc.videotron.ca) (Ping timeout: 268 seconds) |
| 23:54:33 | × | alx741 quits (~alx741@181.199.42.79) (Read error: Connection reset by peer) |
| 23:57:38 | <Henson> | ok, I figured some things out with the problem I was having. I got rid of TVars and used MVars, and the same problems happens, so it's not the TVars or MVars that's the problem. It's also not the TVar doubly-linked list either. I have a thread that captures images from the cameras and puts them into the captured images list (either in an MVar, TVar, or TVar linked list). I thought... |
| 23:58:48 | <Henson> | that the problem was with laziness and the camera images not being evaluated. When printing out the image size everything worked perfectly. However, it doesn't have to print anything related to the image, just printing /something/ from the thread is enough to make it work. If the thread doesn't print anything, it's like it doesn't even run properly and gets all jammed up. Is there anything... |
| 23:59:09 | <Henson> | I thought investigate with this threading problem (using the async library) where it doesn't seem like the thread loop is running reliably? |
| 23:59:22 | <Henson> | I thought investigate -> I should investigate |
| 23:59:32 | <geekosaur> | if the thread is defined incorrectly, all it may do is create a thunk that gets forced later |
All times are in UTC on 2021-12-29.