Index of /~nad/listings/lib-0.4

[ICO]NameLast modifiedSizeDescription

[DIR]Parent Directory   -  
[TXT]Data.Bool.Properties..>28-Sep-2010 01:10 142K 
[TXT]Foreign.Haskell.html 28-Sep-2010 01:10 17K 
[TXT]Algebra.Props.Lattic..>28-Sep-2010 01:10 21K 
[TXT]Data.Nat.Divisibilit..>28-Sep-2010 01:10 133K 
[TXT]Data.Unit.html 28-Sep-2010 01:10 22K 
[TXT]Relation.Nullary.Neg..>28-Sep-2010 01:10 123K 
[TXT]Relation.Nullary.Pro..>28-Sep-2010 01:10 9.4K 
[TXT]Relation.Binary.Prod..>28-Sep-2010 01:10 254K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:10 10K 
[TXT]Relation.Binary.Refl..>28-Sep-2010 01:10 47K 
[TXT]Data.Maybe.Core.html 28-Sep-2010 01:10 4.6K 
[TXT]Data.Nat.InfinitelyO..>28-Sep-2010 01:10 57K 
[TXT]Relation.Binary.NonS..>28-Sep-2010 01:10 67K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:10 11K 
[TXT]Data.Nat.GCD.Lemmas...>28-Sep-2010 01:10 225K 
[TXT]Relation.Binary.Preo..>28-Sep-2010 01:10 21K 
[TXT]Data.List.All.Proper..>28-Sep-2010 01:10 47K 
[TXT]Relation.Binary.Stri..>28-Sep-2010 01:10 6.3K 
[TXT]Relation.Nullary.Uni..>28-Sep-2010 01:10 104K 
[TXT]Data.List.Any.Member..>28-Sep-2010 01:10 221K 
[TXT]Relation.Binary.On.html28-Sep-2010 01:10 107K 
[TXT]Data.AVL.html 28-Sep-2010 01:10 215K 
[TXT]Algebra.Props.Abelia..>28-Sep-2010 01:10 34K 
[TXT]Data.AVL.IndexedMap...>28-Sep-2010 01:10 46K 
[TXT]Data.Bin.html 28-Sep-2010 01:10 173K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:10 10K 
[TXT]Data.DifferenceVec.html28-Sep-2010 01:10 36K 
[TXT]Data.Star.Pointer.html 28-Sep-2010 01:10 73K 
[TXT]Data.Nat.LCM.html 28-Sep-2010 01:10 90K 
[TXT]Data.Sign.html 28-Sep-2010 01:10 11K 
[TXT]Relation.Binary.Cons..>28-Sep-2010 01:10 89K 
[TXT]Algebra.Props.Ring.html28-Sep-2010 01:10 42K 
[TXT]Category.Applicative..>28-Sep-2010 01:10 28K 
[TXT]Data.Fin.Substitutio..>28-Sep-2010 01:10 83K 
[TXT]Algebra.Props.Distri..>28-Sep-2010 01:11 47K 
[TXT]Data.Bool.Show.html 28-Sep-2010 01:11 3.4K 
[TXT]Data.Vec.html 28-Sep-2010 01:11 181K 
[TXT]Data.AVL.Sets.html 28-Sep-2010 01:11 26K 
[TXT]Data.Nat.html 28-Sep-2010 01:11 124K 
[TXT]Data.Container.Any.html28-Sep-2010 01:11 254K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:11 18K 
[TXT]Relation.Binary.Part..>28-Sep-2010 01:11 5.3K 
[TXT]Relation.Nullary.html 28-Sep-2010 01:11 3.8K 
[TXT]Data.Fin.Substitutio..>28-Sep-2010 01:11 23K 
[TXT]Category.Monad.html 28-Sep-2010 01:11 14K 
[TXT]Data.Char.html 28-Sep-2010 01:11 15K 
[TXT]Data.Fin.Substitutio..>28-Sep-2010 01:11 73K 
[TXT]Relation.Binary.Indu..>28-Sep-2010 01:11 21K 
[TXT]Data.Bool.html 28-Sep-2010 01:11 26K 
[TXT]Data.List.Countdown...>28-Sep-2010 01:11 197K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:11 6.5K 
[TXT]Data.BoundedVec.html 28-Sep-2010 01:11 38K 
[TXT]Data.Star.Environmen..>28-Sep-2010 01:11 19K 
[TXT]Function.Inverse.Typ..>28-Sep-2010 01:11 193K 
[TXT]Algebra.Props.Group...>28-Sep-2010 01:11 59K 
[TXT]Everything.html 28-Sep-2010 01:11 92K 
[TXT]Size.html 28-Sep-2010 01:11 3.4K 
[TXT]Level.html 28-Sep-2010 01:11 10K 
[TXT]Data.Nat.Show.html 28-Sep-2010 01:11 11K 
[TXT]Data.Product.html 28-Sep-2010 01:11 91K 
[TXT]Data.Stream.html 28-Sep-2010 01:11 93K 
[TXT]Data.Empty.html 28-Sep-2010 01:11 3.8K 
[TXT]Relation.Binary.List..>28-Sep-2010 01:11 243K 
[TXT]Data.Maybe.html 28-Sep-2010 01:11 97K 
[TXT]Relation.Binary.Orde..>28-Sep-2010 01:11 31K 
[TXT]Data.DifferenceNat.html28-Sep-2010 01:11 12K 
[TXT]Data.Nat.DivMod.html 28-Sep-2010 01:11 77K 
[TXT]Data.Fin.Subset.html 28-Sep-2010 01:11 27K 
[TXT]Data.Star.html 28-Sep-2010 01:11 80K 
[TXT]Relation.Binary.Cons..>28-Sep-2010 01:11 11K 
[TXT]Algebra.RingSolver.S..>28-Sep-2010 01:11 5.2K 
[TXT]Data.List.Any.Proper..>28-Sep-2010 01:11 553K 
[TXT]Category.Monad.Conti..>28-Sep-2010 01:11 38K 
[TXT]Category.Monad.Ident..>28-Sep-2010 01:11 5.1K 
[TXT]Data.List.Reverse.html 28-Sep-2010 01:11 28K 
[TXT]Category.Functor.html 28-Sep-2010 01:11 7.0K 
[TXT]Function.Inverse.html 28-Sep-2010 01:11 157K 
[TXT]Algebra.Props.Boolea..>28-Sep-2010 01:11 492K 
[TXT]Algebra.FunctionProp..>28-Sep-2010 01:11 6.7K 
[TXT]Induction.Nat.html 28-Sep-2010 01:11 41K 
[TXT]Relation.Binary.Stri..>28-Sep-2010 01:11 69K 
[TXT]Relation.Binary.html 28-Sep-2010 01:11 140K 
[TXT]Data.List.Properties..>28-Sep-2010 01:11 435K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:11 8.2K 
[TXT]Data.List.NonEmpty.P..>28-Sep-2010 01:11 43K 
[TXT]Data.String.html 28-Sep-2010 01:11 29K 
[TXT]Data.Vec.Properties...>28-Sep-2010 01:11 134K 
[TXT]Data.Sum.html 28-Sep-2010 01:11 36K 
[TXT]Relation.Binary.Core..>28-Sep-2010 01:11 132K 
[TXT]Relation.Binary.Inde..>28-Sep-2010 01:11 42K 
[TXT]Data.List.Any.html 28-Sep-2010 01:11 121K 
[TXT]Function.html 28-Sep-2010 01:11 53K 
[TXT]Relation.Nullary.Cor..>28-Sep-2010 01:11 7.9K 
[TXT]Algebra.Morphism.html 28-Sep-2010 01:11 45K 
[TXT]Category.Applicative..>28-Sep-2010 01:11 6.3K 
[TXT]Data.Rational.html 28-Sep-2010 01:11 63K 
[TXT]Relation.Binary.List..>28-Sep-2010 01:11 103K 
[TXT]Data.List.NonEmpty.html28-Sep-2010 01:11 123K 
[TXT]Data.Star.Properties..>28-Sep-2010 01:11 93K 
[TXT]Relation.Binary.EqRe..>28-Sep-2010 01:11 7.2K 
[TXT]Data.Fin.Subset.Prop..>28-Sep-2010 01:11 48K 
[TXT]Data.Star.Decoration..>28-Sep-2010 01:11 74K 
[TXT]Data.Colist.html 28-Sep-2010 01:11 161K 
[TXT]Data.Integer.Divisib..>28-Sep-2010 01:11 13K 
[TXT]Data.Digit.html 28-Sep-2010 01:12 61K 
[TXT]Data.Nat.Properties...>28-Sep-2010 01:12 399K 
[TXT]Algebra.RingSolver.L..>28-Sep-2010 01:12 145K 
[TXT]Data.Container.Combi..>28-Sep-2010 01:12 159K 
[TXT]Data.Star.Vec.html 28-Sep-2010 01:12 30K 
[TXT]Relation.Binary.Sum...>28-Sep-2010 01:12 382K 
[TXT]Algebra.Operations.html28-Sep-2010 01:12 32K 
[TXT]Data.Container.Alter..>28-Sep-2010 01:12 127K 
[TXT]Data.Star.Fin.html 28-Sep-2010 01:12 8.8K 
[TXT]Algebra.html 28-Sep-2010 01:12 155K 
[TXT]IO.Primitive.html 28-Sep-2010 01:12 16K 
[TXT]Induction.WellFounde..>28-Sep-2010 01:12 91K 
[TXT]Algebra.RingSolver.A..>28-Sep-2010 01:12 61K 
[TXT]README.Nat.html 28-Sep-2010 01:12 20K 
[TXT]Relation.Nullary.Dec..>28-Sep-2010 01:12 43K 
[TXT]Data.Fin.html 28-Sep-2010 01:12 103K 
[TXT]Relation.Binary.Hete..>28-Sep-2010 01:12 153K 
[TXT]Relation.Binary.Prod..>28-Sep-2010 01:12 126K 
[TXT]Data.Star.Nat.html 28-Sep-2010 01:12 18K 
[TXT]Data.Fin.Substitutio..>28-Sep-2010 01:12 497K 
[TXT]Data.Integer.html 28-Sep-2010 01:12 156K 
[TXT]Function.Surjection...>28-Sep-2010 01:12 37K 
[TXT]Relation.Binary.List..>28-Sep-2010 01:12 108K 
[TXT]Relation.Unary.html 28-Sep-2010 01:12 66K 
[TXT]Data.List.html 28-Sep-2010 01:12 215K 
[TXT]Function.Equality.html 28-Sep-2010 01:12 62K 
[TXT]Function.LeftInverse..>28-Sep-2010 01:12 53K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:12 9.4K 
[TXT]Data.Covec.html 28-Sep-2010 01:12 110K 
[TXT]Induction.Lexicograp..>28-Sep-2010 01:12 51K 
[TXT]Relation.Binary.Simp..>28-Sep-2010 01:12 14K 
[TXT]Function.Equivalence..>28-Sep-2010 01:12 67K 
[TXT]Reflection.html 28-Sep-2010 01:12 25K 
[TXT]Data.Fin.Props.html 28-Sep-2010 01:12 120K 
[TXT]Agda.css 28-Sep-2010 01:12 1.1K 
[TXT]Data.BoundedVec.Inef..>28-Sep-2010 01:12 18K 
[TXT]Data.Nat.GCD.html 28-Sep-2010 01:12 127K 
[TXT]Data.Star.BoundedVec..>28-Sep-2010 01:12 28K 
[TXT]Data.Nat.Coprimality..>28-Sep-2010 01:12 96K 
[TXT]Relation.Binary.Sigm..>28-Sep-2010 01:12 152K 
[TXT]Algebra.Structures.html28-Sep-2010 01:12 211K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:12 83K 
[TXT]Relation.Binary.Prop..>28-Sep-2010 01:12 11K 
[TXT]Data.List.All.html 28-Sep-2010 01:12 42K 
[TXT]Relation.Binary.Prod..>28-Sep-2010 01:12 227K 
[TXT]Data.Vec.N-ary.html 28-Sep-2010 01:12 99K 
[TXT]IO.html 28-Sep-2010 01:12 54K 
[TXT]Category.Monad.Parti..>28-Sep-2010 01:13 680K 
[TXT]Category.Monad.Index..>28-Sep-2010 01:13 32K 
[TXT]Data.Conat.html 28-Sep-2010 01:13 25K 
[TXT]Data.Integer.Propert..>28-Sep-2010 01:13 80K 
[TXT]Category.Monad.State..>28-Sep-2010 01:13 71K 
[TXT]Induction.html 28-Sep-2010 01:13 28K 
[TXT]Algebra.FunctionProp..>28-Sep-2010 01:13 60K 
[TXT]Data.Cofin.html 28-Sep-2010 01:13 19K 
[TXT]Function.Bijection.html28-Sep-2010 01:13 41K 
[TXT]Data.DifferenceList...>28-Sep-2010 01:13 33K 
[TXT]Data.Sign.Properties..>28-Sep-2010 01:13 11K 
[TXT]README.html 28-Sep-2010 01:13 35K 
[TXT]Data.Fin.Dec.html 28-Sep-2010 01:13 129K 
[TXT]Data.Star.List.html 28-Sep-2010 01:13 9.3K 
[TXT]Relation.Binary.Inde..>28-Sep-2010 01:13 17K 
[TXT]Algebra.RingSolver.html28-Sep-2010 01:13 196K 
[TXT]Coinduction.html 28-Sep-2010 01:13 13K 
[TXT]Data.Container.html 28-Sep-2010 01:13 181K 
[TXT]Data.List.Any.BagAnd..>28-Sep-2010 01:13 144K 
[TXT]Relation.Nullary.Sum..>28-Sep-2010 01:13 17K 
[TXT]Relation.Binary.Flip..>28-Sep-2010 01:13 155K 
[TXT]Data.Graph.Acyclic.html28-Sep-2010 01:13 194K 
[TXT]Data.Vec.Equality.html 28-Sep-2010 01:13 78K 
[TXT]Function.Injection.html28-Sep-2010 01:13 27K 

