Permalink
Browse files

remove snow white >< copied mistake

  • Loading branch information...
1 parent bcd14c8 commit e8779a2c48ec65aeb5b4b5276d89696c0f6de0f3 @nfjinjing committed Dec 17, 2009
Showing with 0 additions and 34 deletions.
  1. +0 −34 src/Codec/SnowWhite.hs
View
@@ -1,34 +0,0 @@
-module Codec.SnowWhite (pack, unpack) where
-
-import Data.Binary
-import Numeric
-import MPS.Env hiding (encode, decode)
-import Prelude ()
-import qualified Data.ByteString.Lazy.Char8 as B
-import Data.Char
-
-c2w, w2c :: Char -> Char
-c2w '0' = ' '
-c2w '1' = '\t'
-c2w _ = error "not 0 or 1"
-
-w2c ' ' = '0'
-w2c '\t' = '1'
-w2c _ = error "not 0 or 1"
-
-
-b2s, pack :: (Binary a) => a -> String
-b2s = encode > B.unpack > map (ord > (base 2) > rjust 8 '0' > map c2w) > concat
-
-base :: Int -> Int -> String
-base p n = showIntAtBase p intToDigit n ""
-
-from_base :: Int -> String -> Int
-from_base p = readInt p (const True) digitToInt > first > fst
-
-s2b, unpack :: (Binary a) => String -> a
-s2b = select (belongs_to " \t") > in_group_of 8 > map (map w2c > from_base 2 > chr) > B.pack > decode
-
-
-pack = b2s
-unpack = s2b

0 comments on commit e8779a2

Please sign in to comment.