File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import Data.Foldable (foldr)
8
8
import Data.Generic (class Generic , GenericSpine (..), toSpine )
9
9
import Data.Int (toNumber )
10
10
import Data.List (List (..), (:), toUnfoldable )
11
+ import Data.List as L
12
+
11
13
import Data.Map as M
12
14
import Data.Maybe (Maybe (..))
13
15
import Data.NonEmpty (NonEmpty (..))
@@ -79,7 +81,7 @@ instance encodeJsonNonEmptyArray :: (EncodeJson a) => EncodeJson (NonEmpty Array
79
81
encodeJson (NonEmpty h t) = encodeJson $ Arr .cons h t
80
82
81
83
instance encodeJsonNonEmptyList :: (EncodeJson a ) => EncodeJson (NonEmpty List a ) where
82
- encodeJson (NonEmpty h t) = encodeJson $ Arr .cons h (toUnfoldable t)
84
+ encodeJson (NonEmpty h t) = encodeJson $ L .insertAt 0 h t
83
85
84
86
instance encodeJsonChar :: EncodeJson Char where
85
87
encodeJson = encodeJson <<< singleton
You can’t perform that action at this time.
0 commit comments