README.md 4.83 KB
Newer Older
Marc Coiffier's avatar
Marc Coiffier committed
1
2
3
Marc's Big Haskell Repository
=============================

4
5
![BHR.svg](https://travis-ci.org/lih/BHR.svg?branch=master)

Marc Coiffier's avatar
Marc Coiffier committed
6
7
8
9
10
11
12
This BHR serves as the entire collection of all the Haskell packages
I've written over the years. There are some libraries (definitive-*),
some serious executables (curly), and some random unfinished wankery
(grow/woosh).

You're welcome to use any of the libraries therein in your own code,
if you can make sense of them. If you just want to test out one of the
13
14
15
programs, you can also check out the [release
page](https://github.com/lih/stack-libs/releases) to find a compiled
and ready-to-use version.
Marc Coiffier's avatar
Marc Coiffier committed
16
17
18

Here is a short description of the different packages in this BHR.

19
### The `definitive-*` libraries
Marc Coiffier's avatar
Marc Coiffier committed
20
21
22
23
24
25
26

Those are basic libraries, designed to minimize external dependencies
while providing most of the functionality found in modern Haskell
programs. Most notably, optics (Lenses and the like) are defined very
early on in the definitive-base library, and serve as the basis for
many standard abstractions.

27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
The `definitive-base` library defines all the standard Monad
transformer combinators, from StateT to LogicT, along with a
generalization of the containers library that simplifies the use of
Sets and Maps, and introduces the Bimap, Relation and Equiv containers
under the same interface.

The `definitive-parser` library, as it name indicates, defines the
usual parser combinators (using the LogicT transformer for
non-determinism), and is used for both binary and textual parsing in
most other packages. It also defines Serializable and Format
typeclasses, as well as their instances for most basic data types and
a mechanism for automatic derivation of those classes for types that
are instances of the Generic class.

The `definitive-graphics` library provides high-level wrappers for the
Marc Coiffier's avatar
Marc Coiffier committed
42
43
44
45
GTK windowing framework, allowing one to describe GUIs and their
behaviour in the perfect mix of declarative layout and imperative
event handling.

46
47
48
The other two (`definitive-network` and `definitive-filesystem`) are
much less interesting, and should definitely not be included in any
serious project.
Marc Coiffier's avatar
Marc Coiffier committed
49
50
51

### The Curly compiler and libraries

52
53
The packages whose name start with `curly` are part of the Curly
compiler infrastructure (on which more information can be found at
Marc Coiffier's avatar
Marc Coiffier committed
54
55
[curly-lang.org](https://www.curly-lang.org/)).

56
The `curly` package contains the library that describes how the
Marc Coiffier's avatar
Marc Coiffier committed
57
58
compiler interacts with its environment (reads configuration files,
locates packages, host interactive sessions, ...). Using that library,
59
60
61
it also implements the `curly` executable, aka the compiler
itself. The `curly` library is also used by `curly-gui`, a GUI version
of the compiler, to handle all its context-related operations.
Marc Coiffier's avatar
Marc Coiffier committed
62

63
At a lower level, the `curly-system` library contains the
Marc Coiffier's avatar
Marc Coiffier committed
64
65
66
67
implementation of all of Curly's backends, from x86 assembly to
JavaScript. You could write a basic batch compiler using only this
library.

68
All of the above packages depend on the `curly-core` library, which
Marc Coiffier's avatar
Marc Coiffier committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
defines all the aspects of the core language, in an
architecture-independent way. This is where you can find a description
of the object format (in the Library type), the type system, and the
syntax and semantic of the Curly language itself.

### Random wankery

This BHR also serves as a testing ground for potentially interesting
ideas to develop, mainly because if I want to import stuff from
another library in here, all I have to do is declare it in the
dependencies of the corresponding .cabal file. I blame this all
squarely on Stack, for being such a great tool.

#### CaPriCon : a concatenative proof assistant

CaPriCon is the answer to the question "what would an assembly
language for mathematical proofs look like ?". It's a low-level,
stack-based language capable of manipulating terms in the Calculus of
Prismatic Constructions. More information is available [here](https://wiqee.curly-lang.org).

#### Logos : a concatenative 3D game engine

Since I already had a monad for concatenative languages, why not use
it for fun, too ?

Logos is a language that makes it easy to define 3D scenes, using the
modern OpenGL rendering pipeline for efficiency. It also provide the
basic event handling capability necessary for implenting a
full-fledged game.

One caveat : you can't yet draw any text. You can load font textures,
and manually map their contents onto a quad, but there's no
abstraction for it yet (and there will be, in the far future).

#### hreadline : a pure Haskell ReadLine library

After spending months wrestling with libncursesw version issues on
different distros, I came to the conclusion that writing my own would
actually save me some time. So I did. And it did.

It's not a clone of the "real" ReadLine, not even close. But it
handles simple text editing, programmable autocompletion, and command
history. Plus, it fits in one ~200LoC file, so it's easy to change
something and understand what you did.