curry-base 0.2.4 → 0.2.5
raw patch · 3 files changed
+33/−13 lines, 3 filesnew-uploaderPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Curry.FlatCurry.Goodies: opPrecedence :: OpDecl -> Integer
+ Curry.FlatCurry.Goodies: opPrecedence :: OpDecl -> Int
- Curry.FlatCurry.Goodies: trOp :: (QName -> Fixity -> Integer -> a) -> OpDecl -> a
+ Curry.FlatCurry.Goodies: trOp :: (QName -> Fixity -> Int -> a) -> OpDecl -> a
- Curry.FlatCurry.Goodies: updOp :: (QName -> QName) -> (Fixity -> Fixity) -> (Integer -> Integer) -> OpDecl -> OpDecl
+ Curry.FlatCurry.Goodies: updOp :: (QName -> QName) -> (Fixity -> Fixity) -> (Int -> Int) -> OpDecl -> OpDecl
- Curry.FlatCurry.Goodies: updOpPrecedence :: Update OpDecl Integer
+ Curry.FlatCurry.Goodies: updOpPrecedence :: Update OpDecl Int
- Curry.FlatCurry.Type: Op :: QName -> Fixity -> Integer -> OpDecl
+ Curry.FlatCurry.Type: Op :: QName -> Fixity -> Int -> OpDecl
Files
- Curry/FlatCurry/Goodies.hs +4/−4
- Curry/FlatCurry/Type.hs +13/−3
- curry-base.cabal +16/−6
Curry/FlatCurry/Goodies.hs view
@@ -348,7 +348,7 @@ -- OpDecl -------------------------------------------------------------------- --- transform operator declaration-trOp :: (QName -> Fixity -> Integer -> a) -> OpDecl -> a+trOp :: (QName -> Fixity -> Int -> a) -> OpDecl -> a trOp op (Op name fix prec) = op name fix prec -- Selectors@@ -362,7 +362,7 @@ opFixity = trOp (\_ fix _ -> fix) --- get precedence of operator declaration-opPrecedence :: OpDecl -> Integer+opPrecedence :: OpDecl -> Int opPrecedence = trOp (\_ _ prec -> prec) -- Update Operations@@ -370,7 +370,7 @@ --- update operator declaration updOp :: (QName -> QName) -> (Fixity -> Fixity) ->- (Integer -> Integer) -> OpDecl -> OpDecl+ (Int -> Int) -> OpDecl -> OpDecl updOp fn ff fp = trOp op where op name fix prec = Op (fn name) (ff fix) (fp prec)@@ -384,7 +384,7 @@ updOpFixity f = updOp id f id --- update precedence of operator declaration-updOpPrecedence :: Update OpDecl Integer+updOpPrecedence :: Update OpDecl Int updOpPrecedence = updOp id id -- FuncDecl ------------------------------------------------------------------
Curry/FlatCurry/Type.hs view
@@ -25,7 +25,8 @@ import Curry.Files.PathUtils (writeModule,maybeReadModule) -import Data.List(intersperse)+import Data.List (intersperse)+import Data.Char (isSpace) import Control.Monad (liftM) ------------------------------------------------------------------------------@@ -116,7 +117,7 @@ --- PAKCS definition using Haskell type 'Integer' instead of 'Int' --- for representing the precedence. -data OpDecl = Op QName Fixity Integer deriving (Read, Show, Eq)+data OpDecl = Op QName Fixity Int deriving (Read, Show, Eq) --- Data types for the different choices for the fixity of an operator. @@ -317,8 +318,17 @@ -- Reads a Flat file and returns the corresponding term (type 'Prog') as -- a value of type 'Maybe'.+-- Due to compatibility with PAKCS it is allowed to have a commentary+-- at the beginning of the file enclose in {- ... -}. readFlat :: FilePath -> IO (Maybe Prog)-readFlat = liftM (fmap read) . maybeReadModule+readFlat = liftM (fmap (read . skipComment)) . maybeReadModule+ where+ skipComment s = case dropWhile isSpace s of+ '{':'-':s' -> dropComment s'+ s' -> s'+ dropComment ('-':'}':xs) = xs+ dropComment (_:xs) = dropComment xs+ dropComment [] = [] -- Writes a FlatCurry program term into a file. writeFlatCurry :: String -> Prog -> IO ()
curry-base.cabal view
@@ -1,5 +1,5 @@ Name: curry-base-Version: 0.2.4+Version: 0.2.5 Cabal-Version: >= 1.6 Synopsis: Functions for manipulating Curry programs Description: This package serves as a foundation for Curry compilers. it defines the intermediate@@ -18,8 +18,18 @@ Library Build-Depends: base >= 3 && < 4, mtl, old-time, directory, filepath, containers, pretty ghc-options: - Exposed-Modules: Curry.Base.Position, Curry.Base.Ident, Curry.Base.MessageMonad- Curry.ExtendedFlat.Type, Curry.ExtendedFlat.Goodies, Curry.ExtendedFlat.TypeInference,- Curry.ExtendedFlat.MonadicGoodies, Curry.ExtendedFlat.UnMutual, Curry.ExtendedFlat.LiftLetrec- Curry.FlatCurry.Type, Curry.FlatCurry.Goodies, Curry.FlatCurry.Tools- Curry.Files.Filenames, Curry.Files.PathUtils+ Exposed-Modules: + Curry.Base.Position+ Curry.Base.Ident+ Curry.Base.MessageMonad+ Curry.ExtendedFlat.Type+ Curry.ExtendedFlat.Goodies+ Curry.ExtendedFlat.TypeInference+ Curry.ExtendedFlat.MonadicGoodies+ Curry.ExtendedFlat.UnMutual+ Curry.ExtendedFlat.LiftLetrec+ Curry.FlatCurry.Type+ Curry.FlatCurry.Goodies+ Curry.FlatCurry.Tools+ Curry.Files.Filenames+ Curry.Files.PathUtils