mps 2009.9.18 → 2009.11.7
raw patch · 6 files changed
+31/−14 lines, 6 files
Files
- changelog.md +7/−0
- mps.cabal +1/−1
- src/MPS/Env.hs +1/−1
- src/MPS/Extra.hs +7/−2
- src/MPS/Heavy.hs +3/−2
- src/MPS/Light.hs +12/−8
changelog.md view
@@ -1,3 +1,10 @@+2009.11.7+---------++### Feature++* (<) as (.)+ 2009.9.18 ---------
mps.cabal view
@@ -1,5 +1,5 @@ Name: mps-Version: 2009.9.18+Version: 2009.11.7 Build-type: Simple Synopsis: simply oo Description: DSL that allows one to write Haskell from left to right
src/MPS/Env.hs view
@@ -4,4 +4,4 @@ ) where import MPS.Light-import Prelude hiding ((.), (>), (^), (/), (-))+import Prelude hiding ((.), (>), (<), (^), (/), (-))
src/MPS/Extra.hs view
@@ -8,7 +8,7 @@ import Data.Time.Clock.POSIX import MPS.Light import Numeric-import Prelude hiding ((.), (^), (>), (/), elem, foldl)+import Prelude hiding ((.), (^), (>), (<), (/), elem, foldl) import System.Directory import System.IO import System.Locale (defaultTimeLocale)@@ -21,7 +21,6 @@ import qualified System.IO.Unsafe as Unsafe - -- Parallel p_eval, p_eval' :: [a] -> [a] p_reduce, p_reduce' :: (a -> a -> a) -> [a] -> a@@ -133,8 +132,14 @@ t2i :: UTCTime -> Integer t2i = utcTimeToPOSIXSeconds > floor +t2f :: (Fractional a) => UTCTime -> a+t2f = utcTimeToPOSIXSeconds > toRational > fromRational+ i2t :: Integer -> UTCTime i2t = from_i > posixSecondsToUTCTime++f2t :: (Real a) => a -> UTCTime+f2t = toRational > fromRational > posixSecondsToUTCTime -- Text filter_comment :: String -> String
src/MPS/Heavy.hs view
@@ -3,7 +3,8 @@ import Codec.Binary.Base64.String as C import Data.Char import MPS.Light-import Prelude hiding ((.), (^), (>), (/), elem, foldl)+import Prelude hiding ((.), (^), (>), (<), (/), elem, foldl)+import qualified Prelude as P import Text.ParserCombinators.Parsec (many, char, many1, digit, (<|>), Parser, anyChar, try) import qualified Codec.Compression.GZip as GZip import qualified Data.ByteString.Lazy.Char8 as B@@ -44,7 +45,7 @@ fixChar '>' = ">" fixChar '&' = "&" fixChar '"' = "\""- fixChar c | ord c < 0x80 = [c]+ fixChar c | ord c P.< 0x80 = [c] fixChar c = "&#" ++ show (ord c) ++ ";" -- backward compatible
src/MPS/Light.hs view
@@ -1,13 +1,13 @@ module MPS.Light where -import Control.Arrow ((&&&), (>>>))+import Control.Arrow ((&&&), (>>>), (<<<)) import Control.Category (Category) import Data.Char import Data.Foldable (elem, foldl, foldl', toList, Foldable) import Data.Function (on) import Debug.Trace-import Prelude hiding ((.), (^), (>), (/), (-), elem, foldl, foldl1)-import qualified Prelude as Prelude+import Prelude hiding ((.), (^), (>), (<), (/), (-), elem, foldl, foldl1)+import qualified Prelude as P import System.FilePath ((</>)) import qualified Data.Array as A import qualified Data.List as L@@ -24,6 +24,10 @@ (>) = (>>>) infixl 8 > +(<) :: (Category cat) => cat b c -> cat a b -> cat a c+(<) = (<<<)+infixr 8 <+ (^) :: (Functor f) => f a -> (a -> b) -> f b (^) = flip fmap infixl 8 ^@@ -38,7 +42,7 @@ infixr 0 - (<->) :: (Num a) => a -> a -> a-(<->) = (Prelude.-)+(<->) = (P.-) infix 6 <-> @@ -136,7 +140,7 @@ split_to :: Int -> [a] -> [[a]] split_to n xs = xs.in_group_of(size) where l = xs.length- size = if l < n then 1 else l `div` n+ size = if l P.< n then 1 else l `div` n apply, send_to :: a -> (a -> b) -> b apply x f = f x@@ -162,11 +166,11 @@ ljust, rjust :: Int -> a -> [a] -> [a] rjust n x xs - | n < xs.length = xs+ | n P.< xs.length = xs | otherwise = ( n.times x ++ xs ).reverse.take n.reverse ljust n x xs- | n < xs.length = xs+ | n P.< xs.length = xs | otherwise = ( xs ++ n.times x ).take n ub, lb :: (a -> Bool) -> [a] -> [a]@@ -194,7 +198,7 @@ common [] _ = [] common a@(x:xs) b@(y:ys) | x .is y = y : common xs b- | x < y = common xs b+ | x P.< y = common xs b | otherwise = common a ys