[GHC] #8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim -------------------------------------+------------------------------------- Reporter: guest | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.6.3 Keywords: | Operating System: Unknown/Multiple Architecture: Unknown/Multiple | Type of failure: None/Unknown Difficulty: Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | -------------------------------------+------------------------------------- Self-explanatory. Eq already has INLINE on (==) and (/=), and it'd be nice to have it on Ord so that SPECIALIZE pragmas on its methods in user code can fire. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim --------------------------------------+------------------------------------ Reporter: guest | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (by simonpj): Sounds good to me. By all means offer a patch. Worth measuring the effect on binary size, at least as a sanity check. Simon -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim --------------------------------------+------------------------------------ Reporter: guest | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.6.3 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Comment (by carter): is there any argument for inline over inlineable here? this also *should* be emailed to the haskell libraries mailing list, right? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim --------------------------------------+------------------------------------ Reporter: guest | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries (other) | Version: 7.6.3 Resolution: | Keywords: ghc-prim Operating System: Unknown/Multiple | Architecture: Unknown/Multiple Type of failure: None/Unknown | Difficulty: Unknown Test Case: | Blocked By: Blocking: | Related Tickets: --------------------------------------+------------------------------------ Changes (by hvr): * keywords: => ghc-prim -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim -------------------------------------+------------------------------------- Reporter: guest | Owner: ekmett Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: Core | Keywords: ghc-prim Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Changes (by thomie): * cc: dfeuer, core-libraries-committee@… (added) Comment: In commit 4c03791f986509c5d95adf50de555876ed05522e (libraries/ghc- prim/GHC/Classes.hs): {{{ Author: Simon Peyton Jones <> Date: Mon May 12 10:53:09 2014 +0100 Specialise Eq, Ord, Read, Show at Int, Char, String These instances are quite common, so it's good to have pre-specialised versions available }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#8354: Add INLINE (or at least INLINABLE) pragmas for methods of Ord in ghc-prim -------------------------------------+------------------------------------- Reporter: guest | Owner: ekmett Type: feature | Status: new request | Milestone: Priority: normal | Version: 7.6.3 Component: Core | Keywords: ghc-prim Libraries | Architecture: Unknown/Multiple Resolution: | Difficulty: Unknown Operating System: | Blocked By: Unknown/Multiple | Related Tickets: Type of failure: | None/Unknown | Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- Comment (by dfeuer): I'm wondering if we should revert the `Eq` and `Ord` specialization for `String` and instead try to have some fun with fusion, doing something much like what we do with `foldr2`. If I'm not mistaken, {{{#!hs xs == ys = foldr go null xs ys where go _x _r [] = False go x r (z:zs) | x == z = r zs | otherwise = False }}} {{{#!hs compare xs ys = foldr go (bool LT EQ . null) xs ys where go _x _r [] = GT go x r (z:zs) = case compare x z of LT -> LT GT -> GT EQ -> r zs }}} and similarly (carefully) reversing the roles of `xs` and `ys`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/8354#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC