Skip to content

Commit

Permalink
Document the Command things I have to export
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Jun 10, 2016
1 parent b9c21aa commit 6f9174c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Development/Shake/Command.hs
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ newtype CmdTime = CmdTime {fromCmdTime :: Double}
-- suitable for user diagnostics, but not for direct execution.
newtype CmdLine = CmdLine {fromCmdLine :: String}

-- | The allowable 'String'-like values that can be captured.
class CmdString a where cmdString :: (Str, Str -> a)
instance CmdString () where cmdString = (Unit, \Unit -> ())
instance CmdString String where cmdString = (Str "", \(Str x) -> x)
Expand Down Expand Up @@ -560,6 +561,7 @@ type a :-> t = a
cmd :: CmdArguments args => args :-> Action r
cmd = cmdArguments []

-- | The arguments to 'cmd' - see 'cmd' for examples and semantics.
class CmdArguments t where cmdArguments :: [Either CmdOption String] -> t
instance (Arg a, CmdArguments r) => CmdArguments (a -> r) where
cmdArguments xs x = cmdArguments $ xs ++ arg x
Expand Down

0 comments on commit 6f9174c

Please sign in to comment.