mirror of
https://github.com/ChrisPenner/json-to-haskell.git
synced 2024-09-11 20:38:48 +03:00
Fix subtle bug where we fetch more than the first element
This commit is contained in:
parent
6f9b3e4442
commit
99cf8e89f4
@ -75,10 +75,9 @@ analyze value =
|
||||
nameRecord m'
|
||||
pure $ SRecord m'
|
||||
ArrayF itemsM -> do
|
||||
items <- sequenceA itemsM
|
||||
pure $ case (items V.!? 0) of
|
||||
Just s -> SArray s
|
||||
Nothing -> SArray SValue
|
||||
case (itemsM V.!? 0) of
|
||||
Just s -> SArray <$> s
|
||||
Nothing -> pure $ SArray SValue
|
||||
StringF _ -> pure SString
|
||||
NumberF n -> pure . SNumber
|
||||
$ if (ceiling n == (floor n :: Int))
|
||||
|
Loading…
Reference in New Issue
Block a user