Idris 2 0.6.0 is now available for the JVM
1–10 of 65 posts
Re: Idris 2 0.6.0 is now available for the JVM
#2Re: Idris 2 0.6.0 is now available for the JVM
#3Re: Idris 2 0.6.0 is now available for the JVM
#4Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript.
For example, simple way to adding a extended boolean type:
type MyBoolean = null | true | false.
Or
type MyRange = 3 | 4 | 5
Curious.
Re: Idris 2 0.6.0 is now available for the JVM
#5One of most frequent usage of a type system is literal types. Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript. For example, simple way to adding a extended boolean type: type MyBoolean = null | true | false. Or type MyRange = 3 | 4 | 5 Curious.
Re: Idris 2 0.6.0 is now available for the JVM
#6One of most frequent usage of a type system is literal types. Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript. For example, simple way to adding a extended boolean type: type MyBoolean = null | true | false. Or type MyRange = 3 | 4 | 5 Curious.
Sure, they can be better in java, but they cover a large enough ground, and as always, most people find that sufficient.
Re: Idris 2 0.6.0 is now available for the JVM
#7One of most frequent usage of a type system is literal types. Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript. For example, simple way to adding a extended boolean type: type MyBoolean = null | true | false. Or type MyRange = 3 | 4 | 5 Curious.
Re: Idris 2 0.6.0 is now available for the JVM
#8One of most frequent usage of a type system is literal types. Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript. For example, simple way to adding a extended boolean type: type MyBoolean = null | true | false. Or type MyRange = 3 | 4 | 5 Curious.
Why would I ever want to extend a type with null? That's exactly the opposite of what I want of a type system in the first place.
Re: Idris 2 0.6.0 is now available for the JVM
#9Re: Idris 2 0.6.0 is now available for the JVM
#10One of most frequent usage of a type system is literal types. Haskell, Rust,... and modern programming languages fail to do it. The only exception is Typescript. For example, simple way to adding a extended boolean type: type MyBoolean = null | true | false. Or type MyRange = 3 | 4 | 5 Curious.
That can be done in Haskell with algebraic data types (with constructors without arguments), no?
Languages that have enums: Java, Kotlin, Dart, Ada, C (not in the first version), Pascal (not in the first version), Modula-2, Visual Basic,...
Pascal had subrange types since the first specification. For example "var month : 1..12;"
I don't know anything about Typescript but from what I have found it seems that Typescript's literal types are similar to Pascal's subrange types, i.e., the new type is compatible to the basic type it is derived from (unlike enums in the above languages, which are completely new types). But there is no runtime check.