README
module README where

------------------------------------------------------------------------
-- The Agda standard library, version 0.4
--
-- Author: Nils Anders Danielsson, with contributions from
-- Jean-Philippe Bernardy, Peter Berry, Samuel Bronson, Liang-Ting
-- Chen, Dan Doel, Patrik Jansson, Darin Morrison, Shin-Cheng Mu, Ulf
-- Norell, Nicolas Pouillard and Andrés Sicard-Ramírez
------------------------------------------------------------------------

-- This version of the library has been tested using Agda 2.2.8.

-- Note that no guarantees are currently made about forwards or
-- backwards compatibility, the library is still at an experimental
-- stage.

-- To make use of the library, add the path to the library’s root
-- directory (src) to the Agda search path, either using the
-- --include-path flag or by customising the Emacs mode variable
-- agda2-include-dirs (M-x customize-group RET agda2 RET).

-- Contributions to this library are welcome (but to avoid wasted work
-- it is suggested that you discuss large changes before implementing
-- them). Please send contributions in the form of darcs patches (run
-- darcs send --output <patch file> and attach the patch file to an
-- email), and include a statement saying that you agree to release
-- your library patches under the library's licence. It is appreciated
-- if every patch contains a single, complete change, and if the
-- coding style used in the library is adhered to.

