Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→
Page 1 .. 219 220 221 222 223 224 225 226 227 228 229 .. 17971
1,797,016 events total
2021-06-01 09:11:05 × cheater quits (~Username@user/cheater) (Ping timeout: 264 seconds)
2021-06-01 09:11:11 cheater1__ joins (~Username@user/cheater)
2021-06-01 09:11:11 cheater1__ is now known as cheater
2021-06-01 09:11:21 <boxscape> nshepperd I was under the impression that that implies to *class* constraints but not equality constraints, but I might be wrong
2021-06-01 09:11:36 Torro joins (Torro@gateway/vpn/protonvpn/torro)
2021-06-01 09:12:12 × matsurago quits (~matsurago@nttkyo1723091.tkyo.nt.ngn.ppp.infoweb.ne.jp) (Quit: Leaving)
2021-06-01 09:12:16 <boxscape> % type B :: forall a -> Eq a => *; data B a = B a deriving Show
2021-06-01 09:12:16 <yahb> boxscape: ; <interactive>:20:11: error:; * Illegal constraint in a kind: forall a -> Eq a => *; * In a standalone kind signature for `B': forall a -> Eq a => *
2021-06-01 09:12:26 <boxscape> nshepperd for what it's worth it doesn't say that the equality constraint is illegal
2021-06-01 09:12:30 <nshepperd> hm
2021-06-01 09:14:05 × lavaman quits (~lavaman@98.38.249.169) (Ping timeout: 264 seconds)
2021-06-01 09:14:05 × azeem quits (~azeem@dynamic-adsl-84-220-228-254.clienti.tiscali.it) (Ping timeout: 264 seconds)
2021-06-01 09:14:38 <boxscape> % type C :: forall a -> (a ~ Int) => *; data C a = C a deriving Show -- (there's actually no need to bring type families into this)
2021-06-01 09:14:38 <yahb> boxscape:
2021-06-01 09:15:00 × wei2912 quits (~wei2912@112.199.250.21) (Quit: Lost terminal)
2021-06-01 09:15:32 <nshepperd> % :t A
2021-06-01 09:15:32 <yahb> nshepperd: forall {a} {ev :: Allowed a ~ 'True}. a -> A a
2021-06-01 09:15:48 <boxscape> hm that doesn't look like a constraint
2021-06-01 09:16:20 <maerwald> merijn: my suspicion is that it's laziness to learn SQL... which, I agree, is tedious if you don't use raw SQL a lot. It's easy to forget the details, because none of it is intuitive.
2021-06-01 09:17:54 <dminuoso> maerwald: But with persistent you have to learn SQL *and* some poorly documented DSL ontop.
2021-06-01 09:18:19 <maerwald> Yeah, which is why I usually re-learn SQL
2021-06-01 09:18:28 <kuribas> learning a DSL or language in order not to have to understand SQL is a terrible idea.
2021-06-01 09:18:33 <dminuoso> It's my experience, that any reasonable use of an "sql abstraction layer" eventually leads to you thinking of queris in terms of SQL, and then figuring out how to write the DSL that produces the expected SQL
2021-06-01 09:18:51 <nshepperd> % :t A "not allowed"
2021-06-01 09:18:51 <yahb> nshepperd: A String
2021-06-01 09:19:00 <dminuoso> nshepperd: cute!
2021-06-01 09:19:05 <maerwald> But if I don't use SQL for 1-2 years, most of it is gone from my brain
2021-06-01 09:19:11 <dminuoso> So is persistent. :P
2021-06-01 09:19:17 <kuribas> dminuoso: which is why my DSL is pretty much 1-1 with SQL.
2021-06-01 09:19:24 <nshepperd> not sure that what that is but i guess it can't be a real constraint since A isn't a GADT
2021-06-01 09:19:43 <boxscape> I wonder if GHC just instantiates that argument with `Any` and that's that
2021-06-01 09:20:01 <kuribas> dminuoso: except that I disallow right joins in the typed layer because it makes null checking very hard.
2021-06-01 09:20:37 × brandonh quits (~brandonh@151.44.69.241) (Quit: brandonh)
2021-06-01 09:20:43 jumper149 joins (~jumper149@80.240.31.34)
2021-06-01 09:21:00 <boxscape> % data D where D :: forall {a} {ev :: a ~ Int}. a -> C a
2021-06-01 09:21:00 <yahb> boxscape: ; <interactive>:34:37: error:; * Expected a type, but `a ~ Int' has kind `Constraint'; * In the kind `a ~ Int'; In the definition of data constructor `D'; In the data declaration for `D'
2021-06-01 09:21:03 <boxscape> :(
2021-06-01 09:21:03 × xff0x_ quits (~xff0x@2001:1a81:52ca:4f00:158d:7c0b:fd80:1302) (Ping timeout: 272 seconds)
2021-06-01 09:21:41 <nshepperd> seems possible. a type can't carry evidence anyway so Any is as good as... anything there
2021-06-01 09:21:41 xff0x_ joins (~xff0x@2001:1a81:52ca:4f00:8a7f:8182:f670:e586)
2021-06-01 09:21:42 <jumper149> Hi, What are currently the best tools for dead code detection regarding Haskell.
2021-06-01 09:21:53 azeem joins (~azeem@dynamic-adsl-78-13-240-225.clienti.tiscali.it)
2021-06-01 09:21:57 <maerwald> the new weeder
2021-06-01 09:22:15 <maerwald> https://github.com/ocharles/weeder
2021-06-01 09:22:19 <jumper149> https://hackage.haskell.org/package/weeder ?
2021-06-01 09:22:43 <maerwald> yep, since version 2
2021-06-01 09:25:01 <jumper149> maerwald: Ok this is looking perfect, let's hope it works well :)
2021-06-01 09:25:45 × shryke_ quits (~shryke@91.103.43.254) (Quit: WeeChat 3.1)
2021-06-01 09:25:52 <maerwald> dminuoso: yeah... there are only two ways to learn: 1. build an intuition and keep that (and be able to deconstruct the intuition into its components if needed), 2. mess up really hard and learn through PTSD. Frameworks try to avoid both.
2021-06-01 09:27:17 × ikex quits (~ash@user/ikex) (Ping timeout: 264 seconds)
2021-06-01 09:28:07 shryke joins (~shryke@91.103.43.254)
2021-06-01 09:30:13 <dy> maerwald: bash, the only language named after how you learn it!
2021-06-01 09:30:19 <dy> Bashing your head against hard surfaces.
2021-06-01 09:30:20 xff0x_ is now known as xff0x
2021-06-01 09:30:32 <maerwald> dy: yeat, confusingly, I remember a lot of bash pitfalls
2021-06-01 09:30:42 <maerwald> because they delete your files and break your environment :)
2021-06-01 09:31:00 <dy> Amen to the SQL thing though
2021-06-01 09:31:18 <dy> While I do like some ORMs and such, "just write raw SQL" is honestly usually the better approach in the long run
2021-06-01 09:31:24 fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net)
2021-06-01 09:31:39 <dy> Not to mention many ORMs make even basic n+1 type query optimization a pain
2021-06-01 09:32:05 <maerwald> It's also embarrassing to have done backend dev for several years and not be able to write a correct SQL statement without google... but yeah, can you blame us?
2021-06-01 09:32:14 <boxscape> nshepperd dumping core reveals it actually passes UnsafeRefl, at least in HEAD, and unsafely coerces a representational equality in 8.10
2021-06-01 09:32:23 <dy> Even more infuriating is how frameworks seem to just be completely blind to (materialized) views, triggers, etc
2021-06-01 09:32:32 <dy> Or provide no means to handle them in migrations.
2021-06-01 09:32:32 <kuribas> maerwald: erm yes? Just grab a book on SQL? Read the mysql (or postgresql) manual?
2021-06-01 09:32:40 qbt joins (~edun@user/edun)
2021-06-01 09:32:55 <dy> So you have to basically give up your framework's migrations or substantial features if you want to use views, triggers, in-DB constraints etc
2021-06-01 09:32:57 <kuribas> maerwald: also, goole to look up some details is fine IMO.
2021-06-01 09:33:00 <maerwald> kuribas: when? During saturdays when I'm drunk?
2021-06-01 09:33:23 <kuribas> maerwald: for example :)
2021-06-01 09:33:26 <dy> Even though that's way better in general as it means you don't have to worry reproducing the same sanity checks and cleaning everywhere
2021-06-01 09:34:36 <dy> But yeah stuff that should be easy because of SQL being the way it is are made hard by an ORM layer.
2021-06-01 09:34:52 <dy> Like using indices, views, etc to optimize common queries.
2021-06-01 09:34:55 cheater1__ joins (~Username@user/cheater)
2021-06-01 09:35:05 <dy> Even Django's ORM which is generally pretty good just throws up its hands at views.
2021-06-01 09:35:05 × cheater quits (~Username@user/cheater) (Ping timeout: 264 seconds)
2021-06-01 09:35:06 cheater1__ is now known as cheater
2021-06-01 09:35:23 <kuribas> dy: what's the problem with views?
2021-06-01 09:35:37 <dy> There's no real first class support for them.
2021-06-01 09:35:38 × fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 252 seconds)
2021-06-01 09:35:49 <dy> You have to basically trick Django into thinking they're normal models.
2021-06-01 09:36:13 <dy> And you get no support with migrations and end up with parallel setup code.
2021-06-01 09:36:24 <maerwald> I've done django too and ended up doing raw sql pretty quickly
2021-06-01 09:36:41 <dy> You have to fake the migrations and then manually write the raw SQL into them
2021-06-01 09:36:44 <maerwald> There it was because of abyssmal performance
2021-06-01 09:37:07 <dy> prefetch_related + Q
2021-06-01 09:37:10 <dy> It's essential.
2021-06-01 09:37:24 <dy> Otherwise you'll get 1+N queries everywhere.
2021-06-01 09:37:28 <maerwald> People end up loading huge sets into memory and do stuff there, because they don't understand what the ORM does
2021-06-01 09:37:33 <dy> Django-debug-toolbar thankfully has a nice query inspector panel.
2021-06-01 09:37:42 dminuoso finds that for the majority of problems, handwritten SQL is faster to write and you dont have a bunch of magic semantics in your ORM layer with automatic query twisting, caching, etc.
2021-06-01 09:37:50 <dminuoso> And you get predictable performance
2021-06-01 09:37:52 <dy> Yeah I tend to agree
2021-06-01 09:37:55 <boxscape> % :t C "test" :: C String -- is there any way to actually write the type of `C "test"`?
2021-06-01 09:37:55 <yahb> boxscape: ; <interactive>:1:13: error:; * Couldn't match kind `[Char]' with `Int'; Expected: Int; Actual: String; * In an expression type signature: C String; In the expression: C "test" :: C String
2021-06-01 09:38:11 <sshine> I remember doing a database join in LINQ some years ago where the predicate was '<' rather than '='... it was possible, but hacky.
2021-06-01 09:38:12 <boxscape> % C "test"
2021-06-01 09:38:12 <yahb> boxscape: C "test"
2021-06-01 09:38:29 <dy> LINQ is just janky monads :p
2021-06-01 09:38:35 <dy> Oh I'm sorry "computation expressions"

All times are in UTC.