Logs: freenode/#haskell
| 2020-09-29 13:08:58 | <dminuoso> | You're tripping into Apple issues. |
| 2020-09-29 13:09:56 | <dminuoso> | (Note you will need an iCloud account to reach that) |
| 2020-09-29 13:10:07 | <dminuoso> | Or rather, an Apple Id. |
| 2020-09-29 13:10:09 | <guest12> | yeye which do i download |
| 2020-09-29 13:10:16 | <dminuoso> | Dunno, what do you see there? |
| 2020-09-29 13:10:43 | × | Rudd0 quits (~Rudd0@185.189.115.103) (Ping timeout: 260 seconds) |
| 2020-09-29 13:10:59 | <guest12> | A lot of stuff xcode 12, command line tools for xcode lots and lots of stuff |
| 2020-09-29 13:10:59 | <dminuoso> | Ah the top one |
| 2020-09-29 13:11:05 | <Squarism> | Does there exist some type description language (think protocol buffers/openapi/xml-schema/thrift) that has sum/product types and type functions (atleast paramterized types)? Something that handles the basics of haskell type system. |
| 2020-09-29 13:11:07 | <dminuoso> | Command Line Tools for XCode 12 |
| 2020-09-29 13:11:08 | <dminuoso> | should be fine |
| 2020-09-29 13:11:14 | <guest12> | okay |
| 2020-09-29 13:11:22 | <dminuoso> | Squarism: servant? |
| 2020-09-29 13:11:34 | <dminuoso> | or, are you thinking something else? |
| 2020-09-29 13:12:02 | <dminuoso> | (you can encode anonymous sum/product types up to isomorphism with Either and (,), or using custom data types) |
| 2020-09-29 13:12:09 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 258 seconds) |
| 2020-09-29 13:12:09 | × | Ariakenom__ quits (~Ariakenom@h-178-174-193-185.NA.cust.bahnhof.se) (Ping timeout: 258 seconds) |
| 2020-09-29 13:12:30 | <Squarism> | dminuoso, I meant a textual representation that was at least aimed to be language agnostic. |
| 2020-09-29 13:12:45 | <dminuoso> | What would that language describe? |
| 2020-09-29 13:13:19 | → | aplainzetakind joins (~johndoe@captainludd.powered.by.lunarbnc.net) |
| 2020-09-29 13:13:20 | <Squarism> | data structures (or types in haskell terms) |
| 2020-09-29 13:13:33 | <Squarism> | possibly functions |
| 2020-09-29 13:14:57 | hackage | th-lift 0.8.2 - Derive Template Haskell's Lift class for datatypes. https://hackage.haskell.org/package/th-lift-0.8.2 (ryanglscott) |
| 2020-09-29 13:14:59 | <Cheery> | there is a project that explores that. |
| 2020-09-29 13:15:22 | → | zariuq joins (~zar@fw2.ciirc.cvut.cz) |
| 2020-09-29 13:16:57 | <Cheery> | lol you need to remember the url to find it |
| 2020-09-29 13:17:02 | <Cheery> | https://typedefs.com/ |
| 2020-09-29 13:17:06 | <lortabac> | Squarism: you can achieve something similar with GraphQL, but it's a little cumbersome |
| 2020-09-29 13:17:33 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 13:17:43 | <guest12> | Its fixed thanks guys |
| 2020-09-29 13:17:49 | × | zargoertzel quits (~zar@fw4.ciirc.cvut.cz) (Ping timeout: 246 seconds) |
| 2020-09-29 13:17:56 | <lortabac> | also, you can encode sum types in OpenAPI IIRC |
| 2020-09-29 13:18:19 | × | drbean quits (~drbean@TC210-63-209-47.static.apol.com.tw) (Quit: ZNC 1.8.2+cygwin1 - https://znc.in) |
| 2020-09-29 13:19:24 | × | revprez_stg quits (~revprez_s@pool-108-49-213-40.bstnma.fios.verizon.net) (Quit: Lost terminal) |
| 2020-09-29 13:19:37 | × | guest12 quits (c13ddbc8@edu185.eduroam.aber.ac.uk) (Remote host closed the connection) |
| 2020-09-29 13:22:23 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-09-29 13:23:02 | → | coot_ joins (~coot@37.30.59.210.nat.umts.dynamic.t-mobile.pl) |
| 2020-09-29 13:23:53 | <alp> | thrift too IIRC |
| 2020-09-29 13:24:05 | → | roconnor joins (~roconnor@host-104-157-196-197.dyn.295.ca) |
| 2020-09-29 13:24:13 | → | luke_ joins (~luke@bitnomial/staff/luke) |
| 2020-09-29 13:25:25 | × | coot quits (~coot@37.30.59.210.nat.umts.dynamic.t-mobile.pl) (Ping timeout: 265 seconds) |
| 2020-09-29 13:25:25 | coot_ | is now known as coot |
| 2020-09-29 13:26:11 | → | josh_ joins (~josh@c-67-164-104-206.hsd1.ca.comcast.net) |
| 2020-09-29 13:26:25 | × | sw1nn quits (~sw1nn@host86-173-104-87.range86-173.btcentralplus.com) (Quit: WeeChat 2.9) |
| 2020-09-29 13:27:42 | → | sw1nn joins (~sw1nn@host86-173-104-87.range86-173.btcentralplus.com) |
| 2020-09-29 13:27:43 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 13:30:25 | × | josh_ quits (~josh@c-67-164-104-206.hsd1.ca.comcast.net) (Ping timeout: 246 seconds) |
| 2020-09-29 13:31:36 | × | perdent quits (~blah@101.175.129.224) (Ping timeout: 256 seconds) |
| 2020-09-29 13:32:23 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 2020-09-29 13:32:44 | → | cr3 joins (~cr3@192-222-143-195.qc.cable.ebox.net) |
| 2020-09-29 13:37:52 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 13:39:20 | → | kw joins (ac4a6125@cpe-172-74-97-37.nc.res.rr.com) |
| 2020-09-29 13:40:45 | <kw> | Anyone know why hlint suggests writing `[x]` instead of `x : []`? |
| 2020-09-29 13:41:03 | <dminuoso> | kw: because its more idiomatic to use the [...] notation than : |
| 2020-09-29 13:41:06 | <merijn> | kw: Because hlint is super opinionated |
| 2020-09-29 13:41:24 | <merijn> | kw: And it's opinions reflect those of the author, not necessarily the wider community |
| 2020-09-29 13:41:32 | × | dhil quits (~dhil@11.29.39.217.dyn.plus.net) (Ping timeout: 260 seconds) |
| 2020-09-29 13:41:54 | <kw> | That makes sense. |
| 2020-09-29 13:41:56 | <dminuoso> | I personally prefer `singleton x` in some code paths, where `singleton x = pure x` |
| 2020-09-29 13:42:30 | <kw> | Just always confuses me when constructor syntax like `x : xs` is mixed with literal syntax. |
| 2020-09-29 13:42:49 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 264 seconds) |
| 2020-09-29 13:42:50 | <kw> | But obviously you can't use literal syntax to deconstruct an arbitrary list. |
| 2020-09-29 13:43:08 | <merijn> | kw: You can |
| 2020-09-29 13:43:20 | <kw> | Wait, how? |
| 2020-09-29 13:43:32 | <kw> | Do you mean with comprehensions? |
| 2020-09-29 13:43:34 | <merijn> | > case [1,2] of [x,y] -> "yay!"; _ -> "nay!" |
| 2020-09-29 13:43:36 | <lambdabot> | "yay!" |
| 2020-09-29 13:43:39 | <merijn> | > case [1,2,3] of [x,y] -> "yay!"; _ -> "nay!" |
| 2020-09-29 13:43:42 | <lambdabot> | "nay!" |
| 2020-09-29 13:43:47 | <dminuoso> | I think by "arbitrary" they mean it in the sense of `f ([x,y,z]:_) = ...` |
| 2020-09-29 13:43:54 | <dminuoso> | (Which doesn't make sense, of course) |
| 2020-09-29 13:43:55 | <kw> | OK, fair enough if I don't need the tail... |
| 2020-09-29 13:44:05 | <int-e> | but it's odd when your cases are [], [x], [x,y] and then x:y:z:xs |
| 2020-09-29 13:44:07 | <dminuoso> | kw: no, this is an exact list match |
| 2020-09-29 13:44:14 | <dminuoso> | it doesnt throw the tail away, it just doesnt match |
| 2020-09-29 13:44:19 | <merijn> | kw: No, "[x,y]" is equivalent to matching "x : (y : [])" |
| 2020-09-29 13:44:30 | <dminuoso> | So if you want something like `f (x:y:z:_) = ..` you cant use the [] syntax for that |
| 2020-09-29 13:44:32 | <merijn> | Note that the 2nd example returned "nay" |
| 2020-09-29 13:45:03 | <dminuoso> | kw: Anyhow. If you find the `x:[]` to work better, maybe for symmetry reasons wrt to the pattern matching on the left side, that's perfectly fine. :) |
| 2020-09-29 13:45:10 | <kw> | Sorry, I wasn't very clear. I've got a function that has special cases for lists of length 0, 1, 2, and 3, and has a recursive case for lists of length greater than 3. |
| 2020-09-29 13:45:39 | <merijn> | kw: writing out those fixed cases with literal syntax works fine\ |
| 2020-09-29 13:45:49 | <dminuoso> | `f [] = ...; f [x] = ...; f [x,y] = ...; f [x,y,z] = ...; f xs = ...` |
| 2020-09-29 13:46:22 | → | spew joins (uid195861@gateway/web/irccloud.com/x-smxsszajtmpzphkc) |
| 2020-09-29 13:46:47 | × | mnrmnaugh quits (~mnrmnaugh@unaffiliated/mnrmnaugh) (Ping timeout: 240 seconds) |
| 2020-09-29 13:47:10 | → | ystael joins (~ystael@209.6.50.55) |
| 2020-09-29 13:48:04 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-29 13:48:21 | → | mnrmnaugh joins (~mnrmnaugh@unaffiliated/mnrmnaugh) |
| 2020-09-29 13:48:36 | <dminuoso> | `t :: IO [Pg.Only T]` how do I efficiently turn that into `IO [T]`? |
| 2020-09-29 13:48:54 | <dminuoso> | (Only is just a newtype) |
| 2020-09-29 13:49:06 | <kw> | I guess it really does come down to opinion. For me `case xs of { [] -> z; [x] -> f x; [x1, x2] -> g x1 x2; x1 : x2 : x3 : xs -> h x1 x2 x3 (loop xs)}` seemed really odd. But it does make the recursive case stand out. |
| 2020-09-29 13:49:10 | <dminuoso> | `newtype Only a = Only { fromOnly :: a }` |
| 2020-09-29 13:49:14 | <merijn> | dminuoso: "fmap (fmap getOnly)" :p |
| 2020-09-29 13:49:14 | <[exa]> | dminuoso: fromOnly? |
| 2020-09-29 13:49:25 | <merijn> | Or just "coerce" |
| 2020-09-29 13:49:40 | <dminuoso> | merijn: Will double fmap not cause it to walk over the list unnecessarily? |
| 2020-09-29 13:50:07 | <dminuoso> | % coerce [Produt 5, Product 6] :: [Integer] |
| 2020-09-29 13:50:08 | <yahb> | dminuoso: ; <interactive>:137:9: error:; * Data constructor not in scope: Produt :: t0 -> Product a0; * Perhaps you meant one of these: `Product' (imported from Control.Monad.RWS), variable `product' (imported from Prelude) |
| 2020-09-29 13:50:14 | <dminuoso> | % coerce [Product 5, Product 6] :: [Integer] |
| 2020-09-29 13:50:14 | <yahb> | dminuoso: [5,6] |
| 2020-09-29 13:50:18 | <dminuoso> | Ah. Mmm. |
All times are in UTC.