mirror of
https://github.com/github/semantic.git
synced 2024-12-21 05:41:54 +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
|
||||
encodePrimitive num (Name text) = Encode.text num (LT.fromStrict text)
|
||||
encodePrimitive _ (I _) = error "We should never be encoding I :: Name constructors"
|
||||
decodePrimitive = Name . LT.toStrict <$> Decode.text
|
||||
encodePrimitive num (I index) = Encode.int num index
|
||||
decodePrimitive = Name . LT.toStrict <$> Decode.text <|> I <$> Decode.int
|
||||
primType _ = Bytes
|
||||
|
||||
-- | Construct a 'Name' from a 'Text'.
|
||||
|
Loading…
Reference in New Issue
Block a user