John Meacham - Recent Updates

Code/Haskell - GetOptions

last touched today

GetOptions

  • GetOptions src doc
    This module provides an advanced option parsing routine which can properly parse options depending on what types are infered for them as well as produce a pretty error message with usage info when an incorrect option is used.
  • Main src doc

Download

GetOptions.tar.gz
All Documentation

Darcs Repository

Darcs is the revision control system used for the development of GetOptions.

You may Browse the darcs Repository or fetch the development version with the command

darcs get http://repetae.net/john/repos/GetOptions

You can learn more about darcs at the darcs homepage

The changelog of the project is also available as a RSS feed

Code/Haskell - Doc

last touched today

Doc

  • Doc.DocLike src doc
  • Doc.PPrint src doc
    A Pretty printing class using multiparameter type classes for maximal generality with some useful instances.

    the pprinted type comes as the last argument so newtype deriving can be used in more places.

  • Doc.Pretty src doc
    Modification od Daan Leijens pretty printer. main changes are use of Doc.DocLike framework and the addition of out-of-band data for html tags or ansi escape codes
  • Doc.Chars src doc
    A variety of useful constant documents representing many unicode characters.
  • Doc.Attr src doc

Download

Doc.tar.gz
All Documentation

Darcs Repository

Darcs is the revision control system used for the development of Doc.

You may Browse the darcs Repository or fetch the development version with the command

darcs get http://repetae.net/john/repos/Doc

You can learn more about darcs at the darcs homepage

The changelog of the project is also available as a RSS feed

Code/Haskell - HsLocale

last touched today

HsLocale

Download

HsLocale.tar.gz
All Documentation

Darcs Repository

Darcs is the revision control system used for the development of HsLocale.

You may Browse the darcs Repository or fetch the development version with the command

darcs get http://repetae.net/john/repos/HsLocale

You can learn more about darcs at the darcs homepage

The changelog of the project is also available as a RSS feed

Code/Haskell - HsASA

last touched today

HsASA

A haskell interface to Lester Ingber's adaptive simulating annealing code.

  • Optimize.ASA src doc
    interface to the Adaptive Simulated Annealing algorithm.
  • Optimize.Parameter src doc
    Defines the mapping between haskell types and a set of optimization parameters used to represent said type.
  • Main src doc

Download

HsASA.tar.gz
All Documentation

Darcs Repository

Darcs is the revision control system used for the development of HsASA.

You may Browse the darcs Repository or fetch the development version with the command

darcs get http://repetae.net/john/repos/HsASA

You can learn more about darcs at the darcs homepage

The changelog of the project is also available as a RSS feed

Code/Haskell - Boolean

last touched today

Boolean

A general boolean algebra class and some instances for haskell. The main module is Boolean.Algebra.

  • Boolean.Algebra src doc
    This is the main module of the Boolean hierachy and provides a class which abstracts common operations on boolean algebras. note, we redefine some prelude functions, but the new definitons mean the same thing for Bool so it will not hurt existing code.

    to use properly:

     import Boolean.Algebra
     import Prelude hiding((&&),(||),not,and,or,any,all)
    

  • Boolean.Boolean src doc
    This module provides a data constructor which lifts any type into a boolean algebra and some operations on said lifted type.

  • Boolean.FuzzyBool src doc
  • Boolean.Set src doc
    This creates the boolean algebra of sets from any base boolean algebra. note that the sets created are 'true' sets in the mathematical sense, not the usual programatic aproximation.

    A generalized set can be thought of as a map from keys to boolean values. perhaps the 'map with default' should be seperated out?

  • Boolean.TestCases src doc
    some test cases to test the Boolean.* modules.
  • Boolean.TrueSet src doc

Download

Boolean.tar.gz
All Documentation

Darcs Repository

Darcs is the revision control system used for the development of Boolean.

You may Browse the darcs Repository or fetch the development version with the command

darcs get http://repetae.net/john/repos/Boolean

You can learn more about darcs at the darcs homepage

The changelog of the project is also available as a RSS feed

Code/Haskell - ErrorLog

last touched today

ErrorLog.hs

