aboutsummaryrefslogtreecommitdiffstats
path: root/app/Comment
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-14 07:10:03 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-14 07:10:03 +0100
commit11284c7c12c44e12de1cfc712c0391d5ee32a9f2 (patch)
tree553a527ff19f5ef105cbc2f026284e75fa5900db /app/Comment
parentc8ab97e77c8ab56b9835d9f260dc222a10e9b3c6 (diff)
parent09e26c37de7e7227d856ffe15c9554af36b50c58 (diff)
Merge remote-tracking branch 'origin/feature/review'main
Diffstat (limited to 'app/Comment')
-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