/scratch

Example Idris project structure for a creating a library.

Primary LanguageIdrisBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

idris sample scratch pad

Example Idris project structure for a creating a library.

requires Idris >= 1.3.1 and (gcc >= 5.0 or clang >= 3.8)

Quick Start

clean

idris --clean scratch.ipkg

build

idris --build scratch.ipkg

install (for use by applications)

idris --install scratch.ipkg

test

idris --testpkg scratch.ipkg

docs

idris --mkdoc scratch.ipkg

load the library into Idris repl

idris --repl scratch.ipkg
Main> hello
"hello" : String
Main> demoQuad 8
4096 : Integer
Main> demoQuad 1.2
2.0736 : Double
Main> :exec main
hello
hello
Main> :quit

Usage

  • install library
  • include scratch in your *.ipkg file
    • pkgs = scratch, other-libraries, ...
  • import part or all of the library in *.idr source files
    • import Demo => will import all modules in Demo
    • import Demo.Utils => will import just the Utils module
    • import Other.Utils => will import just the Other module