README.md 4.7 KB
Newer Older
Marc Coiffier's avatar
Marc Coiffier committed
1
2
3
4
5
6
7
8
9
10
Marc's Big Haskell Repository
=============================

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
11
12
13
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
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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

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

### The definitive-* libraries

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.

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
GTK windowing framework, allowing one to describe GUIs and their
behaviour in the perfect mix of declarative layout and imperative
event handling.

The other two (definitive-network and definitive-filesystem) are much
less interesting, and should definitely not be included in any serious
project.

### The Curly compiler and libraries

The packages whose name start with 'curly' are part of the Curly
compiler infrastructure (more information on
[curly-lang.org](https://www.curly-lang.org/)).

The 'curly' package contains the library that describes how the
compiler interacts with its environment (reads configuration files,
locates packages, host interactive sessions, ...). Using that library,
it also implements the 'curly' executable, aka the compiler. The
'curly' library is also used by 'curly-gui' to handle all
context-related operations.

At a lower level, the 'curly-system' library contains the
implementation of all of Curly's backends, from x86 assembly to
JavaScript. You could write a basic batch compiler using only this
library.

All of the above packages depend on the 'curly-core' library, which
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.