« first day (479 days earlier)      last day (98 days later) » 

02:03
I implemented a Qdeql interpreter in Trilangle github.com/bbrk24/Trilangle/pull/156
02:36
@RubenVerg It's also more clear what it means
Like you could totally make an overload that lets you do ???("whoopsies") but a non-Scala-er is going to be pretty confused by that (not that languages should be designed to accommodate people who don't know them, but ??? doesn't seem to have any advantages over TODO either)
@EldritchConundrum If I'm understanding this right, Scala has it too (unapply), also a fairly obscure feature there. Although I don't think exhaustivity checking works too well with Scala's unapply
Oh never mind I misunderstood
Okay looks like they're similar but F#'s active patterns work well with exhaustivity checking?
 
6 hours later…
09:10
@user i think active patterns implicitly create an enum
I think equivalent scala code is something like
object Even:
  def unapply(x: Int): Option[Unit] = if x % 2 == 0 then Some(()) else None
object Odd:
  def unapply(x: Int): Option[Unit] = if x % 2 != 0 then Some(()) else None
2 match
  case Even(_) => "even"
  case Odd(_) => "odd"
I don't think you can make parameterless cases because those turn into equality checking and not unapplying
09:37
yes, it's similar to scala's unapply. it doesn't work any better with exhaustivity checking, because they run arbitrary code.
ah, sorry, I mean: partial active patterns are not compatible with exhaustivity checking. non-partial active patterns are exhaustive.
 
4 hours later…
14:06
@Seggan me. I myself am an obscure programming language feature.
 
1 hour later…
15:24
@Seggan the fact that Python doesn’t like people running from future import braces.
16:01
*__future__
16:44
@RubenVerg Swift uses a different operator from standard equality (~=), but because of reasons it doesn't try that when the pattern is an enum value
 
1 hour later…
18:07
custom ~= is cool, but not as powerful as unapply/recognizers
 
1 hour later…
19:16
@RubenVerg Can't you make unapply return a boolean for that?
@RubenVerg Ah that's a simpler way of thinking about it. That must be convenient, I've had to unnecessarily use case _ => in Scala sometimes because the compiler doesn't understand that my matches really are exhaustive
Oh you're right (about having to use Even(_))
Sad
And in principle it should be pretty easy to support; I assume it's just a special case they didn't think to separately add?
I guess just syntactically it's a problem
@UnrelatedString Which one, letting you define case Even yourself in Scala, or making it so you can tell the compiler that case Even and case Odd cover all of Int (there's a proposal for the latter sitting somewhere)?
The former
Ah
Because exhaustivity checking for math operations is Kinda Difficult™️ generally speaking
19:22
Well case Even is, as Madeline pointed out, used to compare equality to some singleton object Even, and case even is used to mean "whatever it is, bind it to a new variable even"
But even() is acceptable
Though come to think of it one solution could just be to make it possible to define one of the patterns as just the negation of every other pattern
@UnrelatedString Well the way F# seems to do it is not that bad and pretty cool
Oh yeah I completely missed that part of it LMAO
Yeah that seems like an elegant way to do what I was thinking of
I keep wanting to use F# but it seems like Scala in that it's an awesome language bolted on top of a very different (not necessarily bad) platform. Except F# seems even more different from C# and the like than Scala is from Java
It seemed like they shoved classes and subclassing (based on names rather than structure) into an ML and it's really messed with type inference and whatnot. Is that understanding right?
 
1 hour later…
20:33
@user Swift does case even and case let even
@user understanding F# is simple if you already understand both ocaml and C#. (this is both a compliment and severe criticism)
in F# there are two ways of doing everything, and it's honestly annoying. But, I'm using it to play with syntax trees, and active patterns are perfect for that.
I don't have a lot of type inference problems with it, other than the incomprehensible errors that result from underuse of type annotations that is usual with HM inference. but that's technically my fault
Someone who knows well C# and Visual Studio will notice weaknesses in the IDE support of F#.
It's not bad at all, it's just not as good as the best in class (languages that were directly designed for/with an associated IDE).
20:59
I've recently had issues with the C# LSP, with features like "jump to definition" not working across files (and semantic highlighting breaking as a result of not finding things).
21:24
It's a good thing that LSP exists, but last time I looked at what it could do in VS Code, it's clear how far it is from true IDE integration like in VS non-Code.
Well my work computer is a macbook so I don't exactly have the choice
21:54
my VS is in a Windows VM

« first day (479 days earlier)      last day (98 days later) »