Patch to make need/want deal without lists

14 views
Skip to first unread message

Neil Mitchell

unread,
Oct 28, 2014, 2:06:46 PM10/28/14
to shake-bui...@googlegroups.com, cb...@cblp.su
Hi,

A patch has been submitted that makes need/want generalised so they
can work with either [FilePath] or FilePath. See
https://github.com/ndmitchell/shake/pull/180

Basically it introduces a class Targets, so:

-need :: [FilePath] -> Action ()
+need :: Targets targets => targets -> Action ()

* Good: Uses look better, no more need ["foo"], it's just need "foo"
* Good: Flexible to add Maybe or ByteString/Text and other types of path.
* Bad: More complex type signature since it's more general
* Bad: It's less obvious that need requires a list for parallelism
(but if it did matter seriously, I could change the monad to defer
needs a bit longer and group them again)

I'm on the fence, so if any Shake users have opinions, please share
them here or on the GitHub ticket.

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