group keyword with TransformListComp

Hi, The TransformListComp extension makes group a keyword. Unfortunately group is a useful function, and is even in Data.List. Thus, Data.List.group and TransformListComp are incompatible. This seems a very painful concession to give up a nice function name for a new extension. Is this intentional? Here's an example:
$ cat GroupKeyword.hs {-# LANGUAGE TransformListComp #-} module GroupKeyword where
a = map head $ group $ sort [1..100] $ ghci GroupKeyword.hs GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling GroupKeyword ( GroupKeyword.hs, interpreted )
GroupKeyword.hs:4:15: parse error on input `group' Failed, modules loaded: none. Prelude>
There are some places I'd like to use TransformListComp, but I often want to use group in the same module. Thanks Neil

Don't use TransformListComp ?? -- Don ndmitchell:
Hi,
The TransformListComp extension makes group a keyword. Unfortunately group is a useful function, and is even in Data.List. Thus, Data.List.group and TransformListComp are incompatible. This seems a very painful concession to give up a nice function name for a new extension. Is this intentional? Here's an example:
$ cat GroupKeyword.hs {-# LANGUAGE TransformListComp #-} module GroupKeyword where
a = map head $ group $ sort [1..100] $ ghci GroupKeyword.hs GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling GroupKeyword ( GroupKeyword.hs, interpreted )
GroupKeyword.hs:4:15: parse error on input `group' Failed, modules loaded: none. Prelude>
There are some places I'd like to use TransformListComp, but I often want to use group in the same module.
Thanks
Neil _______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

I don't mind what keyword (or indeed syntax) we use! Better alternatives welcome. Simon | -----Original Message----- | From: glasgow-haskell-users-bounces@haskell.org [mailto:glasgow-haskell-users- | bounces@haskell.org] On Behalf Of Neil Mitchell | Sent: 21 June 2009 19:15 | To: glasgow-haskell-users@haskell.org; Max Bolingbroke | Subject: group keyword with TransformListComp | | Hi, | | The TransformListComp extension makes group a keyword. Unfortunately | group is a useful function, and is even in Data.List. Thus, | Data.List.group and TransformListComp are incompatible. This seems a | very painful concession to give up a nice function name for a new | extension. Is this intentional? Here's an example: | | > $ cat GroupKeyword.hs | > {-# LANGUAGE TransformListComp #-} | > module GroupKeyword where | > | > a = map head $ group $ sort [1..100] | > $ ghci GroupKeyword.hs | > GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help | > Loading package ghc-prim ... linking ... done. | > Loading package integer ... linking ... done. | > Loading package base ... linking ... done. | > [1 of 1] Compiling GroupKeyword ( GroupKeyword.hs, interpreted ) | > | > GroupKeyword.hs:4:15: parse error on input `group' | > Failed, modules loaded: none. | > Prelude> | | There are some places I'd like to use TransformListComp, but I often | want to use group in the same module. | | Thanks | | Neil | _______________________________________________ | Glasgow-haskell-users mailing list | Glasgow-haskell-users@haskell.org | http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Hi,
I agree this is annoying. It was hard to find syntax which was both
meaningful and currently unused, so we settled on this instead. As
Simon says, suggestions are welcome!
Note that group *should* be parsed as a special id, so you can still
import D.L qualified and then use dot notation to access the function.
Cheers,
Max
2009/6/21 Neil Mitchell
Hi,
The TransformListComp extension makes group a keyword. Unfortunately group is a useful function, and is even in Data.List. Thus, Data.List.group and TransformListComp are incompatible. This seems a very painful concession to give up a nice function name for a new extension. Is this intentional? Here's an example:
$ cat GroupKeyword.hs {-# LANGUAGE TransformListComp #-} module GroupKeyword where
a = map head $ group $ sort [1..100] $ ghci GroupKeyword.hs GHCi, version 6.10.2: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling GroupKeyword ( GroupKeyword.hs, interpreted )
GroupKeyword.hs:4:15: parse error on input `group' Failed, modules loaded: none. Prelude>
There are some places I'd like to use TransformListComp, but I often want to use group in the same module.
Thanks
Neil
participants (4)
-
Don Stewart
-
Max Bolingbroke
-
Neil Mitchell
-
Simon Peyton-Jones