From 0954b4cbab2564c4d35043a87fddc9aee26b4166 Mon Sep 17 00:00:00 2001 From: "John J. Camilleri" Date: Wed, 7 Jul 2021 13:04:09 +0200 Subject: More cabal file cleanup. Remove some more tabs from Haskell source. --- src/compiler/GF/Interactive2.hs | 2 +- src/compiler/SimpleEditor/Syntax.hs | 8 ++++---- src/runtime/haskell/pgf.cabal | 18 ++++++++++-------- src/server/URLEncoding.hs | 18 +++++++++--------- src/server/transfer/Fold.hs | 8 ++++---- 5 files changed, 28 insertions(+), 26 deletions(-) (limited to 'src') diff --git a/src/compiler/GF/Interactive2.hs b/src/compiler/GF/Interactive2.hs index 6967309b9..d429b4530 100644 --- a/src/compiler/GF/Interactive2.hs +++ b/src/compiler/GF/Interactive2.hs @@ -437,7 +437,7 @@ wc_type = cmd_name x2 = takeWhile (\c -> isIdent c || isSpace c || c == '-' || c == '=' || c == '"') x1 cmd = case [x | (x,cs) <- RP.readP_to_S pCommand x2, all isSpace cs] of - [x] -> Just x + [x] -> Just x _ -> Nothing isIdent c = c == '_' || c == '\'' || isAlphaNum c diff --git a/src/compiler/SimpleEditor/Syntax.hs b/src/compiler/SimpleEditor/Syntax.hs index 4a5eb6da8..8280ed461 100644 --- a/src/compiler/SimpleEditor/Syntax.hs +++ b/src/compiler/SimpleEditor/Syntax.hs @@ -23,10 +23,10 @@ data Fun = Fun { fname:: FunId, ftype:: Type } data Concrete = Concrete { langcode:: Id, opens:: [ModId], - params:: [Param], - lincats:: [Lincat], - opers:: [Oper], - lins:: [Lin] } + params:: [Param], + lincats:: [Lincat], + opers:: [Oper], + lins:: [Lin] } deriving Show data Param = Param {pname:: Id, prhs:: String} deriving Show diff --git a/src/runtime/haskell/pgf.cabal b/src/runtime/haskell/pgf.cabal index ab54be441..41e67f6ae 100644 --- a/src/runtime/haskell/pgf.cabal +++ b/src/runtime/haskell/pgf.cabal @@ -14,17 +14,19 @@ tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4 library default-language: Haskell2010 build-depends: - base >= 4.9.1 && < 4.15, array >= 0.5.1 && < 0.6, - containers >= 0.5.7 && < 0.7, + base >= 4.9.1 && < 4.15, bytestring >= 0.10.8 && < 0.11, - utf8-string >= 1.0.1.1 && < 1.1, - random >= 1.1 && < 1.3, - pretty >= 1.1.3 && < 1.2, - mtl >= 2.2.1 && < 2.3, + containers >= 0.5.7 && < 0.7, ghc-prim >= 0.5.0 && < 0.7, - -- For compatability with GHC < 8 - fail >= 4.9.0 && < 4.10 + mtl >= 2.2.1 && < 2.3, + pretty >= 1.1.3 && < 1.2, + random >= 1.1 && < 1.3, + utf8-string >= 1.0.1.1 && < 1.1 + + if impl(ghc<8.0) + build-depends: + fail >= 4.9.0 && < 4.10 other-modules: -- not really part of GF but I have changed the original binary library diff --git a/src/server/URLEncoding.hs b/src/server/URLEncoding.hs index 881ca21cd..1a8f579b2 100644 --- a/src/server/URLEncoding.hs +++ b/src/server/URLEncoding.hs @@ -6,9 +6,9 @@ import Data.Char (chr,digitToInt,isHexDigit) -- | Decode hexadecimal escapes urlDecodeUnicode :: String -> String urlDecodeUnicode [] = "" -urlDecodeUnicode ('%':'u':x1:x2:x3:x4:s) +urlDecodeUnicode ('%':'u':x1:x2:x3:x4:s) | all isHexDigit [x1,x2,x3,x4] = - chr ( digitToInt x1 `shiftL` 12 + chr ( digitToInt x1 `shiftL` 12 .|. digitToInt x2 `shiftL` 8 .|. digitToInt x3 `shiftL` 4 .|. digitToInt x4) : urlDecodeUnicode s @@ -45,8 +45,8 @@ fromhex2 d1 d2 = 16*digitToInt d1+digitToInt d2 -- Repeatedly extract (and transform) values until a predicate hold. Return the list of values. unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b] unfoldr f p x | p x = [] - | otherwise = y:unfoldr f p x' - where (y, x') = f x + | otherwise = y:unfoldr f p x' + where (y, x') = f x chopList :: ([a] -> (b, [a])) -> [a] -> [b] chopList f l = unfoldr f null l @@ -54,8 +54,8 @@ chopList f l = unfoldr f null l breakAt :: (Eq a) => a -> [a] -> ([a], [a]) breakAt _ [] = ([], []) breakAt x (x':xs) = - if x == x' then - ([], xs) - else - let (ys, zs) = breakAt x xs - in (x':ys, zs) + if x == x' then + ([], xs) + else + let (ys, zs) = breakAt x xs + in (x':ys, zs) diff --git a/src/server/transfer/Fold.hs b/src/server/transfer/Fold.hs index 61f0d4b34..165e762fb 100644 --- a/src/server/transfer/Fold.hs +++ b/src/server/transfer/Fold.hs @@ -13,14 +13,14 @@ fold t = case unApp t of Just (i,[x]) -> case M.lookup i foldable of - Just j -> appFold j x - _ -> mkApp i [fold x] + Just j -> appFold j x + _ -> mkApp i [fold x] Just (i,xs) -> mkApp i $ map fold xs _ -> t appFold :: CId -> Tree -> Tree -appFold j t = +appFold j t = case unApp t of Just (i,[t,ts]) | isPre i "Cons" -> mkApp j [fold t, appFold j ts] Just (i,[t,s]) | isPre i "Base" -> mkApp j [fold t, fold s] - where isPre i s = take 4 (show i) == s \ No newline at end of file + where isPre i s = take 4 (show i) == s -- cgit v1.2.3