mirror of
https://github.com/github/semantic.git
synced 2024-12-30 10:27:45 +03:00
Fill in the Primitive instance of Name
This commit is contained in:
parent
1c2abd36d0
commit
14e5b39afb
@ -29,8 +29,8 @@ instance HasDefault Name where
|
|||||||
|
|
||||||
instance Primitive Name where
|
instance Primitive Name where
|
||||||
encodePrimitive num (Name text) = Encode.text num (LT.fromStrict text)
|
encodePrimitive num (Name text) = Encode.text num (LT.fromStrict text)
|
||||||
encodePrimitive _ (I _) = error "We should never be encoding I :: Name constructors"
|
encodePrimitive num (I index) = Encode.int num index
|
||||||
decodePrimitive = Name . LT.toStrict <$> Decode.text
|
decodePrimitive = Name . LT.toStrict <$> Decode.text <|> I <$> Decode.int
|
||||||
primType _ = Bytes
|
primType _ = Bytes
|
||||||
|
|
||||||
-- | Construct a 'Name' from a 'Text'.
|
-- | Construct a 'Name' from a 'Text'.
|
||||||
|
Loading…
Reference in New Issue
Block a user