From e85b0920a06ad019754e1cb8e72eb6cc34cdeedc Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Thu, 12 Jul 2007 19:50:34 +0200 Subject: use of existential types for plugin support This patch, which *changes the configuration format*, adds easy plugin support by using an existential type for storing the list of commands to be executed. Adding a plugin is just a matter of writing the appropriate instance of the Exec class, after importing Commands.hs. I must thank Claus Reinke for the help in understanding the mysteries of reading existential types. The Read instance of Runnable must be credited to him. See here: http://www.haskell.org/pipermail/haskell-cafe/2007-July/028227.html darcs-hash:20070712175034-d6583-f10174bb3b0a9b4f6e08d05052c18f30e539b319.gz --- Runnable.hs-boot | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Runnable.hs-boot (limited to 'Runnable.hs-boot') diff --git a/Runnable.hs-boot b/Runnable.hs-boot new file mode 100644 index 0000000..90dbe81 --- /dev/null +++ b/Runnable.hs-boot @@ -0,0 +1,11 @@ +{-# OPTIONS -fglasgow-exts #-} +module Runnable where +import Commands + +data Runnable = forall r . (Exec r,Show r, Read r) => Run r + +instance Read Runnable +instance Exec Runnable +instance Show Runnable + + -- cgit v1.2.3