Fairly new to Purescript with some light Haskell experience. I’m trying to access a SQLite database via the SQLite3 package using code that is almost verbatim from the example the package provides:
getMerchants = launchAff do conn <- newDB "./data" exists <- (\rows -> 1 == length rows) <$> queryDB conn "SELECT 1 from merchants" log $ "merchant: " <> (show exists) closeDB conn
The last line results in the following error:
Could not match type
while trying to match type Aff Unit
with type Effect t0
while checking that expression closeDB conn
has type Effect t0
in value declaration getMerchants
where t0 is an unknown type
I understand that the closeDB line returns an Aff, but I was under the impression that I’m feeding that Aff into launchAff, which takes that Aff and returns an Effect.
Any help would be greatly appreciated as I’ve spent the last four hours just trying to figure out how to open and close a SQLite connection.