fcf-containers: Data structures and algorithms for first-class-families

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Package fcf-containers provides type-level functions and data structures that operate on type-level computations. Specifically, we mimick the contents of containers-package and show how these can be used. Everything is based on the ideas given in the first-class-families -package.


[Skip to Readme]

Properties

Versions 0.1.0, 0.2.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 0.8.1, 0.8.2
Change log CHANGELOG.md
Dependencies base (>=4.9 && <4.14), first-class-families (>=0.7 && <0.8) [details]
License BSD-3-Clause
Copyright gspia (c) 2020-
Author gspia
Maintainer iahogsp@gmail.com
Category Other
Home page https://github.com/gspia/fcf-containers
Source repo head: git clone https://github.com/gspia/fcf-containers
Uploaded by gspia at 2020-02-02T09:13:22Z

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


Readme for fcf-containers-0.2.0

[back to package description]

fcf-containers

Fcf-containers mimicks the containers package but for type-level computations. That is, we provide e.g. trees and maps. In addition to that, this package contains some other type-level computation utilities.

These methods are based on the idea given in the first-class-families -package, or Fcf shortly. Fcf is the main dependency of fcf-containers. As some of the methods fit badly under the name "fcf-containers", they might end up into the Fcf or some other package to be created. So stay tuned, be patient, check the TODO.md and send those PR's :)

Motivation for calculating things on type-level or on compile-time include

Why fcf-like? The kind of signatures used for functions might be easier to read for some people and the ability to apply partially a function is nice tool to have.

If you have other motivations, please do let us know!

Note: some of the claims on the items in the above list are such that I believe/hope but really don't know at the moment nor do I know how check them. E.g. the matter of compile time vs run time. Yes, types are erased at compile time but do they still leave something into executables: simple check by comparing outputs of the orbit example and another program that has one method to print integer 42 and main, reveals that sizes are almost the same, but not exactly.

There are lot of open interesting questions. See TODO.md file. E.g. how combine these techniques with singletons-lib and related techniques.

Installation and building

First, get the repo with git clone and cd into the directory.

nix-shell 
cabal build 
cabal test 

The doc-tests both document and work as main testing mechanism for this lib.

If you don't use nix, cabal install fcf-containers should be enough. This package has almost as good number of dependencies as the first-class-families.

Example

See Orbits.hs. It shows how to solve a real problem, what PRAGMAs are probably needed etc.

cabal run orbits 

The ghci and :kind! command in there are your friends!

Source also contains a lot of examples, see fcf-containers.

Happy :kinding!