Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
是否可以对更高种类类型的类实例强制执行类型约束?
我有一个这样定义的类型 newtype PrimeSet a P Integer deriving Eq 我还定义了一个将素数集转换为列表的函数 假设它的类型参数是Integral toList Integral a gt PrimeSet
Haskell
typeclass
typeconstraints
higherkindedtypes
不同种类的ReaderT?
冒着成为一个XY问题 https en wikipedia org wiki XY problem 是否有可能有一个ReaderT与不同的环境 我正在尝试类似 type AppM perms ReaderT perms IO 但是编译器抱怨
Haskell
higherkindedtypes
datakinds
在没有更高类型(HKT)支持的情况下,如何在 Rust 中创建通用结构?
我正在努力使Iteratee结构通用 这样我就可以传入不同的解析函数并获得不同的Iteratee 这是有效的非通用版本 use std io BufRead BufReader use std str from utf8 Utf8Error
function
generics
Rust
higherkindedtypes
值、类型、种类……作为无限序列?
我才刚刚开始熟悉类型的概念 所以如果我没有很好地表达我的问题 请耐心等待 值有类型 3 Int 1 2 3 Int c True Char Bool 类型有种类 the type Int has kind the type Int also
scala
Haskell
functionalprogramming
higherkindedtypes
具有更高种类类型的类的自类型注释
Given abstract class Databases F 我怎样才能让这个特质发挥作用 Marker trait signalling the database plugin supports StaticRoles trait S
scala
existentialtype
higherkindedtypes
selftype
高级类型的辅助模式
编辑 这是问题的一个更简单的表述 使用Foo作为一个例子Aux模式其中does work Foo is a simple Aux pattern type trait Foo A B type Out object Foo type Aux
scala
typelevelcomputation
higherkindedtypes
使用上下文“负向”边界来确保类型类实例不存在于范围内
tl dr 我该如何做类似下面的代码 def notFunctor M Not Functor m M s m is not a functor The Not Functor 这是这里的组成部分 我希望它在提供的 m 不是函子时成功 否则
scala
typeclass
implicit
scalaz
higherkindedtypes
多重集合的高级类型
我想写一个Multiset T S Scala 中的类 它有 2 个类型参数 T是元素的类型 而S是集合的底层表示 在这个多重集中 一个实例S T Int 被构造 在每对中 T是元素并且Int是其出现的次数 这在 C 中是可能的 templ
scala
higherkindedtypes
在 Haskell 中,“更高级的类型”真的是类型吗?或者它们仅仅表示*具体*类型的集合而仅此而已?
参数多态函数 考虑以下函数 f a gt Int f x 1 Int 我们可以说 这种类型f is a gt Int 然后f因此是 多态 类型 以下哪项是最准确的思考方式f 事实上有一个single f类型的a gt Int 然而 它可以用
Haskell
types
higherkindedtypes
parametricpolymorphism
在类型系统的上下文中什么是“种类”?
我已经阅读了维基百科文章并搜索了明显的地方 但我被困住了 有人可以简单地告诉我 Kind 到底是什么吗 它是干什么用的 Scala 示例最受欢迎 简而言之 kind is to types what a type is to values
scala
types
higherkindedtypes
typeconstructor
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
更高种类类型的隐式参数解析
考虑以下代码 object foo trait Bar Q implicit object OptionBar extends Bar Option def test T C c C T implicit bar Bar C def mai
scala
implicit
higherkindedtypes
我可以在 Java 中使用嵌套泛型(又名高级类型)吗?
我试图做类似的事情 public class MyClass
Java
generics
higherkindedtypes