Manages an error log with proper locking. has a number of useful routines for detecting and reporting erronious conditions.

Code/Haskell - BubbleBabble

last touched today

BubbleBabble.hs

Code/Haskell - GenUtil

last touched today

GenUtil.hs

This is a collection of random useful utility functions written in pure Haskell 98. In general, it trys to conform to the naming scheme put forth the haskell prelude and fill in the obvious omissions, as well as provide useful routines in general. To ensure maximum portability, no instances are exported so it may be added to any project without conflicts.

Code/Haskell - JRegex

last touched 1277 days ago

Proposal/Haskell - Class Alias Proposal for Haskell

last touched 1280 days ago

Class Aliases

This is a proposal for a language extension which will hopefully mitigate the issues holding back evolution of the standard prelude as well as provide useful class abstraction capabilities in general.

It's main goals are to

  • remove the false tension between the granularity of a class hierarchy and its practical usability.

  • Allow one to modify a class hierarchy while retaining 100% backwards compatibility with a class API. with a specific use being able to replace the prelude's numeric hierarchy while retaining full Haskell 98 compatibility, including the fact that libraries that only know about Haskell 98 will have their instances automatically propagated to the new class hierarchy (and vice versa), so switching over can be fully incremental.

  • allow one to provide simple and advanced interfaces to a class hierarchy, much as one can do with functions.

  • it incidentally allows certain things that have been requested on the list as 'nice to have' but not world shattering.

  • not interfere with separate compilation and be describable by a straightforward source->source translation.

feel free to skip the next section if you know the issues involved in replacing the numeric hierarchy of the prelude transparently :)

The Problem

Many alternate preludes have been proposed, however to date none have gained popularity beyond the extensions to the standard libraries provided by fptools. Since as a general rule, the Haskell community only likes to standardize changes that have been actively used and implemented already (a very good policy) this makes evolution of the standard problematic.

Although it is easy enough to provide new functions and datatypes, providing wrapper routines with the old interfaces to allow incremental use of a new prelude or any library. there is no way to hide the fact that you changed a class hierarchy. if you split a class into two, every instance has to change, even if the split is irrelevant to a given datatype. Furthermore, depending on how you split or join classes, many type signatures will have to be rewritten. Since Haskell projects tend to be amalgamations of many different libraries and code from previous projects, this makes using alternate preludes with anything larger than a toy project unpossible.

The problem is compounded when you consider the fact that we ideally want multiple competing preludes or certainly different versions of the same one. Imagine a library that provides a handy new Numeric datatype. the writer of the library only knows about the main prelude and doesn't concern himself with the various experimental preludes out there so declares an instance for Num. Bill comes along and realizes he needs an instance for the new Prelude so declares it an instance of ExperimentalNum, Phil, who also uses the library and the new experimental prelude needs to declare his own ExperimentalNum instance. suddenly Bill's and Phil's libraries cannot be combined by Susan who just wants to get work done and needs both Bill's and Phil's libraries.

The basic issue is that you end up with a quadratic number of instances for every datatype combined with every alternative prelude and it is not clear who should be providing these instances. every library writer should not need to know about every alternate prelude out there and vice versa. Not only that but most of the instances will be very redundant, ExperimentalNum and Num most likely provide many of the same operations, you should only need to declare an instance for one and have it automatically propagated to the other.

The Extension

In Haskell, you may create abstract data types, where you are free to change the internal representation without affecting the visible interface, you may create function impedance matching libraries, providing alternate interfaces to the same functionality. however, there is no way to abstract your class hierarchy. there is no way to hide your class layout in such a way you can change it behind the scenes, once a sizable codebase is built up expecting a certain class layout, there is no incremental migration path to something better.

This extension allows the creation of class aliases, or effectively different views of the class hierarchy. this allows library writers to change the class hierarchy under the hood without affecting the visible interface as well as providing cleaner interfaces to begin with, hiding unimportant implementation details of how the classes are laid out from regular users, while providing the more advanced interfaces to power users.

This extension may be carried out completely in the front end via a source->source translation and does not inhibit separate compilation.

