From 2ce1ca3ecafb36a0d91f19923eaf4a73ce4b821e Mon Sep 17 00:00:00 2001 From: Brian Huffman Date: Thu, 21 Sep 2017 13:21:51 -0700 Subject: [PATCH] Change constraint synonym syntax from "constraint" to "type constraint". For example: type constraint NonZero n = (fin n, 1 <= n) last : {n, a} NonZero n => [n]a -> a last xs = xs!0 --- src/Cryptol/Parser.y | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Cryptol/Parser.y b/src/Cryptol/Parser.y index c58f58b1..c8d74257 100644 --- a/src/Cryptol/Parser.y +++ b/src/Cryptol/Parser.y @@ -298,10 +298,10 @@ decl :: { Decl PName } | 'type' name tysyn_params '=' type {% at ($1,$5) `fmap` mkTySyn $2 (reverse $3) $5 } - | 'constraint' name '=' type - {% at ($1,$4) `fmap` mkPropSyn $2 [] $4 } - | 'constraint' name tysyn_params '=' type - {% at ($1,$5) `fmap` mkPropSyn $2 (reverse $3) $5 } + | 'type' 'constraint' name '=' type + {% at ($2,$5) `fmap` mkPropSyn $3 [] $5 } + | 'type' 'constraint' name tysyn_params '=' type + {% at ($2,$6) `fmap` mkPropSyn $3 (reverse $4) $6 } | 'infixl' NUM ops {% mkFixity LeftAssoc $2 (reverse $3) } | 'infixr' NUM ops {% mkFixity RightAssoc $2 (reverse $3) }