Skip to content

Commit 610dfff

Browse files
committed
Update ghc version
1 parent a14a64b commit 610dfff

File tree

6 files changed

+26
-11
lines changed

6 files changed

+26
-11
lines changed

package.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies:
2525
- vector
2626
- HaTeX >= 3.20.0.0
2727
- regex-tdfa
28-
- MissingH
28+
#- MissingH
2929
- fgl
3030
- graphviz
3131
- text

printers/DotGraphWriter.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import Prelude hiding (Word)
66
import Text.LaTeX.Base.Render
77
import Text.LaTeX.Base
88
import Lib
9-
import Data.Tuple.Utils
109
import Data.Graph.Inductive.PatriciaTree (Gr)
1110
import Data.Text.Lazy (fromStrict, replace, pack)
1211
import Data.GraphViz
@@ -16,6 +15,9 @@ import Data.Text (Text)
1615
import qualified Data.ByteString.Lazy as B
1716
import Data.Text.Lazy.Encoding
1817

18+
snd3 :: (a, b, c) -> b
19+
snd3 (_, b, _) = b
20+
1921
tex2text :: LaTeXM a -> Data.Text.Text
2022
tex2text = render . execLaTeXM
2123

@@ -26,4 +28,4 @@ instance Labellable Word where
2628
toLabelValue = StrLabel . fromStrict . tex2text . doLaTeX . substCommandsInWord
2729

2830
writeGraph :: FilePath -> Gr Word Int -> IO ()
29-
writeGraph f = B.writeFile f . encodeUtf8 . replace (pack "\\\\") (pack "\\") . renderDot . toDot . graphToDot quickParams
31+
writeGraph f = B.writeFile f . encodeUtf8 . replace (pack "\\\\") (pack "\\") . renderDot . toDot . graphToDot quickParams

printers/Main.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import SMInterpreter()
2828
import Helpers
2929
import DotGraphWriter()
3030
import MapleFuncWriter()
31-
import Data.Tuple.Utils
3231
import Console.Options
3332
import Data.List (isSuffixOf)
3433

@@ -244,6 +243,7 @@ printPresentationGap is_det grammar outFileName = do
244243
printExample :: Bool -> Grammar -> String -> IO()
245244
printExample is_det grammar outFileName = renderFile outFileName exampleLatex
246245
where
246+
fst3 (x, _, _) = x
247247
symm = toSymm is_det
248248
exampleLatex = execLaTeXM $
249249
do

src/TM2Tms.hs

+1-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import Data.List (transpose, intercalate)
55
import Data.Set (toList)
66
import Data.Map (fromList, lookup, Map)
77
import Data.List.NonEmpty (reverse, NonEmpty(..), length)
8-
import Data.Tuple.Utils (snd3)
98
import Data.Maybe (fromMaybe)
109

1110
import TMType
@@ -125,7 +124,7 @@ cmd2tmsTapeCmds tapeCmds = do
125124
makeIdTapeCommand (_, _, st) = (st, TmsSingleTapeCommand (Leave, Stay), st)
126125
startState = mergeMultipleNames . fmap (\(TmsState s, _, _) -> s)
127126
finalState = mergeMultipleNames . fmap (\(_, _, TmsState f) -> f)
128-
commands = fmap snd3
127+
commands = fmap $ \(_, x, _) -> x
129128

130129
-- |Convert 'Square' to 'Char'.
131130
toValue :: Square -> Either String Char

src/TmsType.hs

+18-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33

44
module TmsType where
55

6-
import Data.Tuple.Utils (fst3, snd3, thd3)
76
import Data.List (intercalate)
8-
import Data.List.Utils (replace)
97
import GHC.Unicode (isAlphaNum)
108

119
import Prettyprinter
@@ -90,4 +88,21 @@ instance Show Tms where
9088

9189
-- |Process string so that it does not contain illegal characters.
9290
filterStateName :: String -> String
93-
filterStateName = replace "^" "v" . filter (\c -> isAlphaNum c || elem c ['_', '^'])
91+
filterStateName = replace '^' 'v' . filter (\c -> isAlphaNum c || elem c ['_', '^'])
92+
where
93+
replace :: Eq a => a -> a -> [a] -> [a]
94+
replace = replace' []
95+
replace' :: Eq a => [a] -> a -> a -> [a] -> [a]
96+
replace' r x y [] = reverse r
97+
replace' r x y (z:zs)
98+
| x == z = replace' (y:r) x y zs
99+
| otherwise = replace' (z:r) x y zs
100+
101+
fst3 :: (a, b, c) -> a
102+
fst3 (a, _, _) = a
103+
104+
snd3 :: (a, b, c) -> b
105+
snd3 (_, b, _) = b
106+
107+
thd3 :: (a, b, c) -> c
108+
thd3 (_, _, c) = c

stack.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
# resolver: ./custom-snapshot.yaml
2020
# resolver: https://example.com/snapshots/2018-01-01.yaml
2121

22-
resolver: lts-17.11
23-
#resolver: lts-12.13
22+
resolver: lts-18.9
2423

2524
# User packages to be built.
2625
# Various formats can be used as shown in the example below.

0 commit comments

Comments
 (0)