given

 >  class Foo a where
 >    foo :: a -> Bool
 >    foo x = False
 >
 >  class Bar b where
 >    bar :: Int -> b -> [b]

We allow new constructs of this form:

 >  class alias FooBar a = (Foo a, Bar a) where
 >    foo = ...

what this does is declare 'FooBar a' as an alias for the two constraints 'Foo a' and 'Bar a'. This affects two things.

FooBar a may appear anywhere a class constraint may appear otherwise, it's meaning is simply (Foo a, Bar a) and the expansion may be carried out as a simple macro replacement, like type synonyms.

The other thing is that one may declare instances of FooBar.

 > instance FooBar Int where
 >    foo x = x > 0
 >    bar n x = replicate n x

this expands to:

 > instance Foo Int where
 >    foo x = x > 0
 >
 > instance Bar Int where
 >    bar n x = replicate n x

The meaning of declaring a type an instance of a class alias is that it declares the type an instance of each class that makes up the alias, distributing the method definitions to their respective classes, using the default methods declared in the class alias if available, otherwise using the default methods of the underlying class. This also may be carried out as a simple translation in the front end.

let us look at a more concrete example:

the current Num class in the Prelude is (more or less) this

 > class Num a where
 >     (+), (*)    :: a -> a -> a
 >     (-)         :: a -> a -> a
 >     negate      :: a -> a
 >     fromInteger :: Integer -> a

ideally we would want to split it up like so (but with more mathematically precise names):

 > class Additive a where
 >   (+) :: a -> a -> a
 >   zero :: a
 >
 > class Additive a => AdditiveNegation where
 >     (-)         :: a -> a -> a
 >     negate      :: a -> a
 >     x - y  = x + negate y
 >
 > class Multiplicative a where
 >   (*) :: a -> a -> a
 >   one :: a
 >
 > class FromInteger a where
 >     fromInteger      :: Integer -> a

now this presents some problems:

  • people using the new prelude have to write the ungainly (FromInteger a, AdditiveNegation a, Multiplicative a) and declare separate instances for all of them.

  • if at some point a HasZero class is separated out then everyone needs to modify their instance declarations.

  • Num still must be declared if you want it to work with old prelude functions, containing completely redundant information.

  • all the problems mentioned in the second section above about alternate preludes in general.

these can be solved with the changing of Num into a class alias.

 > class alias Num a = (Additive a, AdditiveNegation a,
 >                Multiplicative a, FromInteger a)  where
 >    one = fromInteger 1
 >    zero = fromInteger 0
 >    negate x = zero - x

now, all of the above problems are solved. You may use the short 'Num a' notation for numbers, if a HasZero class is split out then it doesn't matter because declaring something a (Num a) will propagate your methods to it properly. declaration of an instance for Num will automatically create instances for all the other classes, declaring separate instances for each of the other classes will give you the equivalent of an instance for Num. people writing libraries need not concern themselves with the alternate prelude or the Haskell 98 one, they can pretend the other doesn't exist and their instance declarations will automatically create appropriate instances in the alternate prelude.

Another Example

This example is unrelated to creating an alternate prelude but shows how this extension is a useful abstraction tool in general.

imagine we want to create a great lattice class library. I mean, a super really flexible one.

 > class Lattice a where
 >         meet :: a -> a -> a
 >         join :: a -> a -> a

of course, you want to be able to express lattices with a distinguished top and bottom.

 > class Lattice a => BoundedLattice a where
 >         top :: a
 >         bottom :: a
 >         meets :: [a] -> a
 >         joins :: [a] -> a
 >         meets xs = foldl meet top xs
 >         joins xs = foldl join bottom xs

hmm.. but then you realize you might want semi lattices.. so you change it too

 > class SemiLatticeMeet a where
 >         meet :: a -> a -> a
 >
 > class SemiLatticeJoin a where
 >         join :: a -> a -> a
 >
 >
 > class (SemiLatticeMeet a,SemiLatticeJoin a) => BoundedLattice a where
 >         top :: a
 >         bottom :: a
 >         meets :: [a] -> a
 >         joins :: [a] -> a
 >         meets xs = foldl meet top xs
 >         joins xs = foldl join bottom xs

