1{-# OPTIONS_GHC -Wall #-}
2{-# LANGUAGE OverloadedStrings #-}
3module Elm.Compiler.Module
17 , ModuleName.Canonical(..)
22import qualified Data.Char as Char
23import qualified Data.List as List
24import qualified Data.Text as Text
25import System.FilePath ((</>))
27import qualified AST.Module.Name as ModuleName
28import qualified Elm.Interface as I
29import qualified Elm.Name as N
30import qualified Json.Decode as Decode
31import qualified Json.Encode as Encode
41nameToString :: Raw -> String
46nameToSlashPath :: Raw -> FilePath
48 List.foldl1 (</>) (map Text.unpack (Text.splitOn "." (N.toText name)))
51nameToHyphenPath :: Raw -> FilePath
52nameToHyphenPath name =
53 Text.unpack (Text.replace "." "-" (N.toText name))
60encode :: Raw -> Encode.Value
65decoder :: Decode.Decoder Text.Text Raw
68 let chunks = Text.splitOn "." txt
69 if all isGoodChunk chunks
70 then Decode.succeed (N.fromText txt)
74isGoodChunk :: Text.Text -> Bool
76 case Text.uncons chunk of
81 Char.isUpper first && Text.all isGoodChar rest
84isGoodChar :: Char -> Bool
86 Char.isAlphaNum char || char == '_'
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