Dataset Viewer
Auto-converted to Parquet Duplicate
statement
stringlengths
8
7.11k
proof
stringlengths
0
27.9k
type
stringclasses
5 values
symbolic_name
stringlengths
1
39
library
stringclasses
161 values
filename
stringclasses
574 values
imports
listlengths
0
62
deps
listlengths
0
64
docstring
stringclasses
1 value
source_url
stringclasses
1 value
commit
stringclasses
1 value
ExitCode : Type where ||| Terminate successfully. ExitSuccess : ExitCode ||| Program terminated for some prescribed reason. ||| ||| @errNo A non-zero numerical value indicating failure. ||| @prf Proof that the int value is non-zero. ExitFailure : (errNo : Int) -> (So (not $ errNo == 0)) => ExitCode
data
ExitCode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "Proof", "So", "for", "int", "is", "not", "some", "the", "value", "|||" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
supportC : (fn : String) -> String
supportC fn = "C:\{fn}, libidris2_support, idris_support.h"
function
supportC
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
supportNode : (fn : String) -> String
supportNode fn = "node:support:\{fn},support_system"
function
supportNode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
libc : (fn : String) -> String
libc fn = "C:" ++ fn ++ ", libc 6" -- `sleep` and `usleep` need to be tied to `blodwen-[u]sleep` for threading -- reasons (see support/racket/support.rkt)
function
libc
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "++" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__sleep : Int -> PrimIO ()
function
prim__sleep
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__usleep : Int -> PrimIO ()
function
prim__usleep
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
sleep : HasIO io => (sec : Int) -> io ()
sleep sec = primIO (prim__sleep sec)
function
sleep
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "primIO", "prim__sleep" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
usleep : HasIO io => (usec : Int) -> So (usec >= 0) => io ()
usleep usec = primIO (prim__usleep usec) -- Get the number of arguments -- Note: node prefixes the list of command line arguments -- with the path to the `node` executable. This is -- inconsistent with other backends, which only list -- the path to the running program. For reasons of -- consist...
function
usleep
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "So", "primIO", "prim__usleep" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__getArgCount : PrimIO Int -- Get argument number `n`. See also `prim__getArgCount` -- about the special treatment of the node backend.
function
prim__getArgCount
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__getArg : Int -> PrimIO String
function
prim__getArg
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
getArgs : HasIO io => io (List String)
getArgs = do n <- primIO prim__getArgCount if n > 0 then for [0..n-1] $ primIO . prim__getArg else pure []
function
getArgs
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "List", "[]", "for", "primIO", "prim__getArg", "prim__getArgCount", "pure" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__getEnv : String -> PrimIO (Ptr String)
function
prim__getEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO", "Ptr" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__getEnvPair : Int -> PrimIO (Ptr String)
function
prim__getEnvPair
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO", "Ptr" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__setEnv : String -> String -> Int -> PrimIO Int
function
prim__setEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__unsetEnv : String -> PrimIO Int
function
prim__unsetEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__enableRawMode : (1 x : %World) -> IORes Int
function
prim__enableRawMode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "IORes" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__resetRawMode : (1 x : %World) -> IORes ()
function
prim__resetRawMode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "IORes" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
enableRawMode : HasIO io => io (Either FileError ())
enableRawMode = case !(primIO prim__enableRawMode) of 0 => pure $ Right () _ => returnError
function
enableRawMode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "Either", "FileError", "HasIO", "primIO", "prim__enableRawMode", "pure", "returnError" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
resetRawMode : HasIO io => io ()
resetRawMode = primIO prim__resetRawMode
function
resetRawMode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "primIO", "prim__resetRawMode" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
withRawMode : HasIO io => (onError : FileError -> io a) -> (onSuccess : () -> io a) -> io a
withRawMode onError onSuccess = do Right () <- enableRawMode | Left err => onError err result <- onSuccess () resetRawMode pure result
function
withRawMode
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "FileError", "HasIO", "enableRawMode", "err", "pure", "resetRawMode" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
getEnv : HasIO io => (var : String) -> io (Maybe String)
getEnv var = do env <- primIO $ prim__getEnv var if prim__nullPtr env /= 0 then pure Nothing else pure (Just (prim__getString env))
function
getEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "Maybe", "primIO", "prim__getEnv", "prim__getString", "prim__nullPtr", "pure", "var" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
getEnvironment : HasIO io => io (List (String, String))
getEnvironment = getAllPairs 0 [] where splitEq : String -> (String, String) splitEq str = let (k, v) = break (== '=') str (_, v') = break (/= '=') v in (k, v') getAllPairs : Int -> List String -> io (List (String, String)) getAllPairs n acc = do envPair <- ...
function
getEnvironment
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "::", "HasIO", "List", "[]", "break", "map", "primIO", "prim__getEnvPair", "prim__getString", "prim__nullPtr", "pure", "reverse" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
setEnv : HasIO io => (var : String) -> (val : String) -> (overwrite : Bool) -> io Bool
setEnv var val overwrite = do ok <- primIO $ prim__setEnv var val (if overwrite then 1 else 0) pure $ ok == 0
function
setEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "Bool", "HasIO", "ok", "overwrite", "primIO", "prim__setEnv", "pure", "val", "var" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
unsetEnv : HasIO io => (var : String) -> io Bool
unsetEnv var = do ok <- primIO $ prim__unsetEnv var pure $ ok == 0
function
unsetEnv
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "Bool", "HasIO", "ok", "primIO", "prim__unsetEnv", "pure", "var" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__system : String -> PrimIO Int
function
prim__system
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
system : HasIO io => String -> io Int
system cmd = primIO (prim__system cmd) system = system . escapeCmd
function
system
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "escapeCmd", "primIO", "prim__system" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
run : HasIO io => (cmd : String) -> io (String, Int)
run cmd = do Right f <- popen cmd Read | Left err => pure ("", 1) Right resp <- fRead f | Left err => pure ("", 1) exitCode <- pclose f pure (resp, exitCode) run = run . escapeCmd
function
run
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "Read", "err", "escapeCmd", "fRead", "pclose", "popen", "pure" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
runProcessingOutput : HasIO io => (String -> io ()) -> (cmd : String) -> io Int
runProcessingOutput pr cmd = do Right f <- popen cmd Read | Left err => pure 1 True <- process f | False => pure 1 -- we do not close `f` in case of reading error, like `run` does pclose f where process : File -> io Bool process h = if !(fEOF h) then pure True else do Right line <- fGetLi...
function
runProcessingOutput
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "Bool", "File", "HasIO", "Read", "err", "escapeCmd", "fEOF", "fGetLine", "line", "pclose", "popen", "process", "pure" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__time : PrimIO Int
function
prim__time
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
time : HasIO io => io Integer
time = pure $ cast !(primIO prim__time)
function
time
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "cast", "primIO", "prim__time", "pure" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__getPID : PrimIO Int
function
prim__getPID
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
getPID : HasIO io => io Int
getPID = primIO prim__getPID
function
getPID
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "primIO", "prim__getPID" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim__exit : Int -> PrimIO ()
function
prim__exit
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "PrimIO" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
exitWith : HasIO io => ExitCode -> io a
exitWith = primIO . believe_me . prim__exit . cast
function
exitWith
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "ExitCode", "HasIO", "believe_me", "cast", "primIO", "prim__exit" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
exitFailure : HasIO io => io a
exitFailure = exitWith (ExitFailure 1)
function
exitFailure
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "exitWith" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
exitSuccess : HasIO io => io a
exitSuccess = exitWith ExitSuccess
function
exitSuccess
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "exitWith" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
die : HasIO io => String -> io a
die str = do ignore $ fPutStrLn stderr str exitFailure
function
die
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "HasIO", "exitFailure", "fPutStrLn", "ignore", "stderr" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Cast Int ExitCode where cast 0 = ExitSuccess cast code = ExitFailure code @{believe_me Oh}
Cast ExitCode Int where cast ExitSuccess = 0 cast (ExitFailure code) = code
function
Cast
libs.base
libs/base/System.idr
[ "public", "Data.String", "public", "System.File" ]
[ "ExitCode", "believe_me", "cast", "code" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
HasErr : Error -> List Error -> Type where Here : HasErr e (e :: es) There : HasErr e es -> HasErr e (e' :: es)
data
HasErr
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "Error", "List" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Path = MayThrow | NoThrow
data
Path
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Usage = One | Any
data
Usage
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "One" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
OneOf : List Type -> Path -> Type where First : e -> OneOf (e :: es) MayThrow Later : OneOf es MayThrow -> OneOf (e :: es) MayThrow
data
OneOf
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "List", "Path" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
SafeBind : Path -> (l' : Path) -> Type where [search l'] SafeSame : SafeBind l l SafeToThrow : SafeBind NoThrow MayThrow
data
SafeBind
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Path" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
AppRes : Type -> Type where MkAppRes : (result : a) -> (1 x : %World) -> AppRes a
data
AppRes
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
App1Res : Usage -> Type -> Type where MkApp1Res1 : (1 result : a) -> (1 x : %World) -> App1Res One a MkApp1ResW : (result : a) -> (1 x : %World) -> App1Res Any a
data
App1Res
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "One", "Usage" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
App : {default MayThrow l : Path} -> (es : List Error) -> Type -> Type where MkApp : (1 prog : (1 w : %World) -> AppRes (execTy l e t)) -> App {l} e t
data
App
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "AppRes", "Error", "List", "Path", "execTy", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
App1 : {default One u : Usage} -> (es : List Error) -> Type -> Type where MkApp1 : (1 prog : (1 w : %World) -> App1Res u t) -> App1 {u} e t
data
App1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1Res", "Error", "List", "One", "Usage", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
AppHasIO : Type where
data
AppHasIO
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
State : (tag : a) -> Type -> List Error -> Type where [search tag] MkState : IORef t -> State tag t e
data
State
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Error", "IORef", "List", "tag" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
PrimIO e where primIO : IO a -> App {l} e a primIO1 : (1 act : IO a) -> App1 e a -- fork starts a new environment, so that any existing state can't get -- passed to it (since it'll be tagged with the wrong environment) fork : (forall e' . PrimIO e' => App {l} e' ()) -> App e ()
interface
PrimIO
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "App1", "IO", "act", "forall", "fork", "primIO", "primIO1" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
FileEx = GenericFileEx Int -- errno | FileReadError | FileWriteError | FileNotFound | PermissionDenied | FileExists
data
FileEx
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
IOError = GenericErr String | FileErr FileEx
data
IOError
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "FileEx" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Error : Type
Error = Type
function
Error
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
0 Has : List (a -> Type) -> a -> Type
function
0
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Has", "List" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
updateP : SafeBind p p' => OneOf es p -> OneOf es p'
updateP @{SafeSame} x = x
function
updateP
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "OneOf", "SafeBind" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
PrimApp : Type -> Type
PrimApp a = (1 x : %World) -> AppRes a
function
PrimApp
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "AppRes" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim_app_pure : a -> PrimApp a
prim_app_pure = MkAppRes
function
prim_app_pure
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "PrimApp" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim_app_bind : (1 act : PrimApp a) -> (1 k : a -> PrimApp b) -> PrimApp b
prim_app_bind fn k w = let MkAppRes x' w' = fn w in k x' w'
function
prim_app_bind
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "PrimApp", "act" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
toPrimApp : (1 act : IO a) -> PrimApp a
toPrimApp x = \w => case toPrim x w of MkIORes r w => MkAppRes r w
function
toPrimApp
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "IO", "PrimApp", "act", "toPrim" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
PrimApp1 : Usage -> Type -> Type
PrimApp1 u a = (1 x : %World) -> App1Res u a
function
PrimApp1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1Res", "Usage" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
toPrimApp1 : {u : _} -> (1 act : IO a) -> PrimApp1 u a
toPrimApp1 x = \w => case toPrim x w of MkIORes r w => case u of One => MkApp1Res1 r w Any => MkApp1ResW r w
function
toPrimApp1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "IO", "One", "PrimApp1", "act", "toPrim" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
prim_app1_bind : (1 act : PrimApp1 Any a) -> (1 k : a -> PrimApp1 u b) -> PrimApp1 u b
prim_app1_bind fn k w = let MkApp1ResW x' w' = fn w in k x' w'
function
prim_app1_bind
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "PrimApp1", "act" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
bindApp : SafeBind l l' => App {l} e a -> (a -> App {l=l'} e b) -> App {l=l'} e b
bindApp (MkApp prog) next = MkApp $ \world => let MkAppRes x' world' = prog world in case x' of Right res => let MkApp r = next res in r world' Left err => MkAppRes (Left (updateP err)) world'
function
bindApp
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "SafeBind", "err", "next", "prog", "updateP" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Cont1Type : Usage -> Type -> Usage -> List Error -> Type -> Type
Cont1Type One a u e b = (1 x : a) -> App1 {u} e b Cont1Type Any a u e b = (x : a) -> App1 {u} e b
function
Cont1Type
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "App1", "Error", "List", "One", "Usage" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
bindApp1 : {u : _} -> (1 act : App1 {u} e a) -> (1 k : Cont1Type u a u' e b) -> App1 {u=u'} e b
bindApp1 {u=One} (MkApp1 fn) = \k => MkApp1 (\w => let MkApp1Res1 x' w' = fn w MkApp1 res = k x' in res w') bindApp1 {u=Any} (MkApp1 fn) = \k => MkApp1 (\w => let MkApp1ResW x' w' = fn w MkApp1 res = k x' in ...
function
bindApp1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1", "Cont1Type", "act" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
absurdWith1 : (1 w : b) -> OneOf e NoThrow -> any
function
absurdWith1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "OneOf", "any" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
absurdWithAppHasIO : (1 w : b) -> OneOf [AppHasIO] t -> any
function
absurdWithAppHasIO
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "OneOf", "any" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
absurdWith2 : (1 x : a) -> (1 w : b) -> OneOf e NoThrow -> any
function
absurdWith2
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "OneOf", "any" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
bindL : App {l=NoThrow} e a -> (1 k : a -> App {l} e b) -> App {l} e b
bindL (MkApp prog) next = MkApp $ \world => let MkAppRes x' world' = prog world in case x' of Right res => let MkApp r = next res in r world' Left err => absurdWith2 next world' err
function
bindL
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "absurdWith2", "err", "next", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
seqL : App {l=NoThrow} e () -> (1 k : App {l} e b) -> App {l} e b
seqL ma mb = bindL ma (\ () => mb)
function
seqL
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "bindL", "ma" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
app : (1 p : App {l=NoThrow} e a) -> App1 {u=Any} e a
app (MkApp prog) = MkApp1 $ \world => let MkAppRes x' world' = prog world in case x' of Left err => absurdWith1 world' err Right res => MkApp1ResW res world'
function
app
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "App1", "absurdWith1", "err", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
app1 : (1 p : App1 {u=Any} e a) -> App {l} e a
app1 (MkApp1 prog) = MkApp $ \world => let MkApp1ResW x' world' = prog world in MkAppRes (Right x') world'
function
app1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "App1", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
pureApp : a -> App {l} e a
pureApp x = MkApp $ MkAppRes (Right x)
function
pureApp
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
(>>=) : SafeBind l l' => App {l} e a -> (k : a -> App {l=l'} e b) -> App {l=l'} e b
(>>=) = bindApp (>>=) = bindApp1
function
>>=
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "SafeBind", "bindApp", "bindApp1" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
delay : {u_act : _} -> (1 _ : App1 {u=u_k} e b) -> Cont1Type u_act () u_k e b
delay mb = case u_act of One => \ () => mb Any => \ _ => mb
function
delay
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Any", "App1", "Cont1Type", "One" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
(>>) : {u_act : _} -> (1 _ : App1 {u=u_act} e ()) -> (1 _ : App1 {u=u_k} e b) -> App1 {u=u_k} e b
function
>>
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
pure : (x : a) -> App1 {u=Any} e a
pure x = MkApp1 $ MkApp1ResW x
function
pure
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
pure1 : (1 x : a) -> App1 e a
pure1 x = MkApp1 $ MkApp1Res1 x
function
pure1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
mapState : State tag t e -> State tag t (eff :: e)
mapState (MkState s) = MkState s
function
mapState
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "State", "tag" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
get : (0 tag : _) -> State tag t e => App {l} e t
get tag @{MkState r} = MkApp $ prim_app_bind (toPrimApp $ readIORef r) $ \val => MkAppRes (Right val)
function
get
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "State", "prim_app_bind", "readIORef", "tag", "toPrimApp", "val" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
put : (0 tag : _) -> State tag t e => (val : t) -> App {l} e ()
put tag @{MkState r} val = MkApp $ prim_app_bind (toPrimApp $ writeIORef r val) $ \val => MkAppRes (Right ())
function
put
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "State", "prim_app_bind", "tag", "toPrimApp", "val", "writeIORef" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
modify : (0 tag : _) -> State tag t e => (p : t -> t) -> App {l} e ()
modify tag f = let (>>=) = bindL in do x <- get tag put tag (f x)
function
modify
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ ">>=", "App", "State", "bindL", "get", "put", "tag" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
new : t -> (p : State tag t e => App {l} e a) -> App {l} e a
new val prog = MkApp $ prim_app_bind (toPrimApp $ newIORef val) $ \ref => let st = MkState ref MkApp res = prog @{st} in res
function
new
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "State", "newIORef", "prim_app_bind", "prog", "tag", "toPrimApp", "val" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Exception : Error -> List Error -> Type
Exception = HasErr
function
Exception
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Error", "HasErr", "List" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
findException : HasErr e es -> e -> OneOf es MayThrow
findException Here err = First err findException (There p) err = Later $ findException p err
function
findException
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "HasErr", "OneOf", "err" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
findError : HasErr e es -> OneOf es MayThrow -> Maybe e
findError Here (First err) = Just err findError (There p) (Later q) = findError p q findError _ _ = Nothing
function
findError
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "HasErr", "Maybe", "OneOf", "err" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
throw : HasErr err es => err -> App es a
throw err = MkApp $ MkAppRes (Left (findException %search err))
function
throw
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "HasErr", "err", "findException" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
catch : HasErr err es => App es a -> (err -> App es a) -> App es a
catch (MkApp prog) handler = MkApp $ prim_app_bind prog $ \res => case res of Left err => case findError %search err of Nothing => MkAppRes (Left err) Just err' => ...
function
catch
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "HasErr", "err", "findError", "ok", "prim_app_bind", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
handle : App (err :: e) a -> (onok : a -> App e b) -> (onerr : err -> App e b) -> App e b
handle (MkApp prog) onok onerr = MkApp $ prim_app_bind prog $ \res => case res of Left (First err) => let MkApp err' = onerr err in err' Left (Later p) => -- different exception, s...
function
handle
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "App", "err", "ok", "prim_app_bind", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
lift : App e a -> App (err :: e) a
lift (MkApp prog) = MkApp $ prim_app_bind prog $ \res => case res of Left err => MkAppRes (Left (Later err)) Right ok => MkAppRes (Right ok)
function
lift
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "App", "err", "ok", "prim_app_bind", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Init : List Error
Init = [AppHasIO]
function
Init
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Error", "List" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
run : App {l} Init a -> IO a
run (MkApp prog) = primIO $ \w => case (prim_app_bind prog $ \r => case r of Right res => MkAppRes res Left (First err) => absurd err) w of MkAppRes r w => MkIORes r w
function
run
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "IO", "Init", "absurd", "err", "primIO", "prim_app_bind", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
noThrow : App Init a -> App Init {l=NoThrow} a
noThrow (MkApp prog) = MkApp $ \w => case prog w of MkAppRes (Left err) w => absurdWithAppHasIO w err MkAppRes (Right res) w => MkAppRes (Right res) w
function
noThrow
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "Init", "absurdWithAppHasIO", "err", "prog" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
new1 : t -> (1 p : State tag t e => App1 {u} e a) -> App1 {u} e a
new1 val prog = MkApp1 $ prim_app1_bind (toPrimApp1 $ newIORef val) $ \ref => let st = MkState ref MkApp1 res = prog @{st} in res
function
new1
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App1", "State", "newIORef", "prim_app1_bind", "prog", "tag", "toPrimApp1", "val" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Has [] es = ()
Has [e] es = e es Has (e :: es') es = (e es, Has es' es)
function
Has
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "::", "[]" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
execTy p es ty = Either (OneOf es p) ty
function
execTy
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "Either", "OneOf" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Functor (App {l} es) where map f ap = bindApp ap $ \ap' => pureApp (f ap')
function
Functor
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "App", "bindApp", "map", "pureApp" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Applicative (App {l} es) where pure = pureApp (<*>) f a = bindApp f $ \f' => bindApp a $ \a' => pure (f' a')
function
Applicative
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ "<*>", "App", "bindApp", "pure", "pureApp" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
Monad (App es) where (>>=) = bindApp -- won't get used, but handy to have the instance
function
Monad
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ ">>=", "App", "bindApp" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
ma >> mb = ma >>= delay mb
function
ma
libs.base.Control
libs/base/Control/App.idr
[ "Data.IORef" ]
[ ">>", ">>=", "delay" ]
https://github.com/idris-lang/Idris2
b2d2cf40dae03d28a873454979fa86093781eb97
End of preview. Expand in Data Studio

Idris2

A structured dataset of type declarations and definitions from Idris 2, a dependently typed functional programming language.

Source

Schema

Column Type Description
statement string Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof
proof string Verbatim proof/body, empty if the declaration has none
type string Declaration keyword
symbolic_name string Declaration identifier
library string Sub-library
filename string Repository-relative source path
imports list[string] File-level Require/Import modules
deps list[string] Intra-corpus identifiers referenced
docstring string Preceding documentation comment, empty if absent
source_url string Upstream repository
commit string Upstream commit extracted

Statistics

  • Entries: 9,925
  • With proof: 7,725 (77.8%)
  • With docstring: 0 (0.0%)
  • Libraries: 161

By type

Type Count
function 8,803
data 692
record 223
interface 129
implementation 78

Example

libc : (fn : String) -> String
libc fn = "C:" ++ fn ++ ", libc 6"

-- `sleep` and `usleep` need to be tied to `blodwen-[u]sleep` for threading
-- reasons (see support/racket/support.rkt)
  • type: function | symbolic_name: libc | libs/base/System.idr

Use

Each declaration is split into a statement (signature/claim) and a proof (body) that are disjoint and together form the complete declaration, for proof modeling, autoformalization, retrieval, and dependency analysis via deps.

Citation

@misc{idris2_dataset,
  title  = {Idris2},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/idris-lang/Idris2, commit b2d2cf40dae0},
  url    = {https://huggingface.co/datasets/phanerozoic/Idris2}
}
Downloads last month
57

Collection including phanerozoic/Idris2