Move solved type classes into Prim modules & bump test deps#3312
Move solved type classes into Prim modules & bump test deps#3312LiamGoodacre merged 12 commits intopurescript:masterfrom LiamGoodacre:feature/expand-prim
Conversation
|
I think doing it this way is fine 👍 I have a branch with updated dependencies too, but until the Prim/Prelude record instances are in that doesn't work anyway. |
|
I read the code that's there so far and didn't spot any obvious oversights 👍 |
src/Language/PureScript/Docs/Prim.hs
Outdated
| , "[the Custom Type Errors guide](https://github.com/purescript/documentation/blob/master/guides/Custom-Type-Errors.md)." | ||
| kindOrdering :: Declaration | ||
| kindOrdering = primKindOf (P.primSubName "Ordering") "Ordering" $ T.unlines | ||
| [ "The `Ordering` kind represents the three possibilites of comparing twos" |
| @@ -349,9 +365,9 @@ primKinds = | |||
| primTypes :: M.Map (Qualified (ProperName 'TypeName)) (Kind, TypeKind) | |||
| primTypes = | |||
| M.fromList | |||
There was a problem hiding this comment.
Should have Partial : kindConstraint for consistency.
|
Updated a whole bunch of tests. 😓 Getting cannot find Updated purescript-typelevel-prelude to reexport stuff from Prim submodules - but that needs more work and somewhat integrating with prelude. |
|
Also haven't fixed tests that involve ST/Ref as I'm not sure what we're doing there. |
|
In what sense? The ST & Ref libraries have been updated (ST being its own monad now). |
|
Right! I'm being a moron 😸 |
|
Think there was one that used |
|
I guess that'll become Unless it's ST, in which case there is an |
|
So there's this test: -- @shouldFailWith TypesDoNotUnify
module Main where
import Prelude
import Control.Monad.Eff
import Control.Monad.ST
import Control.Monad.Eff.Console
test = pureST (do
ref <- newSTRef 0
log "ST"
modifySTRef ref $ \n -> n + 1
readSTRef ref)Which I believe was testing that you can't log in a pure ST. Thoughts on what this should change to? |
|
Similarly the passing one: module Main where
import Prelude
import Control.Monad.Eff
import Control.Monad.ST
import Control.Monad.Eff.Console (log, logShow)
test1 = do
log "Line 1"
log "Line 2"
test2 = runPure (runST (do
ref <- newSTRef 0.0
_ <- modifySTRef ref $ \n -> n + 1.0
readSTRef ref))
test3 = pureST (do
ref <- newSTRef 0.0
_ <- modifySTRef ref $ \n -> n + 1.0
readSTRef ref)
main = do
test1
logShow test2
logShow test3
log "Done"Wondering if these tests should just be deleted, given their focus is actually on |
Yeah that sounds reasonable to me. We probably have quite a lot of redundant tests, but no harm having them unless like this they don't make sense anymore. |
|
Thanks @kritzcreek for finishing off fixing up the tests! |
WIP
Can split this into two PRs if that makes more sense but things aren't going to work until the test deps are consistent.
Next I'll update our tests to switch from Eff to Effect.
Resolves #3179