mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
More cabal file cleanup. Remove some more tabs from Haskell source.
This commit is contained in:
45
gf.cabal
45
gf.cabal
@@ -41,11 +41,11 @@ data-files:
|
|||||||
|
|
||||||
custom-setup
|
custom-setup
|
||||||
setup-depends:
|
setup-depends:
|
||||||
base,
|
base >= 4.9.1 && < 4.15,
|
||||||
Cabal >=1.22.0.0,
|
Cabal >= 1.22.0.0,
|
||||||
directory >= 1.3.0 && < 1.4,
|
directory >= 1.3.0 && < 1.4,
|
||||||
filepath >= 1.4.1 && < 1.5,
|
filepath >= 1.4.1 && < 1.5,
|
||||||
process >=1.0.1.1
|
process >= 1.0.1.1 && < 1.7
|
||||||
|
|
||||||
source-repository head
|
source-repository head
|
||||||
type: git
|
type: git
|
||||||
@@ -75,20 +75,23 @@ library
|
|||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends:
|
build-depends:
|
||||||
-- GHC 8.0.2 to GHC 8.10.4
|
-- GHC 8.0.2 to GHC 8.10.4
|
||||||
base >= 4.9.1 && < 4.15,
|
|
||||||
array >= 0.5.1 && < 0.6,
|
array >= 0.5.1 && < 0.6,
|
||||||
containers >= 0.5.7 && < 0.7,
|
base >= 4.9.1 && < 4.15,
|
||||||
bytestring >= 0.10.8 && < 0.11,
|
bytestring >= 0.10.8 && < 0.11,
|
||||||
utf8-string >= 1.0.1.1 && < 1.1,
|
containers >= 0.5.7 && < 0.7,
|
||||||
random >= 1.1 && < 1.3,
|
|
||||||
pretty >= 1.1.3 && < 1.2,
|
|
||||||
mtl >= 2.2.1 && < 2.3,
|
|
||||||
-- For compatability with GHC < 8
|
|
||||||
exceptions >= 0.8.3 && < 0.11,
|
exceptions >= 0.8.3 && < 0.11,
|
||||||
fail >= 4.9.0 && < 4.10,
|
ghc-prim >= 0.5.0 && < 0.7,
|
||||||
|
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,
|
||||||
-- We need transformers-compat >= 0.6.3, but that is only in newer snapshots where it is redundant.
|
-- We need transformers-compat >= 0.6.3, but that is only in newer snapshots where it is redundant.
|
||||||
transformers-compat >= 0.5.1.4 && < 0.7,
|
transformers-compat >= 0.5.1.4 && < 0.7
|
||||||
ghc-prim >= 0.5.0 && < 0.7
|
|
||||||
|
if impl(ghc<8.0)
|
||||||
|
build-depends:
|
||||||
|
fail >= 4.9.0 && < 4.10
|
||||||
|
|
||||||
hs-source-dirs: src/runtime/haskell
|
hs-source-dirs: src/runtime/haskell
|
||||||
|
|
||||||
other-modules:
|
other-modules:
|
||||||
@@ -152,13 +155,13 @@ library
|
|||||||
---- GF compiler as a library:
|
---- GF compiler as a library:
|
||||||
|
|
||||||
build-depends:
|
build-depends:
|
||||||
filepath >= 1.4.1 && < 1.5,
|
|
||||||
directory >= 1.3.0 && < 1.4,
|
directory >= 1.3.0 && < 1.4,
|
||||||
time >= 1.6.0 && < 1.10,
|
filepath >= 1.4.1 && < 1.5,
|
||||||
process >= 1.4.3 && < 1.7,
|
|
||||||
haskeline >= 0.7.3 && < 0.9,
|
haskeline >= 0.7.3 && < 0.9,
|
||||||
|
json >= 0.9.1 && < 0.11,
|
||||||
parallel >= 3.2.1.1 && < 3.3,
|
parallel >= 3.2.1.1 && < 3.3,
|
||||||
json >= 0.9.1 && < 0.11
|
process >= 1.4.3 && < 1.7,
|
||||||
|
time >= 1.6.0 && < 1.10
|
||||||
|
|
||||||
hs-source-dirs: src/compiler
|
hs-source-dirs: src/compiler
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
@@ -292,9 +295,9 @@ library
|
|||||||
|
|
||||||
if flag(server)
|
if flag(server)
|
||||||
build-depends:
|
build-depends:
|
||||||
|
cgi >= 3001.3.0.2 && < 3001.6,
|
||||||
httpd-shed >= 0.4.0 && < 0.5,
|
httpd-shed >= 0.4.0 && < 0.5,
|
||||||
network>=2.3 && <2.7,
|
network>=2.3 && <2.7
|
||||||
cgi >= 3001.3.0.2 && < 3001.6
|
|
||||||
if flag(network-uri)
|
if flag(network-uri)
|
||||||
build-depends:
|
build-depends:
|
||||||
network-uri >= 2.6.1.0 && < 2.7,
|
network-uri >= 2.6.1.0 && < 2.7,
|
||||||
@@ -346,8 +349,8 @@ library
|
|||||||
Win32 >= 2.3.1.1 && < 2.7
|
Win32 >= 2.3.1.1 && < 2.7
|
||||||
else
|
else
|
||||||
build-depends:
|
build-depends:
|
||||||
unix >= 2.7.2 && < 2.8,
|
terminfo >=0.4.0 && < 0.5,
|
||||||
terminfo >=0.4.0 && < 0.5
|
unix >= 2.7.2 && < 2.8
|
||||||
|
|
||||||
if impl(ghc>=8.2)
|
if impl(ghc>=8.2)
|
||||||
ghc-options: -fhide-source-paths
|
ghc-options: -fhide-source-paths
|
||||||
|
|||||||
@@ -437,7 +437,7 @@ wc_type = cmd_name
|
|||||||
x2 = takeWhile (\c -> isIdent c || isSpace c || c == '-' || c == '=' || c == '"') x1
|
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
|
cmd = case [x | (x,cs) <- RP.readP_to_S pCommand x2, all isSpace cs] of
|
||||||
[x] -> Just x
|
[x] -> Just x
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
isIdent c = c == '_' || c == '\'' || isAlphaNum c
|
isIdent c = c == '_' || c == '\'' || isAlphaNum c
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ data Fun = Fun { fname:: FunId, ftype:: Type }
|
|||||||
|
|
||||||
data Concrete = Concrete { langcode:: Id,
|
data Concrete = Concrete { langcode:: Id,
|
||||||
opens:: [ModId],
|
opens:: [ModId],
|
||||||
params:: [Param],
|
params:: [Param],
|
||||||
lincats:: [Lincat],
|
lincats:: [Lincat],
|
||||||
opers:: [Oper],
|
opers:: [Oper],
|
||||||
lins:: [Lin] }
|
lins:: [Lin] }
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|
||||||
data Param = Param {pname:: Id, prhs:: String} deriving Show
|
data Param = Param {pname:: Id, prhs:: String} deriving Show
|
||||||
|
|||||||
@@ -14,17 +14,19 @@ tested-with: GHC==7.10.3, GHC==8.0.2, GHC==8.10.4
|
|||||||
library
|
library
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
build-depends:
|
build-depends:
|
||||||
base >= 4.9.1 && < 4.15,
|
|
||||||
array >= 0.5.1 && < 0.6,
|
array >= 0.5.1 && < 0.6,
|
||||||
containers >= 0.5.7 && < 0.7,
|
base >= 4.9.1 && < 4.15,
|
||||||
bytestring >= 0.10.8 && < 0.11,
|
bytestring >= 0.10.8 && < 0.11,
|
||||||
utf8-string >= 1.0.1.1 && < 1.1,
|
containers >= 0.5.7 && < 0.7,
|
||||||
random >= 1.1 && < 1.3,
|
|
||||||
pretty >= 1.1.3 && < 1.2,
|
|
||||||
mtl >= 2.2.1 && < 2.3,
|
|
||||||
ghc-prim >= 0.5.0 && < 0.7,
|
ghc-prim >= 0.5.0 && < 0.7,
|
||||||
-- For compatability with GHC < 8
|
mtl >= 2.2.1 && < 2.3,
|
||||||
fail >= 4.9.0 && < 4.10
|
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:
|
other-modules:
|
||||||
-- not really part of GF but I have changed the original binary library
|
-- not really part of GF but I have changed the original binary library
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import Data.Char (chr,digitToInt,isHexDigit)
|
|||||||
-- | Decode hexadecimal escapes
|
-- | Decode hexadecimal escapes
|
||||||
urlDecodeUnicode :: String -> String
|
urlDecodeUnicode :: String -> String
|
||||||
urlDecodeUnicode [] = ""
|
urlDecodeUnicode [] = ""
|
||||||
urlDecodeUnicode ('%':'u':x1:x2:x3:x4:s)
|
urlDecodeUnicode ('%':'u':x1:x2:x3:x4:s)
|
||||||
| all isHexDigit [x1,x2,x3,x4] =
|
| all isHexDigit [x1,x2,x3,x4] =
|
||||||
chr ( digitToInt x1 `shiftL` 12
|
chr ( digitToInt x1 `shiftL` 12
|
||||||
.|. digitToInt x2 `shiftL` 8
|
.|. digitToInt x2 `shiftL` 8
|
||||||
.|. digitToInt x3 `shiftL` 4
|
.|. digitToInt x3 `shiftL` 4
|
||||||
.|. digitToInt x4) : urlDecodeUnicode s
|
.|. 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.
|
-- Repeatedly extract (and transform) values until a predicate hold. Return the list of values.
|
||||||
unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
|
unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
|
||||||
unfoldr f p x | p x = []
|
unfoldr f p x | p x = []
|
||||||
| otherwise = y:unfoldr f p x'
|
| otherwise = y:unfoldr f p x'
|
||||||
where (y, x') = f x
|
where (y, x') = f x
|
||||||
|
|
||||||
chopList :: ([a] -> (b, [a])) -> [a] -> [b]
|
chopList :: ([a] -> (b, [a])) -> [a] -> [b]
|
||||||
chopList f l = unfoldr f null l
|
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 :: (Eq a) => a -> [a] -> ([a], [a])
|
||||||
breakAt _ [] = ([], [])
|
breakAt _ [] = ([], [])
|
||||||
breakAt x (x':xs) =
|
breakAt x (x':xs) =
|
||||||
if x == x' then
|
if x == x' then
|
||||||
([], xs)
|
([], xs)
|
||||||
else
|
else
|
||||||
let (ys, zs) = breakAt x xs
|
let (ys, zs) = breakAt x xs
|
||||||
in (x':ys, zs)
|
in (x':ys, zs)
|
||||||
|
|||||||
@@ -13,14 +13,14 @@ fold t =
|
|||||||
case unApp t of
|
case unApp t of
|
||||||
Just (i,[x]) ->
|
Just (i,[x]) ->
|
||||||
case M.lookup i foldable of
|
case M.lookup i foldable of
|
||||||
Just j -> appFold j x
|
Just j -> appFold j x
|
||||||
_ -> mkApp i [fold x]
|
_ -> mkApp i [fold x]
|
||||||
Just (i,xs) -> mkApp i $ map fold xs
|
Just (i,xs) -> mkApp i $ map fold xs
|
||||||
_ -> t
|
_ -> t
|
||||||
|
|
||||||
appFold :: CId -> Tree -> Tree
|
appFold :: CId -> Tree -> Tree
|
||||||
appFold j t =
|
appFold j t =
|
||||||
case unApp t of
|
case unApp t of
|
||||||
Just (i,[t,ts]) | isPre i "Cons" -> mkApp j [fold t, appFold j ts]
|
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]
|
Just (i,[t,s]) | isPre i "Base" -> mkApp j [fold t, fold s]
|
||||||
where isPre i s = take 4 (show i) == s
|
where isPre i s = take 4 (show i) == s
|
||||||
|
|||||||
Reference in New Issue
Block a user