The *> operator moves to Prelude

66 views
Skip to first unread message

Neil Mitchell

unread,
Nov 12, 2014, 5:49:18 AM11/12/14
to shake-bui...@googlegroups.com
Hi,

As part of GHC 7.10, some of Applicative will be exported by Prelude,
including the *> operator that Shake uses. Clashing with a Prelude
function is a terrible idea, so Shake really needs to rename its
operator. Currently the operators defined by Shake are:

?== -- pattern match
~> -- phony definition
*> -- wildcard pattern
|*> -- or wildcards
&*> -- and wildcards
?> -- predicate pattern
&?> -- and predicate

In order to make a sensible pick, I created a list of all operators on Hackage:

https://gist.github.com/ndmitchell/aa1e0944379a7429cedb#file-gistfile1-txt

The current clashes with non-deprecated interesting Shake operators are:

(*>) Agata Clean Encode HaskellForMaths SimpleH appar base
basic-prelude blas chalkboard constructive-algebra darcs darcs-beta
data-aviary definitive-base diagrams-lib haxl hx ideas
invertible-syntax iterIO lin-alg monad-lrs numeric-prelude
numeric-quest parsimony plumbers roundtrip shake uu-tc uulib
(?==) quickcheck-assertions shake
(?>) AC-MiniTest HaXml feldspar-language fuzzcheck markov-processes
quickcheck-assertions shake
(|*>) MFlow shake
(~>) moe TypeCompose data-fix derp-lib functor-combo funpat groundhog
hTensor haste-compiler hcube hmt hspec-attoparsec ideas machines pipes
pointless-fun sessions shake tidal

So *> is a problem now. ~> might become a problem, but we're fine for
the moment.

My best guess for an alternative to *> is %>, where &%> and |%> are
entirely unused, and %> clashes with:

(%>) cmdlib llvm-ht nsis traced

Which looks entirely reasonable. I can slightly justify %> because in
Makefile's % is the wildcard symbol.

Anyone any other thoughts or suggestions?

Needless to say, Shake will continue to export *> for a really long
time, but it will be discouraged.

Thanks, Neil

John Wiegley

unread,
Nov 12, 2014, 2:00:12 PM11/12/14
to Neil Mitchell, shake-bui...@googlegroups.com
>>>>> Neil Mitchell <ndmit...@gmail.com> writes:

> Which looks entirely reasonable. I can slightly justify %> because in
> Makefile's % is the wildcard symbol.

> Anyone any other thoughts or suggestions?

I think % is a good choice.

John

Brent Yorgey

unread,
Nov 17, 2014, 11:28:05 AM11/17/14
to John Wiegley, Neil Mitchell, shake-bui...@googlegroups.com
%> and friends (&%>, etc.) sounds like a great choice to me too.

Neil Mitchell

unread,
Nov 17, 2014, 4:06:04 PM11/17/14
to Brent Yorgey, John Wiegley, shake-bui...@googlegroups.com
OK, given that people don't think I'm totally crazy I've moved the
repo over to %>. I still export *>, but now it's just an alias for %>.
I expect to make a 0.14 release with this code, likely on Wednesday. I
don't intend to remove *> anytime soon, but as soon as GHC 7.10 comes
out I expect it to decline in popularity somewhat rapidly.

I've also updated the user manual to %>, including the copy at
http://shakebuild.com/manual. I'll probably "go live" with the website
at the same time as the 0.14 release.

Thanks, Neil
Reply all
Reply to author
Forward
0 new messages