-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
import `foo/`; select * from `/test` | ||
""" | ||
|
||
parseFail """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BREAKING. Is there a way to not make it braking?
genSqlQueryF n = Query <$> genDecls n <*> pure n | ||
|
||
genSqlModuleF ∷ ∀ m. Gen.MonadGen m ⇒ CoalgebraM m SqlModuleF Int | ||
genSqlModuleF ∷ ∀ m. Gen.MonadGen m ⇒ MonadRec m ⇒ CoalgebraM m SqlModuleF Int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BREAKING. As new constraint is introduced (that's needed for generating of path-es)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, change a >>> b <$> c
to b <<< a <$> c
🙏
Also two small things to consider
- wrapped
forall a.
-- I might be wrong but the quantifier could be moved to the left - It would be cool if we had
print/parse
for table relation
src/SqlSquared/Signature.purs
Outdated
printAnyDirPath :: AnyDirPath -> String | ||
printAnyDirPath = E.either Pt.unsafePrintPath Pt.unsafePrintPath | ||
|
||
parseAnyDirPath :: forall m. Applicative m => (forall a. String -> m a) -> String -> m AnyDirPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we move a
to the left?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to do this
forall m. (forall a. String -> a) -> any ~
forall m. (exists a. (String -> a) -> any) ~
forall m a. (String -> a) -> any
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I moved a to top forall but it fails with:
[1/1 TypesDoNotUnify] src/SqlSquared/Path.purs:41:4
41 (pure ∘ E.Right)
^^^^^^^^^^^^^^
Could not match type
Either t4 (Path Rel File Unsandboxed)
with type
a1
while trying to match type t2 t3
with type m0 a1
while checking that expression (compose pure) Right
has type Path Rel File Unsandboxed -> m0 a1
in value declaration parseAnyFilePath
where a1 is a rigid type variable
m0 is a rigid type variable
t3 is an unknown type
t2 is an unknown type
t4 is an unknown type
so reverting to inner forall
src/SqlSquared/Signature.purs
Outdated
@@ -138,8 +142,20 @@ data SqlF literal a | |||
| Select (SelectR a) | |||
| Parens a | |||
|
|||
type AnyDirPath = E.Either (Pt.AbsDir Pt.Unsandboxed) (Pt.RelDir Pt.Unsandboxed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worthing to introduce the same type and print/parse for filepath. It's used in table relation.
src/SqlSquared/Signature.purs
Outdated
genImport ∷ ∀ m a. Gen.MonadGen m ⇒ MonadRec m ⇒ m (SqlDeclF a) | ||
genImport = map Import | ||
$ Gen.oneOf | ||
$ (Pt.unsandbox >>> E.Left <$> PtGen.genAbsDirPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flipped flow. Pt.unsandbox >>> E.Left
left-to-right, <$>
right-to-left. It's hard to follow, would you mind switching to E.Left <<< Pt.unsandbox <$> PtGen.genAbsDirPath
or Pt.genAbsDirPath <#> Pt.unsandbox >>> E.Left
?
src/SqlSquared/Signature.purs
Outdated
(pure ∘ E.Right) | ||
(pure ∘ E.Left) | ||
(const $ fail "incorrect directory path") | ||
(const $ fail "incorrect directory path") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I think "incorrect directory path" is an easy error for users to misinterpret. Perhaps "Expected a directory path"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely!
Made requested changes. |
Awesome! Thank you very much! |
Besides broken travis of course :P |
So the braking part of the change is fine? i.e. queries which were fine will be rejected after upgrade. |
This is passing now. What should be a new version? ( |
Yeah, breaking incorrect queries is absolutely fine, they didn't work in quasar anyways. |
No description provided.