From e3f95eb9a8b6978ffc2ff2b460e70f1c38cd17a7 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Fri, 19 May 2017 12:09:49 -0400 Subject: [PATCH] Define Language as a GADT. --- src/Language.hs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Language.hs b/src/Language.hs index b0d0e19bb..cf38f7207 100644 --- a/src/Language.hs +++ b/src/Language.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE DataKinds #-} +{-# LANGUAGE DataKinds, GADTs #-} module Language where import Data.Record @@ -9,12 +9,12 @@ import qualified Syntax as S import Term -- | A programming language. -data Language = - C - | Go - | Markdown - | Ruby - | TypeScript -- ^ Also JavaScript. +data Language where + C :: Language + Go :: Language + Markdown :: Language + Ruby :: Language + TypeScript :: Language -- ^ Also JavaScript. deriving (Show, Eq, Read) -- | Returns a Language based on the file extension (including the ".").