diff --git a/Makefile b/Makefile index 729101097..ff80ebe6c 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ test: stack test --test-arguments '--hide-successes --limit-time ${LIMIT_TIME}';\ fi +.PHONY: stack.yaml stack.yaml: etc/hs-deps/stack-${GHC_VERSION}.yaml @cp etc/hs-deps/stack-${GHC_VERSION}.yaml stack.yaml diff --git a/etc/build/gen_Operator.hs b/etc/build/gen_Operator.hs index 666d2fb23..171d1aa08 100644 --- a/etc/build/gen_Operator.hs +++ b/etc/build/gen_Operator.hs @@ -66,6 +66,7 @@ main = do , [ "" , "instance ( Pretty x" + , " , Data x" , " , ExpressionLike x" , " , ReferenceContainer x" , " , TypeOf x" diff --git a/src/Conjure/Prelude.hs b/src/Conjure/Prelude.hs index 8b2586776..140a58531 100644 --- a/src/Conjure/Prelude.hs +++ b/src/Conjure/Prelude.hs @@ -9,6 +9,7 @@ module Conjure.Prelude ( module X , stringToDoc + , textToDoc , padRight, padLeft, padCenter , pairWithContents , withRest, withAfter, withBefore @@ -123,6 +124,7 @@ import Data.List as X ( (\\), intercalate, intersperse, minimumBy, nub, , inits, tails , findIndex , filter, partition + , cycle ) import Data.List.Split as X ( splitOn, chunksOf ) import Data.Maybe as X ( Maybe(..), catMaybes, listToMaybe, fromMaybe, maybe, maybeToList, mapMaybe @@ -170,6 +172,7 @@ import Data.Generics.Uniplate.Data as X , transformM, transformBiM , descend, descendM , descendBi, descendBiM + , rewriteBi , universe, universeBi , children, childrenBi , uniplate @@ -257,6 +260,9 @@ textToString = T.unpack stringToDoc :: String -> Doc stringToDoc = Pr.text +textToDoc :: T.Text -> Doc +textToDoc = stringToDoc . textToString + padRight :: Int -> Char -> String -> String padRight n ch s = s ++ replicate (n - length s) ch diff --git a/src/test/Conjure/ModelAllSolveAll.hs b/src/test/Conjure/ModelAllSolveAll.hs index 47749303e..871acb6a8 100644 --- a/src/test/Conjure/ModelAllSolveAll.hs +++ b/src/test/Conjure/ModelAllSolveAll.hs @@ -193,7 +193,7 @@ testSingleDir (TestTimeLimit timeLimitMin timeLimitMax) srOptions t@TestDirFiles then validateSolutionNoParam step t expectedSols else validateSolutionWithParams step t [ ( p , [ s | s <- expectedSols - , dropExtension p `isInfixOf` dropExtension s + , (dropExtension p ++ "-solution") `isInfixOf` dropExtension s ] ) | p <- paramFiles diff --git a/src/test/Conjure/RepresentationsTest.hs b/src/test/Conjure/RepresentationsTest.hs index 8df5d6b98..deef396a7 100644 --- a/src/test/Conjure/RepresentationsTest.hs +++ b/src/test/Conjure/RepresentationsTest.hs @@ -1234,4 +1234,3 @@ instance Show (Pr (Name, Constant)) where instance Show (Pr [(Name, Constant)]) where show (Pr xs) = intercalate "\n" $ map (show . Pr) xs -