diff --git a/src/Core/Parse.y b/src/Core/Parse.y index a2f8496..129fb77 100644 --- a/src/Core/Parse.y +++ b/src/Core/Parse.y @@ -95,7 +95,14 @@ ScDef :: { ScDef Name } ScDef : Var ParList '=' Expr { ScDef $1 $2 $4 } Type :: { Type } -Type : Var { TyInt } +Type : Type1 { $1 } + +Type1 :: { Type } +Type1 : '(' Type ')' { $2 } + | Type1 '->' Type { $1 :-> $3 } + -- do we want to use Var instead, permitting symbolic type vars? + | varname { TyVar $1 } + | conname { TyCon $1 } ParList :: { [Name] } ParList : Var ParList { $1 : $2 } diff --git a/src/Core/Syntax.hs b/src/Core/Syntax.hs index 8f20599..46179ca 100644 --- a/src/Core/Syntax.hs +++ b/src/Core/Syntax.hs @@ -139,9 +139,6 @@ instance IsString (Expr b) where instance IsString Type where fromString = TyVar -instance Semigroup (Program b) where - (<>) = coerce $ (<>) @[ScDef b] - instance (Hashable b) => Semigroup (Program b) where (<>) = undefined