1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 17:04:47 +03:00
This commit is contained in:
joshvera 2018-05-31 11:38:45 -04:00
parent a342445b30
commit 1c5d8d816e
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@ data Pos = Pos
deriving (Show, Read, Eq, Ord, Generic, Hashable, Named, Message)
instance MessageField Pos where
encodeMessageField num = (Encode.embedded num . encodeMessage (fieldNumber 1))
encodeMessageField num = Encode.embedded num . encodeMessage (fieldNumber 1)
decodeMessageField = fromMaybe def <$> Decode.embedded (decodeMessage (fieldNumber 1))
protoType pr = messageField (Prim $ Named (Single (nameOf pr))) Nothing

View File

@ -104,7 +104,7 @@ infixContext :: (Context :< fs, Assignment.Parsing m, Semigroup a, HasCallStack,
infixContext context left right operators = uncurry (&) <$> postContextualizeThrough context left (asum operators) <*> postContextualize context right
instance (Apply Message1 fs, Generate Message1 fs fs, Generate Named1 fs fs) => Message1 (Sum fs) where
liftEncodeMessage encodeMessage num fs = apply @Message1 (liftEncodeMessage encodeMessage num) fs
liftEncodeMessage encodeMessage num = apply @Message1 (liftEncodeMessage encodeMessage num)
liftDecodeMessage decodeMessage _ = oneof undefined listOfParsers
where
listOfParsers =
@ -127,7 +127,7 @@ instance Generate c all '[] where
generate _ = mempty
instance (Element f all, c f, Generate c all fs) => Generate c all (f ': fs) where
generate each = (each (Proxy @f) (natVal (Proxy @(ElemIndex f all)))) `mappend` generate @c @all @fs each
generate each = each (Proxy @f) (natVal (Proxy @(ElemIndex f all))) `mappend` generate @c @all @fs each
-- Common