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
-- complicated things, but it suffices for now?
-- Header material {{{
+{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveTraversable #-}
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
------------------------------------------------------------------------}}}
-- 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
-- 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 {{{