------------------------------------------------------------------------
-- Module hierarchy
------------------------------------------------------------------------

-- The top-level module names of the library are currently allocated
-- as follows:
--
-- • Algebra
--     Abstract algebra (monoids, groups, rings etc.), along with
--     properties needed to specify these structures (associativity,
--     commutativity, etc.), and operations on and proofs about the
--     structures.
-- • Category
--     Category theory-inspired idioms used to structure functional
--     programs (functors and monads, for instance).
-- • Coinduction
--     Support for coinduction.
-- • Data
--     Data types and properties about data types.
-- • Function
--     Combinators and properties related to functions.
-- • Foreign
--     Related to the foreign function interface.
-- • Induction
--     A general framework for induction (includes lexicographic and
--     well-founded induction).
-- • IO
--     Input/output-related functions.
-- • Level
--     Universe levels.
-- • Reflection
--     Support for reflection.
-- • Relation
--     Properties of and proofs about relations (mostly homogeneous
--     binary relations).
-- • Size
--     Sizes used by the sized types mechanism.

------------------------------------------------------------------------
-- A selection of useful library modules
------------------------------------------------------------------------

-- Note that module names in source code are often hyperlinked to the
-- corresponding module. In the Emacs mode you can follow these
-- hyperlinks by typing M-. or clicking with the middle mouse button.