but then you realize you might want bounded semilattices so you come up with the following. your final super flexible lattice class.

 > class BoundedAbove a where
 >         top :: a
 >
 > class BoundedBelow a where
 >         bottom :: a
 >
 > class SemiLatticeMeet a where
 >         meet :: a -> a -> a
 >
 > class SemiLatticeJoin a where
 >         join :: a -> a -> a
 >
 >
 > meets :: (BoundedAbove a,SemiLatticeMeet a) => [a] -> a
 > meets xs = foldl meet top xs
 >
 > joins :: (BoundedBelow a,SemiLatticeJoin a) => [a] -> a
 > joins xs = foldl join bottom xs

notice two things beyond the points mentioned above:

1. You have pissed off all your users... they just wanted to declare a simple bounded lattice and now they have to type a whole lot of crud to do so. refer to the docs several times to see how you named things and know some non-trivial things about lattices.

2. creating a simple bounded lattice instance for Bool requires writing 4 instances, none of which actually say 'BoundedLattice'! not very intuitive or flexible.

3. you can no longer make meets and joins members of a type class, meaning you cannot create optimized versions of them for certain types which most definitely exist and are important for many applications of lattices. you have traded flexibility in one direction for flexibility in another.

of course, you could do something like

 > class (BoundedBelow a, SemiLatticeJoin a) => BoundedBelowJoinable a where
 >         joins :: [a] -> a

but things are already getting absurd. no user is going to type BoundedBelowJoinable constantly when they just want a lattice. there is a fundamental weakness in Haskell here in that it creates a false tension between these two types of flexibility, this is compounded by the inability to change type classes without changing your interface so it is hard to tweak things if it turns out you chose something non-ideally.

now, lets look at the above with class aliases.

 > class SemiLatticeMeet a where
 >         meet :: a -> a -> a
 >
 > class SemiLatticeJoin a where
 >         join :: a -> a -> a
 >
 > class alias Lattice a = (SemiLatticeMeet a, SemiLatticeJoin a)
 >
 > class BoundedAbove a where
 >         top :: a
 >
 > class BoundedBelow a where
 >         bottom :: a
 >
 > class alias Bounded a = (BoundedAbove a, BoundedBelow a)
 >
 >
 > class BoundedBelowJoinable a = (BoundedBelow a, SemiLatticeJoin a) where
 >         joins :: [a] -> a
 >         joins xs = foldl join bottom xs
 >
 > class BoundedAboveMeetable a = (BoundedAbove a, SemiLatticeMeet a) where
 >         meets :: [a] -> a
 >         meets xs = foldl meet top xs
 >
 > class alias BoundedLattice a = (BoundedBelow a, BoundedAbove a, SemiLatticeMeet a,
 >              SemiLatticeJoin a,BoundedBelowJoinable a, BoundedAboveMeetable b)

this looks complicated but you really wanted to write a super-ultra fancy lattice class. But from a library users point of view it is great:

The library user simply need to declare

 > instance BoundedLattice Bool where
 >         top = True
 >         bottom = False
 >         meet = (&&)
 >         join = (||)

and _all_ of the above classes are filled in properly.

someone else can write

 > instance Lattice Integer where
 >         join = max
 >         meet = min

while a power user is free to declare his SemiLattices or BoundedAboveMeetables or whatever.

this is a great benefit IMHO. There has always been a false tension between the granularity of your class hierarchy and its practical usability. this extension gets rid of that tension.

Interaction With Superclasses and More Details

lets look at a slightly different formulation for the class alias for Num.

 > class alias Num a = Eq a => (Additive a, Multiplicative a)

notice that the alias now has an Eq superclass. What this means is that although having an instance for Num means a type must have an instance for Eq, writing an instance definition for Num will not create an instance for Eq, it must be specified separately since it is a superclass and acts just like Haskell superclasses.

