[swift-evolution] Epic: Typesafe calculations

Matt Whiteside mwhiteside.dev at gmail.com
Wed Jan 13 12:19:32 CST 2016


That was my thinking when I wrote it, but I’m not sure exactly what the limits would be.  For example, the product of 2 invertible matrices is an invertible matrix, giving you another way to construct one.

Matt


> On Jan 13, 2016, at 09:56, Thorsten Seitz <tseitz42 at icloud.com> wrote:
> 
> 
> Am 12.01.2016 um 23:49 schrieb Matt Whiteside via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>>:
> 
>> struct InvertibleMatrix: SquareMatrix where determinant() != 0 
>> //                       ^~~ 'restriction’ clause, i.e., not inheritance;
>> //                       determinant() is executed at compile time,
>> //                       since `entries` is a constexpr
> 
> Wouldn't that only work for literal matrices?
> 
> -Thorsten 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160113/967fe437/attachment.html>


More information about the swift-evolution mailing list