【文件属性】:
文件名称:CanonicalTraits.jl:Julia的全特征。 没有完整功能,我怎么敢这样说?
文件大小:17KB
文件格式:ZIP
更新时间:2021-02-15 13:33:59
typeclasses traits Julia
典范特质
查看文档以获取更多详细信息。
特征
抽象(通过@implement! )
多参数特征
功能依赖
通过字典传递算法实现
优雅的符号
弹性实例和弹性类别
""" vector space to scalar space """
function V2F end
@trait VecSpace{F, V} where
{F = V2F (V)} begin
vec_add :: [V, V] => V
scalar_mul :: [F, V] => V
end
@trait VecSpace{F, V} >: InnerProd{F, V} where
{F = V2F (V)} begin
dot :: [V, V] => F
end
@trait InnerProd{F, V} >: Ortho{F, V} where
{F = V2F (V)
【文件预览】:
CanonicalTraits.jl-master
----.github()
--------workflows()
----src()
--------Typeclasses.jl(5KB)
--------CanonicalTraits.jl(172B)
--------Instances.jl(4KB)
--------Utils.jl(5KB)
----Project.toml(442B)
----.travis.yml(615B)
----LICENSE(1KB)
----test()
--------runtests.jl(5KB)
----README.md(2KB)
----docs()
--------src()
--------Project.toml(59B)
--------Manifest.toml(2KB)
--------make.jl(414B)
----.gitignore(85B)