what the above alias means is:

  • If I have f :: Num a => ... then I can use any of the class ops of Eq, Additive, Multiplicative in the body of f.

  • Dually, a call of f can be satisfied if (Eq, Additive, Multiplicative) are all available (or Num of course).

  • One can declare an instance of Num either by giving separate instances for Eq, Additive, Multiplicative; or by giving a separate instance for Eq, and an instance for Num itself. The two ways of creating an instance for Num are identical, declaring an instance of an alias is equivalent to declaring separate instances for its constituents.

  • If a type T is an instance of Additive, then it's an error to also give a Num instance, even if the instance only gives the methods for Multiplicative. This is because declaring an instance of a class alias is equivalent to declaring instances of each of it constituents and normal Haskell overlapping instance rules apply. The instances created are independent of which methods you actually override, since normal defaulting occurs for unsupplied methods.

  • In the class declaration for Num one can override the default methods for Additive and Multiplicative. These new default methods will be used (only) when an instance is declared for Num. The default methods may refer to any methods of constituents of the alias, including mutual recursion across classes. You may also use the methods of the superclasses of the alias or any of its constituents, but not override their defaults.

There is no reason you couldn't have a superclass of one of the constituents as another constituent, and in fact this is quite useful. for example

 > class alias EqOrd a = (Eq a, Ord a) where
 >       a == b = compare a b == EQ

even though Eq is a superclass of Ord, making it a constituent of the class means that declaring an instance of EqOrd will declare both an Eq and an Ord instance. instances only get declared for the constituents of the alias and not their superclasses.

note that this alias lets you provide full Eq and Ord instances by only declaring a single 'compare' function.

Notes

  • How these interact with other type class extensions would have to be figured out. it shouldn't present an issue and I think even if class aliases needed to be restricted to single parameter type classes (unlikely) then they would still be useful.

  • deciding what to display in error messages is an issue. but no more complicated than deciding whether to show a type synonym or an underlying type. a heuristic like show the most general constraint that can be expressed with the names in scope should suffice.

  • although it is basically a source->source translation, in practice it could not be carried out by a preprocessor because all the names needed would not be in scope and we would want to propagate the class alias information in the 'hi' files (or equivalent) of the compiler.

  • I had an earlier supertyping proposal you might know about, I feel this is a much better proposal even though it doesn't fully subsume my supertyping proposal, I feel it solves the problems it was meant to solve in a cleaner and easier to implement way.

  • You may wonder why for the Num example I put Additive a in the class alias even though it was already a superclass of AdditiveNegation. that is because class aliases do not change the meaning of superclasses, you need to explicitly list a class if you want instance declarations to propagate methods to it. superclasses are checked just like normal in class aliases.

  • incidental but not earth-shattering benefits include being able to declare an instance for a class and all its superclasses at once, smarter defaults when you are combining related classes, and much nicer type signatures by being able to create your own aliases for common combinations of classes.

Projects - whaw

last touched 1346 days ago

whaw is a program for X11 that can use advanced tiling algorithms and an intuitive user interface to quickly lay out windows without having to replace or modify the set up of your window manager of choice. whaw is meant to augment the capabilities of your current window manager, not supplant them.

Projects - jhc: Haskell Compiler

last touched 1457 days ago

jhc is a haskell compiler.

Util - bt.prl

last touched 1720 days ago

NAME

bt - simple wrapper around RCS for sharing files between projects


SYNOPSIS

bt [options] <command> [projects ... ]


COMMANDS

bring [projects ...]

create the RCS directory and create the appropriate symbolic links for the listed projects.

diff

show differences between your working versions and the ones in the repository

ls

print the file names under repository control

update

checkout the latest version of each file. will prompt for files you have modified.

info

show information about current directory.

avail

list available projects

Download - bt.prl

Proposal/X11 - Move windows between screens

last touched 1751 days ago

I have a simple proposal which builds on the XRANDR extension. Basically, my proposal is:

If XRANDR is present, then XReparentWindow behaves slightly differently. If the new parent window is on a screen other than the one the window is currently on, then rather than generate a BadWindow error, the window will be reparented successfully and a RANDR event will be generated and sent to the reparented window containing its new root window information. An implementation may require that a compatible visual exist on the new screen. (which XReparentWindow requires on the same screen anyway)

