mps 2008.11.6 → 2009.4.20
raw patch · 4 files changed
+46/−11 lines, 4 filesdep +interpolatedstring-qqPVP ok
version bump matches the API change (PVP)
Dependencies added: interpolatedstring-qq
API changes (from Hackage documentation)
Files
- changelog.markdown +16/−0
- mps.cabal +2/−2
- src/MPS/Snippets.hs +28/−6
- src/MPS/UTF8.hs +0/−3
changelog.markdown view
@@ -1,3 +1,19 @@+2009.4.20+---------++### Feature++* require interpolatedstring-qq+* Add here as alias of istr ( Ruby like string using QQ ).++2008.11.15+----------++### Fix++* Replace `from_utf8` `to_utf8` to `b2u` `u2b`+* Comment on dynamic programming usage+ 2008.11.6 ----------
mps.cabal view
@@ -1,5 +1,5 @@ Name: mps-Version: 2008.11.6+Version: 2009.4.20 Build-type: Simple Synopsis: message passing style helpers Description: message passing style helpers@@ -15,7 +15,7 @@ library ghc-options: -Wall -fno-warn-missing-signatures -fno-warn-name-shadowing -fno-warn-orphans -fno-warn-type-defaults- build-depends: base, containers, array, parallel, fgl, QuickCheck, time, bytestring >= 0.9, pandoc, regexpr >= 0.3.4, parsec >= 2, utf8-string >= 0.3.3, directory+ build-depends: base, containers, array, parallel, fgl, QuickCheck, time, bytestring >= 0.9, pandoc, regexpr >= 0.3.4, parsec >= 2, utf8-string >= 0.3.3, directory, interpolatedstring-qq hs-source-dirs: src/ exposed-modules: MPS, MPSUTF8 other-modules: MPS.UTF8, MPS.Snippets, MPS.Hack.Dot
src/MPS/Snippets.hs view
@@ -24,10 +24,12 @@ import qualified Codec.Binary.UTF8.String as Codec import System.Directory import Text.ParserCombinators.Parsec (many, char, many1, digit, (<|>), Parser, anyChar)+import qualified Prelude as Prelude import Prelude hiding ((.), sum, product, maximum, minimum, foldl, foldr, foldl1, foldr1, concat, concatMap, and, or, any, all, elem, (^)) import Data.List (transpose, sort, group, (\\), sortBy)+import Text.InterpolatedString.QQ -- List join x xs = L.intercalate x xs@@ -234,8 +236,8 @@ -- Integer collapse' [] _ r = r-collapse' (x:xs) q r = collapse' xs (q+1) (r + x * 10^q)-collapse xs = collapse' (xs.reverse) 0 0 .fromIntegral+collapse' (x:xs) q r = collapse' xs (q+1) (r + x * 10 <^> q)+collapse xs = collapse' (xs.reverse.map from_i) 0 0 .fromIntegral explode n = n.show.map digitToInt @@ -294,6 +296,19 @@ -- Algorithm -- DP++-- OK usage is a bit tricky+-- xs.cache block where+-- block a list = closure+-- The idea is to bound a in your closure+-- what is this a anyway?+-- It's an array that lazily caches the result+-- from your list processing function, i.e. what's+-- inside your closure.+-- This implies that your processing function+-- is of type: [x] -> [x]++ cache f xs = a.to_list where a = xs.g.to_a g ys = f a ys@@ -322,14 +337,17 @@ -- Text-markdown = from_utf8 >>> readMarkdown defaultParserState >>> writeHtml defaultWriterOptions-markdown' = from_utf8 >>> readMarkdown defaultParserState >>> writeHtmlString defaultWriterOptions >>> to_utf8+markdown = b2u >>> readMarkdown defaultParserState >>> writeHtml defaultWriterOptions+markdown' = b2u >>> readMarkdown defaultParserState >>> writeHtmlString defaultWriterOptions >>> u2b -- Monad a ^ b = a .liftM b infixl 9 ^ +(<^>) = (Prelude.^)+infixr 8 <^>+ a <.> b = a .liftM b infixl 9 <.> @@ -371,5 +389,9 @@ filter_comment = lines >>> map strip >>> reject null >>> reject (head >>> (== '#')) >>> unlines -- UTF8-from_utf8 = Codec.decodeString-to_utf8 = Codec.encodeString+b2u = Codec.decodeString+u2b = Codec.encodeString++-- QQ++here = istr
src/MPS/UTF8.hs view
@@ -9,9 +9,6 @@ -- io-b2u = from_utf8-u2b = to_utf8- read_file = readFile write_file = writeFile ls x = MPS.ls (x.u2b) ^ map b2u