1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 16:02:43 +03:00

Regenerate Semantic.hs

This commit is contained in:
joshvera 2018-05-30 18:04:07 -04:00
parent 11a48035b6
commit 5fc9090ad1
3 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
syntax = "proto3";
import "semantic-types.proto";
import "types.proto";
package semantic;
message HealthCheckRequest {

View File

@ -1,5 +1,5 @@
{-# LANGUAGE AllowAmbiguousTypes, DeriveAnyClass, GADTs, TypeOperators, MultiParamTypeClasses, UndecidableInstances, ScopedTypeVariables, KindSignatures, RankNTypes, ConstraintKinds #-}
{-# OPTIONS_GHC -Wno-redundant-constraints #-} -- For HasCallStack
{-# OPTIONS_GHC -Wno-redundant-constraints -fno-warn-orphans #-} -- For HasCallStack
module Data.Syntax where
import Data.Abstract.Evaluatable
@ -105,12 +105,12 @@ infixContext context left right operators = uncurry (&) <$> postContextualizeThr
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
liftDecodeMessage decodeMessage num = oneof undefined listOfParsers
liftDecodeMessage decodeMessage _ = oneof undefined listOfParsers
where
listOfParsers =
generate @Message1 @fs @fs (\ (proxy :: proxy f) i -> let num = FieldNumber (fromInteger (succ i)) in [(num, fromJust <$> embedded (inject @f @fs <$> liftDecodeMessage decodeMessage num))])
generate @Message1 @fs @fs (\ (_ :: proxy f) i -> let num = FieldNumber (fromInteger (succ i)) in [(num, fromJust <$> embedded (inject @f @fs <$> liftDecodeMessage decodeMessage num))])
liftDotProto _ =
[Proto.DotProtoMessageOneOf (Proto.Single "syntax") (generate @Named1 @fs @fs (\ (proxy :: proxy f) i ->
[Proto.DotProtoMessageOneOf (Proto.Single "syntax") (generate @Named1 @fs @fs (\ (_ :: proxy f) i ->
let
num = FieldNumber (fromInteger (succ i))
fieldType = Proto.Prim (Proto.Named . Proto.Single $ nameOf1 (Proxy @f))