Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
存在类型和类型成员的 Scala 类型推断
以下代码无法编译 trait A F def find x Int F def fill f F Unit object TestA def test T lt A F forSome type F t T t fill t find 0
scala
typeinference
existentialtype
typemembers
在没有 unsafeCoerce 的情况下兼顾存在主义
最近我一直在研究这种类型 我理解它是自由分配函子的编码 有关切线背景 请参阅这个答案 https stackoverflow com a 56822105 2751851 data Ev g a where Ev g x gt x gt a
Haskell
existentialtype
higherranktypes
为什么我不能使用具有存在量化类型的记录选择器?
当使用存在类型时 我们必须使用模式匹配语法来提取forall编辑值 我们不能将普通的记录选择器用作函数 GHC 报告错误并建议使用与此定义的模式匹配yALL LANGUAGE ExistentialQuantification data A
Haskell
record
existentialtype
存在类型表达式的 Skolem 化
在 Scala 中 以下表达式会引发类型错误 val pair A gt String A forSome type A a Int gt a toString 19 pair 1 pair 2 正如中提到的SI 9899 https is
scala
existentialtype
具有更高种类类型的类的自类型注释
Given abstract class Databases F 我怎样才能让这个特质发挥作用 Marker trait signalling the database plugin supports StaticRoles trait S
scala
existentialtype
higherkindedtypes
selftype
为什么 scala 需要存在类型来限制泛型界限?
具有以下类层次结构 trait Provider A def get Seq A abstract class ProviderImpl A extends Provider A final override def get Seq A S
scala
types
existentialtype
理解 `k : Nat ** 5 * k = n` 签名
以下函数编译 onlyModByFive n Nat gt k Nat 5 k n gt Nat onlyModByFive n k 100 但有什么作用k以其代表Nat 5 k n syntax 另外 我该如何称呼它 这是我尝试过的 但我
dependenttype
existentialtype
idris
如何从范围内的约束族派生类型类实例?
edit 我又跟进了一个具体问题 https stackoverflow com questions 70088443 how can i use a constraint family thats in scope to prove in
Haskell
constraints
gadt
existentialtype
quantifiedconstraints
`forSome { val `? 的示例
Scala 语言规范指定的语法存在主义类型 https scala lang org files archive spec 2 13 03 types html existential types as Type InfixType Exi
scala
existentialtype
pathdependenttype
价值的存在量化
我在 Scala 语言中遇到了对值的存在量化 规范 3 2 10 存在类型 x y Inner forSome val y Outer 有人有说明性的用例吗 T forSome val x S 定义为T forSome type t lt
scala
types
existentialtype
存在主义类型。为异构映射编写类的实例
使用以下类型和类定义 我不明白为什么在创建时会出现错误instance below 我需要 MyMap 来保存异构值的映射 LANGUAGE ExistentialQuantification module Scratch SO Extis
Haskell
existentialtype
将变量从 Scala 中的存在类型 TypeCast 转换为运行时类型
这个线程 https stackoverflow com questions 29380839 trait runtime type of type parameter through typetag when used with exis
scala
types
casting
existentialtype
Haskell 函数返回存在类型
是否可以编写一个 Haskell 函数来生成隐藏了确切类型参数的参数化类型 IE 就像是f T gt exists a U a 明显的尝试 LANGUAGE ExistentialQuantification data D a D a da
Haskell
existentialtype
异构地图
我需要一个可以包含任意值的映射 只要它们的类型属于相同的类型类 我的第一个天真的方法是这样的 type HMap forall a MyClass a gt M Map Int a 但它似乎不起作用 以下代码给出了编译错误 testFunc
Haskell
polymorphism
existentialtype
higherranktypes
存在类型如何与路径依赖类型重叠?
起始 Scala 3 存在类型已dropped http dotty epfl ch docs reference dropped features existential types html原因之一如下 存在类型在很大程度上与路径依赖类
scala
existentialtype
pathdependenttype
是否可以强制存在量化类型变量仅具有单一类型?
考虑下面的代码 trait Foo T def one Foo gt T def two T def three x T def test T f Foo T val b f one b three b two 方法测试无法进行类型检查 它
scala
existentialtype
scala - 泛型中的任何与下划线
Scala 中以下泛型定义有何不同 class Foo T lt List and class Bar T lt List Any 我的直觉告诉我它们大致相同 但后者更明确 我发现前者可以编译但后者不能编译的情况 但无法指出确切的差异 Th
scala
generics
covariance
any
existentialtype
解构存在类型
我使用存在类型作为包装器 在我的代码中 当我知道封闭类型时 我想用它做一些特定于封闭类型的事情 这是我能得到的最接近的 LANGUAGE ExistentialQuantification class Agent a where agent
Haskell
patternmatching
existentialtype
Scala 中是否有类型变量 'm forSome { type m[O] <: UpperBound[O] }` 的简写?
Problem trait UpperBound O trait High F O lt UpperBound O def canEqual that Any that isInstanceOf High def high h High 无
scala
types
existentialtype
higherkindedtypes
使用 Precog 配置模式的 Scala cake-pattern 编译错误
继自this问题 我现在有以下内容 case class Pet val name String trait ConfigComponent type Config def config Config trait VetModule ext
scala
compilererrors
existentialtype
cakepattern
1
2
»