1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Elm.Compiler.Module
19 , ModuleName.Canonical(..)
24import qualified Data.Char as Char
25import qualified Data.List as List
26import qualified Data.Text as Text
27import System.FilePath ((</>))
29import qualified AST.Module.Name as ModuleName
30import qualified Elm.Interface as I
31import qualified Elm.Name as N
32import qualified Json.Decode as Decode
33import qualified Json.Encode as Encode
43nameToPath :: Raw -> FilePath
45 List.foldl1 (</>) (map Text.unpack (Text.splitOn "." name))
48nameToString :: Raw -> String
53nameFromText :: Text.Text -> Maybe Raw
58hyphenate :: Raw -> Text.Text
60 Text.replace "." "-" name
63dehyphenate :: Text.Text -> Maybe Raw
68fromText :: Char -> Text.Text -> Maybe Raw
72 Text.splitOn (Text.singleton sep) name
74 if all isGoodChunk chunks then Just name else Nothing
77isGoodChunk :: Text.Text -> Bool
79 case Text.uncons chunk of
84 Char.isUpper first && Text.all isGoodChar rest
87isGoodChar :: Char -> Bool
89 Char.isAlphaNum char || char == '_'
96encode :: Raw -> Encode.Value
101decoder :: Decode.Decoder Text.Text Raw
103 do txt <- Decode.text
104 case nameFromText txt of
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list