twentefp-eventloop-graphics 0.1.0.1 → 0.1.0.2
raw patch · 3 files changed
+12/−11 lines, 3 filesdep ~basePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base
API changes (from Hackage documentation)
Files
- src/EventLoop/EventProcessor.hs +2/−0
- src/EventLoop/Json.hs +8/−9
- twentefp-eventloop-graphics.cabal +2/−2
src/EventLoop/EventProcessor.hs view
@@ -31,6 +31,7 @@ let string = T.unpack msg request = stringToJsonObject string + --WS.safePutStr stdoutM string return request sendResponse :: WS.ConnectionSendMutex -> WS.Connection -> WS.StdOutMutex -> IOMessage -> IO () @@ -38,4 +39,5 @@ let string = show response text = T.pack string + --WS.safePutStr stdoutM string WS.safeSendText mu conn text
src/EventLoop/Json.hs view
@@ -46,7 +46,7 @@ escapeStringJson :: [Char] -> [Char] escapeStringJson [] = "" -escapeStringJson (c:cs) | c == '"' || c == '\'' || c == '\\' = '\\':c:rest +escapeStringJson (c:cs) | c == '"' || c == '\\' = '\\':c:rest | otherwise = c:rest where rest = escapeStringJson cs @@ -99,18 +99,17 @@ parseVariable :: Rest -> (Rest, JSONMessage) parseVariable [] = error (errorMsg "something" "premature end") parseVariable [c1] = error (errorMsg "longer variable" (c1:" and premature end")) -parseVariable (c1:c2:cs) | c1 == '"' && ((isLower c2) || (isUpper c2)) = (r1, JSONString word) - | isDigit c1 = (r2, JSONFloat (read number)) - | otherwise = error (errorMsg "\"" [c1]) +parseVariable (c1:cs) | c1 == '"' = (r1, JSONString word) + | isDigit c1 = (r2, JSONFloat (read number)) + | otherwise = error (errorMsg "\" or digit" [c1]) where - (r1, word) = parseWord (c2:cs) - (r2, number) = parseNumber (c1:c2:cs) + (r1, word) = parseWord (cs) + (r2, number) = parseNumber (c1:cs) parseWord :: Rest -> (Rest, [Char]) parseWord [] = error (errorMsg "something" "premature end") -parseWord (c1:cs) | (isLower c1) || (isDigit c1) || (isUpper c1) = (r1, c1:result') - | c1 == '"' = (cs, []) - | otherwise = error (errorMsg "letter or number" [c1]) +parseWord (c1:cs) | c1 == '"' = (cs, []) + | otherwise = (r1, c1:result') where (r1, result') = parseWord cs
twentefp-eventloop-graphics.cabal view
@@ -1,5 +1,5 @@ name: twentefp-eventloop-graphics -version: 0.1.0.1 +version: 0.1.0.2 synopsis: An eventloop based graphical IO system. Used as Lab Assignments Environment at Univeriteit Twente description: An eventloop based graphical IO system. It uses websockets as a way to communicate with IO devices; a browser in this case. This system is used in the Graphical submodule to be able to express graphical output using the eventloop system for a browser. license: BSD3 @@ -36,7 +36,7 @@ FPPrac.Graphics.NormalizeNumber build-depends: - base >= 4.6.0.1 && < 5, + base >= 4.6.0.0 && < 5, twentefp-websockets >= 0.1.0.1, twentefp-number >= 0.1.0.2, text >= 0.11.3.1,