, , OCaml. Apache mime.types - . - , . OCaml:
let mimetype_of_extension = function
| "txt" | "log" -> "text/plain"
| "html" | "htm" -> "text/html"
| "zip" | "application/zip"
...
- , .
, , text/plain. ; , get_language_from_mime_type.
, , , . , .
let extension_of_filename filename =
let pos = (String.rindex filename '.') + 1 in
let len = String.length filename in
let ext = String.create (len - pos) in
String.blit filename pos ext 0 (len - pos);
ext;;
, , , Brainfuck OCaml, . - "c" - C, "h"; "" OCaml; .