An interpreter of Hagino's Categorical Programming Language (CPL).
|Latest on Hackage:||0.0.8|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
An implementation of "A Categorical Programing Language"
This package is an implementation of "A Categorical Programing Language" (CPL for short) written in Haskell.
CPL is a functional programming language based on category theory. Data types are declared in a categorical manner by adjunctions. Data types that can be handled include the terminal object, the initial object, the binary product functor, the binary coproduct functor, the exponential functor, the natural number object, the functor for finite lists, and the functor for infinite lists. Each data type is declared with its basic operations or morphisms. Programs consist of these morphisms, and execution of programs is the reduction of elements (i.e. special morphisms) to their canonical form.
De-Compress archive and enter its top directory. Then type:
$ cabal configure $ cabal build $ cabal install
If you want to compile with readline or haskeline, add -fReadline or -fHaskeline respectively to configure command.
See chapter 5 of 
This program is licenced under the BSD-style license. (See the file 'COPYING'.)
Copyright (C) 2004-2014 Masahiro Sakai
(1) Tatsuya Hagino, “A Categorical Programming Languge”. Ph.D. Thesis, University of Edinburgh, 1987 available at http://www.tom.sfc.keio.ac.jp/~hagino/index.html.en
(2) Tatsuya Hagino, “Categorical Functional Programming Language”. Computer Software, Vol 7, No.1. Advances in Software Science and Technology 4, 1992 ISBN 0-12-037104-9
Changes since the 0.0.7 release
- "→" can be used instead of "->"
- GHC-7.10 support
Changes since the 0.0.6 release
- Clean up internals
Changes since the 0.0.5 release
Changes since the 0.0.3 release
Function defintions are added.
> let uncurry(f) = eval . prod(f, I) uncurry(f) = eval.prod(f,I) f: *a -> exp(*b,*c) ----------------------------- uncurry(f): prod(*a,*b) -> *c > let primrec(f,g) = pi2.pr(pair(0,f), pair(s.pi1, g)) primrec(f,g) = pi2.pr(pair(0,f),pair(s.pi1,g)) f: 1 -> *a g: prod(nat,*a) -> *a --------------------------------- primrec(f,g): nat -> *a