aboutsummaryrefslogtreecommitdiffstats
path: root/app/Comment/Language.hs
diff options
context:
space:
mode:
Diffstat (limited to 'app/Comment/Language.hs')
-rw-r--r--app/Comment/Language.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/Comment/Language.hs b/app/Comment/Language.hs
index 7a9963f..3f8c7a4 100644
--- a/app/Comment/Language.hs
+++ b/app/Comment/Language.hs
@@ -25,9 +25,13 @@ newtype Language = Language {languageKey :: L.LanguageKey}
deriving (Eq, Show, Generic)
deriving newtype (Binary)
-fromPath :: FilePath -> N.NonEmpty Language
+-- TODO Support amiguous file languages
+--
+-- @backlog
+fromPath :: FilePath -> Language
fromPath fp =
- fromMaybe (throw $ E.UnknownFile fp)
+ N.head
+ . fromMaybe (throw $ E.UnknownFile fp)
. N.nonEmpty
. map (Language . L.languageName)
$ L.languagesForPath fp