News for hackers. Stuff that matters.
Re:Idris: A Language for Type-Driven Development by JadeNB on Friday January 20, 2023 @09:44PM (#34463317)
> foo : A -> A

> since we know absolutely NOTHING about A, all we can really do is give it back to you, so foo turns out to be identity, or id.

> another might be bar: [A] -> Nat we still don't know anything about A, but we know a little about lists, so a good suggestion might be length.

Certainly a good suggestion, but, unlike `foo`, not the only one—e.g., `bar xs = length xs + 1` or `bar xs = 2*(length xs)` also work.

Re:Idris: A Language for Type-Driven Development by still_grokking on Saturday January 21, 2023 @03:19AM (#34464819)
Maybe a better example would be `z: [A] -> [B] -> [(A, B)]`.