[commit: ghc] wip/nfs-locking: Adds Pony (5dd8bbb)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:50:27 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/5dd8bbb0090ebef875650ca7de8bc87aa37f54c9/ghc

>---------------------------------------------------------------

commit 5dd8bbb0090ebef875650ca7de8bc87aa37f54c9
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Tue Jan 12 15:42:56 2016 +0800

    Adds Pony
    
    This fixes #92 for good.
    Together this fixes #134 almost entirely.


>---------------------------------------------------------------

5dd8bbb0090ebef875650ca7de8bc87aa37f54c9
 src/Base.hs | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)

diff --git a/src/Base.hs b/src/Base.hs
index c733226..ffe06d8 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -142,26 +142,52 @@ putError msg = do
     putColoured Red msg
     error $ "GHC build system error: " ++ msg
 
+-- | Render an action.
 renderAction :: String -> String -> String -> Action String
 renderAction what input output = buildInfo >>= return . \case
     Normal -> renderBox [ what
                         , "     input:" ++ input
                         , " => output:" ++ output ]
     Brief  -> "> " ++ what ++ ": " ++ input ++ " => " ++ output
-    Pony   -> " *** PONY NOT YET SUPPORTED ***"
+    Pony   -> renderPony [ what
+                         , "     input:" ++ input
+                         , " => output:" ++ output ]
     Dot    -> "."
     None   -> ""
 
+-- | Render the successful build of a program
 renderProgram :: String -> String -> String -> Action String
 renderProgram name bin synopsis = return $ renderBox [ "Successfully built program " ++ name
                                                      , "Executable: " ++ bin
                                                      , "Program synopsis: " ++ synopsis ++ "."]
 
+-- | Render the successful built of a library
 renderLibrary :: String -> String -> String -> Action String
 renderLibrary name lib synopsis = return $ renderBox [ "Successfully built library " ++ name
                                                      , "Library: " ++ lib
                                                      , "Library synopsis: " ++ synopsis ++ "."]
 
+-- | Render the given set of lines next to our favorit unicorn Robert.
+renderPony :: [String] -> String
+renderPony ls =
+    unlines $ take (max (length ponyLines) (length boxLines)) $
+        zipWith (++) (ponyLines ++ repeat ponyPadding) (boxLines ++ repeat "")
+  where
+    ponyLines :: [String]
+    ponyLines = [ "                   ,;,,;'"
+                , "                  ,;;'(    Robert the spitting unicorn"
+                , "       __       ,;;' ' \\   wants you to know"
+                , "     /'  '\\'~~'~' \\ /'\\.)  that a task      "
+                , "  ,;(      )    /  |.  /   just finished!   "
+                , " ,;' \\    /-.,,(   ) \\                      "
+                , " ^    ) /       ) / )|     Almost there!    "
+                , "      ||        ||  \\)                      "
+                , "      (_\\       (_\\                         " ]
+    ponyPadding :: String
+    ponyPadding = "                                            "
+    boxLines :: [String]
+    boxLines = ["", "", ""] ++ (lines . renderBox $ ls)
+
 -- | Render the given set of lines in a nice box of ASCII.
 --
 -- The minimum width and whether to use Unicode symbols are hardcoded in the



More information about the ghc-commits mailing list