File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,14 @@ instance decodeJsonJson :: DecodeJson Json where
117
117
118
118
toNonEmpty :: forall a f . (Plus f ) => ({ head :: f a -> Maybe a , tail :: f a -> Maybe (f a ) } ) -> (f a ) -> Either String (NonEmpty f a )
119
119
toNonEmpty i a = case (Tuple (i.head a) (i.tail a)) of
120
- (Tuple Nothing _) -> Left " is empty."
120
+ (Tuple Nothing _) -> Left " is empty."
121
121
(Tuple (Just h) Nothing ) -> Right $ singleton h
122
122
(Tuple (Just h) (Just t)) -> Right $ h :| t
123
123
124
124
instance decodeJsonNonEmptyArray :: (DecodeJson a ) => DecodeJson (NonEmpty Array a ) where
125
125
decodeJson
126
- = lmap (" Couldn't decode Array: " <> _)
127
- <<< (traverse decodeJson <=< (toNonEmpty { head : Arr .head, tail : Arr .tail } ) <=< decodeJArray)
126
+ = lmap (" Couldn't decode NonEmpty Array: " <> _)
127
+ <<< (traverse decodeJson <=< (lmap ( " Array " <> _) <<< toNonEmpty { head : Arr .head, tail : Arr .tail } ) <=< decodeJArray)
128
128
129
129
instance decodeJsonNonEmptyList :: (DecodeJson a ) => DecodeJson (NonEmpty List a ) where
130
130
decodeJson
You can’t perform that action at this time.
0 commit comments