-- • Some data types

import Data.Bool     -- Booleans.
import Data.Char     -- Characters.
import Data.Empty    -- The empty type.
import Data.Fin      -- Finite sets.
import Data.List     -- Lists.
import Data.Maybe    -- The maybe type.
import Data.Nat      -- Natural numbers.
import Data.Product  -- Products.
import Data.Stream   -- Streams.
import Data.String   -- Strings.
import Data.Sum      -- Disjoint sums.
import Data.Unit     -- The unit type.
import Data.Vec      -- Fixed-length vectors.

-- • Some types used to structure computations

import Category.Functor      -- Functors.
import Category.Applicative  -- Applicative functors.
import Category.Monad        -- Monads.

-- • Equality

-- Propositional equality:
import Relation.Binary.PropositionalEquality

-- Convenient syntax for "equational reasoning" using a preorder:
import Relation.Binary.PreorderReasoning

-- Solver for commutative ring or semiring equalities:
import Algebra.RingSolver

-- • Properties of functions, sets and relations

-- Monoids, rings and similar algebraic structures:
import Algebra

-- Negation, decidability, and similar operations on sets:
import Relation.Nullary

-- Properties of homogeneous binary relations:
import Relation.Binary

-- • Induction

-- An abstraction of various forms of recursion/induction:
import Induction

