[GHC] #12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’)

#12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature | Status: new request | Priority: lowest | Milestone: Component: Core | Version: 8.0.1 Libraries | 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: -------------------------------------+------------------------------------- Opening a ticket for discussion. As mentioned in [https://www.reddit.com/r/haskell/comments/2y2pe5/shouldnt_ftp_propagate_chan... this comment], more functions can be generalized to `Foldable` {{{#!hs catMaybes :: Foldable f => f (Maybe a) -> [a] mapMaybe :: Foldable f => (a -> Maybe b) -> (f a -> [b]) listToMaybe :: Foldable f => f a -> Maybe a }}} I think `catMaybes` and `mapMaybe` are fine candidates. The comment offers more extreme changes, {{{#!hs catMaybes :: (Foldable f, Foldable g) => Foldable f => f (g a) -> [a] mapMaybes :: (Foldable f, Foldable g) => (a -> f b) -> (f a -> [b]) }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12828 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: lowest | Milestone: Component: Core Libraries | 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: @@ -16,1 +16,1 @@ - mapMaybes :: (Foldable f, Foldable g) => (a -> f b) -> (f a -> [b]) + mapMaybe :: (Foldable f, Foldable g) => (a -> f b) -> (f a -> [b]) New description: Opening a ticket for discussion. As mentioned in [https://www.reddit.com/r/haskell/comments/2y2pe5/shouldnt_ftp_propagate_chan... this comment], more functions can be generalized to `Foldable` {{{#!hs catMaybes :: Foldable f => f (Maybe a) -> [a] mapMaybe :: Foldable f => (a -> Maybe b) -> (f a -> [b]) listToMaybe :: Foldable f => f a -> Maybe a }}} I think `catMaybes` and `mapMaybe` are fine candidates. The comment offers more extreme changes, {{{#!hs catMaybes :: (Foldable f, Foldable g) => Foldable f => f (g a) -> [a] mapMaybe :: (Foldable f, Foldable g) => (a -> f b) -> (f a -> [b]) }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12828#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: new Priority: lowest | Milestone: Component: Core Libraries | 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: @@ -15,1 +15,1 @@ - catMaybes :: (Foldable f, Foldable g) => Foldable f => f (g a) -> [a] + catMaybes :: (Foldable f, Foldable g) => f (g a) -> [a] New description: Opening a ticket for discussion. As mentioned in [https://www.reddit.com/r/haskell/comments/2y2pe5/shouldnt_ftp_propagate_chan... this comment], more functions can be generalized to `Foldable` {{{#!hs catMaybes :: Foldable f => f (Maybe a) -> [a] mapMaybe :: Foldable f => (a -> Maybe b) -> (f a -> [b]) listToMaybe :: Foldable f => f a -> Maybe a }}} I think `catMaybes` and `mapMaybe` are fine candidates. The comment offers more extreme changes, {{{#!hs catMaybes :: (Foldable f, Foldable g) => f (g a) -> [a] mapMaybe :: (Foldable f, Foldable g) => (a -> f b) -> (f a -> [b]) }}} -- -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12828#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: closed Priority: lowest | Milestone: Component: Core Libraries | Version: 8.0.1 Resolution: invalid | 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: | -------------------------------------+------------------------------------- Changes (by rwbarton): * status: new => closed * resolution: => invalid Comment: The libraries list is the proper place for this kind of discussion. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12828#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#12828: Generalize functions from Data.Maybe (‘catMaybes’, ‘mapMaybe’) -------------------------------------+------------------------------------- Reporter: Iceland_jack | Owner: Type: feature request | Status: closed Priority: lowest | Milestone: Component: Core Libraries | Version: 8.0.1 Resolution: invalid | 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): Made a [https://mail.haskell.org/pipermail/libraries/2016-November/027453.html thread]. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/12828#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC