Index of /~nad/listings/lib-0.6

[ICO]NameLast modifiedSizeDescription

[PARENTDIR]Parent Directory   -  
[TXT]Category.Monad.Parti..>2011-12-27 19:30 699K 
[TXT]Data.List.Any.Proper..>2011-12-27 19:30 636K 
[TXT]Algebra.Props.Boolea..>2011-12-27 19:30 508K 
[TXT]Data.Fin.Substitutio..>2011-12-27 19:30 500K 
[TXT]Data.List.Properties..>2011-12-27 19:30 500K 
[TXT]Relation.Binary.Sum...>2011-12-27 19:30 488K 
[TXT]Data.Nat.Properties...>2011-12-27 19:30 432K 
[TXT]Relation.Binary.Sigm..>2011-12-27 19:30 407K 
[TXT]Relation.Binary.Prod..>2011-12-27 19:30 331K 
[TXT]Data.Vec.Properties...>2011-12-27 19:30 307K 
[TXT]Data.AVL.html 2011-12-27 19:30 294K 
[TXT]Data.List.Any.Member..>2011-12-27 19:30 265K 
[TXT]Data.List.Any.BagAnd..>2011-12-27 19:30 263K 
[TXT]Data.Container.Any.html2011-12-27 19:30 257K 
[TXT]Data.Integer.Propert..>2011-12-27 19:30 257K 
[TXT]Relation.Binary.List..>2011-12-27 19:30 244K 
[TXT]Reflection.html 2011-12-27 19:30 229K 
[TXT]Relation.Binary.Prod..>2011-12-27 19:30 227K 
[TXT]Data.Nat.GCD.Lemmas...>2011-12-27 19:30 225K 
[TXT]Data.List.html 2011-12-27 19:30 215K 
[TXT]Function.Related.Typ..>2011-12-27 19:30 215K 
[TXT]Function.Related.html 2011-12-27 19:30 212K 
[TXT]Algebra.Structures.html2011-12-27 19:30 210K 
[TXT]Data.List.Countdown...>2011-12-27 19:30 197K 
[TXT]Data.Graph.Acyclic.html2011-12-27 19:30 196K 
[TXT]Algebra.RingSolver.html2011-12-27 19:30 196K 
[TXT]Data.Vec.html 2011-12-27 19:30 191K 
[TXT]Data.Colist.html 2011-12-27 19:30 180K 
[TXT]Data.Bin.html 2011-12-27 19:30 173K 
[TXT]Data.Container.html 2011-12-27 19:30 172K 
[TXT]Data.Vec.N-ary.html 2011-12-27 19:30 163K 
[TXT]Algebra.Props.Boolea..>2011-12-27 19:30 159K 
[TXT]Data.Container.Combi..>2011-12-27 19:30 159K 
[TXT]Relation.Binary.On.html2011-12-27 19:30 158K 
[TXT]Relation.Binary.Hete..>2011-12-27 19:30 158K 
[TXT]Algebra.html 2011-12-27 19:30 155K 
[TXT]Relation.Binary.Flip..>2011-12-27 19:30 155K 
[TXT]Relation.Binary.Vec...>2011-12-27 19:30 150K 
[TXT]Record.html 2011-12-27 19:30 146K 
[TXT]Data.Integer.html 2011-12-27 19:30 146K 
[TXT]Data.Bool.Properties..>2011-12-27 19:30 145K 
[TXT]Algebra.RingSolver.L..>2011-12-27 19:30 144K 
[TXT]Relation.Binary.html 2011-12-27 19:30 140K 
[TXT]Data.List.NonEmpty.html2011-12-27 19:30 138K 
[TXT]Data.Fin.Dec.html 2011-12-27 19:30 137K 
[TXT]Data.List.Any.html 2011-12-27 19:30 137K 
[TXT]Data.Fin.Props.html 2011-12-27 19:30 134K 
[TXT]Data.Nat.Divisibilit..>2011-12-27 19:30 133K 
[TXT]Relation.Binary.Core..>2011-12-27 19:30 132K 
[TXT]Data.Nat.html 2011-12-27 19:30 131K 
[TXT]Data.Nat.GCD.html 2011-12-27 19:30 127K 
[TXT]Relation.Nullary.Neg..>2011-12-27 19:30 127K 
[TXT]Relation.Binary.Prod..>2011-12-27 19:30 126K 
[TXT]Relation.Binary.List..>2011-12-27 19:30 120K 
[TXT]Data.Fin.Subset.Prop..>2011-12-27 19:30 118K 
[TXT]Data.Fin.html 2011-12-27 19:30 117K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 117K 
[TXT]Relation.Nullary.Uni..>2011-12-27 19:30 114K 
[TXT]Data.Maybe.html 2011-12-27 19:30 111K 
[TXT]Data.Covec.html 2011-12-27 19:30 110K 
[TXT]Relation.Binary.List..>2011-12-27 19:30 109K 
[TXT]Data.Star.Properties..>2011-12-27 19:30 99K 
[TXT]Data.Star.html 2011-12-27 19:30 98K 
[TXT]Everything.html 2011-12-27 19:30 98K 
[TXT]Data.Nat.Coprimality..>2011-12-27 19:30 96K 
[TXT]Data.Stream.html 2011-12-27 19:30 93K 
[TXT]Data.List.All.Proper..>2011-12-27 19:30 93K 
[TXT]Data.Product.html 2011-12-27 19:30 91K 
[TXT]Induction.WellFounde..>2011-12-27 19:30 91K 
[TXT]Data.Nat.LCM.html 2011-12-27 19:30 90K 
[TXT]Relation.Binary.Cons..>2011-12-27 19:30 89K 
[TXT]Function.Inverse.html 2011-12-27 19:30 88K 
[TXT]Category.Monad.State..>2011-12-27 19:30 84K 
[TXT]Data.Fin.Substitutio..>2011-12-27 19:30 83K 
[TXT]Data.Nat.DivMod.html 2011-12-27 19:30 83K 
[TXT]Data.Integer.Additio..>2011-12-27 19:30 81K 
[TXT]Data.Star.Decoration..>2011-12-27 19:30 74K 
[TXT]Data.Fin.Substitutio..>2011-12-27 19:30 74K 
[TXT]Data.Star.Pointer.html 2011-12-27 19:30 73K 
[TXT]Data.Integer.Multipl..>2011-12-27 19:30 73K 
[TXT]Data.Vec.Equality.html 2011-12-27 19:30 71K 
[TXT]Function.html 2011-12-27 19:30 70K 
[TXT]Relation.Unary.html 2011-12-27 19:30 70K 
[TXT]Relation.Binary.Stri..>2011-12-27 19:30 69K 
[TXT]Relation.Binary.NonS..>2011-12-27 19:30 67K 
[TXT]Function.Equivalence..>2011-12-27 19:30 67K 
[TXT]Algebra.Props.Lattic..>2011-12-27 19:30 66K 
[TXT]Data.Rational.html 2011-12-27 19:30 63K 
[TXT]Relation.Binary.Refl..>2011-12-27 19:30 62K 
[TXT]Category.Applicative..>2011-12-27 19:30 62K 
[TXT]Function.Equality.html 2011-12-27 19:30 62K 
[TXT]Data.Digit.html 2011-12-27 19:30 61K 
[TXT]Algebra.RingSolver.A..>2011-12-27 19:30 61K 
[TXT]Algebra.FunctionProp..>2011-12-27 19:30 60K 
[TXT]Algebra.Props.Distri..>2011-12-27 19:30 59K 
[TXT]Algebra.Props.Group...>2011-12-27 19:30 59K 
[TXT]Data.Nat.InfinitelyO..>2011-12-27 19:30 58K 
[TXT]IO.html 2011-12-27 19:30 57K 
[TXT]Function.LeftInverse..>2011-12-27 19:30 57K 
[TXT]Data.Plus.html 2011-12-27 19:30 51K 
[TXT]Induction.Lexicograp..>2011-12-27 19:30 51K 
[TXT]Data.List.NonEmpty.P..>2011-12-27 19:30 48K 
[TXT]Data.List.All.html 2011-12-27 19:30 48K 
[TXT]Function.Surjection...>2011-12-27 19:30 47K 
[TXT]Relation.Nullary.Dec..>2011-12-27 19:30 46K 
[TXT]Algebra.Props.Ring.html2011-12-27 19:30 45K 
[TXT]Algebra.Morphism.html 2011-12-27 19:30 45K 
[TXT]Category.Monad.Conti..>2011-12-27 19:30 44K 
[TXT]Data.AVL.IndexedMap...>2011-12-27 19:30 43K 
[TXT]Data.Fin.Subset.html 2011-12-27 19:30 42K 
[TXT]Data.DifferenceVec.html2011-12-27 19:30 42K 
[TXT]Data.Product.N-ary.html2011-12-27 19:30 42K 
[TXT]Relation.Binary.Inde..>2011-12-27 19:30 41K 
[TXT]Data.BoundedVec.html 2011-12-27 19:30 41K 
[TXT]Induction.Nat.html 2011-12-27 19:30 41K 
[TXT]Function.Bijection.html2011-12-27 19:30 41K 
[TXT]Data.DifferenceList...>2011-12-27 19:30 40K 
[TXT]Data.Sum.html 2011-12-27 19:30 37K 
[TXT]Category.Monad.Index..>2011-12-27 19:30 36K 
[TXT]Algebra.Props.Abelia..>2011-12-27 19:30 35K 
[TXT]Data.String.html 2011-12-27 19:30 33K 
[TXT]Algebra.Operations.html2011-12-27 19:30 32K 
[TXT]Relation.Binary.Orde..>2011-12-27 19:30 31K 
[TXT]Function.Injection.html2011-12-27 19:30 31K 
[TXT]Data.Star.Vec.html 2011-12-27 19:30 30K 
[TXT]Data.List.Reverse.html 2011-12-27 19:30 29K 
[TXT]Data.Star.BoundedVec..>2011-12-27 19:30 28K 
[TXT]Induction.html 2011-12-27 19:30 28K 
[TXT]Data.ReflexiveClosur..>2011-12-27 19:30 26K 
[TXT]Data.AVL.Sets.html 2011-12-27 19:30 26K 
[TXT]Data.Bool.html 2011-12-27 19:30 26K 
[TXT]Data.Conat.html 2011-12-27 19:30 25K 
[TXT]Data.Fin.Substitutio..>2011-12-27 19:30 24K 
[TXT]Data.Unit.html 2011-12-27 19:30 23K 
[TXT]Relation.Binary.Preo..>2011-12-27 19:30 21K 
[TXT]Relation.Binary.Indu..>2011-12-27 19:30 21K 
[TXT]Data.BoundedVec.Inef..>2011-12-27 19:30 20K 
[TXT]Data.Cofin.html 2011-12-27 19:30 19K 
[TXT]Data.Star.Environmen..>2011-12-27 19:30 19K 
[TXT]Data.Char.html 2011-12-27 19:30 19K 
[TXT]Data.Star.Nat.html 2011-12-27 19:30 19K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 18K 
[TXT]IO.Primitive.html 2011-12-27 19:30 18K 
[TXT]Data.W.html 2011-12-27 19:30 18K 
[TXT]Category.Monad.html 2011-12-27 19:30 17K 
[TXT]Relation.Binary.Inde..>2011-12-27 19:30 17K 
[TXT]Relation.Nullary.Sum..>2011-12-27 19:30 17K 
[TXT]Relation.Binary.Simp..>2011-12-27 19:30 14K 
[TXT]Data.Nat.Primality.html2011-12-27 19:30 14K 
[TXT]Data.Integer.Divisib..>2011-12-27 19:30 13K 
[TXT]Coinduction.html 2011-12-27 19:30 13K 
[TXT]Data.Unit.Core.html 2011-12-27 19:30 12K 
[TXT]Data.DifferenceNat.html2011-12-27 19:30 12K 
[TXT]Universe.html 2011-12-27 19:30 12K 
[TXT]Data.Nat.Show.html 2011-12-27 19:30 11K 
[TXT]Relation.Binary.Cons..>2011-12-27 19:30 11K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 11K 
[TXT]Data.Sign.html 2011-12-27 19:30 11K 
[TXT]Data.Sign.Properties..>2011-12-27 19:30 11K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 10K 
[TXT]Relation.Binary.Hete..>2011-12-27 19:30 10K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 9.9K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 9.9K 
[TXT]Relation.Nullary.Pro..>2011-12-27 19:30 9.5K 
[TXT]Data.Star.List.html 2011-12-27 19:30 9.5K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 9.3K 
[TXT]Level.html 2011-12-27 19:30 9.2K 
[TXT]Data.Star.Fin.html 2011-12-27 19:30 9.0K 
[TXT]Category.Functor.html 2011-12-27 19:30 8.2K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 8.1K 
[TXT]Relation.Nullary.Cor..>2011-12-27 19:30 7.8K 
[TXT]Relation.Binary.Prop..>2011-12-27 19:30 7.8K 
[TXT]Category.Applicative..>2011-12-27 19:30 7.6K 
[TXT]Relation.Binary.EqRe..>2011-12-27 19:30 7.1K 
[TXT]Algebra.FunctionProp..>2011-12-27 19:30 6.6K 
[TXT]Category.Monad.Ident..>2011-12-27 19:30 6.5K 
[TXT]Relation.Binary.Stri..>2011-12-27 19:30 6.2K 
[TXT]Relation.Binary.Part..>2011-12-27 19:30 5.2K 
[TXT]Data.Maybe.Core.html 2011-12-27 19:30 5.2K 
[TXT]Algebra.RingSolver.S..>2011-12-27 19:30 5.1K 
[TXT]Data.Empty.html 2011-12-27 19:30 4.3K 
[TXT]Relation.Nullary.html 2011-12-27 19:30 3.9K 
[TXT]Data.Bool.Show.html 2011-12-27 19:30 3.6K 
[TXT]Size.html 2011-12-27 19:30 3.6K 
[TXT]Foreign.Haskell.html 2011-12-27 19:30 2.7K 
[TXT]Agda.css 2011-12-27 19:30 1.1K 

README
module README where

------------------------------------------------------------------------
-- The Agda standard library, version 0.6
--
-- Author: Nils Anders Danielsson, with contributions from Andreas
-- Abel, Jean-Philippe Bernardy, Peter Berry, Samuel Bronson, Daniel
-- Brown, Liang-Ting Chen, Dominique Devriese, Dan Doel, Simon Foster,
-- Patrik Jansson, Alan Jeffrey, Eric Mertens, 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.3.0.

-- 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).

-- To compile the library using the MAlonzo compiler you first need to
-- install some supporting Haskell code, for instance as follows:
--
--   cd ffi
--   cabal install
--
-- Currently the library does not support the Epic or JavaScript
-- compiler backends.

-- 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.
-- • Record
--     An encoding of record types with manifest fields and "with".
-- • Reflection
--     Support for reflection.
-- • Relation
--     Properties of and proofs about relations (mostly homogeneous
--     binary relations).
-- • Size
--     Sizes used by the sized types mechanism.
-- • Universe
--     A definition of universes.

------------------------------------------------------------------------
-- 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/integers and some
-- related operations and properties are defined, and how they can be
-- used:

import README.Nat
import README.Integer

-- Some examples showing how the AVL tree module can be used.

import README.AVL

-- An example showing how the Record module can be used.

import README.Record

-- An example showing how the case expression can be used.

import README.Case

------------------------------------------------------------------------
-- 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

-- Note that the Everything module is generated automatically. If you
-- have downloaded the library from its darcs repository and want to
-- type check README then you can (try to) construct Everything by
-- running "cabal install && GenerateEverything".

-- Note that all library sources are located under src or ffi. The
-- modules README, README.* and Everything are not really part of the
-- library, so these modules are located in the top-level directory
-- instead.