File tree 1 file changed +7
-5
lines changed
dhall-lsp-server/src/Dhall/LSP
1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -7,26 +7,28 @@ module Dhall.LSP.Util (
7
7
unlines'
8
8
) where
9
9
10
- import Data.List.NonEmpty
11
- import Data.Text
10
+ import Data.List.NonEmpty (NonEmpty (.. ))
11
+ import Data.Text (Text )
12
+
13
+ import qualified Data.Text as Text
12
14
13
15
-- | Shorthand for @pack . show@. Useful since we are mostly working with Text
14
16
-- rather than String.
15
17
tshow :: Show a => a -> Text
16
- tshow = pack . show
18
+ tshow = Text. pack . show
17
19
18
20
-- | A variant of @Data.Text.lines@ that does not swallow the last empty. Always
19
21
-- returns at least the empty line!
20
22
lines' :: Text -> NonEmpty Text
21
23
lines' text =
22
- case split (== ' \n ' ) text of
24
+ case Text. split (== ' \n ' ) text of
23
25
[] -> " " :| [] -- this case never occurs!
24
26
l : ls -> l :| ls
25
27
26
28
-- | A variant of @Data.Text.unlines@ that is the exact inverse to @lines'@ (and
27
29
-- vice-versa).
28
30
unlines' :: [Text ] -> Text
29
- unlines' = intercalate " \n "
31
+ unlines' = Text. intercalate " \n "
30
32
31
33
rightToMaybe :: Either a b -> Maybe b
32
34
rightToMaybe (Right b) = Just b
You can’t perform that action at this time.
0 commit comments