Logs: liberachat/#haskell
| 2021-06-05 17:00:08 | <motte> | hi, how can i join two aeson arrays together? the arrays are non-homogeneous, thus i can't just join them together before calling toJSON |
| 2021-06-05 17:00:34 | → | ddellacosta joins (~ddellacos@89.46.62.43) |
| 2021-06-05 17:02:24 | → | Erutuon joins (~Erutuon@user/erutuon) |
| 2021-06-05 17:03:04 | → | ddellaco_ joins (~ddellacos@89.46.62.116) |
| 2021-06-05 17:04:21 | → | hexo joins (~hexo@user/hexo) |
| 2021-06-05 17:04:34 | → | Sose joins (~username@mobile-access-6df047-172.dhcp.inet.fi) |
| 2021-06-05 17:05:15 | → | rk04 joins (~rk04@user/rajk) |
| 2021-06-05 17:05:28 | → | Jeanne-Kamikaze joins (~Jeanne-Ka@static-198-54-133-135.cust.tzulo.com) |
| 2021-06-05 17:06:18 | × | ddellacosta quits (~ddellacos@89.46.62.43) (Ping timeout: 264 seconds) |
| 2021-06-05 17:06:41 | × | Bartosz quits (~textual@24.35.90.211) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-06-05 17:09:29 | × | justsomeguy quits (~justsomeg@user/justsomeguy) (Quit: WeeChat 3.0.1) |
| 2021-06-05 17:11:39 | → | emliunix joins (~emliunix@103.138.74.59) |
| 2021-06-05 17:12:30 | × | ddellaco_ quits (~ddellacos@89.46.62.116) (Read error: Connection reset by peer) |
| 2021-06-05 17:13:04 | → | ddellacosta joins (~ddellacos@89.46.62.116) |
| 2021-06-05 17:13:08 | → | Bartosz joins (~textual@24.35.90.211) |
| 2021-06-05 17:15:52 | → | boxscape joins (~boxscape@user/boxscape) |
| 2021-06-05 17:18:00 | <boxscape> | motte what are the types before you convert it to JSON? |
| 2021-06-05 17:18:25 | × | Hanicef quits (~gustaf@81-229-9-108-no92.tbcn.telia.com) (Quit: leaving) |
| 2021-06-05 17:18:53 | × | lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 252 seconds) |
| 2021-06-05 17:21:14 | × | samhh quits (~samhh@90.252.97.14) (Quit: samhh) |
| 2021-06-05 17:21:46 | <motte> | [Tree a], and [b], where a and b are my own defined data types |
| 2021-06-05 17:22:50 | <motte> | paste: http://ix.io/3oRf |
| 2021-06-05 17:22:55 | × | aplainze1akind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Quit: Free ZNC ~ Powered by LunarBNC: https://LunarBNC.net) |
| 2021-06-05 17:23:27 | <motte> | essentially i'd like to do "children" .= children ++ targets |
| 2021-06-05 17:23:39 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 2021-06-05 17:23:51 | → | anderson joins (~ande@134.209.221.71) |
| 2021-06-05 17:24:06 | <boxscape> | motte I'm not sure if this is the best way, but you could make a type `data HasJSON = forall a . HasJSON (ToJSON a => a)`, write `map HasJSON xs ++ HasJSON ys`, then you just need to make a ToJSON instance for this type that uses the ToJSON instance of a |
| 2021-06-05 17:24:16 | × | aplainzetakind quits (~johndoe@captainludd.powered.by.lunarbnc.net) (Client Quit) |
| 2021-06-05 17:25:07 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 2021-06-05 17:25:11 | → | dunkeln joins (~dunkeln@94.129.65.28) |
| 2021-06-05 17:25:19 | <motte> | thanks, i'll try it out |
| 2021-06-05 17:25:50 | <ski> | boxscape : did you mean `data HasJSON = forall a. ToJSON a => HasJSON a' ? |
| 2021-06-05 17:26:15 | <boxscape> | ski erm, yes, I suppose I did |
| 2021-06-05 17:26:19 | <boxscape> | ^ motte |
| 2021-06-05 17:26:19 | → | jmcarthur joins (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) |
| 2021-06-05 17:28:07 | → | ddellaco_ joins (~ddellacos@86.106.121.196) |
| 2021-06-05 17:30:06 | <ski> | i guess if one wanted `FromJSON HasJSON' too, that'd be harder |
| 2021-06-05 17:30:59 | × | dunkeln quits (~dunkeln@94.129.65.28) (Ping timeout: 252 seconds) |
| 2021-06-05 17:31:10 | <motte> | yeah i thought of it a little bit and i think i need FromJSON too, so maybe i'll just try to make the types homogeneous |
| 2021-06-05 17:31:37 | → | wonko joins (~wjc@62.115.229.50) |
| 2021-06-05 17:31:56 | → | Guest60 joins (~Guest60@187.83.249.216.dyn.smithville.net) |
| 2021-06-05 17:32:47 | → | econo joins (uid147250@user/econo) |
| 2021-06-05 17:32:50 | × | ddellaco_ quits (~ddellacos@86.106.121.196) (Ping timeout: 245 seconds) |
| 2021-06-05 17:34:20 | <ski> | could the JSON representation of a tree look the same as the one for a target ? |
| 2021-06-05 17:36:11 | → | dhil joins (~dhil@195.213.192.47) |
| 2021-06-05 17:38:47 | <ski> | i guess maybe you could make a `data TreeOrTarget = FromTree (Tree GroupWithTargets) | From Target', and make `ToJSON' and `FromJSON' instances for that, then in `FromJSON (Tree GroupWithTargets)' you could grab a `[TreeOrTarget]', and then split that into `([Tree GroupWithTargets],[Target])' |
| 2021-06-05 17:41:24 | <arjun> | can i make an absolute path from a relative FilePath like sourcePath = "../source/contents/" |
| 2021-06-05 17:41:42 | <arjun> | how can i * |
| 2021-06-05 17:42:09 | <monochrom> | If you also know the current working directory, you can compute it, or just do concatenation. |
| 2021-06-05 17:42:09 | × | jmcarthur quits (~jmcarthur@c-73-29-224-10.hsd1.nj.comcast.net) (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
| 2021-06-05 17:42:24 | <arjun> | System.Directory (makeAblsoulte) introduces a ".." in the path |
| 2021-06-05 17:42:34 | × | Guest60 quits (~Guest60@187.83.249.216.dyn.smithville.net) (Quit: Client closed) |
| 2021-06-05 17:42:58 | <monochrom> | probably because the author just does concatenation. I mean why bother. |
| 2021-06-05 17:43:04 | <arjun> | monochrom: it's outside my currentDir. but sure, i can get my cd |
| 2021-06-05 17:44:16 | <arjun> | like i have to go a level up and 2 levels down |
| 2021-06-05 17:46:52 | × | reumeth quits (~reumeth@user/reumeth) (Ping timeout: 268 seconds) |
| 2021-06-05 17:48:36 | × | rk04 quits (~rk04@user/rajk) (Quit: rk04) |
| 2021-06-05 17:48:53 | → | reumeth joins (~reumeth@user/reumeth) |
| 2021-06-05 17:48:57 | <arjun> | monochrom: nvm, found it. |
| 2021-06-05 17:51:33 | → | safinaskar joins (~user@109.252.90.89) |
| 2021-06-05 17:52:23 | × | Bartosz quits (~textual@24.35.90.211) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2021-06-05 17:52:56 | × | reumeth quits (~reumeth@user/reumeth) (Ping timeout: 244 seconds) |
| 2021-06-05 17:53:02 | → | dunkeln joins (~dunkeln@94.129.65.28) |
| 2021-06-05 17:53:58 | → | Bartosz joins (~textual@24.35.90.211) |
| 2021-06-05 17:54:32 | <safinaskar> | consider this code: do { c <- lookup a b; lookup d c }. is this possible to write it similar to this: lookup d <<lookup a b>>. Here << >> are hypotetical brackets, which will simplify writing monadic code. Maybe such brackets already exists? Maybe arrow bananas are exactly such brackets?! |
| 2021-06-05 17:55:08 | <ski> | lookup d =<< lookup a b |
| 2021-06-05 17:55:38 | × | ddellacosta quits (~ddellacos@89.46.62.116) (Remote host closed the connection) |
| 2021-06-05 17:55:47 | → | ddellacosta joins (~ddellacos@89.46.62.116) |
| 2021-06-05 17:55:52 | <safinaskar> | ski: yes, but what to do in more complicated cases? i will provide example |
| 2021-06-05 17:56:14 | <safinaskar> | let's assume safeDiv is safe division with type Int -> Int -> Maybe Int |
| 2021-06-05 17:56:15 | × | ddellacosta quits (~ddellacos@89.46.62.116) (Remote host closed the connection) |
| 2021-06-05 17:56:27 | → | justsomeguy joins (~justsomeg@user/justsomeguy) |
| 2021-06-05 17:56:42 | <ski> | i have a (vaporware) syntax (with type system rules, and translation rules), including such brackets |
| 2021-06-05 17:56:44 | → | ddellacosta joins (~ddellacos@89.46.62.116) |
| 2021-06-05 17:56:55 | <safinaskar> | now consider this: do { x <- (a + b) `safeDiv` (c + d); x * y + z `safeDiv` 2; } |
| 2021-06-05 17:57:22 | <boxscape> | vaporwave syntax? |
| 2021-06-05 17:57:40 | <boxscape> | oh wait |
| 2021-06-05 17:57:44 | <boxscape> | I misread, lol |
| 2021-06-05 17:57:51 | ski | glances around nervously |
| 2021-06-05 17:58:07 | <boxscape> | funnily I was thinking "there is a word that sounds similar that would fit here, but I can't think of it" |
| 2021-06-05 17:58:17 | <monochrom> | haha |
| 2021-06-05 17:58:46 | <safinaskar> | are arrow bananas (| ... |) ( https://downloads.haskell.org/~ghc/8.10.2/docs/html/users_guide/glasgow_exts.html#arrow-notation ) what i need?! |
| 2021-06-05 17:58:53 | <c_wraith> | now I want syntax with lots of neon pink and blue |
| 2021-06-05 18:00:09 | × | fabfianda quits (~fabfianda@net-93-148-121-206.cust.dsl.teletu.it) (Ping timeout: 265 seconds) |
| 2021-06-05 18:00:15 | <justsomeguy> | I want syntax highlighting that makes parenthesis taller when they enclose another pair of parenthesis. |
| 2021-06-05 18:00:57 | <justsomeguy> | Sorry, that was random. |
| 2021-06-05 18:01:10 | × | ddellacosta quits (~ddellacos@89.46.62.116) (Ping timeout: 245 seconds) |
| 2021-06-05 18:01:40 | <monochrom> | No, that's a natural desire. |
| 2021-06-05 18:02:01 | <monochrom> | Random would be "I want parenthesis height to be random" :D |
| 2021-06-05 18:02:10 | <justsomeguy> | :D |
| 2021-06-05 18:02:54 | <mrmonday> | the kerning should be just a little bit different at each level |
| 2021-06-05 18:03:09 | <monochrom> | Well, I wouldn't hold my breath for it. You can't even talk programmers out of fixed-width fonts, so nevermind variable heights. |
| 2021-06-05 18:03:29 | <safinaskar> | ski: please, show that your software |
| 2021-06-05 18:05:39 | <ski> | ⌜ ⟨ ⌞ (a + b) `safeDiv` (c + d) ⌟ * y + z `safeDiv` 2 ⟩ ⌝ |
| 2021-06-05 18:05:59 | <ski> | alternatively |
| 2021-06-05 18:06:20 | <ski> | ⌜ ⟨ ⟨ (a + b) `safeDiv` (c + d) ⟩ * y + z `safeDiv` 2 ⟩ ⌝ |
| 2021-06-05 18:07:14 | → | ddellacosta joins (~ddellacos@89.46.62.209) |
| 2021-06-05 18:07:26 | <ski> | (innermost unquotes can be replaced by "splices") |
| 2021-06-05 18:07:56 | <safinaskar> | ski: does actual tool exist, which accept such syntax? |
| 2021-06-05 18:09:19 | → | ddellaco_ joins (~ddellacos@89.45.224.79) |
All times are in UTC.