diff --git a/src/Data/Syntax.hs b/src/Data/Syntax.hs index e763694e8..292558c23 100644 --- a/src/Data/Syntax.hs +++ b/src/Data/Syntax.hs @@ -148,7 +148,7 @@ instance Message1 [] where -- oneMsg = decodeMessage (fieldNumber 1) -- liftDotProto (_ :: Proxy [a]) = messageField (NestedRepeated (Named (Single (nameOf (Proxy @a))))) Nothing liftDotProto (_ :: Proxy [a]) = [ Proto.DotProtoMessageField $ Proto.DotProtoField (fieldNumber 1) ty (Proto.Single "listContent") [] Nothing ] - where ty = (Proto.NestedRepeated (Proto.Named (Proto.Single (nameOf (Proxy @a))))) + where ty = Proto.NestedRepeated (Proto.Named (Proto.Single (nameOf (Proxy @a)))) -- Common diff --git a/src/Data/Syntax/Expression.hs b/src/Data/Syntax/Expression.hs index 461ba326a..47f6ebc0f 100644 --- a/src/Data/Syntax/Expression.hs +++ b/src/Data/Syntax/Expression.hs @@ -176,7 +176,7 @@ instance Evaluatable Power where eval t = rvalBox =<< (traverse subtermValue t >>= go) where go (Power a b) = liftNumeric2 liftedExponent a b -data Negate a = Negate { term :: a } +newtype Negate a = Negate { term :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Negate where liftEq = genericLiftEq @@ -240,7 +240,7 @@ instance Evaluatable And where cond <- a ifthenelse cond b (pure cond) -data Not a = Not { term :: a } +newtype Not a = Not { term :: a } deriving (Declarations1, Diffable, Eq, Foldable, FreeVariables1, Functor, Generic1, Hashable1, Mergeable, Ord, Show, ToJSONFields1, Traversable, Named1, Message1) instance Eq1 Not where liftEq = genericLiftEq diff --git a/src/Data/Term.hs b/src/Data/Term.hs index 98d1f9469..320f2478c 100644 --- a/src/Data/Term.hs +++ b/src/Data/Term.hs @@ -83,9 +83,9 @@ instance (Show1 f, Show a) => Show (Term f a) where showsPrec = showsPrec1 instance Message1 f => Message (Term f ()) where - encodeMessage num (Term (In _ f)) = Encode.embedded num (liftEncodeMessage encodeMessage (fromInteger 1) f) - decodeMessage num = termIn () . fromMaybe undefined <$> Decode.at (Decode.embedded (liftDecodeMessage decodeMessage (fromInteger 1))) num - dotProto _ = [ DotProtoMessageField (DotProtoField (fromInteger 1) (Prim (Named (Single "Syntax"))) (Single "syntax") [] Nothing) ] + encodeMessage num (Term (In _ f)) = Encode.embedded num (liftEncodeMessage encodeMessage 1 f) + decodeMessage num = termIn () . fromMaybe undefined <$> Decode.at (Decode.embedded (liftDecodeMessage decodeMessage 1)) num + dotProto _ = [ DotProtoMessageField (DotProtoField 1 (Prim (Named (Single "Syntax"))) (Single "syntax") [] Nothing) ] instance Named (Term f a) where nameOf _ = "Term"