I think this would make working with multiple screens immensely more useful and (with a properly extended window manager) would give 98% of the value of XINERAMA without any of its issues. It would also be possible to use this behavior to allow turning on and off extra screens at run-time as windows on the screen to be shut down can be reparented to another.

Proposal/X11 - Share X11 Selections

last touched 1801 days ago

Selections are one of the most powerful IPC mechanisms provided by the X server, allowing complex features not seen in other systems such as content negotiation and lazy generation of content only when it is created. However, several issues with their design make common idioms impossible to implement and their full power is as yet unrealized. Perhaps the main problem is the inability of applications to 'copy' the contents of a selection in a non-destructive fashion, by choosing to receive the data, they must decide on a format and the alternate formats are lost.

This should be unsurprising, as the generation of alternate formats and/or lazy generation of content might require arbitrary computations by the publisher of the data which the X server or other clients cannot be expected to replicate. although some problems may be addressed by X Server extensions such as XFIXES, the fundamental problem of copying selections cannot be without client participation.

examples of several things which are currently impossible, unacceptably lossy or inefficient are:

  • having an app which provides multiple clipboards, or a place to temporarily place multiple selections for later use.
  • have an app which is able to accept drag-n-drop's and place them in the clipboard (or other holding area), and vice versa, taking the contents of the clipboard and publishing them via drag-n-drop.
  • a proxy for allowing drag-n-drops between screens on a single X server
  • saving the contents of the CLIPBOARD in an alternate location
  • saving the contents of a selection after an app owning it exits
  • assigning a global hot-key which swaps CLIPBOARD and SECONDARY
  • assign a global hot-key which copies PRIMARY to CLIPBOARD

the fundamental difficulty is that we would like the ability to work with and manipulate selections as separate entities, but in fact the app which holds the selection has complete control over it, so all interactions with the selection must go through it's owner.

the two parts of this proposal are relatively independent and may be considered separately or as a unit.

Part 1: copying selections

An owner of a selection (call it 'SEL_A') may advertise a conversion type of 'CAN_CLONE_SELECTION' if it wishes to participate. any client may send such a selection owner a 'CLONE_SELECTION' message with an atom representing a new selection name (call it 'SEL_B') and a timestamp. the owner of SEL_A then calls

