2021-08-30 17:31:37 +03:00
|
|
|
module System.File.Support
|
|
|
|
|
|
|
|
%default total
|
|
|
|
|
2021-10-29 19:58:29 +03:00
|
|
|
||| Shorthand for a function in the C support libary
|
|
|
|
||| (libidris2_support, idris_file.h)
|
|
|
|
|||
|
|
|
|
||| @ fn the function name to refer to in the C support library
|
2021-08-30 17:31:37 +03:00
|
|
|
public export
|
|
|
|
support : String -> String
|
|
|
|
support fn = "C:" ++ fn ++ ", libidris2_support, idris_file.h"
|
|
|
|
|
2021-10-29 19:58:29 +03:00
|
|
|
||| Wrap x in the `Right` part of an `io . Either`.
|
2021-08-30 17:31:37 +03:00
|
|
|
export
|
2021-10-29 19:58:29 +03:00
|
|
|
ok : HasIO io => (x : a) -> io (Either err a)
|
2021-08-30 17:31:37 +03:00
|
|
|
ok x = pure (Right x)
|