Skip to content
This repository was archived by the owner on May 1, 2020. It is now read-only.

Commit 1d17fda

Browse files
committed
Take advantage of record wildcards
1 parent bfe0bfd commit 1d17fda

File tree

1 file changed

+44
-46
lines changed

1 file changed

+44
-46
lines changed

src/Options.purs

Lines changed: 44 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -116,60 +116,58 @@ instance isForeignEither :: (IsForeign a, IsForeign b) => IsForeign (Either a b)
116116

117117
instance isForeignPsc :: IsForeign Psc where
118118
read obj =
119-
(\a b c d e f g h i j k l m o ->
120-
Psc { noPrelude: a
121-
, noTco: b
122-
, noMagicDo: c
123-
, main: d
124-
, noOpts: e
125-
, verboseErrors: f
126-
, comments: g
127-
, browserNamespace: h
128-
, "module": i
129-
, codegen: j
130-
, output: k
131-
, externs: l
132-
, noPrefix: m
133-
, ffi: o
134-
}) <$> readProp noPreludeKey obj
135-
<*> readProp noTcoKey obj
136-
<*> readProp noMagicDoKey obj
137-
<*> readProp mainKey obj
138-
<*> readProp noOptsKey obj
139-
<*> readProp verboseErrorsKey obj
140-
<*> readProp commentsKey obj
141-
<*> readProp browserNamespaceKey obj
142-
<*> readProp moduleKey obj
143-
<*> readProp codegenKey obj
144-
<*> readProp outputKey obj
145-
<*> readProp externsKey obj
146-
<*> readProp noPrefixKey obj
147-
<*> readProp ffiKey obj
148-
149-
instance isForeignPscMake :: IsForeign PscMake where
150-
read obj =
151-
(\a b c d e f g h i ->
152-
PscMake { output: a
153-
, noPrelude: b
154-
, noTco: c
155-
, noMagicDo: d
156-
, noOpts: e
157-
, verboseErrors: f
158-
, comments: g
159-
, noPrefix: h
160-
, ffi: i
161-
}) <$> readProp outputKey obj
162-
<*> readProp noPreludeKey obj
119+
Psc <$> ({ noPrelude: _
120+
, noTco: _
121+
, noMagicDo: _
122+
, main: _
123+
, noOpts: _
124+
, verboseErrors: _
125+
, comments: _
126+
, browserNamespace: _
127+
, "module": _
128+
, codegen: _
129+
, output: _
130+
, externs: _
131+
, noPrefix: _
132+
, ffi: _
133+
} <$> readProp noPreludeKey obj
163134
<*> readProp noTcoKey obj
164135
<*> readProp noMagicDoKey obj
136+
<*> readProp mainKey obj
165137
<*> readProp noOptsKey obj
166138
<*> readProp verboseErrorsKey obj
167139
<*> readProp commentsKey obj
140+
<*> readProp browserNamespaceKey obj
141+
<*> readProp moduleKey obj
142+
<*> readProp codegenKey obj
143+
<*> readProp outputKey obj
144+
<*> readProp externsKey obj
168145
<*> readProp noPrefixKey obj
169-
<*> readProp ffiKey obj
146+
<*> readProp ffiKey obj)
147+
148+
instance isForeignPscMake :: IsForeign PscMake where
149+
read obj =
150+
PscMake <$> ({ output: _
151+
, noPrelude: _
152+
, noTco: _
153+
, noMagicDo: _
154+
, noOpts: _
155+
, verboseErrors: _
156+
, comments: _
157+
, noPrefix: _
158+
, ffi: _
159+
} <$> readProp outputKey obj
160+
<*> readProp noPreludeKey obj
161+
<*> readProp noTcoKey obj
162+
<*> readProp noMagicDoKey obj
163+
<*> readProp noOptsKey obj
164+
<*> readProp verboseErrorsKey obj
165+
<*> readProp commentsKey obj
166+
<*> readProp noPrefixKey obj
167+
<*> readProp ffiKey obj)
170168

171169
instance isForeignPscDocs :: IsForeign PscDocs where
172-
read obj = (\a -> PscDocs { format: a }) <$> readProp formatKey obj
170+
read obj = PscDocs <<< { format: _ } <$> readProp formatKey obj
173171

174172
instance isForeignFormat :: IsForeign Format where
175173
read val = read val >>= (\a -> case a of

0 commit comments

Comments
 (0)