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

Bump PureScript to 0.14.3 #280

Merged

Conversation

pete-murphy
Copy link
Collaborator

@pete-murphy pete-murphy commented Jul 15, 2021

All told, only 17 14 of 80 ended up in the broken pile which doesn't seem too bad.


  • AceEditorHalogenHooks
    ❌ Move to broken
    Module Halogen.Query.EventSource was not found.
    
  • Add RemoveEventListenerJs
    ✏️ Add missing dependencies to spago.dhall
  • AffGameSnakeJs
    ❌ Move to broken
    [error] The following packages do not exist in your package set:
    [error]   - canvas-action
    [error]   - game
    
  • AffjaxPostNode
    ✏️ Add missing dependencies to spago.dhall
  • BasicHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • BehaviorSuperCircleJs
    ❌ Move to broken
    [error] The following packages do not exist in your package set:
    [error]   - behaviors
    
  • BigIntJs
    ✅ Already works
  • BookHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
  • BookReactHooks
    ✅ Already works
  • ButtonsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • ButtonsReactHooks
    ✅ Already works
  • CapabilityPatternNode
    ✅ Already works
  • CardsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
    ✏️ Change NonEmpty Array to NonEmptyArray
  • CardsReactHooks
    ✏️ Change NonEmpty Array to NonEmptyArray
  • CatGifsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • CatGifsReactHooks
    ✅ Already works
  • ClockReactHooks
    ✅ Already works
  • ComponentsHalogenHooks
    ❌ Move to broken
    Cannot import type Hooked from module Halogen.Hooks
    It either does not exist or the module does not export it.
    
  • ComponentsInputHalogenHooks
    ❌ Move to broken
    Cannot import type Hooked from module Halogen.Hooks
    It either does not exist or the module does not export it.
    
  • ComponentsInputReactHooks
    ✅ Already works
  • ComponentsMultiTypeHalogenHooks
    ❌ Move to broken
    Cannot import type Hooked from module Halogen.Hooks
    It either does not exist or the module does not export it.
    
  • ComponentsMultiTypeReactHooks
    ✅ Already works
  • ComponentsReactHooks
    ✅ Already works
  • DateTimeBasicsLog
    ✅ Already works
  • DebuggingLog
    ✏️ Change Debug.Trace to Debug
  • DiceCLI
    ✏️ Switch argument order
  • DiceLog
    ✅ Already works
  • DragAndDropHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • DragAndDropReactHooks
    ✅ Already works
  • DriverIoHalogenHooks
    ❌ Move to broken
    Module Control.Coroutine was not found.
    
  • DriverRoutingHalogenHooks
    ❌ Move to broken
    Could not match type
    
      Function t1
    
    with type
    
      Proxy @Symbol
    
  • DriverWebSocketsHalogenHooks
    ❌ Move to broken
    Could not match type
    
      Function t1
    
    with type
    
      Proxy @Symbol
    
  • FileUploadHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • FileUploadReactHooks
    ✅ Already works
  • FindDomElementJs
    ✅ Already works
  • FormsReactHooks
    ✅ Already works
  • GroceriesHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
  • GroceriesJs
    ✏️ appendChild returns Unit instead of Node
  • GroceriesReactHooks
    ✅ Already works
  • HelloConcur
    ✅ Already works
  • HelloHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
  • HelloJs
    ✅ Already works
  • HelloLog
    ✅ Already works
  • HelloReactHooks
    ✅ Already works
  • HeterogenousArrayLog
    ✏️ Replace SProxy with Proxy
  • ImagePreviewsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • ImagePreviewsReactHooks
    ✅ Already works
  • InterpretHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • KeyboardInputHalogenHooks
    ❌ Move to broken
    Module Halogen.Query.EventSource was not found.
    
  • LifecycleHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
    ✏️ Replace SProxy with Proxy
  • MemoizeFibonacci
    ❌ Move to broken
    [error] The following packages do not exist in your package set:
    [error]   - memoize
    
  • NumbersHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • NumbersReactHooks
    ✅ Already works
  • ParallelAppMExampleLog
    ✅ Already works
  • PayloadHttpApiNode
    ✅ Already works
  • PositionsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • PositionsReactHooks
    ✅ Already works
  • RandomNumberGameNode
    ✅ Already works
  • ReadPrintFileContentsConcur
    ✅ Already works
  • ReadPrintFileContentsNode
    ✅ Already works
  • RoutingHashHalogenClassic
    ❌ Move to broken
    Could not match type
    
      Function t1
    
    with type
    
      Proxy @Symbol
    
  • RoutingHashLog
    ✏️ Remove generics-rep from spago.dhall
    ✏️ Replace Data.Generic.Rep.Show with Data.Show.Generic
  • RoutingHashReactHooks
    ✏️ Remove generics-rep from spago.dhall
  • RoutingPushHalogenClassic
    ❌ Move to broken
    Could not match type
    
      Function t1
    
    with type
    
      Proxy @Symbol
    
  • RoutingPushReactHooks
    ✏️ Remove generics-rep from spago.dhall
  • RunCapabilityPatternNode
    ✏️ Update usage of Run
  • ShapesHalogenHooks
    ✏️ Update to reflect a few breaking changes in Halogen.Svg.Attributes
  • ShapesReactHooks
    ✅ Already works
  • SignalRenderJs
    ✅ Already works
  • SignalSnakeJs
    ✅ Already works
  • SignalTrisJs
    ✏️ Use toMap from Data.Set
    ✏️ Remove toNonEmpty
  • SimpleASTParserLog
    ✏️ Replace Global import with qualified Data.Number import
  • TextFieldsHalogenHooks
    ✏️ Remove HH.HTML as parameter to Component
    ✏️ Update event handler signature from MouseEvent -> Maybe i to MouseEvent -> i
  • TextFieldsReactHooks
    ✅ Already works
  • TicTacToeReactHooks
    ✏️ Remove generics-rep from spago.dhall
    ✏️ Replace Data.Generic.Rep.Show with Data.Show.Generic
  • TimeHalogenHooks
    ❌ Move to broken
    Module Halogen.Query.EventSource was not found.
    
  • TimeReactHooks
    ✅ Already works
  • ValueBasedJsonCodecLog
    ✏️ Replace partial fromRight with inline lambda
  • WindowPropertiesJs
    ✅ Already works
  • WriteFileNode
    ✅ Already works