XSetSelectionOwner(disp, SEL_B, owner's window, timestamp from message);

and publishes the exact same data on SEL_B as SEL_A. from now on, the selections are treated independently, losing one does not imply losing the other and SEL_B may be the source of more clones.

this protocol would allow many of the type of apps discussed above to be written, not only could selections be cloned, it is done without sending any data through the X server, effectively making it 'free' to manipulate selections.

An interesting utility that this would allow is a generic 'palette' or dock app could be implemented which would accept many drops of arbitrary, even unknown types and keep them as icons in a window to be used as the source of drags in the future. if you are commonly working on several directories ,with certain colors or with chunks of text or an arbitrary mix you could create a custom toolbox just by dragging and dropping them and without lossy conversions or inefficient sending of data through the X server. AFAIK this sort of app is impossible to write on windows or macs without actually copying the selection data around.

Part 2: Persistence of selection data

In general, since converting data between types and/or generating them dynamically or lazily could require arbitrary code, the only truly general way for selections to stick around is for their owner to not exit, but rather, keep a stub around to hold the selections after the app quits. However, this is overkill for most types of apps which use selections for simple blocks of text.

to solve this selections may advertise either of these conversion targets:

PERSIST_SELF_HANDLED
This means the client handles persistence after its exit itself such as by wine or xclip. persistence daemons need do nothing. the reason for it's inclusion is to keep clipboard type apps from harvesting it's selections prematurely thinking the data would be lost on exit.

PERSIST_COPY_OKAY
this target means that it is okay for a persistence daemon to copy this data out of the selection. A client wishing to copy the raw data would do a ConvertSelection to this type, what is returned is a list of atoms representing the types which should be copied. the persistence daemon should copy the data from all types listed and advertise the same set of types when it grabs the selection returning the same raw data.

if neither of these are listed the owner is not participating in this protocol and the proper behavior of a persistence daemon will have to be decided by heuristic or user preference.

A notification ClientMessage could be sent to the persistance manager on exit, the app would wait for a SelectionClearEvent to be sure the manager got the data out okay.

Projects - DrIFT

last touched 1804 days ago

DrIFT is a type sensitive preprocessor for Haskell. It extracts type declarations and directives from modules. The directives cause rules to be fired on the parsed type declarations, generating new code which is then appended to the bottom of the input file. The rules are expressed as Haskell code, and it is intended that the user can add new rules as required.

Projects - wmscope

last touched 1804 days ago

WMscope is a little applet that docks under WindowMaker or Afterstep and will display audio data or a neat sine wave display.

Projects - emap

last touched 1804 days ago

emap is a client for the X window system which listens for events such as certain keystrokes in the background and executes shell commands or takes other action in response. In addition to being able to create simple hotkeys, emap implements a prefix map, allowing sequences of keys to be bound to actions. emap also passes information on to shell commands via the environment, which lets commands change their behavior based on things such as the currently active application.

Projects - VSDB

last touched 1804 days ago

VSDB is an experimental database based on atomic updates of constant databases. Unlike other lightweight databases, VSDB supports full transactional semantics when reading and writing to the database. A VSDB database consists of several hash tables (with plans for other data structures). Transaction conflicts are detected and rolled back and the system maintains full ACID semantics. VSDB may be used across distributed filesystems such as NFS without problems.

Projects - Ginsu Chat Client

last touched 1805 days ago

Ginsu is a client for the [Gale chat system] . It is designed to be powerful and above all stable, as well as having a quick learning curve.

Proposal/Haskell - Supertyping Suggestion for Haskell

last touched 1807 days ago

Pardon if my terminology is a bit off, but this is my first Haskell language suggestion. In any case I thought a feature that might be very useful for Haskell would be the ability to supertype as well as subtype classes. Basically it would allow you too add nodes anywhere in the class inheritance tree rather than just extending the bottom. It is VERY useful to allow reuseability of code in ways the original author did not anticipate.

for an example from algebra imagine you are given a class Num a which basically represents a field and you need a Group class and would like to reuse the standard operators in Num as well as have all types (Num a) automatically work as Groups. With supertyping you can without modifying or accessing the original code at all. you simply declare the following:

(ex. in pseudo-Haskell)

class Num a <= Group a where
	(+) :: a -> a -> a 
	negate :: a -> a

note the <= , this declares the new class Group from which the existing Num is derived.

this would create the new class Group and add it to the class inheritance tree above Num, note that the operations in Group must be a subset of what is currently contained in Num, the effect is the exact same as if Num had derived from Group in the first place.

this would take much of the burden of any author writing reusable components to come up with the 'perfect' class inheritance tree. It would also be particularly useful in Haskell since overloading takes place only via classes so a not well thought out class can eat up a lot of the namespace which you would like to reuse for more fine grained components (as in the above example.)

This functionality becomes even more necessary when faced with binary-only libraries and standard language features which cannot be easily rewritten or overridden without great effort.

note that supertyping has been used successfully in Sather (http://gnu.org/software/sather ). Although Sather is an imperative OO language its type systems consists of declarative inheritance of interfaces which are somewhat similar to simple Haskell classes.

let me know what you think... if this functionality already exists or it horribly breaks the soundness of the typesystem then i apologize. It does not seem to adversely affect the typesystem as far as i can tell as it does not really add any new constructs it only generalizes class hierarchy construction... of course, as always, i could just be plain wrong.

Fiction - The Mat

last touched 1807 days ago

Jill turned off the water, first hot, then cold, and stepped out of the shower. On the first step she noticed the bath mat felt different, in that the mat had gotten sticky somehow. Fearing she might have to replace it, she went in for a closer look. Ah, the stickiness was perfectly understandable now. the threads in her mat had gained some amount of life. She could see them writhe slowly with her unaided eye. Obviously they obtained nourishment from her foot, there are all sorts of tasty things that live on the bottom of feet she thinks. Jill grabs a towel and walks out of the room. She is going to have to get a new mat.


Copyright © 1995-2004 John Meacham