jukebox 0.1.2 → 0.1.3
raw patch · 6 files changed
+38/−7 lines, 6 files
Files
- Jukebox/HighSat.hs +3/−2
- Jukebox/Name.hs +2/−1
- Jukebox/Seq.hs +9/−0
- Jukebox/TPTP/ParseProblem.hs +2/−1
- dist/build/Jukebox/TPTP/Lexer.hs +21/−2
- jukebox.cabal +1/−1
Jukebox/HighSat.hs view
@@ -16,9 +16,10 @@ import Control.Applicative import Data.Maybe import Data.List(partition)+import Control.Applicative -newtype Sat1 a b = Sat1 { runSat1_ :: ReaderT Solver (ReaderT (Watch a) (StateT (Map a Lit) IO)) b } deriving (Functor, Monad, MonadIO)-newtype Sat a b c = Sat { runSat_ :: ReaderT (Watch a) (StateT (Map b (SatState a)) IO) c } deriving (Functor, Monad, MonadIO)+newtype Sat1 a b = Sat1 { runSat1_ :: ReaderT Solver (ReaderT (Watch a) (StateT (Map a Lit) IO)) b } deriving (Functor, Applicative, Monad, MonadIO)+newtype Sat a b c = Sat { runSat_ :: ReaderT (Watch a) (StateT (Map b (SatState a)) IO) c } deriving (Functor, Applicative, Monad, MonadIO) data SatState a = SatState Solver (Map a Lit) type Watch a = a -> Sat1 a ()
Jukebox/Name.hs view
@@ -18,6 +18,7 @@ import Data.Int import Data.Typeable import Control.Monad.State.Strict+import Control.Applicative data Name = Name {@@ -75,7 +76,7 @@ newtype NameM a = NameM { unNameM :: State Int64 a }- deriving (Functor, Monad)+ deriving (Functor, Applicative, Monad) newName :: Named a => a -> NameM Name newName x = NameM $ do
Jukebox/Seq.hs view
@@ -6,6 +6,7 @@ import Data.Hashable import qualified Data.HashSet as Set import Data.Monoid+import Control.Applicative data Seq a = Append (Seq a) (Seq a) | Unit a | Nil @@ -48,10 +49,18 @@ fmap f (Unit x) = Unit (f x) fmap f Nil = Nil +instance Applicative Seq where+ pure = return+ (<*>) = liftM2 ($)+ instance Monad Seq where return = Unit x >>= f = concatMapA f x fail _ = Nil++instance Alternative Seq where+ empty = mzero+ (<|>) = mplus instance MonadPlus Seq where mzero = Nil
Jukebox/TPTP/ParseProblem.hs view
@@ -23,7 +23,8 @@ parseProblemWith :: (FilePath -> IO (Maybe FilePath)) -> ProgressBar -> FilePath -> IO (Either String (Problem Form)) parseProblemWith findFile progressBar name = runErrorT (fmap finalise (parseFile name Nothing "<command line>" (Pos 0 0) initialState))- where err file (Pos l c) msg = throwError msg'+ where err :: String -> Pos -> String -> ErrorT String IO a+ err file (Pos l c) msg = throwError msg' where msg' = "Error at " ++ file ++ " (line " ++ show l ++ ", column " ++ show c ++ "):\n" ++ msg liftMaybeIO :: IO (Maybe a) -> FilePath -> Pos -> String -> ErrorT String IO a liftMaybeIO m file pos msg = do
dist/build/Jukebox/TPTP/Lexer.hs view
@@ -252,7 +252,7 @@ {-# LINE 1 "templates/GenericTemplate.hs" #-} {-# LINE 1 "<built-in>" #-} {-# LINE 1 "<command-line>" #-}-{-# LINE 8 "<command-line>" #-}+{-# LINE 9 "<command-line>" #-} # 1 "/usr/include/stdc-predef.h" 1 3 4 # 17 "/usr/include/stdc-predef.h" 3 4@@ -298,7 +298,26 @@ -{-# LINE 8 "<command-line>" #-}+{-# LINE 9 "<command-line>" #-}+{-# LINE 1 "/usr/lib/ghc-7.10.1/include/ghcversion.h" #-}++++++++++++++++++{-# LINE 9 "<command-line>" #-} {-# LINE 1 "templates/GenericTemplate.hs" #-} -- ----------------------------------------------------------------------------- -- ALEX TEMPLATE
jukebox.cabal view
@@ -1,5 +1,5 @@ Name: jukebox-Version: 0.1.2+Version: 0.1.3 Cabal-version: >= 1.8 Build-type: Simple Author: Nick Smallbone