Skip to content

Commit 87db086

Browse files
author
Serhii Khoma
committed
feat: update to purs 0.14
1 parent 99033aa commit 87db086

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Language/PS/CST/Printers.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ printModule (Module { moduleName, imports, exports, declarations }) =
3131
, printDeclarations declarations
3232
] <> break
3333

34-
printDeclarations :: Array (Declaration) -> Doc Void
34+
printDeclarations :: Array Declaration -> Doc Void
3535
printDeclarations declarations = printAndConditionallyAddNewlinesBetween shouldBeNoNewlineBetweenDeclarations printDeclaration declarations
3636

3737
printComments :: Comments -> Doc Void

src/Language/PS/CST/Printers/Utils.purs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,19 @@ module Language.PS.CST.Printers.Utils where
33
import Prelude
44

55
import Data.Array.NonEmpty (NonEmptyArray)
6-
import Data.Either (fromRight)
76
import Data.Foldable (class Foldable)
87
import Data.List (List(..), (:))
98
import Data.List (fromFoldable) as List
109
import Data.Maybe (Maybe(..))
1110
import Data.Newtype (class Newtype, unwrap)
12-
import Data.String.Regex (Regex, regex)
11+
import Data.String.Regex (Regex)
1312
import Data.String.Regex as Regex
13+
import Data.String.Regex.Unsafe as Regex
1414
import Data.String.Regex.Flags as RegexFlags
1515
import Dodo (Doc, bothNotEmpty, break, enclose, encloseEmptyAlt, flexAlt, flexGroup, foldWithSeparator, indent, softBreak, space, spaceBreak, text, (<+>))
1616
import Language.PS.CST.ReservedNames (appendUnderscoreIfReserved, isReservedName)
1717
import Language.PS.CST.Types.Declaration (Declaration(..), Expr(..), InstanceBinding(..), LetBinding(..))
1818
import Language.PS.CST.Types.Leafs (Label(..), ModuleName(..), ProperName, ProperNameType_ConstructorName)
19-
import Partial.Unsafe (unsafePartial)
2019

2120
-- | >>> dquotes "·"
2221
-- "·"
@@ -107,7 +106,7 @@ labelNeedsQuotes (Label name) =
107106

108107
unquotedLabelRegex :: Regex
109108
unquotedLabelRegex =
110-
unsafePartial $ fromRight $ regex "^[a-z][A-Za-z0-9_]*$" RegexFlags.noFlags
109+
Regex.unsafeRegex "^[a-z][A-Za-z0-9_]*$" RegexFlags.noFlags
111110

112111
unwrapText :: forall a. Newtype a String => a -> Doc Void
113112
unwrapText = text <<< appendUnderscoreIfReserved <<< unwrap

0 commit comments

Comments
 (0)