[GHC] #14124: add shrink prim-op for other array type

#14124: add shrink prim-op for other array type -------------------------------------+------------------------------------- Reporter: winter | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- This issue arised in the recently PR to bring unified array interface to primitive: https://github.com/haskell/primitive/pull/64 . In that issue andrewthad ask if we want to keep `shrikArr` API. My guts feels that it's possible for other type of array as well since it's just the same closure overwrite thing. So i'm asking for adding such prim-op here. I suppose we should provide `getSizeOfXXX` prim-op which consume a state token for other array type as well since the array size is not referential transparent now. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14124 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14124: add shrink prim-op for other array type -------------------------------------+------------------------------------- Reporter: winter | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Description changed by winter: Old description:
This issue arised in the recently PR to bring unified array interface to primitive: https://github.com/haskell/primitive/pull/64 . In that issue andrewthad ask if we want to keep `shrikArr` API. My guts feels that it's possible for other type of array as well since it's just the same closure overwrite thing. So i'm asking for adding such prim-op here.
I suppose we should provide `getSizeOfXXX` prim-op which consume a state token for other array type as well since the array size is not referential transparent now.
New description: This issue arised in the recently PR to bring unified array interface to primitive: https://github.com/haskell/primitive/pull/64 . In that PR andrewthad ask if we want to keep `shrinkArr` API. My guts feeling says it's possible for other type of array as well since it's just the same closure overwrite thing. So i'm asking for adding such prim-op here. I suppose we should provide `getSizeOfXXX` prim-op which consume a state token for other array type as well since the array size is not referential transparent now. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14124#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14124: add shrink prim-op for other array type -------------------------------------+------------------------------------- Reporter: winter | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): I don't think it's quite as simple to provide a shrink operation for `MutableArray` and `MutableArrayArray` as it is for `MutableByteArray`. The reason is that in those cases we would need to remove the truncated references from the GC's remembered set. Of course, this ought to be doable, but it is a bit more complexity. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14124#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14124: add shrink prim-op for other array type -------------------------------------+------------------------------------- Reporter: winter | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.2.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by winter): I suppose a modification from `fold'` 's document is OK: -- | The strict version of 'iterate'. -- It ensures that each step of the iterating is forced to weak head normal form before next step, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly step a function which produces a single, monolithic result (e.g. (+1)). -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14124#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC