| 1 |
{-# OPTIONS --rewriting --guardedness --sized-types #-} |
| 2 |
|
| 3 |
module README where |
| 4 |
|
| 5 |
------------------------------------------------------------------------ |
| 6 |
-- The Agda standard library, version 2.3 |
| 7 |
-- |
| 8 |
-- Authors: Nils Anders Danielsson, Matthew Daggitt, Guillaume Allais |
| 9 |
-- with contributions from Andreas Abel, Stevan Andjelkovic, |
| 10 |
-- Jean-Philippe Bernardy, Peter Berry, Bradley Hardy, Joachim Breitner, |
| 11 |
-- Samuel Bronson, Daniel Brown, Jacques Carette, James Chapman, |
| 12 |
-- Liang-Ting Chen, Dominique Devriese, Dan Doel, Érdi Gergő, |
| 13 |
-- Zack Grannan, Helmut Grohne, Simon Foster, Liyang Hu, Jason Hu, |
| 14 |
-- Patrik Jansson, Alan Jeffrey, Wen Kokke, Evgeny Kotelnikov, |
| 15 |
-- James McKinna, Sergei Meshveliani, Eric Mertens, Darin Morrison, |
| 16 |
-- Guilhem Moulin, Shin-Cheng Mu, Ulf Norell, Noriyuki Ohkawa, |
| 17 |
-- Nicolas Pouillard, Andrés Sicard-Ramírez, Lex van der Stoep, |
| 18 |
-- Sandro Stucki, Milo Turner, Noam Zeilberger, Shu-Hung You |
| 19 |
-- and other anonymous contributors. |
| 20 |
------------------------------------------------------------------------ |
| 21 |
|
| 22 |
-- This version of the library has been tested using Agda 2.7.0 and |
| 23 |
-- 2.8.0 |
| 24 |
|
| 25 |
-- The library comes with a .agda-lib file, for use with the library |
| 26 |
-- management system. |
| 27 |
|
| 28 |
-- Currently the library does not support the JavaScript compiler |
| 29 |
-- backend. |
| 30 |
|
| 31 |
------------------------------------------------------------------------ |
| 32 |
-- Stability guarantees |
| 33 |
------------------------------------------------------------------------ |
| 34 |
|
| 35 |
-- We do our best to adhere to the spirit of semantic versioning in that |
| 36 |
-- minor versions should not break people's code. This applies to the |
| 37 |
-- the entire library with one exception: modules with names that end in |
| 38 |
-- either ".Core" or ".Primitive". |
| 39 |
|
| 40 |
-- The former have (mostly) been created to avoid mutual recursion |
| 41 |
-- between modules and the latter to bind primitive operations to the |
| 42 |
-- more efficient operations supplied by the relevant backend. |
| 43 |
|
| 44 |
-- These modules may undergo backwards incompatible changes between |
| 45 |
-- minor versions and therefore are imported directly at your own risk. |
| 46 |
-- Instead their contents should be accessed by their parent module, |
| 47 |
-- whose interface will remain stable. |
| 48 |
|
| 49 |
------------------------------------------------------------------------ |
| 50 |
-- High-level overview of contents |
| 51 |
------------------------------------------------------------------------ |
| 52 |
|
| 53 |
-- The top-level module names of the library are currently allocated |
| 54 |
-- as follows: |
| 55 |
-- |
| 56 |
-- • Algebra |
| 57 |
-- Abstract algebra (monoids, groups, rings etc.), along with |
| 58 |
-- properties needed to specify these structures (associativity, |
| 59 |
-- commutativity, etc.), and operations on and proofs about the |
| 60 |
-- structures. |
| 61 |
|
| 62 |
-- • Axiom |
| 63 |
-- Types and consequences of various additional axioms not |
| 64 |
-- necessarily included in Agda, e.g. uniqueness of identity |
| 65 |
-- proofs, function extensionality and excluded middle. |
| 66 |
|
| 67 |
import README.Axiom |
| 68 |
|
| 69 |
-- • Codata |
| 70 |
-- Coinductive data types and properties. There are two different |
| 71 |
-- approaches taken. The `Codata.Sized` folder contains the new more |
| 72 |
-- standard approach using sized types. The `Codata.Musical` |
| 73 |
-- folder contains modules using the old musical notation. |
| 74 |
|
| 75 |
-- • Data |
| 76 |
-- Data types and properties. |
| 77 |
|
| 78 |
-- • Effect |
| 79 |
-- Category theory-inspired idioms used to structure functional |
| 80 |
-- programs (functors and monads, for instance). |
| 81 |
|
| 82 |
import README.Data |
| 83 |
|
| 84 |
-- • Function |
| 85 |
-- Combinators and properties related to functions. |
| 86 |
|
| 87 |
-- • Foreign |
| 88 |
-- Related to the foreign function interface. |
| 89 |
|
| 90 |
-- • Induction |
| 91 |
-- A general framework for induction (includes lexicographic and |
| 92 |
-- well-founded induction). |
| 93 |
|
| 94 |
-- • IO |
| 95 |
-- Input/output-related functions. |
| 96 |
|
| 97 |
import README.IO |
| 98 |
|
| 99 |
-- • Level |
| 100 |
-- Universe levels. |
| 101 |
|
| 102 |
-- • Reflection |
| 103 |
-- Support for reflection. |
| 104 |
|
| 105 |
-- • Relation |
| 106 |
-- Properties of and proofs about relations. |
| 107 |
|
| 108 |
-- • Size |
| 109 |
-- Sizes used by the sized types mechanism. |
| 110 |
|
| 111 |
-- • Strict |
| 112 |
-- Provides access to the builtins relating to strictness. |
| 113 |
|
| 114 |
-- • Tactic |
| 115 |
-- Tactics for automatic proof generation |
| 116 |
|
| 117 |
-- • Text |
| 118 |
-- Format-based printing, Pretty-printing, and regular expressions |
| 119 |
|
| 120 |
|
| 121 |
------------------------------------------------------------------------ |
| 122 |
-- Library design |
| 123 |
------------------------------------------------------------------------ |
| 124 |
-- The following modules contain a discussion of some of the choices |
| 125 |
-- that have been made whilst designing the library. |
| 126 |
|
| 127 |
-- • How mathematical hierarchies (e.g. preorder, partial order, total |
| 128 |
-- order) are handled in the library. |
| 129 |
|
| 130 |
import README.Design.Hierarchies |
| 131 |
|
| 132 |
-- • How decidability is handled in the library. |
| 133 |
|
| 134 |
import README.Design.Decidability |
| 135 |
|
| 136 |
|
| 137 |
------------------------------------------------------------------------ |
| 138 |
-- A selection of useful library modules |
| 139 |
------------------------------------------------------------------------ |
| 140 |
|
| 141 |
-- Note that module names in source code are often hyperlinked to the |
| 142 |
-- corresponding module. In the Emacs mode you can follow these |
| 143 |
-- hyperlinks by typing M-. or clicking with the middle mouse button. |
| 144 |
|
| 145 |
-- • Some data types |
| 146 |
|
| 147 |
import Data.Bool -- Booleans. |
| 148 |
import Data.Char -- Characters. |
| 149 |
import Data.Empty -- The empty type. |
| 150 |
import Data.Fin -- Finite sets. |
| 151 |
import Data.List -- Lists. |
| 152 |
import Data.Maybe -- The maybe type. |
| 153 |
import Data.Nat -- Natural numbers. |
| 154 |
import Data.Product -- Products. |
| 155 |
import Data.String -- Strings. |
| 156 |
import Data.Sum -- Disjoint sums. |
| 157 |
import Data.Unit -- The unit type. |
| 158 |
import Data.Vec -- Fixed-length vectors. |
| 159 |
|
| 160 |
-- • Some co-inductive data types |
| 161 |
|
| 162 |
import Codata.Sized.Stream -- Streams. |
| 163 |
import Codata.Sized.Colist -- Colists. |
| 164 |
|
| 165 |
-- • Some types used to structure computations |
| 166 |
|
| 167 |
import Effect.Functor -- Functors. |
| 168 |
import Effect.Applicative -- Applicative functors. |
| 169 |
import Effect.Monad -- Monads. |
| 170 |
|
| 171 |
-- • Equality |
| 172 |
|
| 173 |
-- Propositional equality: |
| 174 |
import Relation.Binary.PropositionalEquality |
| 175 |
|
| 176 |
-- Convenient syntax for "equational reasoning" using a preorder: |
| 177 |
import Relation.Binary.Reasoning.Preorder |
| 178 |
|
| 179 |
-- Solver for commutative ring or semiring equalities: |
| 180 |
import Algebra.Solver.Ring |
| 181 |
|
| 182 |
-- • Properties of functions, sets and relations |
| 183 |
|
| 184 |
-- Monoids, rings and similar algebraic structures: |
| 185 |
import Algebra |
| 186 |
|
| 187 |
-- Negation, decidability, and similar operations on sets: |
| 188 |
import Relation.Nullary |
| 189 |
|
| 190 |
-- Properties of homogeneous binary relations: |
| 191 |
import Relation.Binary |
| 192 |
|
| 193 |
-- • Induction |
| 194 |
|
| 195 |
-- An abstraction of various forms of recursion/induction: |
| 196 |
import Induction |
| 197 |
|
| 198 |
-- Well-founded induction: |
| 199 |
import Induction.WellFounded |
| 200 |
|
| 201 |
-- Various forms of induction for natural numbers: |
| 202 |
import Data.Nat.Induction |
| 203 |
|
| 204 |
-- • Support for coinduction |
| 205 |
|
| 206 |
import Codata.Musical.Notation |
| 207 |
import Codata.Sized.Thunk |
| 208 |
|
| 209 |
-- • IO |
| 210 |
|
| 211 |
import IO |
| 212 |
|
| 213 |
-- ∙ Text |
| 214 |
|
| 215 |
-- Dependently typed formatted printing |
| 216 |
import Text.Printf |
| 217 |
|
| 218 |
------------------------------------------------------------------------ |
| 219 |
-- More documentation |
| 220 |
------------------------------------------------------------------------ |
| 221 |
|
| 222 |
-- Some examples showing how the case expression can be used. |
| 223 |
|
| 224 |
import README.Case |
| 225 |
|
| 226 |
-- Showcasing the framework for well-scoped substitutions |
| 227 |
|
| 228 |
import README.Data.Fin.Substitution.UntypedLambda |
| 229 |
|
| 230 |
-- Some examples showing how combinators can be used to emulate |
| 231 |
-- "functional reasoning" |
| 232 |
|
| 233 |
import README.Function.Reasoning |
| 234 |
|
| 235 |
-- An example showing how to use the debug tracing mechanism to inspect |
| 236 |
-- the behaviour of compiled Agda programs. |
| 237 |
|
| 238 |
import README.Debug.Trace |
| 239 |
|
| 240 |
-- An exploration of the generic programs acting on n-ary functions and |
| 241 |
-- n-ary heterogeneous products |
| 242 |
|
| 243 |
import README.Nary |
| 244 |
|
| 245 |
-- Explaining the inspect idiom: use case, equivalent handwritten |
| 246 |
-- auxiliary definitions, and implementation details. |
| 247 |
|
| 248 |
import README.Inspect |
| 249 |
|
| 250 |
-- Explaining how to use the automatic solvers |
| 251 |
|
| 252 |
import README.Tactic.MonoidSolver |
| 253 |
import README.Tactic.RingSolver |
| 254 |
|
| 255 |
-- Explaining how the Haskell FFI works |
| 256 |
|
| 257 |
import README.Foreign.Haskell |
| 258 |
|
| 259 |
-- Explaining string formats and the behaviour of printf |
| 260 |
|
| 261 |
import README.Text.Printf |
| 262 |
|
| 263 |
-- Showcasing the pretty printing module |
| 264 |
|
| 265 |
import README.Text.Pretty |
| 266 |
|
| 267 |
-- Demonstrating the regular expression matching |
| 268 |
|
| 269 |
import README.Text.Regex |
| 270 |
|
| 271 |
-- Explaining how to display tables of strings: |
| 272 |
|
| 273 |
import README.Text.Tabular |
| 274 |
|
| 275 |
------------------------------------------------------------------------ |
| 276 |
-- All library modules |
| 277 |
------------------------------------------------------------------------ |
| 278 |
|
| 279 |
-- For short descriptions of every library module, see Everything; |
| 280 |
-- to exclude unsafe modules, see EverythingSafe: |
| 281 |
|
| 282 |
import Everything |
| 283 |
import EverythingSafe |
| 284 |
|
| 285 |
-- Note that the Everything* modules are generated automatically. If |
| 286 |
-- you have downloaded the library from its Git repository and want |
| 287 |
-- to type check README then you can (try to) construct Everything by |
| 288 |
-- running "cabal install && GenerateEverything". |
| 289 |
|
| 290 |
-- Note that all library sources are located under src or ffi. The |
| 291 |
-- modules README, README.* and Everything are not really part of the |
| 292 |
-- library, so these modules are located in the top-level directory |
| 293 |
-- instead. |