Here is a simple example of my intention: this is an alternative (simpler & more generalisable) way of writing: But the compiler won't let m ...
Here is a simple example of my intention: this is an alternative (simpler & more generalisable) way of writing: But the compiler won't let m ...
Is it possible to have a function with a generic argument that converts that argument to an Arc with a generic trait? Something like this: struct Foo ...
I have the following example: import scala.concurrent.Future Which fails compilation due to the reason that: I'm binding the generic type on th ...
I have a trait definition that wraps side effects when instantiated like this: Where my Param is a case class which itself takes type parameters li ...
I was reading about higher-kinded-types when I found the term equality witness, I looked up an example and found this type definition: type ('a, 'b) ...
context: this is using scala-3 final case class TableSchema[T[_[_]] <: Table]( /* ... */ ) ...
I am working with Websockets in java. I have to implement a method that takes in a generic message handler. So I wrote like this and it compiles. B ...
I have the following trait: And I tried to apply the so-called batching transformation to it as follows: The problem is it does not compile with ...
How do I express a constraint like (The above expression doesn't work because constraints can't have impl in them) If this isn't possible, what ca ...
I wonder if it is possible to write a method that will handle casting of undefined types like: Precondition: Method call: convert method itself ...
I have a higher-kinded data type like this and a value that labels every member with some kind of string (the name of a CSV column for example): ...
I think there is something I don't quite well understand when I have the following code: The name of the classes are pretty much meaningless, the g ...
I recently discovered how to simulate higher kinded types in Java in a somewhat roundabout way like so Here H encodes a higher kinded type that tak ...
OCaml functors taking an OCaml functor as arguments, or returning OCaml functors are never mentioned in the manual. Is there a technical reason that ...
I recently defined a type whose fields I might fail to compute: Now, one obvious thing I might do would be to just use liftA3: That works fine, ...
I have this record: and this coercion function which is applicable to the record value without problems: However, if I define the only slight ...
. Answers to this question are eligible for a +50 reputation bounty. Sh ...
I am trying and failing to get something like this to work in Scala 3: type TupleK[K[*], V[*], A] = (K[A], V[A]) final class MapK[K[*], V[*]] priva ...
In my attempt to write an authenticated Servant API where handlers use the RIO monad instead of Servant's own Handler monad, I am stuck on authenticat ...
Consider this code, using the Functor and Foldable typeclasses: Is there some analogous set of typeclasses that can operate on higher-kinded type p ...