From 44f9a11a623c772f27bc2ea1be0744835643c6d0 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Wed, 25 Sep 2019 11:48:07 -0400 Subject: [PATCH] Define a helper to look up the mode for a given language. --- src/Data/Language.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Data/Language.hs b/src/Data/Language.hs index a93e3469d..21b81ef84 100644 --- a/src/Data/Language.hs +++ b/src/Data/Language.hs @@ -12,6 +12,7 @@ module Data.Language , languageToText , PerLanguageModes(..) , LanguageMode(..) + , modeForLanguage ) where import Data.Aeson @@ -150,3 +151,8 @@ data LanguageMode = ALaCarte | Precise deriving (Bounded, Enum, Eq, Ord, Read, Show) + +modeForLanguage :: PerLanguageModes -> Language -> LanguageMode +modeForLanguage modes = \case + Python -> pythonMode modes + _ -> ALaCarte