inch 0.1.0 → 0.2.0
raw patch · 7 files changed
+31/−27 lines, 7 filesdep ~IndentParserdep ~containersdep ~directory
Dependency ranges changed: IndentParser, containers, directory, filepath, mtl, parsec, pretty
Files
- inch.cabal +18/−17
- src/Language/Inch/Context.lhs +1/−1
- src/Language/Inch/File.lhs +4/−4
- src/Language/Inch/Main.lhs +1/−1
- src/Language/Inch/ModuleSyntax.lhs +2/−1
- src/Language/Inch/Syntax.lhs +1/−1
- src/Language/Inch/TypeCheck.lhs +4/−2
inch.cabal view
@@ -1,7 +1,7 @@ Name: inch-Version: 0.1.0+Version: 0.2.0 Synopsis: A type-checker for Haskell with integer constraints-Description: +Description: Inch is a type-checker for a subset of Haskell (plus some GHC extensions) with the addition of integer constraints. After successfully type-checking a source file, it outputs an@@ -38,13 +38,13 @@ hs-source-dirs: src Main-is: Language/Inch/Main.lhs Build-depends: base == 4.*,- IndentParser == 0.2.*,- parsec == 3.1.*,+ IndentParser > 0.2 && < 0.3,+ parsec > 3.1 && < 3.5, presburger == 0.4.*,- pretty == 1.*,- mtl == 2.0.*,- containers == 0.4.*,- filepath == 1.2.*+ pretty >= 1.0 && < 2,+ mtl > 2.0 && < 2.3,+ containers > 0.4 && < 0.6,+ filepath > 1.2 && < 1.4 Other-modules: Language.Inch.BwdFwd, Language.Inch.Check, Language.Inch.Context@@ -63,21 +63,22 @@ Language.Inch.TyNum Language.Inch.TypeCheck Language.Inch.Type- Language.Inch.Unify - + Language.Inch.Unify+ Test-Suite test-inch type: exitcode-stdio-1.0 hs-source-dirs: src tests main-is: Main.lhs build-depends: base == 4.*,- IndentParser == 0.2.*,- parsec == 3.1.*,+ IndentParser > 0.2 && < 0.3,+ parsec > 3.1 && < 3.5, presburger == 0.4.*,- pretty == 1.*,- mtl == 2.0.*,- containers == 0.4.*,- filepath == 1.2.*,- directory == 1.1.*+ pretty >= 1.0 && < 2,+ mtl > 2.0 && < 2.3,+ containers > 0.4 && < 0.6,+ filepath > 1.2 && < 1.4,+ directory > 1.1 && < 1.3+ source-repository head type: git
src/Language/Inch/Context.lhs view
@@ -7,7 +7,7 @@ > import Control.Applicative > import Control.Monad.Error > import Control.Monad.State-> import Control.Monad.Writer hiding (All)+> import Control.Monad.Writer hiding (All, (<>)) > import qualified Data.Map as Map > import Data.Map (Map) > import Data.Foldable
src/Language/Inch/File.lhs view
@@ -2,8 +2,8 @@ > module Language.Inch.File where -> import Prelude hiding (catch)-> import Control.Exception+> import Prelude +> import qualified Control.Exception as E > import Control.Monad.State > import System.Exit > import System.FilePath@@ -52,8 +52,8 @@ > readImport :: FilePath -> Import -> IO [STopDeclaration] > readImport dir im = do-> s <- catch (readFile (combine dir inchFile)) $ \ (_ :: IOException) ->-> catch (readFile =<< getDataFileName inchFile) $ \ (_ :: IOException) ->+> s <- E.catch (readFile (combine dir inchFile)) $ \ (_ :: E.IOException) ->+> E.catch (readFile =<< getDataFileName inchFile) $ \ (_ :: E.IOException) -> > hPutStrLn stderr ("Could not load " ++ inchFile) >> return "" > case parseInterface inchFile s of > Right ds -> return $ filter (included . topDeclName) ds
src/Language/Inch/Main.lhs view
@@ -2,7 +2,7 @@ > module Main where -> import Prelude hiding (catch)+> import Prelude > import System.Environment > import System.FilePath
src/Language/Inch/ModuleSyntax.lhs view
@@ -1,5 +1,6 @@ > {-# LANGUAGE StandaloneDeriving, TypeOperators, GADTs,-> FlexibleInstances, MultiParamTypeClasses, TypeFamilies #-}+> FlexibleInstances, MultiParamTypeClasses,+> TypeFamilies, AllowAmbiguousTypes #-} > module Language.Inch.ModuleSyntax where
src/Language/Inch/Syntax.lhs view
@@ -3,7 +3,7 @@ > StandaloneDeriving, TypeFamilies, RankNTypes, > ImpredicativeTypes, FlexibleContexts, > MultiParamTypeClasses, EmptyDataDecls,-> UndecidableInstances #-}+> UndecidableInstances, AllowAmbiguousTypes #-} > module Language.Inch.Syntax where
src/Language/Inch/TypeCheck.lhs view
@@ -134,8 +134,10 @@ > solveForLots :: Var () KNum -> [Type KConstraint] -> Maybe NormalNum > solveForLots a = getFirst . foldMap (First . maybeSolveFor a) . mapMaybe f-> where f (TyComp EL `TyApp` m `TyApp` n) = Just (normaliseNum (m - n))-> f _ = Nothing+> where+> f :: Type k -> Maybe NormalNum+> f (TyComp EL `TyApp` m `TyApp` n) = Just (normaliseNum (m - n))+> f _ = Nothing > subsCheck :: Sigma -> Sigma -> Contextual ()