Re:Idris: A Language for Type-Driven Development
by josephcsible on Friday January 20, 2023 @07:35PM
(#34462385)
For Boolean conditionals, you're right. But there are richer conditionals that make certain variables available in only one clause of them, e.g., matching on whether an Either in Haskell is Left or Right, or whether a Result in Rust is an Err or an Ok.
Re:Idris: A Language for Type-Driven Development
by ekidd on Friday January 20, 2023 @08:32PM
(#34462815)
> Does that work in anything but boilerplate code?
It depends on the problem and the language.
The most impressive I've ever seen was implementing "call with current continuation" as a monad, given nothing but the type signature.
Generally, it works best in strongly-typed, functional languages.
Re:Idris: A Language for Type-Driven Development
by still_grokking on Saturday January 21, 2023 @03:24AM
(#34464846)
> The most impressive I've ever seen was implementing "call with current continuation" as a monad, given nothing but the type signature.
That sounds cool. Where to find this? I get only irrelevant search results.
Does that work in anything but boilerplate code? Like, hole filling won't be able to decide between then and else clauses in a conditional, for instance, because both clauses return the same type. And conditionals are one of the most basic data flow structures.