git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Bump version, pretty printing JS
commit74560586d0c22150359661a49a1b8ca212b14d05 authorPhil Freeman <paf31@cantab.net> dateThu 14 Nov 2013, 16:56 (13 years ago) parent3403d5f
7 files changed+193−110
purescript.cabal+1−1 src/Language/PureScript.hs+1−1 src/Language/PureScript/Pretty/Common.hs+21−15 src/Language/PureScript/Pretty/JS.hs+129−52 src/Language/PureScript/Pretty/Kinds.hs+7−7 src/Language/PureScript/Pretty/Types.hs+11−11 src/Language/PureScript/Pretty/Values.hs+23−23
purescript.cabal+1−1
@@ -1,5 +1,5 @@
11name: purescript
2−version: 0.1.8
2+version: 0.1.9
33cabal-version: >=1.8
44build-type: Simple
55license: MIT
src/Language/PureScript.hs+1−1
@@ -33,6 +33,6 @@ compile :: [Declaration] -> Either String (String, String, Environment)
3333compile decls = do
3434 bracketted <- rebracket decls
3535 (_, env) <- check (typeCheckAll bracketted)
36− let js = intercalate "; " . map (prettyPrintJS . optimize) . concat . mapMaybe (declToJs Nothing global) $ bracketted
36+ let js = prettyPrintJS . map optimize . concat . mapMaybe (declToJs Nothing global) $ bracketted
3737 let exts = intercalate "\n" . mapMaybe (externToPs 0 global env) $ bracketted
3838 return (js, exts, env)
src/Language/PureScript/Pretty/Common.hs+21−15
@@ -39,38 +39,44 @@ identToJs (Op op) = concatMap opCharToString op
3939 opCharToString :: Char -> String
4040 opCharToString = (:) '$'. show . ord
4141
42−newtype Pattern a b = Pattern { runPattern :: A.Kleisli Maybe a b } deriving (C.Category, A.Arrow, A.ArrowZero, A.ArrowPlus)
42+newtype Pattern u a b = Pattern { runPattern :: A.Kleisli (StateT u Maybe) a b } deriving (C.Category, A.Arrow, A.ArrowZero, A.ArrowPlus)
4343
44−instance Functor (Pattern a) where
44+instance Functor (Pattern u a) where
4545 fmap f (Pattern p) = Pattern $ A.Kleisli $ fmap f . A.runKleisli p
4646
47−pattern :: Pattern a b -> a -> Maybe b
48−pattern = A.runKleisli . runPattern
47+pattern :: Pattern u a b -> u -> a -> Maybe b
48+pattern p u = flip evalStateT u . A.runKleisli (runPattern p)
49+
50+mkPattern :: (a -> Maybe b) -> Pattern u a b
51+mkPattern f = Pattern $ A.Kleisli (lift . f)
52+
53+mkPattern' :: (a -> StateT u Maybe b) -> Pattern u a b
54+mkPattern' = Pattern . A.Kleisli
4955
5056parens :: String -> String
5157parens s = ('(':s) ++ ")"
5258
53−chainl :: Pattern a (a, a) -> (r -> r -> r) -> Pattern a r -> Pattern a r
59+chainl :: Pattern u a (a, a) -> (r -> r -> r) -> Pattern u a r -> Pattern u a r
5460chainl split f p = fix $ \c -> split >>> ((c <+> p) *** p) >>> A.arr (uncurry f)
5561
56−chainr :: Pattern a (a, a) -> (r -> r -> r) -> Pattern a r -> Pattern a r
62+chainr :: Pattern u a (a, a) -> (r -> r -> r) -> Pattern u a r -> Pattern u a r
5763chainr split f p = fix $ \c -> split >>> (p *** (c <+> p)) >>> A.arr (uncurry f)
5864
59−wrap :: Pattern a (s, a) -> (s -> r -> r) -> Pattern a r -> Pattern a r
65+wrap :: Pattern u a (s, a) -> (s -> r -> r) -> Pattern u a r -> Pattern u a r
6066wrap split f p = fix $ \c -> split >>> (C.id *** (c <+> p)) >>> A.arr (uncurry f)
6167
62−split :: Pattern a (s, t) -> (s -> t -> r) -> Pattern a r -> Pattern a r
68+split :: Pattern u a (s, t) -> (s -> t -> r) -> Pattern u a r -> Pattern u a r
6369split s f p = s >>> A.arr (uncurry f)
6470
65−data OperatorTable a r = OperatorTable { runOperatorTable :: [ [Operator a r] ] }
71+data OperatorTable u a r = OperatorTable { runOperatorTable :: [ [Operator u a r] ] }
6672
67−data Operator a r where
68− AssocL :: Pattern a (a, a) -> (r -> r -> r) -> Operator a r
69− AssocR :: Pattern a (a, a) -> (r -> r -> r) -> Operator a r
70− Wrap :: Pattern a (s, a) -> (s -> r -> r) -> Operator a r
71− Split :: Pattern a (s, t) -> (s -> t -> r) -> Operator a r
73+data Operator u a r where
74+ AssocL :: Pattern u a (a, a) -> (r -> r -> r) -> Operator u a r
75+ AssocR :: Pattern u a (a, a) -> (r -> r -> r) -> Operator u a r
76+ Wrap :: Pattern u a (s, a) -> (s -> r -> r) -> Operator u a r
77+ Split :: Pattern u a (s, t) -> (s -> t -> r) -> Operator u a r
7278
73−buildPrettyPrinter :: OperatorTable a r -> Pattern a r -> Pattern a r
79+buildPrettyPrinter :: OperatorTable u a r -> Pattern u a r -> Pattern u a r
7480buildPrettyPrinter table p = foldl (\p' ops -> foldl1 (<+>) (flip map ops $ \op ->
7581 case op of
7682 AssocL pat g -> chainl pat g p'
src/Language/PureScript/Pretty/JS.hs+129−52
@@ -25,94 +25,171 @@ import Data.List
2525import Data.Maybe (fromMaybe)
2626import qualified Control.Arrow as A
2727import Control.Arrow ((***), (<+>), first, second)
28+import Control.Applicative
29+import Control.Monad.State
2830
29−literals :: Pattern JS String
30−literals = Pattern $ A.Kleisli match
31+newtype PrinterState = PrinterState { indent :: Int } deriving (Show, Eq, Ord)
32+
33+blockIndent :: Int
34+blockIndent = 4
35+
36+withIndent :: StateT PrinterState Maybe String -> StateT PrinterState Maybe String
37+withIndent s = do
38+ current <- get
39+ modify $ \s -> s { indent = indent s + blockIndent }
40+ result <- s
41+ modify $ \s -> s { indent = indent s - blockIndent }
42+ return result
43+
44+currentIndent :: StateT PrinterState Maybe String
45+currentIndent = do
46+ current <- get
47+ return $ replicate (indent current) ' '
48+
49+literals :: Pattern PrinterState JS String
50+literals = mkPattern' match
3151 where
32− match (JSNumericLiteral n) = Just $ either show show n
33− match (JSStringLiteral s) = Just $ show s
34− match (JSBooleanLiteral True) = Just "true"
35− match (JSBooleanLiteral False) = Just "false"
36− match (JSArrayLiteral xs) = Just $ "[" ++ intercalate ", " (map prettyPrintJS xs) ++ "]"
37− match (JSObjectLiteral ps) = Just $ "{ " ++ intercalate ", " (map (\(key, value) -> key ++ ": " ++ prettyPrintJS value) ps) ++ " }"
38− match (JSBlock sts) = Just $ "{ " ++ intercalate "; " (map prettyPrintJS sts) ++ " }"
39− match (JSVar ident) = Just (identToJs ident)
40− match (JSVariableIntroduction ident value) = Just $ "var " ++ identToJs ident ++ maybe "" ((" = " ++) . prettyPrintJS) value
41− match (JSAssignment target value) = Just $ targetToJs target ++ " = " ++ prettyPrintJS value
42− match (JSWhile cond sts) = Just $ "while ("
43− ++ prettyPrintJS cond ++ ") "
44− ++ prettyPrintJS sts
45− match (JSFor ident start end sts) = Just $ "for ("
46− ++ identToJs ident ++ " = " ++ prettyPrintJS start ++ "; "
47− ++ identToJs ident ++ " < " ++ prettyPrintJS end ++ "; "
48− ++ identToJs ident ++ "++) "
49− ++ prettyPrintJS sts
50− match (JSIfElse cond thens elses) = Just $ "if ("
51− ++ prettyPrintJS cond ++ ") "
52− ++ prettyPrintJS thens
53− ++ maybe "" ((" else " ++) . prettyPrintJS) elses
54− match (JSReturn value) = Just $ "return " ++ prettyPrintJS value
55− match (JSThrow value) = Just $ "throw " ++ prettyPrintJS value
56− match _ = Nothing
52+ match :: JS -> StateT PrinterState Maybe String
53+ match (JSNumericLiteral n) = return $ either show show n
54+ match (JSStringLiteral s) = return $ show s
55+ match (JSBooleanLiteral True) = return "true"
56+ match (JSBooleanLiteral False) = return "false"
57+ match (JSArrayLiteral xs) = fmap concat $ sequence
58+ [ return "[ "
59+ , fmap (intercalate ", ") $ forM xs prettyPrintJS'
60+ , return " ]"
61+ ]
62+ match (JSObjectLiteral ps) = fmap concat $ sequence
63+ [ return "{\n"
64+ , withIndent $ do
65+ jss <- forM ps $ \(key, value) -> fmap ((key ++ ": ") ++) . prettyPrintJS' $ value
66+ indentString <- currentIndent
67+ return $ intercalate ", \n" $ map (indentString ++) jss
68+ , return "\n"
69+ , currentIndent
70+ , return "}"
71+ ]
72+ match (JSBlock sts) = fmap concat $ sequence
73+ [ return "{\n"
74+ , withIndent $ do
75+ jss <- forM sts prettyPrintJS'
76+ indentString <- currentIndent
77+ return $ intercalate "\n" $ map (++ "; ") $ map (indentString ++) jss
78+ , return "\n"
79+ , currentIndent
80+ , return "}"
81+ ]
82+ match (JSVar ident) = return (identToJs ident)
83+ match (JSVariableIntroduction ident value) = fmap concat $ sequence
84+ [ return "var "
85+ , return $ identToJs ident
86+ , maybe (return "") (fmap (" = " ++) . prettyPrintJS') value
87+ ]
88+ match (JSAssignment target value) = fmap concat $ sequence
89+ [ return $ targetToJs target
90+ , return " = "
91+ , prettyPrintJS' value
92+ ]
93+ match (JSWhile cond sts) = fmap concat $ sequence
94+ [ return "while ("
95+ , prettyPrintJS' cond
96+ , return ") "
97+ , prettyPrintJS' sts
98+ ]
99+ match (JSFor ident start end sts) = fmap concat $ sequence
100+ [ return $ "for (" ++ identToJs ident ++ " = "
101+ , prettyPrintJS' start
102+ , return $ "; " ++ identToJs ident ++ " < "
103+ , prettyPrintJS' end
104+ , return $ "; " ++ identToJs ident ++ "++) "
105+ , prettyPrintJS' sts
106+ ]
107+ match (JSIfElse cond thens elses) = fmap concat $ sequence
108+ [ return "if ("
109+ , prettyPrintJS' cond
110+ , return ") "
111+ , prettyPrintJS' thens
112+ , maybe (return "") (fmap (" else " ++) . prettyPrintJS') elses
113+ ]
114+ match (JSReturn value) = fmap concat $ sequence
115+ [ return "return "
116+ , prettyPrintJS' value
117+ ]
118+ match (JSThrow value) = fmap concat $ sequence
119+ [ return "throw "
120+ , prettyPrintJS' value
121+ ]
122+ match _ = mzero
57123
58124targetToJs :: JSAssignment -> String
59125targetToJs (JSAssignVariable ident) = identToJs ident
60126targetToJs (JSAssignProperty prop target) = targetToJs target ++ "." ++ prop
61127
62−conditional :: Pattern JS ((JS, JS), JS)
63−conditional = Pattern $ A.Kleisli match
128+conditional :: Pattern PrinterState JS ((JS, JS), JS)
129+conditional = mkPattern match
64130 where
65131 match (JSConditional cond th el) = Just ((th, el), cond)
66132 match _ = Nothing
67133
68−accessor :: Pattern JS (String, JS)
69−accessor = Pattern $ A.Kleisli match
134+accessor :: Pattern PrinterState JS (String, JS)
135+accessor = mkPattern match
70136 where
71137 match (JSAccessor prop val) = Just (prop, val)
72138 match _ = Nothing
73139
74−indexer :: Pattern JS (String, JS)
75−indexer = Pattern $ A.Kleisli match
140+indexer :: Pattern PrinterState JS (String, JS)
141+indexer = mkPattern' match
76142 where
77− match (JSIndexer index val) = Just (prettyPrintJS index, val)
78− match _ = Nothing
143+ match (JSIndexer index val) = (,) <$> prettyPrintJS' index <*> pure val
144+ match _ = mzero
79145
80−lam :: Pattern JS ((Maybe Ident, [Ident]), JS)
81−lam = Pattern $ A.Kleisli match
146+lam :: Pattern PrinterState JS ((Maybe Ident, [Ident]), JS)
147+lam = mkPattern match
82148 where
83149 match (JSFunction name args ret) = Just ((name, args), ret)
84150 match _ = Nothing
85151
86−app :: Pattern JS (String, JS)
87−app = Pattern $ A.Kleisli match
152+app :: Pattern PrinterState JS (String, JS)
153+app = mkPattern' match
88154 where
89− match (JSApp val args) = Just (intercalate "," (map prettyPrintJS args), val)
90− match _ = Nothing
155+ match (JSApp val args) = do
156+ jss <- mapM prettyPrintJS' args
157+ return (intercalate ", " jss, val)
158+ match _ = mzero
91159
92−unary :: UnaryOperator -> String -> Operator JS String
160+unary :: UnaryOperator -> String -> Operator PrinterState JS String
93161unary op str = Wrap pattern (++)
94162 where
95− pattern :: Pattern JS (String, JS)
96− pattern = Pattern $ A.Kleisli match
163+ pattern :: Pattern PrinterState JS (String, JS)
164+ pattern = mkPattern match
97165 where
98166 match (JSUnary op' val) | op' == op = Just (str, val)
99167 match _ = Nothing
100168
101−binary :: BinaryOperator -> String -> Operator JS String
169+binary :: BinaryOperator -> String -> Operator PrinterState JS String
102170binary op str = AssocR pattern (\v1 v2 -> v1 ++ " " ++ str ++ " " ++ v2)
103171 where
104− pattern :: Pattern JS (JS, JS)
105− pattern = Pattern $ A.Kleisli match
172+ pattern :: Pattern PrinterState JS (JS, JS)
173+ pattern = mkPattern match
106174 where
107175 match (JSBinary op' v1 v2) | op' == op = Just (v1, v2)
108176 match _ = Nothing
109177
110−prettyPrintJS :: JS -> String
111−prettyPrintJS = fromMaybe (error "Incomplete pattern") . pattern matchValue
178+prettyPrintJS1 :: JS -> String
179+prettyPrintJS1 = fromMaybe (error "Incomplete pattern") . flip evalStateT (PrinterState 0) . prettyPrintJS'
180+
181+prettyPrintJS :: [JS] -> String
182+prettyPrintJS sts = fromMaybe (error "Incomplete pattern") . flip evalStateT (PrinterState 0) $ do
183+ jss <- forM sts prettyPrintJS'
184+ indentString <- currentIndent
185+ return $ intercalate "\n" $ map (++ "; ") $ map (indentString ++) jss
186+
187+prettyPrintJS' :: JS -> StateT PrinterState Maybe String
188+prettyPrintJS' = A.runKleisli $ runPattern matchValue
112189 where
113− matchValue :: Pattern JS String
190+ matchValue :: Pattern PrinterState JS String
114191 matchValue = buildPrettyPrinter operators (literals <+> fmap parens matchValue)
115− operators :: OperatorTable JS String
192+ operators :: OperatorTable PrinterState JS String
116193 operators =
117194 OperatorTable [ [ Wrap accessor $ \prop val -> val ++ "." ++ prop ]
118195 , [ Wrap indexer $ \index val -> val ++ "[" ++ index ++ "]" ]
@@ -121,7 +198,7 @@ prettyPrintJS = fromMaybe (error "Incomplete pattern") . pattern matchValue
121198 ++ maybe "" identToJs name
122199 ++ "(" ++ intercalate ", " (map identToJs args) ++ ") "
123200 ++ ret ]
124− , [ Wrap conditional $ \(th, el) cond -> cond ++ " ? " ++ prettyPrintJS th ++ " : " ++ prettyPrintJS el ]
201+ , [ Wrap conditional $ \(th, el) cond -> cond ++ " ? " ++ prettyPrintJS1 th ++ " : " ++ prettyPrintJS1 el ]
125202 , [ binary LessThan "<" ]
126203 , [ binary LessThanOrEqualTo "<=" ]
127204 , [ binary GreaterThan ">" ]
src/Language/PureScript/Pretty/Kinds.hs+7−7
@@ -26,25 +26,25 @@ import Control.Applicative
2626import Language.PureScript.Kinds
2727import Language.PureScript.Pretty.Common
2828
29−typeLiterals :: Pattern Kind String
30−typeLiterals = Pattern $ A.Kleisli match
29+typeLiterals :: Pattern () Kind String
30+typeLiterals = mkPattern match
3131 where
3232 match Star = Just "*"
3333 match Row = Just "#"
3434 match (KUnknown u) = Just $ 'u' : show u
3535 match _ = Nothing
3636
37−funKind :: Pattern Kind (Kind, Kind)
38−funKind = Pattern $ A.Kleisli match
37+funKind :: Pattern () Kind (Kind, Kind)
38+funKind = mkPattern match
3939 where
4040 match (FunKind arg ret) = Just (arg, ret)
4141 match _ = Nothing
4242
4343prettyPrintKind :: Kind -> String
44−prettyPrintKind = fromMaybe (error "Incomplete pattern") . pattern matchKind
44+prettyPrintKind = fromMaybe (error "Incomplete pattern") . pattern matchKind ()
4545 where
46− matchKind :: Pattern Kind String
46+ matchKind :: Pattern () Kind String
4747 matchKind = buildPrettyPrinter operators (typeLiterals <+> fmap parens matchKind)
48− operators :: OperatorTable Kind String
48+ operators :: OperatorTable () Kind String
4949 operators =
5050 OperatorTable [ [ AssocR funKind $ \arg ret -> arg ++ " -> " ++ ret ] ]
src/Language/PureScript/Pretty/Types.hs+11−11
@@ -32,8 +32,8 @@ import Language.PureScript.Declarations
3232import Language.PureScript.TypeChecker.Monad
3333import Language.PureScript.Pretty.Common
3434
35−typeLiterals :: Pattern Type String
36−typeLiterals = Pattern $ A.Kleisli match
35+typeLiterals :: Pattern () Type String
36+typeLiterals = mkPattern match
3737 where
3838 match Number = Just "Number"
3939 match String = Just "String"
@@ -59,30 +59,30 @@ prettyPrintRow = (\(tys, tail) -> intercalate ", " (map (uncurry nameAndTypeToPs
5959 toList tys (RCons name ty row) = toList ((name, ty):tys) row
6060 toList tys r = (tys, r)
6161
62−typeApp :: Pattern Type (Type, Type)
63−typeApp = Pattern $ A.Kleisli match
62+typeApp :: Pattern () Type (Type, Type)
63+typeApp = mkPattern match
6464 where
6565 match (TypeApp f x) = Just (f, x)
6666 match _ = Nothing
6767
68−singleArgumentFunction :: Pattern Type (Type, Type)
69−singleArgumentFunction = Pattern $ A.Kleisli match
68+singleArgumentFunction :: Pattern () Type (Type, Type)
69+singleArgumentFunction = mkPattern match
7070 where
7171 match (Function [arg] ret) = Just (arg, ret)
7272 match _ = Nothing
7373
74−function :: Pattern Type ([Type], Type)
75−function = Pattern $ A.Kleisli match
74+function :: Pattern () Type ([Type], Type)
75+function = mkPattern match
7676 where
7777 match (Function args ret) = Just (args, ret)
7878 match _ = Nothing
7979
8080prettyPrintType :: Type -> String
81−prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType
81+prettyPrintType = fromMaybe (error "Incomplete pattern") . pattern matchType ()
8282 where
83− matchType :: Pattern Type String
83+ matchType :: Pattern () Type String
8484 matchType = buildPrettyPrinter operators (typeLiterals <+> fmap parens matchType)
85− operators :: OperatorTable Type String
85+ operators :: OperatorTable () Type String
8686 operators =
8787 OperatorTable [ [ AssocL typeApp $ \f x -> f ++ " " ++ x ]
8888 , [ AssocR singleArgumentFunction $ \arg ret -> arg ++ " -> " ++ ret
src/Language/PureScript/Pretty/Values.hs+23−23
@@ -29,8 +29,8 @@ import Language.PureScript.Values
2929import Language.PureScript.Names
3030import Language.PureScript.Pretty.Common
3131
32−literals :: Pattern Value String
33−literals = Pattern $ A.Kleisli match
32+literals :: Pattern () Value String
33+literals = mkPattern match
3434 where
3535 match (NumericLiteral n) = Just $ either show show n
3636 match (StringLiteral s) = Just $ show s
@@ -47,66 +47,66 @@ literals = Pattern $ A.Kleisli match
4747prettyPrintCaseAlternative :: Binder -> Value -> String
4848prettyPrintCaseAlternative binder val = prettyPrintBinder binder ++ " -> " ++ prettyPrintValue val
4949
50−ifThenElse :: Pattern Value ((Value, Value), Value)
51−ifThenElse = Pattern $ A.Kleisli match
50+ifThenElse :: Pattern () Value ((Value, Value), Value)
51+ifThenElse = mkPattern match
5252 where
5353 match (IfThenElse cond th el) = Just ((th, el), cond)
5454 match _ = Nothing
5555
56−accessor :: Pattern Value (String, Value)
57−accessor = Pattern $ A.Kleisli match
56+accessor :: Pattern () Value (String, Value)
57+accessor = mkPattern match
5858 where
5959 match (Accessor prop val) = Just (prop, val)
6060 match _ = Nothing
6161
62−indexer :: Pattern Value (Value, Value)
63−indexer = Pattern $ A.Kleisli match
62+indexer :: Pattern () Value (Value, Value)
63+indexer = mkPattern match
6464 where
6565 match (Indexer index val) = Just (index, val)
6666 match _ = Nothing
6767
68−objectUpdate :: Pattern Value ([String], Value)
69−objectUpdate = Pattern $ A.Kleisli match
68+objectUpdate :: Pattern () Value ([String], Value)
69+objectUpdate = mkPattern match
7070 where
7171 match (ObjectUpdate o ps) = Just (flip map ps $ \(key, val) -> key ++ " = " ++ prettyPrintValue val, o)
7272 match _ = Nothing
7373
74−app :: Pattern Value (String, Value)
75−app = Pattern $ A.Kleisli match
74+app :: Pattern () Value (String, Value)
75+app = mkPattern match
7676 where
7777 match (App val args) = Just (intercalate "," (map prettyPrintValue args), val)
7878 match _ = Nothing
7979
80−lam :: Pattern Value ([String], Value)
81−lam = Pattern $ A.Kleisli match
80+lam :: Pattern () Value ([String], Value)
81+lam = mkPattern match
8282 where
8383 match (Abs args val) = Just (map show args, val)
8484 match _ = Nothing
8585
86−unary :: UnaryOperator -> String -> Operator Value String
86+unary :: UnaryOperator -> String -> Operator () Value String
8787unary op str = Wrap pattern (++)
8888 where
89− pattern :: Pattern Value (String, Value)
90− pattern = Pattern $ A.Kleisli match
89+ pattern :: Pattern () Value (String, Value)
90+ pattern = mkPattern match
9191 where
9292 match (Unary op' val) | op' == op = Just (str, val)
9393 match _ = Nothing
9494
95−binary :: BinaryOperator -> String -> Operator Value String
95+binary :: BinaryOperator -> String -> Operator () Value String
9696binary op str = AssocR pattern (\v1 v2 -> v1 ++ " " ++ str ++ " " ++ v2)
9797 where
98− pattern :: Pattern Value (Value, Value)
99− pattern = Pattern $ A.Kleisli match
98+ pattern :: Pattern () Value (Value, Value)
99+ pattern = mkPattern match
100100 where
101101 match (Binary op' v1 v2) | op' == op = Just (v1, v2)
102102 match _ = Nothing
103103
104104prettyPrintValue :: Value -> String
105−prettyPrintValue = fromMaybe (error "Incomplete pattern") . pattern matchValue
105+prettyPrintValue = fromMaybe (error "Incomplete pattern") . pattern matchValue ()
106106 where
107− matchValue :: Pattern Value String
107+ matchValue :: Pattern () Value String
108108 matchValue = buildPrettyPrinter operators (literals <+> fmap parens matchValue)
109− operators :: OperatorTable Value String
109+ operators :: OperatorTable () Value String
110110 operators =
111111 OperatorTable [ [ Wrap accessor $ \prop val -> val ++ "." ++ prop ]
112112 , [ Wrap objectUpdate $ \ps val -> val ++ "{ " ++ intercalate ", " ps ++ " }" ]