Logs: liberachat/#haskell
| 2021-07-08 15:40:45 | → | MQ-17J joins (~MQ-17J@8.21.10.15) |
| 2021-07-08 15:41:05 | → | norias joins (~jaredm@c-98-219-195-163.hsd1.pa.comcast.net) |
| 2021-07-08 15:43:09 | <dsal> | :t map (const ()) |
| 2021-07-08 15:43:10 | <lambdabot> | error: |
| 2021-07-08 15:43:10 | <lambdabot> | Ambiguous occurrence ‘map’ |
| 2021-07-08 15:43:10 | <lambdabot> | It could refer to |
| 2021-07-08 15:43:27 | <monochrom> | That's strange. |
| 2021-07-08 15:43:30 | <monochrom> | @undefine |
| 2021-07-08 15:43:31 | <lambdabot> | Undefined. |
| 2021-07-08 15:43:36 | <monochrom> | :t map |
| 2021-07-08 15:43:37 | <lambdabot> | (a -> b) -> [a] -> [b] |
| 2021-07-08 15:43:40 | <monochrom> | better |
| 2021-07-08 15:44:16 | <dsal> | :t (const.const) () |
| 2021-07-08 15:44:17 | <lambdabot> | b1 -> b2 -> () |
| 2021-07-08 15:44:23 | <wroathe> | monochrom: Why head? |
| 2021-07-08 15:44:24 | → | gioyik joins (~gioyik@gateway/tor-sasl/gioyik) |
| 2021-07-08 15:44:39 | <monochrom> | [t] -> t with t = a->b |
| 2021-07-08 15:44:49 | × | ptr_frac7al quits (~longlong@user/ptr-frac7al/x-0038398) (Ping timeout: 258 seconds) |
| 2021-07-08 15:45:02 | → | fluffyballoon joins (~fluffybal@199.204.58.62) |
| 2021-07-08 15:45:21 | <dsal> | wroathe: if you don't want the results of a function, bit calling it is the restaurant l easiest way to avoid it |
| 2021-07-08 15:45:40 | <dsal> | Phone language... |
| 2021-07-08 15:45:50 | <dsal> | Just don't call the function. |
| 2021-07-08 15:46:01 | <wroathe> | Ah. The scenario is that I'm actually doing this in Javascript, and I was using function composition but the object each routine is operating on is a reference type, and so for the sake of sanity I'm not going to require the user to return the object that's being operated on, and instead this routine is just going to call each function in a sequence with the object |
| 2021-07-08 15:46:35 | <dsal> | :t traverse_ |
| 2021-07-08 15:46:36 | <monochrom> | Translate our mapM_ to javascript. |
| 2021-07-08 15:46:36 | <lambdabot> | (Foldable t, Applicative f) => (a -> f b) -> t a -> f () |
| 2021-07-08 15:46:58 | <wroathe> | Ah. That's exactly what I was looking for. |
| 2021-07-08 15:47:00 | <wroathe> | Thanks. |
| 2021-07-08 15:47:22 | × | Pickchea quits (~private@user/pickchea) (Ping timeout: 246 seconds) |
| 2021-07-08 15:47:44 | <monochrom> | X -> IO Y vs X -> Y |
| 2021-07-08 15:48:03 | <wroathe> | monochrom: Yeah, that makes way more sense. |
| 2021-07-08 15:48:48 | → | yauhsien joins (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) |
| 2021-07-08 15:48:52 | × | cfricke quits (~cfricke@user/cfricke) (Quit: WeeChat 3.2) |
| 2021-07-08 16:03:05 | × | Obo quits (~roberto@122.red-83-38-248.dynamicip.rima-tde.net) (Quit: WeeChat 2.8) |
| 2021-07-08 16:11:06 | × | jippiedoe quits (~david@2a02-a44c-e14e-1-bdc4-1e8f-afa7-3bad.fixed6.kpn.net) (Ping timeout: 252 seconds) |
| 2021-07-08 16:11:36 | × | smarton quits (~smarton@121407.xyz) (Changing host) |
| 2021-07-08 16:11:36 | → | smarton joins (~smarton@gnu/webmaster/smarton) |
| 2021-07-08 16:12:11 | × | nsilv quits (~nsilv@212.103.198.210) (Quit: WeeChat 3.0.1) |
| 2021-07-08 16:13:30 | <Las[m]> | Does anyone here know how I'd parse only the first YAML document in a string? I'm trying to parse the YAML metadata blocks used with pandoc, but I'm assuming there's some clever way of doing it without me having to search for the `...` and stripping away everything after that. |
| 2021-07-08 16:13:57 | <Las[m]> | Both HsYAML and yaml just give me an error just after the `...`, which is where the Markdown starts of course |
| 2021-07-08 16:16:34 | × | alphabeta quits (~kilolympu@cpc92710-cmbg20-2-0-cust265.5-4.cable.virginm.net) (Ping timeout: 240 seconds) |
| 2021-07-08 16:18:05 | → | xerxes joins (~xerxes@117.222.64.149) |
| 2021-07-08 16:18:16 | <sm[m]> | parseYaml $ unlines $ takeWhile (/= "..." $ lines s ? |
| 2021-07-08 16:19:38 | <sm[m]> | * parseYaml $ unlines $ takeWhile (/= "...") $ lines s ? |
| 2021-07-08 16:20:13 | <kosmikus> | viluon: is your question about generics-sop still open? I'm not sure if I understand your comment correctly. the constraint `All SListI xss` does not say very much. In principle, all that it states is that all elements of `xss` must themselves be lists. This is in principle already clear by their kind, but the `SListI` gives inductive access to the list structure. |
| 2021-07-08 16:20:35 | <viluon> | kosmikus: hi! yes! |
| 2021-07-08 16:21:00 | <Las[m]> | sm: Yeah, I could do that, it just seems ugly since it parses it 2 times. |
| 2021-07-08 16:21:01 | <viluon> | kosmikus: thanks for the clarification, the documentation however states that `SListI xs` ensures `xs` is a *singleton* list |
| 2021-07-08 16:21:02 | × | dajoer quits (~david@user/gvx) (Quit: leaving) |
| 2021-07-08 16:22:29 | <kosmikus> | viluon: oh, I see. this phrasing is unfortunate. |
| 2021-07-08 16:22:36 | <sm[m]> | Las: if you also want the markdown part, use break and friends |
| 2021-07-08 16:22:45 | <kosmikus> | viluon: I should probably improve it. there's a concept in type-level programming of "singleton types". |
| 2021-07-08 16:22:53 | × | zeenk quits (~zeenk@2a02:2f04:a106:9600:82fb:aed9:ca9:38d3) (Quit: Konversation terminated!) |
| 2021-07-08 16:23:18 | <viluon> | kosmikus: oh, what are singleton types? Types of a single value? |
| 2021-07-08 16:23:24 | <kosmikus> | viluon: a singleton type is essentially a type that establishes a one-to-one correspondence between term-level entities and type-level entities of a particular kind. |
| 2021-07-08 16:23:58 | <kosmikus> | viluon: and you can use a singleton type as a proxy to perform induction / case distinctions on types of a kind. |
| 2021-07-08 16:24:06 | × | alx741 quits (~alx741@181.196.69.147) (Ping timeout: 272 seconds) |
| 2021-07-08 16:24:24 | → | cuz joins (~user@38.140.58.234) |
| 2021-07-08 16:24:41 | <kosmikus> | viluon: so what this comment is trying to say is that the `SListI xs` constraint provides such a singleton type for the kind of type-level lists. |
| 2021-07-08 16:24:55 | <kosmikus> | viluon: it does *not* mean to say that the list must somehow have exactly one element. |
| 2021-07-08 16:25:12 | <kosmikus> | viluon: but I can see how the current text might give that incorrect impression. |
| 2021-07-08 16:26:13 | <kosmikus> | viluon: btw, with any current version of generics-sop, explicitly stating this `All SListI xss` constraint on `gPrettyVal'` and `gPrettyVal''` is not actually required. it's already implied by the `All2 PrettyVal xss`. |
| 2021-07-08 16:28:01 | <kosmikus> | viluon: a simple example of a singleton type would be the GADT `data SBool (b :: Bool) where SFalse :: SBool False; STrue :: SBool True`. |
| 2021-07-08 16:28:01 | × | cuz quits (~user@38.140.58.234) (Remote host closed the connection) |
| 2021-07-08 16:28:28 | → | cuz joins (~user@38.140.58.234) |
| 2021-07-08 16:28:29 | <kosmikus> | viluon: now there's exactly one value `SFalse` corresponding to the type `False`, and one value `STrue` corresponding to the type `True`. |
| 2021-07-08 16:29:01 | <kosmikus> | viluon: if you want to define something by induction on the kind `Bool`, you can add a parameter of type `SBool b` to it and perform pattern matching on that GADT. |
| 2021-07-08 16:29:35 | <kosmikus> | viluon: there are a number of variations on this technique, including providing the value of type `SBool` implicitly by means of a type class. |
| 2021-07-08 16:29:41 | × | kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Quit: ERC (IRC client for Emacs 26.3)) |
| 2021-07-08 16:29:51 | <kosmikus> | viluon: `All SListI xs` does essentially that for the kind of type-level lists. |
| 2021-07-08 16:31:20 | × | cheater quits (~Username@user/cheater) (Ping timeout: 252 seconds) |
| 2021-07-08 16:31:35 | → | cheater joins (~Username@user/cheater) |
| 2021-07-08 16:37:59 | → | alx741 joins (~alx741@181.196.68.47) |
| 2021-07-08 16:39:10 | × | chomwitt quits (~Pitsikoko@athedsl-16082.home.otenet.gr) (Ping timeout: 246 seconds) |
| 2021-07-08 16:39:18 | → | Gurkenglas joins (~Gurkengla@dslb-002-203-144-156.002.203.pools.vodafone-ip.de) |
| 2021-07-08 16:39:58 | <viluon> | kosmikus: thanks for the thorough explanation! |
| 2021-07-08 16:40:58 | × | yauhsien quits (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) (Remote host closed the connection) |
| 2021-07-08 16:41:31 | → | yauhsien joins (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) |
| 2021-07-08 16:46:09 | × | nschoe quits (~quassel@178.251.84.79) (Ping timeout: 268 seconds) |
| 2021-07-08 16:46:38 | × | yauhsien quits (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) (Ping timeout: 252 seconds) |
| 2021-07-08 16:47:57 | → | jneira[m] joins (~jneira@47.red-176-83-116.dynamicip.rima-tde.net) |
| 2021-07-08 16:48:16 | × | argento quits (~argent0@168-227-97-29.ptr.westnet.com.ar) (Ping timeout: 246 seconds) |
| 2021-07-08 16:55:05 | → | mekeor joins (~user@2001:a61:3430:c01:f86:cca7:c1fe:e2b4) |
| 2021-07-08 16:55:47 | → | yauhsien joins (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) |
| 2021-07-08 16:57:35 | <viluon> | kosmikus: so.. with `SListI xs` you can "map" the typelevel `xs` list to a term - a list - which you can perform induction on? But you still don't know anything about its elements? |
| 2021-07-08 16:57:59 | <viluon> | kosmikus: if so, how's that different to just saying `[x]`? |
| 2021-07-08 16:58:13 | <viluon> | or `'[x]` |
| 2021-07-08 17:00:20 | × | yauhsien quits (~yauhsien@61-231-39-135.dynamic-ip.hinet.net) (Ping timeout: 258 seconds) |
| 2021-07-08 17:01:21 | → | Deide joins (~Deide@217.155.19.23) |
| 2021-07-08 17:01:21 | × | Deide quits (~Deide@217.155.19.23) (Changing host) |
| 2021-07-08 17:01:21 | → | Deide joins (~Deide@user/deide) |
| 2021-07-08 17:04:04 | <kosmikus> | viluon: let's say you want to create something like an `NP (K ()) xs`. |
| 2021-07-08 17:04:33 | <kosmikus> | viluon: conceptually, it's easy. you just have to repeat `K ()` as often as the type-level list `xs` dictates. but how do you actually do this? |
| 2021-07-08 17:04:57 | × | jneira[m] quits (~jneira@47.red-176-83-116.dynamicip.rima-tde.net) (Remote host closed the connection) |
| 2021-07-08 17:05:16 | × | drd quits (~drd@93-39-151-19.ip76.fastwebnet.it) (Ping timeout: 268 seconds) |
| 2021-07-08 17:05:18 | <viluon> | kosmikus: oh, so the constraint part is trivial, the length-preserving mapping is what counts? |
| 2021-07-08 17:05:21 | <kosmikus> | viluon: if you define `makeNP :: NP (K ()) xs`, you have no inputs whatsoever. nothing you can perform induction on. you cannot look whether `xs` is expected to be empty or not. |
| 2021-07-08 17:05:51 | <kosmikus> | viluon: that's why you need something extra that'll give you access to the structure of `xs`. |
| 2021-07-08 17:06:58 | → | georg joins (~georg@84-112-37-146.cable.dynamic.surfer.at) |
| 2021-07-08 17:07:39 | <kosmikus> | viluon: and that's what the `SListI xs` constraint provides you with. |
All times are in UTC.