@JordanMartinez
Copy link
Owner

Thanks for working on this!

exampleJson :: Json
exampleJson = unsafePartial $ fromRight $ jsonParser
exampleJson = unsafePartial $ (\(Right json) -> json) $ jsonParser
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered making a standalone function for this, something like

fromRight :: Partial => forall a b. Either a b -> b
fromRight (Right x) = x

but I opted for the minimal change. I'm definitely open to suggestions here; this one in particular felt like one of the more questionable changes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think people have typically been doing something like either (\_ -> unsafeCrashWith "got Left: bad parser") identity. It's a bit longer, but then it at least provides a somewhat clearer error message.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 140 to 141
case readFloat fullString of
x | isFinite x -> pure $ LitNum x
case Number.fromString fullString of
Just x | Number.isFinite x -> pure $ LitNum x
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't find the partial readFloat here, so replaced with fromString. Since there was already a fromString imported from Data.Int, I had to namespace both imports to disambiguate.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Number.isFinite check is no longer necessary as Number.fromString already handles that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pete-murphy pete-murphy marked this pull request as ready for review July 16, 2021 03:21
@JordanMartinez
Copy link
Owner

  • Argument order was switched in node-readline#23:
    • DiceCLI
  • FProxy was replaced with Proxy
    • RunCapabilityPatternNode
  • Map's Monoid instance was dropped. Use SemigroupMap newtype to get instance again, but check the k's Monoid instance to verify that implementation is still the same:
    • SignalTrisJs

Don't worry about these ones:

  • Needs to update code to use new EventSource code
  • Hooked type missing from Halogen.Hooks module. declaration of hook and the function that creates/uses it
    • ComponentsHalogenHooks
    • ComponentsInputHalogenHooks
    • ComponentsMultiTypeHalogenHooks
  • slot_ was changed
    • DriverRoutingHalogenHooks
    • RoutingHashHalogenClassic
    • RoutingPushHalogenClassic

