[GHC] #13177: Give Data.Functor.* its lifted unit and void

#13177: Give Data.Functor.* its lifted unit and void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature | Status: new request | Priority: normal | Milestone: Component: | Version: 8.0.1 libraries/base | 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: -------------------------------------+------------------------------------- `GHC.Generics` has {{{#!hs data U1 a = U1 data V1 a }}} They are simple but why are they not present in the `Data.Functor` hierarchy along with functions like (from [https://hackage.haskell.org/package/one-liner-0.7/docs/src/Generics- OneLiner-Internal.html one-liner]) {{{#!hs absurd :: V1 a -> b absurd = \case }}} Packages like [https://hackage.haskell.org/package/linear linear] provide basically the same lifted functors {{{#!hs data V0 a = V0 newtype V1 a = V1 a }}} if they or those from `GHC.Generics` should be preferred it could be added to the documentation. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted unit and void -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 Iceland_jack: @@ -18,2 +18,2 @@ - Packages like [https://hackage.haskell.org/package/linear linear] provide - basically the same lifted functors + The package [https://hackage.haskell.org/package/linear linear] provides + the lifted unit functor @@ -22,2 +22,1 @@ - data V0 a = V0 - newtype V1 a = V1 a + data V0 a = V0 New description: `GHC.Generics` has {{{#!hs data U1 a = U1 data V1 a }}} They are simple but why are they not present in the `Data.Functor` hierarchy along with functions like (from [https://hackage.haskell.org/package/one-liner-0.7/docs/src/Generics- OneLiner-Internal.html one-liner]) {{{#!hs absurd :: V1 a -> b absurd = \case }}} The package [https://hackage.haskell.org/package/linear linear] provides the lifted unit functor {{{#!hs data V0 a = V0 }}} if they or those from `GHC.Generics` should be preferred it could be added to the documentation. -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted void and unit -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 Iceland_jack: @@ -4,0 +4,1 @@ + data V1 a @@ -5,1 +6,0 @@ - data V1 a @@ -26,1 +26,1 @@ - to the documentation. + to the documentation New description: `GHC.Generics` has {{{#!hs data V1 a data U1 a = U1 }}} They are simple but why are they not present in the `Data.Functor` hierarchy along with functions like (from [https://hackage.haskell.org/package/one-liner-0.7/docs/src/Generics- OneLiner-Internal.html one-liner]) {{{#!hs absurd :: V1 a -> b absurd = \case }}} The package [https://hackage.haskell.org/package/linear linear] provides the lifted unit functor {{{#!hs data V0 a = V0 }}} if they or those from `GHC.Generics` should be preferred it could be added to the documentation -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted void and unit -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 RyanGlScott): Interesting idea. I do admit that I'm not a fan of having copies of every common `(* -> *)`-kinded datatype in `GHC.Generics`, but sadly, that's the way it is right now. I think it might be an interesting proposal idea to add non-`GHC.Generics` versions of `V1` and `U1` to the `Data.Functor.*` namespace in `base`. But of course, the hardest part is naming, as always. I'm not terribly found of the name `V0` for lifted unit, given its linear algebra connotation. As another point of reference, the `trivia` package on Hackage calls lifted void and unit `Zero` and `One`, respectively. So do you want to be the adventurous spirit that chooses a set of names to rally behind and argue for them on the libraries mailing list? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted void and unit -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 Iceland_jack): Replying to [comment:3 RyanGlScott]:
I do admit that I'm not a fan of having copies of every common `(* -> *)`-kinded datatype in `GHC.Generics`, …
As another point of reference, the `trivia` package on Hackage calls
Agreed but is merging them a realistic option? lifted void and unit `Zero` and `One`, respectively. I like those names. As long as the name is consistent I'm happy. I have heard `Void`, `Empty`, `Null`, `Vacuous`, `Finalize` / `Initialize`, `Terminal` / `Initial`, `Naught`. Even `DevNull` :-)
So do you want to be the adventurous spirit that chooses a set of names to rally behind and argue for them on the libraries mailing list?
Ack! Sure, I don't like dealing with the mailing lists though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted void and unit -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 RyanGlScott): Replying to [comment:4 Iceland_jack]:
Agreed but is merging them a realistic option?
As another point of reference, the `trivia` package on Hackage calls
In the short term, probably not. But it is on my radar after ekmett pitched the idea in https://ghc.haskell.org/trac/ghc/ticket/11650#comment:11. It's possible that we might want to merge the datatypes in `GHC.Generics` with their `Data.Functor.*` counterparts someday with clever uses of pattern synonyms. I dunno. lifted void and unit `Zero` and `One`, respectively.
I like those names.
If you like the names `Zero` and `One`, great! I don't think it'd be wise for me to just plop datatypes into `base` without warning, or else folks who care about this stuff might come after me with pitchforks :) That's why I always advise folks to consult the libraries mailing list if they're in doubt. It can be tedious, I know, but it's the best solution we have to make sure that what goes into the core libraries doesn't create a rift with those who actually use it. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#13177: Give Data.Functor.* its lifted void and unit -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: libraries/base | Version: 8.0.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 Iceland_jack): Some [https://gist.github.com/Icelandjack/e77a5f0e2cef21b47a1a707e80bed7c0 notes]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13177#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC