From f145782dfed6c9af5e18946a34ec76fff8d76109 Mon Sep 17 00:00:00 2001 From: Rick Winfrey Date: Tue, 19 Sep 2017 15:33:30 -0700 Subject: [PATCH] Add Type.Slice constructor --- src/Data/Syntax/Type.hs | 6 ++++++ src/Language/Go/Syntax.hs | 1 + 2 files changed, 7 insertions(+) diff --git a/src/Data/Syntax/Type.hs b/src/Data/Syntax/Type.hs index 0c25883d8..e92f8d66e 100644 --- a/src/Data/Syntax/Type.hs +++ b/src/Data/Syntax/Type.hs @@ -42,3 +42,9 @@ newtype SendChannel a = SendChannel { sendChannelElementType :: a } instance Eq1 SendChannel where liftEq = genericLiftEq instance Show1 SendChannel where liftShowsPrec = genericLiftShowsPrec + +newtype Slice a = Slice { sliceElementType :: a } + deriving (Diffable, Eq, Foldable, Functor, GAlign, Generic1, Show, Traversable) + +instance Eq1 Slice where liftEq = genericLiftEq +instance Show1 Slice where liftShowsPrec = genericLiftShowsPrec diff --git a/src/Language/Go/Syntax.hs b/src/Language/Go/Syntax.hs index 76b0116d8..fb37947ad 100644 --- a/src/Language/Go/Syntax.hs +++ b/src/Language/Go/Syntax.hs @@ -49,6 +49,7 @@ type Syntax = , Type.BiDirectionalChannel , Type.ReceiveChannel , Type.SendChannel + , Type.Slice , [] ]