Can't do anything about these ones other than get the packages added again to the package set:

  • Packages missing from package set.
    • canvas-action, game
      • AffGameSnakeJs
    • behaviors
      • BehaviorSuperCircleJs
    • memoize
      • MemoizeFibonacci

@pete-murphy
Copy link
Collaborator Author

* Argument order was switched in [node-readline#23](https://github.com/purescript-node/purescript-node-readline/pull/23/files):
  
  * DiceCLI

* `FProxy` was replaced with `Proxy`
  
  * RunCapabilityPatternNode

* `Map`'s `Monoid` instance was dropped. Use [`SemigroupMap`](https://pursuit.purescript.org/packages/purescript-ordered-collections/2.0.1/docs/Data.Map#t:SemigroupMap) newtype to get instance again, but check the `k`'s `Monoid` instance to verify that implementation is still the same:
  
  * SignalTrisJs

Sounds good 👍 those seem reasonable enough to tackle in this PR

@JordanMartinez
Copy link
Owner

Thanks again for all this work!

Comment on lines -39 to +40
type LOGGER = FProxy LoggerF
type GET_USER_NAME = FProxy GetUserNameF
type LOGGER r = (logger :: LoggerF | r)
type GET_USER_NAME r = (getUserName :: GetUserNameF | r)
Copy link
Collaborator Author

@pete-murphy pete-murphy Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This compiles and works, but I was just guessing my way through this refactor while referencing the Run docs. There might be an alternative that's closer to the original.

Comment on lines 399 to 401
-----------------
-- Faster versions of these functions are proposed in
-- https://github.com/purescript/purescript-ordered-collections/pull/21
toMap :: forall a. Ord a => Set a -> Map a Unit
toMap = foldl (\m k -> Map.insert k unit m) mempty

annotateSet :: forall a b. Ord a => (a -> b) -> Set a -> Map a b
annotateSet f = mapWithIndex (\k _ -> f k) <<< toMap
Copy link
Collaborator Author

@pete-murphy pete-murphy Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toMap is now in Data.Set, so no need for a Monoid instance here. I couldn't find anything like annotateSet in there though.

Copy link
Collaborator

@milesfrain milesfrain Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just added annotateSet to the todo list in purescript/purescript-ordered-collections#50
Might be good to link to that new issue in a comment here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"purescript": "^0.13.8",
"spago": "^0.16.0"
"purescript": "^0.14.3",
"spago": "^0.19.1"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want to bump this to the latest spago version, but that should be done in a separate PR.

Copy link
Owner

@JordanMartinez JordanMartinez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to make before merging this:

  • Let's change migrate from the fromRight partial function to either (\_ -> unsafeCrashWith "got Left: bad parser") identity fromRight' (\_ -> unsafeCrashWith "got Left: bad parser").
  • Check whether v0.14.3 compiles this PR too (if it does, use it; if not, ignore it and continue with the one you have).

Thank you for all your work!

@pete-murphy
Copy link
Collaborator Author

* [ ]  Let's change migrate from the `fromRight` partial function to `either (\_ -> unsafeCrashWith "got Left: bad parser") identity`.

I think

either (\_ -> unsafeCrashWith "got Left: bad parser") identity

is same as

fromRight' \_ -> unsafeCrashWith "got Left: bad parser"

I'm fine with either (no pun intended) but would you still prefer the former?

@JordanMartinez
Copy link
Owner

Oh, whoops! Yeah, let's use the fromRight' \_ -> ... version.

@pete-murphy
Copy link
Collaborator Author

make buildAll works with the 0.14.3 package set 👍

@JordanMartinez
Copy link
Owner

I'm going to use a merge commit for this PR because it touches so many different recipes.

@JordanMartinez JordanMartinez merged commit a69f835 into JordanMartinez:master Jul 17, 2021
@pete-murphy pete-murphy deleted the pm/bump-purescript-0-14-3 branch July 17, 2021 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants