morphismtech / squeal

Squeal, a deep embedding of SQL in Haskell
362 stars 32 forks source link

Add in functions: strpos, CombineNullity #284

Closed adamwespiser closed 3 years ago

adamwespiser commented 3 years ago

Adds a type family to combine nullity of two arguments, and two functions for determining if a string is a substring of another string. I've wrote a version strpos a few of times while writing application code, and think it'd be a useful addition to squeal, as it directly mirrors an existing Postgresql.

echatav commented 3 years ago

I think I may have messed up CI. Can you merge dev back into this branch @adamwespiser ?

adamwespiser commented 3 years ago

I think I may have messed up CI. Can you merge dev back into this branch @adamwespiser ?

Yes, the CI was broken, I just rebased off dev and pushed back

echatav commented 3 years ago

Ok, now I wonder if we should put hasInfix in simspace-squeal instead of Squeal proper? The reason being that it's not an actual Postgres function, nor operator, and Squeal's design is intended to be fairly low-level over Postgres.

adamwespiser commented 3 years ago

Moving hasInfix to simspace-squeal would be appropriate, as it introduces a new concept over Postgresql

adamwespiser commented 3 years ago

@echatav I removed hasInfix, updated the PR description, and CI is passing.