{"id":16603234,"url":"https://github.com/laserpants/baseline-idris","last_synced_at":"2026-03-10T13:31:41.621Z","repository":{"id":148169518,"uuid":"117409545","full_name":"laserpants/baseline-idris","owner":"laserpants","description":"Minimal readline-like API for Idris.","archived":false,"fork":false,"pushed_at":"2018-01-15T11:19:33.000Z","size":135,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T09:47:11.495Z","etag":null,"topics":["editline","idris","readline"],"latest_commit_sha":null,"homepage":null,"language":"Idris","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/laserpants.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-14T07:01:04.000Z","updated_at":"2019-12-13T00:33:12.000Z","dependencies_parsed_at":"2023-05-19T08:45:40.296Z","dependency_job_id":null,"html_url":"https://github.com/laserpants/baseline-idris","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fbaseline-idris","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fbaseline-idris/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fbaseline-idris/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/laserpants%2Fbaseline-idris/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/laserpants","download_url":"https://codeload.github.com/laserpants/baseline-idris/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242729418,"owners_count":20175943,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["editline","idris","readline"],"created_at":"2024-10-12T00:48:32.087Z","updated_at":"2026-03-10T13:31:36.590Z","avatar_url":"https://github.com/laserpants.png","language":"Idris","funding_links":[],"categories":[],"sub_categories":[],"readme":"# baseline-idris\n\nThis project provides a high-level line-editing API via FFI bindings to the \n[Editline](https://github.com/troglobit/editline) library. It aims to implement\nbasic readline functionality in [Idris](https://github.com/idris-lang). Perhaps \nthe name *editline-idris* would be suitable if the API was a bit more complete. \n:stuck_out_tongue:\n\n## Preliminaries\n\nTo use this library, first [build and install Editline](https://github.com/troglobit/editline#build--install). \n\n## Installing\n\nInstall the package using:\n\n```\nidris --install baseline-idris.ipkg\n```\n\n## Usage\n\n### Vanilla `IO` monad\n\n`examples/Basic.idr`:\n\n```idris\nmodule Main\n\nimport Baseline\n\nloop : IO ()\nloop = do\n  str \u003c- baseline \"$\u003e \"\n  case str of\n       Nothing =\u003e putStrLn \"Exit!\"\n       Just \"\" =\u003e loop\n       Just s  =\u003e do\n         putStrLn (\"You typed: \" ++ s)\n         loop\n\nmain : IO ()\nmain = do\n  addDictEntries\n    [ \"multidiscipline\"\n    , \"multivitamin\"\n    , \"multiplex\"\n    , \"monocrystalline\"\n    , \"streamline\"\n    , \"waterline\"\n    , \"skyline\"\n    , \"online\"\n    , \"byline\" ]\n  loop\n```\n\n### Effect\n\n`examples/Effect.idr`:\n\n```idris\nmodule Main\n\nimport Effect.Baseline\nimport Effect.StdIO\nimport Effects\nimport Baseline\n\nprogram : Eff () [BASELINE, STDIO]\nprogram = do\n  readHistory \".history\"\n  addDictEntries\n    [ \"multidiscipline\"\n    , \"multivitamin\"\n    , \"multiplex\"\n    , \"monocrystalline\"\n    , \"streamline\"\n    , \"waterline\"\n    , \"skyline\"\n    , \"online\"\n    , \"byline\" ]\n  loop\n  writeHistory \".history\"\n  putStrLn \"Exit!\"\nwhere\n  loop : Eff () [BASELINE, STDIO]\n  loop = case !(baseline \"$\u003e \") of\n              Just \"\" =\u003e loop\n              Just s  =\u003e do\n                putStrLn (\"You typed: \" ++ s)\n                loop\n              otherwise =\u003e pure ()\n\nmain : IO ()\nmain = run program\n```\n\n### Save and restore history\n\nSee `examples/History.idr` or above snippet. :point_up_2:\n\n## API\n\n#### `baseline : (prompt : String) -\u003e IO (Maybe String)` \n#### `baseline : (prompt : String) -\u003e Eff (Maybe String) [BASELINE] *`\n\nRun the readline prompt and save input to history.\n\n#### `addDictEntry : (entry : String) -\u003e IO ()` \n#### `addDictEntry : (entry : String) -\u003e Eff () [BASELINE] *`\n\nAdd an entry to tab completion dictionary.\n\n#### `addDictEntries : Foldable t =\u003e (entries : t String) -\u003e IO ()` \n#### `addDictEntries : Traversable t =\u003e (entries : t String) -\u003e Eff () [BASELINE] *` \n\nAdd multiple entries to tab completion dictionary.\n\n#### `readHistory : (filename : String) -\u003e IO ()`\n#### `readHistory : (filename : String) -\u003e Eff () [BASELINE] *`\n\nRecover saved history from file.\n\n#### `writeHistory : (filename : String) -\u003e IO ()`\n#### `writeHistory : (filename : String) -\u003e Eff () [BASELINE] *`\n\nSave history to file.\n\n---\n\n*) Use `import Effect.Baseline`.\n\n## Roadmap\n\n- [ ] Ability to take callback for custom tab completion (requires FFI support)\n- [ ] Implement more of Editline's API\n- [ ] Readline-like reverse search\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaserpants%2Fbaseline-idris","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flaserpants%2Fbaseline-idris","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flaserpants%2Fbaseline-idris/lists"}