Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unnamed types #662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions etc/build/gen_Operator.hs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ main = do

, [ ""
, "instance ( Pretty x"
, " , Data x"
, " , ExpressionLike x"
, " , ReferenceContainer x"
, " , TypeOf x"
Expand Down
6 changes: 6 additions & 0 deletions src/Conjure/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
module Conjure.Prelude
( module X
, stringToDoc
, textToDoc
, padRight, padLeft, padCenter
, pairWithContents
, withRest, withAfter, withBefore
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -170,6 +172,7 @@ import Data.Generics.Uniplate.Data as X
, transformM, transformBiM
, descend, descendM
, descendBi, descendBiM
, rewriteBi
, universe, universeBi
, children, childrenBi
, uniplate
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/test/Conjure/ModelAllSolveAll.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/test/Conjure/RepresentationsTest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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


Loading