-- Well-founded induction:
import Induction.WellFounded

-- Various forms of induction for natural numbers:
import Induction.Nat

-- • Support for coinduction

import Coinduction

-- • IO

import IO

------------------------------------------------------------------------
-- Record hierarchies
------------------------------------------------------------------------

-- When an abstract hierarchy of some sort (for instance semigroup →
-- monoid → group) is included in the library the basic approach is to
-- specify the properties of every concept in terms of a record
-- containing just properties, parameterised on the underlying
-- operations, sets etc.:
--
--   record IsSemigroup {A} (≈ : Rel A) (∙ : Op₂ A) : Set where
--     open FunctionProperties ≈
--     field
--       isEquivalence : IsEquivalence ≈
--       assoc         : Associative ∙
--       ∙-cong        : ∙ Preserves₂ ≈ ⟶ ≈ ⟶ ≈
--
-- More specific concepts are then specified in terms of the simpler
-- ones:
--
--     record IsMonoid {A} (≈ : Rel A) (∙ : Op₂ A) (ε : A) : Set where
--       open FunctionProperties ≈
--       field
--         isSemigroup : IsSemigroup ≈ ∙
--         identity    : Identity ε ∙
--
--     open IsSemigroup isSemigroup public
--
-- Note here that open IsSemigroup isSemigroup public ensures that the
-- fields of the isSemigroup record can be accessed directly; this
-- technique enables the user of an IsMonoid record to use underlying
-- records without having to manually open an entire record hierarchy.
-- This is not always possible, though. Consider the following definition
-- of preorders:
--
--   record IsPreorder {A : Set}
--                     (_≈_ : Rel A) -- The underlying equality.
--                     (_∼_ : Rel A) -- The relation.
--                     : Set where
--     field
--       isEquivalence : IsEquivalence _≈_
--       -- Reflexivity is expressed in terms of an underlying equality:
--       reflexive     : _≈_ ⇒ _∼_
--       trans         : Transitive _∼_
--
--     module Eq = IsEquivalence isEquivalence
--
--     ...
--
-- The Eq module in IsPreorder is not opened publicly, because it
-- contains some fields which clash with fields or other definitions
-- in IsPreorder.

-- Records packing up properties with the corresponding operations,
-- sets, etc. are sometimes also defined:
--
--   record Semigroup : Set₁ where
--     infixl 7 _∙_
--     infix  4 _≈_
--     field
--       Carrier     : Set
--       _≈_         : Rel Carrier
--       _∙_         : Op₂ Carrier
--       isSemigroup : IsSemigroup _≈_ _∙_
--
--     open IsSemigroup isSemigroup public
--
--     setoid : Setoid
--     setoid = record { isEquivalence = isEquivalence }
--
--   record Monoid : Set₁ where
--     infixl 7 _∙_
--     infix  4 _≈_
--     field
--       Carrier  : Set
--       _≈_      : Rel Carrier
--       _∙_      : Op₂ Carrier
--       ε        : Carrier
--       isMonoid : IsMonoid _≈_ _∙_ ε
--
--     open IsMonoid isMonoid public
--
--     semigroup : Semigroup
--     semigroup = record { isSemigroup = isSemigroup }
--
--     open Semigroup semigroup public using (setoid)
--
-- Note that the Monoid record does not include a Semigroup field.
-- Instead the Monoid /module/ includes a "repackaging function"
-- semigroup which converts a Monoid to a Semigroup.

-- The above setup may seem a bit complicated, but we think it makes the
-- library quite easy to work with, while also providing enough
-- flexibility.

------------------------------------------------------------------------
-- More documentation
------------------------------------------------------------------------

-- Some examples showing where the natural numbers and some related
-- operations and properties are defined, and how they can be used:

import README.Nat

------------------------------------------------------------------------
-- Core modules
------------------------------------------------------------------------

-- Some modules have names ending in ".Core". These modules are
-- internal, and have (mostly) been created to avoid mutual recursion
-- between modules. They should not be imported directly; their
-- contents are reexported by other modules.

------------------------------------------------------------------------
-- All library modules
------------------------------------------------------------------------

-- For short descriptions of every library module, see Everything:

import Everything