[Pkg-haskell-commits] [SCM] haskell-testpack branch, master, updated. debian/1.0.2-1-4-gb0d6b36

John Goerzen jgoerzen at complete.org
Fri Apr 23 14:46:22 UTC 2010


The following commit has been merged in the master branch:
commit 244cc3ce002ebbaff578b7af87fce907b6aca045
Author: John Goerzen <jgoerzen at complete.org>
Date:   Sun Nov 14 03:41:25 2004 +0100

    Checkpointing
    
    Keywords:
    
    
    (jgoerzen at complete.org--projects/missingh--head--0.5--patch-27)

diff --git a/ChangeLog b/ChangeLog
index 22059dd..7a7aa88 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,18 @@
 # arch-tag: automatic-ChangeLog--jgoerzen at complete.org--projects/missingh--head--0.5
 #
 
+2004-11-13 20:41:25 GMT	John Goerzen <jgoerzen at complete.org>	patch-27
+
+    Summary:
+      Checkpointing
+    Revision:
+      missingh--head--0.5--patch-27
+
+
+    modified files:
+     ChangeLog libsrc/MissingH/Printf.hs
+
+
 2004-11-13 20:23:12 GMT	John Goerzen <jgoerzen at complete.org>	patch-26
 
     Summary:
diff --git a/libsrc/MissingH/Printf.hs b/libsrc/MissingH/Printf.hs
index 9bca0b3..b3634b4 100644
--- a/libsrc/MissingH/Printf.hs
+++ b/libsrc/MissingH/Printf.hs
@@ -33,9 +33,11 @@ Written by John Goerzen, jgoerzen\@complete.org
 
 module MissingH.Printf(sprintf,
                        Value(..)
+
                        ) where
 
 import MissingH.Str
+import Data.List
 
 class PFFun a where
               toFun :: a -> PFCall -> String
@@ -60,7 +62,7 @@ instance PFType String where
     fromValue (ValueString x) = x
     fromValue _ = error "fromValue string"
 
-{-
+
 instance PFFun String where
     toFun x (PFCall []) = x
     toFun _ _ = error "Too many arguments"
@@ -69,7 +71,15 @@ instance (PFType a, PFFun b) => PFFun (a -> b) where
     toFun f (PFCall (x:xs)) =
         toFun (f (fromValue x)) (PFCall xs)
     toFun _ _ = error "Too few arguments"
--}
+
+class PFRun a where
+    pfrun :: ([Value] -> Value) -> a
+
+--instance PFType a => PFRun a where
+--    pfrun f = f . fromValue
+
+instance (PFType a, PFRun b) => PFRun (a -> b) where
+    pfrun f x = pfrun (\xs -> f (toValue x : xs))
 
 {-
 instance PFFun String where
@@ -88,7 +98,10 @@ sprintf ('%' : xs) (y : ys) = (fromValue y) ++ sprintf xs ys
 sprintf ('!' : xs) (y : ys) = show (((fromValue y)::Int) + 1) ++ sprintf xs ys
 sprintf (x:xs) y = x : sprintf xs y
 
-
+{-
+wrapper :: String -> [PFType] -> String
+wrapper x v = sprintf x (map toValue v)
+-}
 {- To try next: define a third pffun instance that itself works off the format string -}
 ----------------------------------------------------
 {-

-- 
haskell-testpack



More information about the Pkg-haskell-commits mailing list