Logs: freenode/#haskell
| 2021-05-12 21:31:55 | → | renzhi joins (~renzhi@2607:fa49:6500:bc00::e7b) |
| 2021-05-12 21:32:10 | <deejaytee> | I'm aware of http://hackage.haskell.org/package/ghc-lib-parser but I'm not sure if that is what you're looking for |
| 2021-05-12 21:32:35 | → | olligobber joins (olligobber@gateway/vpn/privateinternetaccess/olligobber) |
| 2021-05-12 21:34:02 | → | chasmonad joins (9d83a8ce@157-131-168-206.fiber.dynamic.sonic.net) |
| 2021-05-12 21:35:41 | × | ddellacosta quits (ddellacost@gateway/vpn/mullvad/ddellacosta) (Ping timeout: 240 seconds) |
| 2021-05-12 21:36:02 | <chasmonad> | hi all... is there a way to capture `cabal build` output so I can filter out the extraneous version spam? `cabal build 2>&1 | grep -v extraneous` does not work, for example |
| 2021-05-12 21:36:42 | → | mounty joins (~mounty@236.216.214.218.sta.wbroadband.net.au) |
| 2021-05-12 21:36:52 | <xaxaxixax> | oh nice, that might be able to fix the inconsistent docs issue, thanks! the problem is the AST is handed to me by GHC, so I have to track down the exact docs for the version of GHC I'm using. i think though if I use the haddock build/host thing that should work |
| 2021-05-12 21:37:25 | <xaxaxixax> | the data types themselves are real messes though, the source line tagging and everything makes it a horrible mess to pattern match on |
| 2021-05-12 21:37:44 | × | grepcake quits (~artyom@77.234.203.49) (Quit: Konversation terminated!) |
| 2021-05-12 21:37:58 | × | Aquazi quits (uid312403@gateway/web/irccloud.com/x-oagakatzmderzmkp) (Quit: Connection closed for inactivity) |
| 2021-05-12 21:37:59 | <xaxaxixax> | never used lenses but they're one solution to this sort of issue, right? |
| 2021-05-12 21:38:02 | × | fendor quits (~fendor@178.165.130.48.wireless.dyn.drei.com) (Remote host closed the connection) |
| 2021-05-12 21:42:23 | <deejaytee> | it depends - if all you need is to match on particularly complex data constructors that will always have the same shape, PatternSynonyms may be all you need |
| 2021-05-12 21:42:50 | × | tsaka__ quits (~torstein@178-147-206-209.haap.dm.cosmote.net) (Ping timeout: 246 seconds) |
| 2021-05-12 21:43:26 | → | nut joins (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) |
| 2021-05-12 21:43:35 | <deejaytee> | (it's a language extension) |
| 2021-05-12 21:43:37 | × | stree quits (~stree@68.36.8.116) (Ping timeout: 265 seconds) |
| 2021-05-12 21:44:27 | × | Tuplanolla quits (~Tuplanoll@91-159-68-239.elisa-laajakaista.fi) (Quit: Leaving.) |
| 2021-05-12 21:51:23 | × | chasmonad quits (9d83a8ce@157-131-168-206.fiber.dynamic.sonic.net) (Ping timeout: 240 seconds) |
| 2021-05-12 21:53:07 | × | wonko7 quits (~wonko7@62.115.229.50) (Ping timeout: 252 seconds) |
| 2021-05-12 21:53:27 | → | chasmonad joins (9d83a8ce@157-131-168-206.fiber.dynamic.sonic.net) |
| 2021-05-12 21:53:49 | → | elfets joins (~elfets@ip-37-201-23-96.hsi13.unitymediagroup.de) |
| 2021-05-12 21:53:59 | <chasmonad> | hmmmm ping timeouts sigh |
| 2021-05-12 21:55:44 | <xaxaxixax> | ah pattern synonyms look really nice, im kicking myself for not finding this earlier |
| 2021-05-12 21:56:37 | <xaxaxixax> | incidentally, are extensions implemented in the same way as plugins? |
| 2021-05-12 21:56:49 | → | stree joins (~stree@68.36.8.116) |
| 2021-05-12 21:57:05 | <deejaytee> | one of the best and worst things I ever did was read the whole GHC language extension list end to end |
| 2021-05-12 21:57:57 | → | tonyc- joins (~tonyc@208.163.180.21) |
| 2021-05-12 21:58:16 | <ski> | dunno what you mean by "plugins" |
| 2021-05-12 21:58:43 | <deejaytee> | re extension implementation, no idea, but I suspect a fair few of them would be difficult to impossible w/ just the GHC API |
| 2021-05-12 21:59:07 | <deejaytee> | if that's what you mean by plugins |
| 2021-05-12 21:59:09 | → | star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com) |
| 2021-05-12 21:59:30 | tonyc- | is now known as Xyberista |
| 2021-05-12 21:59:39 | <xaxaxixax> | plugins as in https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/extending_ghc.html#compiler-plugins |
| 2021-05-12 22:00:00 | × | ddellac__ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Remote host closed the connection) |
| 2021-05-12 22:00:16 | × | isovector quits (~isovector@172.103.216.166) (Ping timeout: 252 seconds) |
| 2021-05-12 22:00:33 | → | ddellaco_ joins (~ddellacos@ool-44c73afa.dyn.optonline.net) |
| 2021-05-12 22:00:53 | → | ddellac__ joins (~ddellacos@86.106.143.137) |
| 2021-05-12 22:00:59 | × | ubert quits (~Thunderbi@p200300ecdf005e54e6b318fffe838f33.dip0.t-ipconnect.de) (Remote host closed the connection) |
| 2021-05-12 22:01:08 | × | olligobber quits (olligobber@gateway/vpn/privateinternetaccess/olligobber) (Remote host closed the connection) |
| 2021-05-12 22:01:28 | × | chasmonad quits (9d83a8ce@157-131-168-206.fiber.dynamic.sonic.net) (Quit: Connection closed) |
| 2021-05-12 22:01:32 | <Cale> | xaxaxixax: Pattern synonyms are equal parts nice and horrible. :) |
| 2021-05-12 22:01:39 | <Cale> | They're a cool idea, but the way they interact with the type system is a bit cringey. |
| 2021-05-12 22:01:50 | <Cale> | You end up with weird-looking types with multiple => contexts that can't be combined, because there's a distinction to be made between what needs to be true to use the pattern synonym and what you learn when you use it. |
| 2021-05-12 22:02:28 | <Cale> | -- and even that doesn't really get you the full generality you might want, since there's still one big forall quantifying the variables |
| 2021-05-12 22:02:28 | <ski> | some kind of version of mode declarations, a la Mercury, could be helpful |
| 2021-05-12 22:03:11 | ← | Xyberista parts (~tonyc@208.163.180.21) ("""") |
| 2021-05-12 22:03:17 | <Cale> | Or maybe there ought to be a type constructor for patterns |
| 2021-05-12 22:04:15 | → | nvmd joins (~nvmd@177.30.111.232) |
| 2021-05-12 22:04:26 | <ski> | (or, i suppose one could possibly phrase them as a sort of functional dependency / injectivity constraints, hmm .. although how would one specify which constraints are learned ?) |
| 2021-05-12 22:04:29 | <Cale> | There's this distinction between required and provided stuff when it comes to classes, but not for arguments to the pattern, and I think it makes sense to want that sometimes |
| 2021-05-12 22:04:49 | <ski> | yes, it definitely does |
| 2021-05-12 22:05:21 | × | ddellaco_ quits (~ddellacos@ool-44c73afa.dyn.optonline.net) (Ping timeout: 260 seconds) |
| 2021-05-12 22:05:35 | <ski> | e.g. imagine being able to match on `xs ++ ys', `xs' being an expression, and `ys' a pattern |
| 2021-05-12 22:05:43 | × | `slikts quits (~nelabs@wikipedia/reinis) (Ping timeout: 260 seconds) |
| 2021-05-12 22:05:44 | <Cale> | yeah |
| 2021-05-12 22:05:57 | × | mikoto-chan quits (~mikoto-ch@gateway/tor-sasl/mikoto-chan) (Ping timeout: 240 seconds) |
| 2021-05-12 22:06:01 | <Cale> | Or if you wanted to implement c*n + k patterns :) |
| 2021-05-12 22:06:48 | ski | was sketching some examples, another time, of a syntax in which such expression-parameterized pattern-synonyms could naturally be specified/defined |
| 2021-05-12 22:07:28 | → | isovector joins (~isovector@172.103.216.166) |
| 2021-05-12 22:08:11 | × | Guest9827 quits (~textual@zrcout.mskcc.org) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-05-12 22:08:13 | → | bitdex joins (~bitdex@gateway/tor-sasl/bitdex) |
| 2021-05-12 22:08:34 | <Iceland_jack> | https://gitlab.haskell.org/ghc/ghc/-/wikis/pattern-families |
| 2021-05-12 22:08:55 | <ski> | (hm, also reminds me i should continue thinking about specifying bijections / type equalities directly, since that ties into these syntactical matters about patterns as well ..) |
| 2021-05-12 22:09:01 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 260 seconds) |
| 2021-05-12 22:09:25 | <Cale> | I was thinking it might be nice to have, instead of Req => Prov => t1 -> ... -> tn -> t, have all the "required" stuff occur outside the Pattern type constructor, and provided stuff inside it, like Req => Pattern (Prov => t1 -> ... -> tn -> t) |
| 2021-05-12 22:09:46 | <ski> | oh, i forgot to ask what you mean by "type constructor for patterns" |
| 2021-05-12 22:10:07 | <ski> | Iceland_jack : unfortunately seems to time out atm. hopefully it'll work later ? |
| 2021-05-12 22:10:08 | <Cale> | Yeah, just a sort of wired-in thing |
| 2021-05-12 22:10:42 | <ski> | could you give an example of how it might look, for a concrete example ? |
| 2021-05-12 22:11:23 | <deejaytee> | stopped timing out for me about a minute ago |
| 2021-05-12 22:11:53 | <geekosaur> | it's been having problems all afternoon, just retry until it works |
| 2021-05-12 22:13:19 | × | rond_ quits (531cde7e@bmc126.neoplus.adsl.tpnet.pl) (Quit: Connection closed) |
| 2021-05-12 22:14:27 | → | Rudd0 joins (~Rudd0@185.189.115.108) |
| 2021-05-12 22:14:55 | <Cale> | Sure, so we could have something like... pattern Is :: (Eq a) => a -> Pattern a; pattern Is x y = (True <- x == y) |
| 2021-05-12 22:14:58 | → | gzj joins (~gzj@unaffiliated/gzj) |
| 2021-05-12 22:15:47 | <ski> | Cale : <https://paste.tomsmeding.com/Qa0bDI6k> was some scribbles (experimenting with several alternative syntaces) on this that i did |
| 2021-05-12 22:15:53 | <Cale> | er... something like that |
| 2021-05-12 22:19:49 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-05-12 22:20:04 | × | nut quits (~nut@roc37-h01-176-170-197-243.dsl.sta.abo.bbox.fr) (Ping timeout: 252 seconds) |
| 2021-05-12 22:20:59 | × | Varis quits (~Tadas@unaffiliated/varis) (Remote host closed the connection) |
| 2021-05-12 22:21:30 | × | gzj quits (~gzj@unaffiliated/gzj) (Remote host closed the connection) |
| 2021-05-12 22:21:50 | × | jao quits (~jao@pdpc/supporter/professional/jao) (Remote host closed the connection) |
| 2021-05-12 22:21:50 | → | gzj joins (~gzj@unaffiliated/gzj) |
| 2021-05-12 22:22:00 | × | renzhi quits (~renzhi@2607:fa49:6500:bc00::e7b) (Ping timeout: 246 seconds) |
| 2021-05-12 22:22:29 | <ski> | Cale : how about `pattern Req => psyn ParamType0 ... :: Prov => BindType0 -> ... -> MatchType', in that case. so `pattern Eq a => Is a :: a; pattern Is x = ((x ==) -> True)' (or with a different style of doing the concrete defining equation, if you prefer) ? |
| 2021-05-12 22:23:30 | <ski> | hmm |
| 2021-05-12 22:24:15 | <Cale> | Oh, yeah, I kind of fucked up my example there, but you got the idea of it :) |
| 2021-05-12 22:24:21 | × | gehmehgeh quits (~ircuser1@gateway/tor-sasl/gehmehgeh) (Ping timeout: 240 seconds) |
| 2021-05-12 22:24:30 | <ski> | (yea, `Is x y' didn't make sense to me ..) |
| 2021-05-12 22:25:11 | <Cale> | Yeah, it should have been Is x = (True <- (x ==)) indeed |
| 2021-05-12 22:25:28 | → | jao joins (~jao@pdpc/supporter/professional/jao) |
| 2021-05-12 22:25:34 | <ski> | i suppose with `data Foo = Prov => Mk T U', `T' and `U' would be "bind types", not "param types" .. hm. making the analogy less appealing |
| 2021-05-12 22:26:43 | → | gehmehgeh joins (~ircuser1@gateway/tor-sasl/gehmehgeh) |
| 2021-05-12 22:27:53 | → | bitmapper joins (uid464869@gateway/web/irccloud.com/x-adzrjzdemregudmd) |
| 2021-05-12 22:29:23 | <ski> | (one could also perhaps imagine wanting the param types to sometimes come after the bind ones. like with `n + k' (rather than `k + n' that i did in the paste above). something like `pattern Integral a,Ord a,k :: a |- n + k :: a -| n :: a', hmm ..) |
| 2021-05-12 22:32:56 | <ski> | as for definitions, i had the notion of `pattern case <pattern application definiendum> of <implementing body pattern (definiens)> -> <list of bindings to make>; ...' (see e.g. `(/\/)' in the paste) |
| 2021-05-12 22:35:40 | <ski> | however, instead of having the pattern definiendum be of the form `psyn param0 ... subpattern0 ...' (where `param0',.. are ordinary patterns that you can match on, like the left parameter of `++'. effectively `[] ++ ys' is a different pattern synonym to `(x:xs) ++ ys', and `xs ++ ys' is a pattern synonym that will dispatch to one of the former, after matching on `xs') |
| 2021-05-12 22:36:58 | <ski> | and where `subpattern0',.. are identifiers referring to the subpatterns that we actually apply the pattern synonym to, where we must mention all those identifiers once, in the definiens / body pattern (the expansion of the pattern synonym) |
All times are in UTC.