1 Oct 2011 07:46
Re: Two Proposals
Lennart Augustsson <lennart <at> augustsson.net>
2011-10-01 05:46:23 GMT
2011-10-01 05:46:23 GMT
What are the defaulting rules for IsList? It needs to be backwards compatible. -- Lennart (iPhone) On Sep 30, 2011, at 19:28, George Giorgidze <giorgidze <at> gmail.com> wrote: > GHC Users, > > I would like to make to the following two proposals: > * Eliminate the default grouping close from SQL-like comprehensions > * Introduce a GHC extension for list literal overloading > > OK, let me start with the first proposal. > > Currently, the SQL-like comprehension notation (both in its list comprehension and monad comprehension variants) features the following five clauses: > > then f > then f by e > then group by e > then group using f > then group by e using f > > The first two clauses are used for specifying transformations of type [a] -> [a] (or Monad m => m a-> m a for monad comprehensions). The following three clauses are used for specifying transformations of type [a] -> [[a]] (or Monad m, Functor f => m a -> m (f a) for monad comprehensions). See [1] for further details. > > Note that the third clause does not mention which function is used for grouping. In this case GHC.Exts.groupWith function is used as a default for list comprehensions and the mgroupWith function from the MonadGroup class is used as a default for monad comprehensions.(Continue reading)
RSS Feed