1
1
mirror of https://github.com/github/semantic.git synced 2025-01-06 23:46:21 +03:00
semantic/src/Language.hs

17 lines
355 B
Haskell
Raw Normal View History

2016-02-11 01:30:14 +03:00
module Language where
2016-02-11 01:32:11 +03:00
import Data.Text
2016-02-11 01:30:14 +03:00
-- | A programming language.
data Language =
C
| JavaScript
2016-02-11 01:32:11 +03:00
-- | Returns a Language based on the file extension (including the ".").
languageForType :: Text -> Maybe Language
languageForType mediaType = case mediaType of
".h" -> Just C
".c" -> Just C
".js" -> Just JavaScript
_ -> Nothing