Skip to content
Snippets Groups Projects
Commit e92b612f authored by Hugo Hörnquist's avatar Hugo Hörnquist
Browse files

Cleanup.

parent 98c091b5
No related branches found
No related tags found
No related merge requests found
......@@ -29,11 +29,14 @@ data Expression = Negate Expression
deriving (Show)
serialize :: Expression -> String
serialize (Number x) = [chr((fromInteger a) + 33) | a <- [mod (div x (94^b)) 94 | b<-[y,y-1..0]]]
where y = floor ( logBase 94.0 (fromInteger x) )
serialize (Number x) =
chr . (+ 33) . fromInteger <$>
[(x `div` 94^b) `mod` 94
| b <- [digits, digits-1 .. 0]]
where digits = floor $ logBase 94 (fromInteger x)
parseBool :: GenParser Char () Expression
parseBool
parseBool
= (char 'T' >> (return $ Boolean True))
<|> (char 'F' >> (return $ Boolean False))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment