-
Notifications
You must be signed in to change notification settings - Fork 56
Description
For example, if I want to prove that a function returns a well-typed output on any file. What should the input type be? Data.Buffer has IO interface and can't be pattern matched on. String can't handle arbitrary bytes and doesn't allow to pattern match on individual bytes. I could use List, but it seems that there is no type for a byte either. If I use List (Fin 256), will the performance be reasonable?
Without a good way to work with bytes, I struggle to find any practical application for Idris. Almost any program has to work with bytes because a program would be useless without interacting with files or network. Working with compressed data (images, video), any binary file formats (like protobuf) is impossible.
Are there any workarounds I'm not aware of? I found the following:
- A similar question that is unanswered;
- A related question with
Data.Bufferas the suggested way to do it; - http4idris explicitly states that there is a problem with null bytes because of the use of
String.