From 8b8525de5b8da1308737bfa7d9486378c207ef91 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Fri, 29 Mar 2013 14:26:28 -0400 Subject: [PATCH] More cleanups and a forgotten file --- README.md | 18 ++++++++++-------- dyna.cabal | 4 ---- src/Dyna/Term/TTerm.hs | 19 +++++++++---------- 3 files changed, 19 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index f74154c..75524ea 100644 --- a/README.md +++ b/README.md @@ -19,18 +19,20 @@ An overview of the source tree Building -------- -First, ensure that you have GHC 7.6 or later. (Though in a pinch, if you're -only interested in the frontend stuff and the Python backend, apparently as -early as 7.0 continues to be servicable.) - -Ensure that you have the Haskell platform available, either through your -favorite package manager or by installing it stand-alone. You should -probably run +First, ensure that you have the Haskell platform 2012.2 or later installed, +either through your favorite package manager or by installing it +stand-alone. You should probably run cabal update before proceeding, just to make sure that your package database is -up-to-date. Then fetch, build, and install any dependencies (for the +up-to-date. Some of our transitive dependencies assume that you have +`alex` and `happy` available -- either fetch those from your package manager +or add `~/.cabal/bin` to your `PATH` and run + + cabal install alex happy + +Then fetch, build, and install any dependencies (for the moment, we seem to be doing OK with vanilla upstreams!) make deps diff --git a/dyna.cabal b/dyna.cabal index e00fe19..c466502 100644 --- a/dyna.cabal +++ b/dyna.cabal @@ -53,7 +53,6 @@ Library template-haskell, transformers >= 0.3, trifecta >= 1.0, - unification-fd, unordered-containers>=0.2, utf8-string >=0.3, wl-pprint-extras >=3.0, @@ -82,7 +81,6 @@ Executable drepl tagged >= 0.4.4, transformers >= 0.3, trifecta >= 1.0, - unification-fd, unordered-containers>=0.2, utf8-string >=0.3, wl-pprint-extras >=3.0 @@ -114,7 +112,6 @@ Executable dyna tagged >= 0.4.4, transformers >= 0.3, trifecta >= 1.0, - unification-fd, unordered-containers>=0.2, utf8-string >=0.3, wl-pprint-extras >=3.0, @@ -153,7 +150,6 @@ Test-suite dyna-selftests test-framework-golden >= 1.1, transformers >= 0.3, trifecta >= 1.0, - unification-fd, unordered-containers>=0.2, utf8-string >=0.3, wl-pprint-extras >=3.0 diff --git a/src/Dyna/Term/TTerm.hs b/src/Dyna/Term/TTerm.hs index 2ed6aad..ca401c0 100644 --- a/src/Dyna/Term/TTerm.hs +++ b/src/Dyna/Term/TTerm.hs @@ -5,6 +5,7 @@ -- complicated things, but it suffices for now? -- Header material {{{ +{-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE DeriveFoldable #-} {-# LANGUAGE DeriveFunctor #-} {-# LANGUAGE DeriveTraversable #-} @@ -21,17 +22,17 @@ module Dyna.Term.TTerm ( TBase(..), TBaseSkolem(..), -- * Terms - TermF(..), DTermV, DVar, DFunct, DFunctAr, DTerm, + TermF(..), {- DTermV, -} DVar, DFunct, DFunctAr, {- DTerm, -} -- * Rules DAgg, {- DRule(..), -} -- * Convenience re-export - UTerm(..) + -- UTerm(..) ) where -import Control.Unification import qualified Data.ByteString as B +import qualified Data.Data as D import qualified Data.Foldable as F import qualified Data.Traversable as T import qualified Text.PrettyPrint.Free as PP @@ -39,15 +40,13 @@ import qualified Text.PrettyPrint.Free as PP ------------------------------------------------------------------------}}} -- Term Base Cases {{{ --- | Used in mode analysis to indicate that an inst is bound to a ground --- (but unknown) value. data TBaseSkolem = TSNumeric | TSString deriving (Eq,Ord,Show) -- | Term base cases. data TBase = TNumeric !(Either Integer Double) | TString !B.ByteString - deriving (Eq,Ord,Show) + deriving (D.Data,D.Typeable,Eq,Ord,Show) instance PP.Pretty TBase where pretty (TNumeric (Left x)) = PP.pretty x @@ -58,27 +57,27 @@ instance PP.Pretty TBase where -- Terms {{{ data Annotation t = AnnType t - deriving (Eq,F.Foldable,Functor,Ord,Show,T.Traversable) + deriving (D.Data,D.Typeable,Eq,F.Foldable,Functor,Ord,Show,T.Traversable) data TermF a t = TFunctor !a ![t] - | TBase TBase + | TBase !TBase deriving (Eq,F.Foldable,Functor,Ord,Show,T.Traversable) type DFunct = B.ByteString type DFunctAr = (DFunct,Int) -type DTermV v = UTerm (TermF DFunct) v type DVar = B.ByteString -type DTerm = DTermV DVar ------------------------------------------------------------------------}}} -- Instances {{{ +{- instance (Eq a) => Unifiable (TermF a) where zipMatch (TFunctor a as) (TFunctor b bs) | a == b && length as == length bs = Just (TFunctor a (zipWith (\aa ba -> Right (aa,ba)) as bs)) zipMatch _ _ = Nothing +-} ------------------------------------------------------------------------}}} -- Rules {{{ -- 2.50.1