Permalink
Browse files

move json helper functions into Utils.hs

  • Loading branch information...
1 parent e067cd6 commit f82826e8027be9170989f4d1a85ea0351d42a4da @MarcWeber MarcWeber committed Jul 22, 2009
Showing with 16 additions and 10 deletions.
  1. +15 −0 lib/Scion/Utils.hs
  2. +1 −0 lib/scion.cabal
  3. +0 −10 server/Scion/Server/Commands.hs
View
@@ -25,6 +25,8 @@ import Data.Maybe ( fromMaybe )
import Data.Char (isLower, isUpper)
+import Text.JSON
+
thingsAroundPoint :: (Int, Int) -> [Located n] -> [Located n]
thingsAroundPoint pt ls = [ l | l <- ls, spans (getLoc l) pt ]
@@ -58,6 +60,19 @@ ifM cm tm em = do
c <- cm
if c then tm else em
+
+------------------------------------------------------------------------
+-- JSON helper functions
+
+lookupKey :: JSON a => JSObject JSValue -> String -> Result a
+lookupKey = flip valFromObj
+
+makeObject :: [(String, JSValue)] -> JSValue
+makeObject = makeObj
+
+------------------------------------------------------------------------------
+
+
-- an alternative to the broken Fuzzy module
-- match sH simpleHTTP
-- match siH simpleHTTP
View
@@ -28,6 +28,7 @@ library
uniplate == 1.2.*,
time == 1.1.*,
filepath == 1.1.*,
+ json == 0.4.*,
multiset == 0.1.*
hs-source-dirs: .
extensions: CPP, PatternGuards
@@ -59,16 +59,6 @@ import Packages ( pkgIdMap )
import Distribution.InstalledPackageInfo
#endif
-------------------------------------------------------------------------
-
-lookupKey :: JSON a => JSObject JSValue -> String -> Result a
-lookupKey = flip valFromObj
-
-makeObject :: [(String, JSValue)] -> JSValue
-makeObject = makeObj
-
-------------------------------------------------------------------------------
-
type KeepGoing = Bool
-- a scion request is JS object with 3 keys:

0 comments on commit f82826e

Please sign in to comment.