avh4 / elm-format

elm-format formats Elm source code according to a standard set of rules based on the official Elm Style Guide
BSD 3-Clause "New" or "Revised" License
1.31k stars 145 forks source link

Remaining differences with `elm/core` #650

Open rlefevre opened 4 years ago

rlefevre commented 4 years ago

In the spirit of targeting 1.0 being used in core libraries, I did a diff with elm/core using Allow single-line if expressions and Allow single-line case-expressions branches to see if there are major differences that could require some remaining discussion.

As elm/core seems to mix indentations of 2 spaces vs 4 spaces, uses [1, 2, 3] syntax for lists/tuples instead of [ 1, 2, 3 ], and does not always put the same blank lines, here is the git diff result using git diff --ignore-all-space --ignore-blank-lines | grep -v '^\+$':

diff --git a/src/Array.elm b/src/Array.elm
index 8c18060..c44784b 100644
--- a/src/Array.elm
+++ b/src/Array.elm
@@ -1,47 +1,45 @@
-module Array
-    exposing
+module Array exposing
     ( Array
-        , empty
-        , isEmpty
-        , length
-        , initialize
-        , repeat
-        , fromList
-        , get
-        , set
-        , push
-        , toList
-        , toIndexedList
-        , foldr
-        , foldl
-        , filter
-        , map
-        , indexedMap
-        , append
-        , slice
+    , empty, initialize, repeat, fromList
+    , isEmpty, length, get
+    , set, push, append, slice
+    , toList, toIndexedList
+    , map, indexedMap, foldl, foldr, filter
     )

 {-| Fast immutable arrays. The elements in an array must have the same type.

 # Arrays
 @docs Array

 # Creation
 @docs empty, initialize, repeat, fromList

 # Query
 @docs isEmpty, length, get

 # Manipulate
 @docs set, push, append, slice

 # Lists
 @docs toList, toIndexedList

 # Transform
 @docs map, indexedMap, foldl, foldr, filter
--}

+-}

 import Basics exposing (..)
 import Bitwise
@@ -501,7 +531,8 @@ foldl func baseCase (Array_elm_builtin _ _ tree tail) =

 {-| Keep elements that pass the test.

-    filter isEven (fromList [1,2,3,4,5,6]) == (fromList [2,4,6])
+    filter isEven (fromList [ 1, 2, 3, 4, 5, 6 ]) == fromList [ 2, 4, 6 ]
 -}
 filter : (a -> Bool) -> Array a -> Array a
 filter isGood array =
@@ -608,7 +643,7 @@ appendHelpTree toAppend ((Array_elm_builtin len _ tree tail) as array) =
             JsArray.length toAppend

         notAppended =
-            branchFactor - (JsArray.length tail) - itemsToAppend
+            branchFactor - JsArray.length tail - itemsToAppend

         newArray =
             unsafeReplaceTail appended array
@@ -633,7 +669,7 @@ appendHelpBuilder tail builder =
             JsArray.length tail

         notAppended =
-            branchFactor - (JsArray.length builder.tail) - tailLen
+            branchFactor - JsArray.length builder.tail - tailLen
     in
     if notAppended < 0 then
         { tail = JsArray.slice notAppended tailLen tail
@@ -972,7 +1035,7 @@ treeFromBuilder : List (Node a) -> Int -> Tree a
 treeFromBuilder nodeList nodeListSize =
     let
         newNodeSize =
-            ((toFloat nodeListSize) / (toFloat branchFactor))
+            (toFloat nodeListSize / toFloat branchFactor)
                 |> ceiling
     in
     if newNodeSize == 1 then
@@ -994,7 +1058,7 @@ compressNodes nodes acc =
             JsArray.initializeFromList branchFactor nodes

         newAcc =
-            (SubTree node) :: acc
+            SubTree node :: acc
     in
     case remainingNodes of
         [] ->
diff --git a/src/Basics.elm b/src/Basics.elm
index 0c734aa..34482f1 100644
--- a/src/Basics.elm
+++ b/src/Basics.elm
@@ -1,14 +1,13 @@
 module Basics exposing
-  ( Int, Float
-  , (+), (-), (*), (/), (//), (^)
+    ( Int, Float, (+), (-), (*), (/), (//), (^)
     , toFloat, round, floor, ceiling, truncate
     , (==), (/=)
     , (<), (>), (<=), (>=), max, min, compare, Order(..)
     , Bool(..), not, (&&), (||), xor
     , (++)
     , modBy, remainderBy, negate, abs, clamp, sqrt, logBase, e
-  , pi, cos, sin, tan, acos, asin, atan, atan2
     , degrees, radians, turns
+    , pi, cos, sin, tan, acos, asin, atan, atan2
     , toPolar, fromPolar
     , isNaN, isInfinite
     , identity, always, (<|), (|>), (<<), (>>), Never, never
@@ -96,10 +117,14 @@ infix right 9 (>>) = composeR
 {-| An `Int` is a whole number. Valid syntax for integers includes:

     0
     42
     9000
     0xFF -- 255 in hexadecimal
-    0x000A --  10 in hexadecimal
+    0x0A --  10 in hexadecimal

 **Note:** `Int` math is well-defined in the range `-2^31` to `2^31 - 1`. Outside
 of that range, the behavior is determined by the compilation target. When
@@ -108,7 +133,7 @@ operations, but if we generate WebAssembly some day, we would do the traditional
 [integer overflow][io]. This quirk is necessary to get good performance on
 quirky compilation targets.

-**Historical Note:** The name `Int` comes from the term [integer][]. It appears
+**Historical Note:** The name `Int` comes from the term [integer]. It appears
 that the `int` abbreviation was introduced in [ALGOL 68][68], shortening it
 from `integer` in [ALGOL 60][60]. Today, almost all programming languages use
 this abbreviation.
@@ -117,8 +142,10 @@ this abbreviation.
 [integer]: https://en.wikipedia.org/wiki/Integer
 [60]: https://en.wikipedia.org/wiki/ALGOL_60
 [68]: https://en.wikipedia.org/wiki/ALGOL_68
 -}
-type Int = Int -- NOTE: The compiler provides the real implementation.
+type Int
+    = Int -- NOTE: The compiler provides the real implementation.

 {-| A `Float` is a [floating-point number][fp]. Valid syntax for floats includes:
@@ -140,8 +167,10 @@ compatible with any widely-used assembly language.

 [fp]: https://en.wikipedia.org/wiki/Floating-point_arithmetic
 [ieee]: https://en.wikipedia.org/wiki/IEEE_754
 -}
-type Float = Float -- NOTE: The compiler provides the real implementation.
+type Float
+    = Float -- NOTE: The compiler provides the real implementation.

 {-| Add two numbers. The `number` type variable means this operation can be
@@ -191,13 +225,22 @@ mul =
 {-| Floating-point division:

     10 / 4 == 2.5
     11 / 4 == 2.75
     12 / 4 == 3
     13 / 4 == 3.25
-    14 / 4 == 3.5

-    -1 / 4 == -0.25
-    -5 / 4 == -1.25
+    14
+        / 4
+        == 3.5
+        - 1
+        / 4
+        == -0.25
+        - 5
+        / 4
+        == -1.25

 -}
 fdiv : Float -> Float -> Float
@@ -208,13 +251,22 @@ fdiv =
 {-| Integer division:

     10 // 4 == 2
     11 // 4 == 2
     12 // 4 == 3
     13 // 4 == 3
-    14 // 4 == 3

-    -1 // 4 == 0
-    -5 // 4 == -1
+    14
+        // 4
+        == 3
+        - 1
+        // 4
+        == 0
+        - 5
+        // 4
+        == -1

 Notice that the remainder is discarded, so `3 // 4` is giving output
 similar to `truncate (3 / 4)`.
@@ -331,7 +410,7 @@ objects.

 **Note:** Equality (in the Elm sense) is not possible for certain types. For
 example, the functions `(\n -> n + 1)` and `(\n -> 1 + n)` are &ldquo;the
-same&rdquo; but detecting this in general is [undecidable][]. In a future
+same&rdquo; but detecting this in general is [undecidable]. In a future
 release, the compiler will detect when `(==)` is used with problematic
 types and provide a helpful error message. This will require quite serious
 infrastructure work that makes sense to batch with another big project, so the
@@ -419,7 +507,10 @@ compare =
 {-| Represents the relative ordering of two things.
 The relations are less than, equal to, and greater than.
 -}
-type Order = LT | EQ | GT
+type Order
+    = LT
+    | EQ
+    | GT

@@ -436,8 +527,11 @@ from Richard [here][rt].
 [ut]: https://guide.elm-lang.org/types/union_types.html
 [jf]: https://youtu.be/6TDKHGtAxeg?t=1m25s
 [rt]: https://youtu.be/IcgmSRJHu_8?t=1m14s
 -}
-type Bool = True | False
+type Bool
+    = True
+    | False

 {-| Negate a boolean value.
@@ -796,7 +950,7 @@ toPolar ( x, y ) =

 {-| Determine whether a float is an undefined or unrepresentable number.
-NaN stands for *not a number* and it is [a standardized part of floating point
+NaN stands for _not a number_ and it is [a standardized part of floating point
 numbers](https://en.wikipedia.org/wiki/NaN).

     isNaN (0 / 0) == True
@@ -910,7 +1075,7 @@ identity x =
     x

-{-| Create a function that *always* returns the same value. Useful with
+{-| Create a function that _always_ returns the same value. Useful with
 functions like `map`:

     List.map (always 0) [1,2,3,4,5] == [0,0,0,0,0]
@@ -936,17 +1102,19 @@ So there cannot be any event handlers on that HTML.

 You may also see this used with tasks that never fail, like `Task Never ()`.

-The `Never` type is useful for restricting *arguments* to a function. Maybe my
+The `Never` type is useful for restricting _arguments_ to a function. Maybe my
 API can only accept HTML without event handlers, so I require `Html Never` and
 users can give `Html msg` and everything will go fine. Generally speaking, you
 do not want `Never` in your return types though.
 -}
-type Never = JustOneMore Never
+type Never
+    = JustOneMore Never

 {-| A function that can never be called. Seems extremely pointless, but it
-*can* come in handy. Imagine you have some HTML that should never produce any
-messages. And say you want to use it in some other HTML that *does* produce
+_can_ come in handy. Imagine you have some HTML that should never produce any
+messages. And say you want to use it in some other HTML that _does_ produce
 messages. You could say:

     import Html exposing (..)
diff --git a/src/Bitwise.elm b/src/Bitwise.elm
index bd488fc..e7d25fe 100644
--- a/src/Bitwise.elm
+++ b/src/Bitwise.elm
@@ -5,13 +5,17 @@ module Bitwise exposing

 {-| Library for [bitwise operations](https://en.wikipedia.org/wiki/Bitwise_operation).

 # Basic Operations
 @docs and, or, xor, complement

 # Bit Shifts
 @docs shiftLeftBy, shiftRightBy, shiftRightZfBy
--}

+-}

 import Basics exposing (Int)
 import Elm.Kernel.Bitwise
diff --git a/src/Char.elm b/src/Char.elm
index 059c75a..c3adac6 100644
--- a/src/Char.elm
+++ b/src/Char.elm
@@ -9,23 +9,34 @@ module Char exposing
 {-| Functions for working with characters. Character literals are enclosed in
 `'a'` pair of single quotes.

 # Characters
 @docs Char

 # ASCII Letters
 @docs isUpper, isLower, isAlpha, isAlphaNum

 # Digits
 @docs isDigit, isOctDigit, isHexDigit

 # Conversion
 @docs toUpper, toLower, toLocaleUpper, toLocaleLower

 # Unicode Code Points
 @docs toCode, fromCode
 -}

-import Basics exposing (Bool, Int, (&&), (||), (>=), (<=))
+import Basics exposing ((&&), (<=), (>=), (||), Bool, Int)
 import Elm.Kernel.Char

@@ -44,9 +61,12 @@ import Elm.Kernel.Char
     'πŸ™ˆ'

     '\t'
-    '\"'
+    '"'
     '\''
-    '\u{1F648}' -- 'πŸ™ˆ'
+    'πŸ™ˆ' -- 'πŸ™ˆ'

 **Note 1:** You _cannot_ use single quotes around multiple characters like in
 JavaScript. This is how we distinguish [`String`](String#String) and `Char`
@@ -58,8 +78,10 @@ characters directly. Using the escapes can be better if you need one of the
 many whitespace characters with different widths.

 [u]: https://en.wikipedia.org/wiki/Unicode
 -}
-type Char = Char -- NOTE: The compiler provides the real implementation.
+type Char
+    = Char -- NOTE: The compiler provides the real implementation.

@@ -69,14 +91,20 @@ type Char = Char -- NOTE: The compiler provides the real implementation.
 {-| Detect upper case ASCII characters.

     isUpper 'A' == True
-    isUpper 'B' == True
-    ...
-    isUpper 'Z' == True
+    isUpper 'B'
+        == True
+        ... isUpper 'Z'
+        == True

     isUpper '0' == False
     isUpper 'a' == False
     isUpper '-' == False
     isUpper 'Ξ£' == False
 -}
 isUpper : Char -> Bool
 isUpper char =
@@ -90,14 +118,20 @@ isUpper char =
 {-| Detect lower case ASCII characters.

     isLower 'a' == True
-    isLower 'b' == True
-    ...
-    isLower 'z' == True
+    isLower 'b'
+        == True
+        ... isLower 'z'
+        == True

     isLower '0' == False
     isLower 'A' == False
     isLower '-' == False
     isLower 'Ο€' == False
 -}
 isLower : Char -> Bool
 isLower char =
@@ -144,13 +191,18 @@ isAlphaNum char =
 {-| Detect digits `0123456789`

     isDigit '0' == True
-    isDigit '1' == True
-    ...
-    isDigit '9' == True
+    isDigit '1'
+        == True
+        ... isDigit '9'
+        == True

     isDigit 'a' == False
     isDigit 'b' == False
     isDigit 'A' == False
 -}
 isDigit : Char -> Bool
 isDigit char =
@@ -164,13 +216,18 @@ isDigit char =
 {-| Detect octal digits `01234567`

     isOctDigit '0' == True
-    isOctDigit '1' == True
-    ...
-    isOctDigit '7' == True
+    isOctDigit '1'
+        == True
+        ... isOctDigit '7'
+        == True

     isOctDigit '8' == False
     isOctDigit 'a' == False
     isOctDigit 'A' == False
 -}
 isOctDigit : Char -> Bool
 isOctDigit char =
@@ -198,25 +255,29 @@ isHexDigit char =
 -- CONVERSIONS

-{-| Convert to upper case. -}
+{-| Convert to upper case.
+-}
 toUpper : Char -> Char
 toUpper =
     Elm.Kernel.Char.toUpper

-{-| Convert to lower case. -}
+{-| Convert to lower case.
+-}
 toLower : Char -> Char
 toLower =
     Elm.Kernel.Char.toLower

-{-| Convert to upper case, according to any locale-specific case mappings. -}
+{-| Convert to upper case, according to any locale-specific case mappings.
+-}
 toLocaleUpper : Char -> Char
 toLocaleUpper =
     Elm.Kernel.Char.toLocaleUpper

-{-| Convert to lower case, according to any locale-specific case mappings. -}
+{-| Convert to lower case, according to any locale-specific case mappings.
+-}
 toLocaleLower : Char -> Char
 toLocaleLower =
     Elm.Kernel.Char.toLocaleLower
@@ -227,10 +288,15 @@ toLocaleLower =
 [cp]: https://en.wikipedia.org/wiki/Code_point

     toCode 'A' == 65
     toCode 'B' == 66
     toCode '木' == 0x6728
-    toCode 'πŒ†' == 0x1D306
-    toCode 'πŸ˜ƒ' == 0x1F603
+    toCode 'πŒ†' == 0x0001D306
+    toCode 'πŸ˜ƒ' == 0x0001F603
 -}
 toCode : Char -> Int
 toCode =
@@ -240,10 +306,15 @@ toCode =
 {-| Convert a Unicode [code point][cp] to a character.

     fromCode 65 == 'A'
     fromCode 66 == 'B'
     fromCode 0x6728 == '木'
-    fromCode 0x1D306 == 'πŒ†'
-    fromCode 0x1F603 == 'πŸ˜ƒ'
+    fromCode 0x0001D306 == 'πŒ†'
+    fromCode 0x0001F603 == 'πŸ˜ƒ'
     fromCode -1 == 'οΏ½'

 The full range of unicode is from `0` to `0x10FFFF`. With numbers outside that
diff --git a/src/Debug.elm b/src/Debug.elm
index cb8e32f..fdaae09 100644
--- a/src/Debug.elm
+++ b/src/Debug.elm
@@ -1,16 +1,14 @@
-module Debug exposing
-  ( toString
-  , log
-  , todo
-  )
+module Debug exposing (toString, log, todo)

 {-| This module can be useful while _developing_ an application. It is not
 available for use in packages or production.

 # Debugging
 @docs toString, log, todo
--}

+-}

 import Elm.Kernel.Debug
 import String exposing (String)
diff --git a/src/Dict.elm b/src/Dict.elm
index 3f80842..3d130d6 100644
--- a/src/Dict.elm
+++ b/src/Dict.elm
@@ -11,39 +11,50 @@ module Dict exposing
 type. This includes `Int`, `Float`, `Time`, `Char`, `String`, and tuples or
 lists of comparable types.

-Insert, remove, and query operations all take *O(log n)* time.
+Insert, remove, and query operations all take _O(log n)_ time.

 # Dictionaries
 @docs Dict

 # Build
 @docs empty, singleton, insert, update, remove

 # Query
 @docs isEmpty, member, get, size

 # Lists
 @docs keys, values, toList, fromList

 # Transform
 @docs map, foldl, foldr, filter, partition

 # Combine
 @docs union, intersect, diff, merge

 -}

-
 import Basics exposing (..)
-import Maybe exposing (..)
 import List exposing (..)
+import Maybe exposing (..)

 -- DICTIONARIES
+-- The color of a node. Leaves are considered Black.

--- The color of a node. Leaves are considered Black.
 type NColor
     = Red
     | Black
@@ -74,7 +86,8 @@ type Dict k v
     | RBEmpty_elm_builtin

-{-| Create an empty dictionary. -}
+{-| Create an empty dictionary.
+-}
 empty : Dict k v
 empty =
     RBEmpty_elm_builtin
@@ -109,7 +122,8 @@ get targetKey dict =
                     get targetKey right

-{-| Determine if a key is in a dictionary. -}
+{-| Determine if a key is in a dictionary.
+-}
 member : comparable -> Dict comparable v -> Bool
 member key dict =
     case get key dict of
@@ -120,7 +134,8 @@ member key dict =
             False

-{-| Determine the number of key-value pairs in the dictionary. -}
+{-| Determine the number of key-value pairs in the dictionary.
+-}
 size : Dict k v -> Int
 size dict =
     sizeHelp 0 dict
@@ -151,7 +167,8 @@ isEmpty dict =

 {-| Insert a key-value pair into a dictionary. Replaces value when there is
-a collision. -}
+a collision.
+-}
 insert : comparable -> v -> Dict comparable v -> Dict comparable v
 insert key value dict =
     -- Root node is always Black
@@ -214,7 +231,8 @@ balance color key value left right =

 {-| Remove a key-value pair from a dictionary. If the key is not found,
-no changes are made. -}
+no changes are made.
+-}
 remove : comparable -> Dict comparable v -> Dict comparable v
 remove key dict =
     -- Root node is always Black
@@ -405,7 +425,8 @@ moveRedRight dict =
             dict

-{-| Update the value of a dictionary for a specific key with a given function. -}
+{-| Update the value of a dictionary for a specific key with a given function.
+-}
 update : comparable -> (Maybe v -> Maybe v) -> Dict comparable v -> Dict comparable v
 update targetKey alter dictionary =
     case alter (get targetKey dictionary) of
@@ -416,7 +437,8 @@ update targetKey alter dictionary =
             remove targetKey dictionary

-{-| Create a dictionary with one key-value pair. -}
+{-| Create a dictionary with one key-value pair.
+-}
 singleton : comparable -> v -> Dict comparable v
 singleton key value =
     -- Root node is always Black
@@ -458,9 +481,10 @@ accumulators for when a given key appears:

 You then traverse all the keys from lowest to highest, building up whatever
 you want.
 -}
-merge
-  :  (comparable -> a -> result -> result)
+merge :
+    (comparable -> a -> result -> result)
     -> (comparable -> a -> b -> result -> result)
     -> (comparable -> b -> result -> result)
     -> Dict comparable a
@@ -554,7 +580,8 @@ foldr func acc t =
             foldr func (func key value (foldr func acc right)) left

-{-| Keep only the key-value pairs that pass the given test. -}
+{-| Keep only the key-value pairs that pass the given test.
+-}
 filter : (comparable -> v -> Bool) -> Dict comparable v -> Dict comparable v
 filter isGood dict =
     foldl (\k v d -> if isGood k v then insert k v d else d) empty dict
@@ -598,13 +628,15 @@ values dict =
     foldr (\key value valueList -> value :: valueList) [] dict

-{-| Convert a dictionary into an association list of key-value pairs, sorted by keys. -}
+{-| Convert a dictionary into an association list of key-value pairs, sorted by keys.
+-}
 toList : Dict k v -> List ( k, v )
 toList dict =
     foldr (\key value list -> ( key, value ) :: list) [] dict

-{-| Convert an association list into a dictionary. -}
+{-| Convert an association list into a dictionary.
+-}
 fromList : List ( comparable, v ) -> Dict comparable v
 fromList assocs =
     List.foldl (\( key, value ) dict -> insert key value dict) empty assocs
diff --git a/src/Elm/JsArray.elm b/src/Elm/JsArray.elm
index 4007623..a29d4c7 100644
--- a/src/Elm/JsArray.elm
+++ b/src/Elm/JsArray.elm
@@ -1,20 +1,9 @@
-module Elm.JsArray
-    exposing
+module Elm.JsArray exposing
     ( JsArray
-        , empty
-        , singleton
-        , length
-        , initialize
-        , initializeFromList
-        , unsafeGet
-        , unsafeSet
-        , push
-        , foldl
-        , foldr
-        , map
-        , indexedMap
-        , slice
-        , appendN
+    , empty, singleton, initialize
+    , length, unsafeGet, unsafeSet, push
+    , foldl, foldr, map, slice
+    , appendN, indexedMap, initializeFromList
     )

 {-| This library provides an immutable version of native javascript arrays.
diff --git a/src/List.elm b/src/List.elm
index 9ef2b17..2542dce 100644
--- a/src/List.elm
+++ b/src/List.elm
@@ -56,9 +67,10 @@ singleton value =
     [ value ]

-{-| Create a list with *n* copies of a value:
+{-| Create a list with _n_ copies of a value:

     repeat 3 ( 0, 0 ) == [ ( 0, 0 ), ( 0, 0 ), ( 0, 0 ) ]
 -}
 repeat : Int -> a -> List a
 repeat n value =
@@ -98,10 +113,12 @@ rangeHelp lo hi list =
 {-| Add an element to the front of a list.

     1 :: [ 2, 3 ] == [ 1, 2, 3 ]
     1 :: [] == [ 1 ]

-This operator is pronounced *cons* for historical reasons, but you can think
+This operator is pronounced _cons_ for historical reasons, but you can think
 of it like pushing an entry onto a stack.
 -}
 cons : a -> List a -> List a
 cons =
@@ -555,9 +611,10 @@ tail list =
             Nothing

-{-| Take the first *n* members of a list.
+{-| Take the first _n_ members of a list.

     take 2 [ 1, 2, 3, 4 ] == [ 1, 2 ]
 -}
 take : Int -> List a -> List a
 take n list =
@@ -609,9 +670,10 @@ takeReverse n list kept =
                 takeReverse (n - 1) xs (cons x kept)

-{-| Drop the first *n* members of a list.
+{-| Drop the first _n_ members of a list.

     drop 2 [ 1, 2, 3, 4 ] == [ 3, 4 ]
 -}
 drop : Int -> List a -> List a
 drop n list =
diff --git a/src/Maybe.elm b/src/Maybe.elm
index 7cb5a5b..4de1463 100644
--- a/src/Maybe.elm
+++ b/src/Maybe.elm
@@ -1,23 +1,28 @@
 module Maybe exposing
     ( Maybe(..)
+    , withDefault, map, map2, map3, map4, map5
     , andThen
-  , map, map2, map3, map4, map5
-  , withDefault
     )

 {-| This library fills a bunch of important niches in Elm. A `Maybe` can help
 you with optional arguments, error handling, and records with optional fields.

 # Definition
 @docs Maybe

 # Common Helpers
 @docs withDefault, map, map2, map3, map4, map5

 # Chaining Maybes
 @docs andThen
--}

+-}

 import Basics exposing (Bool(..))

@@ -33,8 +37,12 @@ sometimes, but does not absolutely need it.
         , age : Maybe Int
         }

-    tom = { name = "Tom", age = Just 42 }
-    sue = { name = "Sue", age = Nothing }
+    tom =
+        { name = "Tom", age = Just 42 }
+    sue =
+        { name = "Sue", age = Nothing }
 -}
 type Maybe a
     = Just a
diff --git a/src/Platform.elm b/src/Platform.elm
index aced382..a7fc236 100644
--- a/src/Platform.elm
+++ b/src/Platform.elm
@@ -19,7 +25,7 @@ module Platform exposing
 An extremely tiny portion of library authors should ever write effect managers.
 Fundamentally, Elm needs maybe 10 of them total. I get that people are smart,
 curious, etc. but that is not a substitute for a legitimate reason to make an
-effect manager. Do you have an *organic need* this fills? Or are you just
+effect manager. Do you have an _organic need_ this fills? Or are you just
 curious? Public discussions of your explorations should be framed accordingly.

 @docs Router, sendToApp, sendToSelf
@@ -39,10 +46,11 @@ import Platform.Sub exposing (Sub)
 {-| A `Program` describes an Elm program! How does it react to input? Does it
 show anything on screen? Etc.
 -}
-type Program flags model msg = Program
+type Program flags model msg
+    = Program

-{-| Create a [headless][] program with no user interface.
+{-| Create a [headless] program with no user interface.

 This is great if you want to use Elm as the &ldquo;brain&rdquo; for something
 else. For example, you could send messages out ports to modify the DOM, but do
@@ -61,9 +69,10 @@ module has a few ways to create that kind of `Program` instead!

 [headless]: https://en.wikipedia.org/wiki/Headless_software
 [browser]: /packages/elm/browser/latest/Browser
 -}
-worker
-  : { init : flags -> ( model, Cmd msg )
+worker :
+    { init : flags -> ( model, Cmd msg )
     , update : msg -> model -> ( model, Cmd msg )
     , subscriptions : model -> Sub msg
     }
@@ -80,14 +89,16 @@ worker =
 information on this. It is only defined here because it is a platform
 primitive.
 -}
-type Task err ok = Task
+type Task err ok
+    = Task

 {-| Head over to the documentation for the [`Process`](Process) module for
 information on this. It is only defined here because it is a platform
 primitive.
 -}
-type ProcessId = ProcessId
+type ProcessId
+    = ProcessId

@@ -97,8 +108,8 @@ type ProcessId = ProcessId
 {-| An effect manager has access to a β€œrouter” that routes messages between
 the main app and your individual effect manager.
 -}
-type Router appMsg selfMsg =
-  Router
+type Router appMsg selfMsg
+    = Router

 {-| Send the router a message for the main loop of your app. This message will
diff --git a/src/Platform/Cmd.elm b/src/Platform/Cmd.elm
index 8ee7683..cc4fbb2 100644
--- a/src/Platform/Cmd.elm
+++ b/src/Platform/Cmd.elm
@@ -1,14 +1,12 @@
 module Platform.Cmd exposing
-  ( Cmd
-  , none
-  , batch
+    ( Cmd, none, batch
     , map
     )

 {-|

 > **Note:** Elm has **managed effects**, meaning that things like HTTP
-> requests or writing to disk are all treated as *data* in Elm. When this
+> requests or writing to disk are all treated as _data_ in Elm. When this
 > data is given to the Elm runtime system, it can do some β€œquery optimization”
 > before actually performing the effect. Perhaps unexpectedly, this managed
 > effects idea is the heart of why Elm is so nice for testing, reuse,
@@ -43,8 +45,10 @@ messages that will come back into your application.
 ever, commands will make more sense as you work through [the Elm Architecture
 Tutorial](https://guide.elm-lang.org/architecture/) and see how they
 fit into a real application!
 -}
-type Cmd msg = Cmd
+type Cmd msg
+    = Cmd

 {-| Tell the runtime that there are no commands.
@@ -76,9 +80,10 @@ batch =
 Very similar to [`Html.map`](/packages/elm/html/latest/Html#map).

 This is very rarely useful in well-structured Elm code, so definitely read the
-section on [structure][] in the guide before reaching for this!
+section on [structure] in the guide before reaching for this!

 [structure]: https://guide.elm-lang.org/webapps/structure.html
 -}
 map : (a -> msg) -> Cmd a -> Cmd msg
 map =
diff --git a/src/Platform/Sub.elm b/src/Platform/Sub.elm
index 66f9848..bb9d9ee 100644
--- a/src/Platform/Sub.elm
+++ b/src/Platform/Sub.elm
@@ -1,14 +1,12 @@
 module Platform.Sub exposing
-  ( Sub
-  , none
-  , batch
+    ( Sub, none, batch
     , map
     )

 {-|

 > **Note:** Elm has **managed effects**, meaning that things like HTTP
-> requests or writing to disk are all treated as *data* in Elm. When this
+> requests or writing to disk are all treated as _data_ in Elm. When this
 > data is given to the Elm runtime system, it can do some β€œquery optimization”
 > before actually performing the effect. Perhaps unexpectedly, this managed
 > effects idea is the heart of why Elm is so nice for testing, reuse,
@@ -34,9 +37,9 @@ import Elm.Kernel.Platform
 interesting happens over there!” So if you want to listen for messages on a web
 socket, you would tell Elm to create a subscription. If you want to get clock
 ticks, you would tell Elm to subscribe to that. The cool thing here is that
-this means *Elm* manages all the details of subscriptions instead of *you*.
-So if a web socket goes down, *you* do not need to manually reconnect with an
-exponential backoff strategy, *Elm* does this all for you behind the scenes!
+this means _Elm_ manages all the details of subscriptions instead of _you_.
+So if a web socket goes down, _you_ do not need to manually reconnect with an
+exponential backoff strategy, _Elm_ does this all for you behind the scenes!

 Every `Sub` specifies (1) which effects you need access to and (2) the type of
 messages that will come back into your application.
@@ -45,8 +48,10 @@ messages that will come back into your application.
 ever, subscriptions will make more sense as you work through [the Elm Architecture
 Tutorial](https://guide.elm-lang.org/architecture/) and see how they fit
 into a real application!
 -}
-type Sub msg = Sub
+type Sub msg
+    = Sub

 {-| Tell the runtime that there are no subscriptions.
@@ -75,9 +81,10 @@ batch =
 Very similar to [`Html.map`](/packages/elm/html/latest/Html#map).

 This is very rarely useful in well-structured Elm code, so definitely read the
-section on [structure][] in the guide before reaching for this!
+section on [structure] in the guide before reaching for this!

 [structure]: https://guide.elm-lang.org/webapps/structure.html
 -}
 map : (a -> msg) -> Sub a -> Sub msg
 map =
diff --git a/src/Process.elm b/src/Process.elm
index 27ca23b..9c1400d 100644
--- a/src/Process.elm
+++ b/src/Process.elm
@@ -1,9 +1,4 @@
-module Process exposing
-  ( Id
-  , spawn
-  , sleep
-  , kill
-  )
+module Process exposing (Id, spawn, sleep, kill)

 {-|

@@ -45,8 +44,8 @@ longer. That’s kind of what Elm is all about.
 -}

 import Basics exposing (Float, Never)
-import Elm.Kernel.Scheduler
 import Elm.Kernel.Process
+import Elm.Kernel.Scheduler
 import Platform
 import Task exposing (Task)

@@ -56,8 +55,8 @@ get a bunch of different tasks running in different processes. The Elm runtime
 will interleave their progress. So if a task is taking too long, we will pause
 it at an `andThen` and switch over to other stuff.

-**Note:** We make a distinction between *concurrency* which means interleaving
-different sequences and *parallelism* which means running different
+**Note:** We make a distinction between _concurrency_ which means interleaving
+different sequences and _parallelism_ which means running different
 sequences at the exact same time. For example, a
 [time-sharing system](https://en.wikipedia.org/wiki/Time-sharing) is definitely
 concurrent, but not necessarily parallel. So even though JS runs within a
diff --git a/src/Result.elm b/src/Result.elm
index df944b4..c9722ed 100644
--- a/src/Result.elm
+++ b/src/Result.elm
@@ -1,9 +1,8 @@
 module Result exposing
     ( Result(..)
-  , withDefault
     , map, map2, map3, map4, map5
     , andThen
-  , toMaybe, fromMaybe, mapError
+    , withDefault, toMaybe, fromMaybe, mapError
     )

 {-| A `Result` is the result of a computation that may fail. This is a great
@@ -183,11 +199,14 @@ This means we only continue with the callback if things are going well. For
 example, say you need to use (`toInt : String -> Result String Int`) to parse
 a month and make sure it is between 1 and 12:

     toValidMonth : Int -> Result String Int
     toValidMonth month =
-        if month >= 1 && month <= 12
-            then Ok month
-            else Err "months must be between 1 and 12"
+        if month >= 1 && month <= 12 then
+            Ok month
+        else
+            Err "months must be between 1 and 12"

     toMonth : String -> Result String Int
     toMonth rawString =
diff --git a/src/Set.elm b/src/Set.elm
index 33256e6..f74e747 100644
--- a/src/Set.elm
+++ b/src/Set.elm
@@ -11,24 +11,36 @@ module Set exposing
 includes `Int`, `Float`, `Time`, `Char`, `String`, and tuples or lists
 of comparable types.

-Insert, remove, and query operations all take *O(log n)* time.
+Insert, remove, and query operations all take _O(log n)_ time.

 # Sets
 @docs Set

 # Build
 @docs empty, singleton, insert, remove

 # Query
 @docs isEmpty, member, size

 # Combine
 @docs union, intersect, diff

 # Lists
 @docs toList, fromList

 # Transform
 @docs map, foldl, foldr, filter, partition

 -}
@@ -42,8 +54,8 @@ import Maybe exposing (Maybe(..))
 {-| Represents a set of unique values. So `(Set Int)` is a set of integers and
 `(Set String)` is a set of strings.
 -}
-type Set t =
-  Set_elm_builtin (Dict.Dict t ())
+type Set t
+    = Set_elm_builtin (Dict.Dict t ())

 {-| Create an empty set.
diff --git a/src/String.elm b/src/String.elm
index 0e60bdd..2118918 100644
--- a/src/String.elm
+++ b/src/String.elm
@@ -1,6 +1,5 @@
 module String exposing
-  ( String
-  , isEmpty, length, reverse, repeat, replace
+    ( String, isEmpty, length, reverse, repeat, replace
     , append, concat, split, join, words, lines
     , slice, left, right, dropLeft, dropRight
     , contains, startsWith, endsWith, indexes, indices
@@ -13,33 +12,51 @@ module String exposing
     )

 {-| A built-in representation for efficient string manipulation. String literals
-are enclosed in `"double quotes"`. Strings are *not* lists of characters.
+are enclosed in `"double quotes"`. Strings are _not_ lists of characters.

 # Strings
 @docs String, isEmpty, length, reverse, repeat, replace

 # Building and Splitting
 @docs append, concat, split, join, words, lines

 # Get Substrings
 @docs slice, left, right, dropLeft, dropRight

 # Check for Substrings
 @docs contains, startsWith, endsWith, indexes, indices

 # Int Conversions
 @docs toInt, fromInt

 # Float Conversions
 @docs toFloat, fromFloat

 # Char Conversions
 @docs fromChar, cons, uncons

 # List Conversions
 @docs toList, fromList

 # Formatting
 Cosmetic operations such as padding with extra characters or trimming whitespace.

 @docs toUpper, toLower, pad, padLeft, padRight, trim, trimLeft, trimRight
@@ -70,7 +92,8 @@ import Result exposing (Result)

     -- strings with escape characters
     "this\n\t\"that\""
-    "\u{1F648}\u{1F649}\u{1F64A}" -- "πŸ™ˆπŸ™‰πŸ™Š"
+    "πŸ™ˆπŸ™‰πŸ™Š" -- "πŸ™ˆπŸ™‰πŸ™Š"

     -- multiline strings
     """Triple double quotes let you
@@ -89,8 +112,10 @@ characters with different widths.
 **Note:** JavaScript lets you use double quotes and single quotes interchangably.
 This is not true in Elm. You must use double quotes for a `String`, and you must
 use single quotes for a [`Char`](Char#Char).
 -}
-type String = String -- NOTE: The compiler provides the real implementation.
+type String
+    = String -- NOTE: The compiler provides the real implementation.

 {-| Determine if a string is empty.
@@ -123,9 +152,10 @@ reverse =
     Elm.Kernel.String.reverse

-{-| Repeat a string *n* times.
+{-| Repeat a string _n_ times.

     repeat 3 "ha" == "hahaha"
 -}
 repeat : Int -> String -> String
 repeat n chunk =
@@ -225,21 +266,26 @@ lines =

 {-| Take a substring given a start and end index. Negative indexes
-are taken starting from the *end* of the list.
+are taken starting from the _end_ of the list.

     slice 7 9 "snakes on a plane!" == "on"
     slice 0 6 "snakes on a plane!" == "snakes"
     slice 0 -7 "snakes on a plane!" == "snakes on a"
     slice -6 -1 "snakes on a plane!" == "plane"
 -}
 slice : Int -> Int -> String -> String
 slice =
     Elm.Kernel.String.slice

-{-| Take *n* characters from the left side of a string.
+{-| Take _n_ characters from the left side of a string.

     left 2 "Mulder" == "Mu"
 -}
 left : Int -> String -> String
 left n string =
@@ -249,9 +296,10 @@ left n string =
         slice 0 n string

-{-| Take *n* characters from the right side of a string.
+{-| Take _n_ characters from the right side of a string.

     right 2 "Scully" == "ly"
 -}
 right : Int -> String -> String
 right n string =
@@ -261,9 +310,10 @@ right n string =
         slice -n (length string) string

-{-| Drop *n* characters from the left side of a string.
+{-| Drop _n_ characters from the left side of a string.

     dropLeft 2 "The Lone Gunmen" == "e Lone Gunmen"
 -}
 dropLeft : Int -> String -> String
 dropLeft n string =
@@ -273,9 +324,10 @@ dropLeft n string =
         slice n (length string) string

-{-| Drop *n* characters from the right side of a string.
+{-| Drop _n_ characters from the right side of a string.

     dropRight 2 "Cigarette Smoking Man" == "Cigarette Smoking M"
 -}
 dropRight : Int -> String -> String
 dropRight n string =
@@ -332,7 +394,8 @@ indexes =
     Elm.Kernel.String.indexes

-{-| Alias for `indexes`. -}
+{-| Alias for `indexes`.
+-}
 indices : String -> String -> List Int
 indices =
     Elm.Kernel.String.indexes
@@ -450,10 +532,12 @@ toInt =
 {-| Convert an `Int` to a `String`.

     String.fromInt 123 == "123"
     String.fromInt -42 == "-42"

-Check out [`Debug.toString`](Debug#toString) to convert *any* value to a string
+Check out [`Debug.toString`](Debug#toString) to convert _any_ value to a string
 for debugging purposes.
 -}
 fromInt : Int -> String
 fromInt =
@@ -485,11 +574,14 @@ toFloat =
 {-| Convert a `Float` to a `String`.

     String.fromFloat 123 == "123"
     String.fromFloat -42 == "-42"
     String.fromFloat 3.9 == "3.9"

-Check out [`Debug.toString`](Debug#toString) to convert *any* value to a string
+Check out [`Debug.toString`](Debug#toString) to convert _any_ value to a string
 for debugging purposes.
 -}
 fromFloat : Float -> String
 fromFloat =
@@ -595,22 +699,28 @@ foldr =
     Elm.Kernel.String.foldr

-{-| Determine whether *any* characters pass the test.
+{-| Determine whether _any_ characters pass the test.

     any isDigit "90210" == True
     any isDigit "R2-D2" == True
     any isDigit "heart" == False
 -}
 any : (Char -> Bool) -> String -> Bool
 any =
     Elm.Kernel.String.any

-{-| Determine whether *all* characters pass the test.
+{-| Determine whether _all_ characters pass the test.

     all isDigit "90210" == True
     all isDigit "R2-D2" == False
     all isDigit "heart" == False
 -}
 all : (Char -> Bool) -> String -> Bool
 all =
diff --git a/src/Task.elm b/src/Task.elm
index 1a9cbf7..8388062 100644
--- a/src/Task.elm
+++ b/src/Task.elm
@@ -1,11 +1,8 @@
 effect module Task where { command = MyCmd } exposing
-  ( Task
-  , succeed, fail
+    ( Task, perform, attempt
+    , andThen, succeed, fail, sequence
     , map, map2, map3, map4, map5
-  , sequence
-  , andThen
     , onError, mapError
-  , perform, attempt
     )

 {-| Tasks make it easy to describe asynchronous operations that may fail, like
@@ -25,7 +30,7 @@ HTTP requests or writing to a database.

 -}

-import Basics exposing (Never, (|>), (<<))
+import Basics exposing ((<<), (|>), Never)
 import Elm.Kernel.Scheduler
 import List exposing ((::))
 import Maybe exposing (Maybe(..))
@@ -67,8 +72,10 @@ type alias Task x a =
 {-| A task that succeeds immediately when run. It is usually used with
 [`andThen`](#andThen). You can use it like `map` if you want:

-    import Time -- elm install elm/time
+    import Time

+    -- elm install elm/time
     timeInMillis : Task x Int
     timeInMillis =
         Time.now
@@ -83,7 +90,8 @@ succeed =
 {-| A task that fails immediately when run. Like with `succeed`, this can be
 used with `andThen` to check on the outcome of another task.

-    type Error = NotFound
+    type Error
+        = NotFound

     notFound : Task Error a
     notFound =
@@ -102,8 +111,10 @@ fail =
 out what time it will be in one hour:

     import Task exposing (Task)
-    import Time -- elm install elm/time
+    import Time

+    -- elm install elm/time
     timeInOneHour : Task x Time.Posix
     timeInOneHour =
         Task.map addAnHour Time.now
@@ -124,8 +136,10 @@ map func taskA =
 the current month, we could use [`elm/time`][time] to ask:

     import Task exposing (Task)
-    import Time -- elm install elm/time
+    import Time

+    -- elm install elm/time
     getMonth : Task x Int
     getMonth =
         Task.map2 Time.toMonth Time.here Time.now
@@ -139,38 +154,68 @@ If it fails, the whole thing fails!
 map2 : (a -> b -> result) -> Task x a -> Task x b -> Task x result
 map2 func taskA taskB =
     taskA
-    |> andThen (\a -> taskB
-    |> andThen (\b -> succeed (func a b)))
+        |> andThen
+            (\a ->
+                taskB
+                    |> andThen (\b -> succeed (func a b))
+            )

 {-| -}
 map3 : (a -> b -> c -> result) -> Task x a -> Task x b -> Task x c -> Task x result
 map3 func taskA taskB taskC =
     taskA
-    |> andThen (\a -> taskB
-    |> andThen (\b -> taskC
-    |> andThen (\c -> succeed (func a b c))))
+        |> andThen
+            (\a ->
+                taskB
+                    |> andThen
+                        (\b ->
+                            taskC
+                                |> andThen (\c -> succeed (func a b c))
+                        )
+            )

 {-| -}
 map4 : (a -> b -> c -> d -> result) -> Task x a -> Task x b -> Task x c -> Task x d -> Task x result
 map4 func taskA taskB taskC taskD =
     taskA
-    |> andThen (\a -> taskB
-    |> andThen (\b -> taskC
-    |> andThen (\c -> taskD
-    |> andThen (\d -> succeed (func a b c d)))))
+        |> andThen
+            (\a ->
+                taskB
+                    |> andThen
+                        (\b ->
+                            taskC
+                                |> andThen
+                                    (\c ->
+                                        taskD
+                                            |> andThen (\d -> succeed (func a b c d))
+                                    )
+                        )
+            )

 {-| -}
 map5 : (a -> b -> c -> d -> e -> result) -> Task x a -> Task x b -> Task x c -> Task x d -> Task x e -> Task x result
 map5 func taskA taskB taskC taskD taskE =
     taskA
-    |> andThen (\a -> taskB
-    |> andThen (\b -> taskC
-    |> andThen (\c -> taskD
-    |> andThen (\d -> taskE
-    |> andThen (\e -> succeed (func a b c d e))))))
+        |> andThen
+            (\a ->
+                taskB
+                    |> andThen
+                        (\b ->
+                            taskC
+                                |> andThen
+                                    (\c ->
+                                        taskD
+                                            |> andThen
+                                                (\d ->
+                                                    taskE
+                                                        |> andThen (\e -> succeed (func a b c d e))
+                                                )
+                                    )
+                        )
+            )

 {-| Start with a list of tasks, and turn them into a single task that returns a
@@ -194,8 +239,10 @@ successful, you give the result to the callback resulting in another task. This
 task then gets run. We could use this to make a task that resolves an hour from
 now:

-    import Time -- elm install elm/time
+    -- elm install elm/time
     import Process
+    import Time

     timeInOneHour : Task x Time.Posix
     timeInOneHour =
@@ -253,15 +303,17 @@ mapError convert task =
 -- COMMANDS

-type MyCmd msg =
-  Perform (Task Never msg)
+type MyCmd msg
+    = Perform (Task Never msg)

 {-| Like I was saying in the [`Task`](#Task) documentation, just having a
 `Task` does not mean it is done. We must command Elm to `perform` the task:

-    import Time  -- elm install elm/time
+    -- elm install elm/time
     import Task
+    import Time

     type Msg
         = Click
@@ -287,7 +340,9 @@ perform toMessage task =
 {-| This is very similar to [`perform`](#perform) except it can handle failures!
 So we could _attempt_ to focus on a certain DOM node like this:

-    import Browser.Dom  -- elm install elm/browser
+    -- elm install elm/browser
+    import Browser.Dom
     import Task

     type Msg
@@ -310,11 +366,13 @@ feeling for how commands fit into The Elm Architecture.
 -}
 attempt : (Result x a -> msg) -> Task x a -> Cmd msg
 attempt resultToMessage task =
-  command (Perform (
-    task
+    command
+        (Perform
+            (task
                 |> andThen (succeed << resultToMessage << Ok)
                 |> onError (succeed << resultToMessage << Err)
-  ))
+            )
+        )

 cmdMap : (a -> b) -> MyCmd a -> MyCmd b
@@ -345,7 +403,7 @@ onSelfMsg _ _ _ =

 spawnCmd : Platform.Router msg Never -> MyCmd msg -> Task x ()
 spawnCmd router (Perform task) =
-  Elm.Kernel.Scheduler.spawn (
-    task
+    Elm.Kernel.Scheduler.spawn
+        (task
             |> andThen (Platform.sendToApp router)
         )

So it looks pretty good. Here are a few remaining differences worth mentioning:

1. Unicode characters

    '\u{1F648}' -- 'πŸ™ˆ'

in documentation is replaced by:

    'πŸ™ˆ' -- 'πŸ™ˆ'

This breaks the point of the example.

2. Arithmetic expressions examples

The following arithmetic examples:

    10 / 4 == 2.5
    11 / 4 == 2.75
    12 / 4 == 3
    13 / 4 == 3.25
    14 / 4 == 3.5

    -1 / 4 == -0.25
    -5 / 4 == -1.25

become broken:

    10 / 4 == 2.5  

    11 / 4 == 2.75  

    12 / 4 == 3  

    13 / 4 == 3.25  

    14  
        / 4  
        == 3.5  
        - 1  
        / 4  
        == -0.25  
        - 5  
        / 4  
        == -1.25  

3. ~Markdown link bug~

-**Historical Note:** The name `Int` comes from the term [integer][]. It appears
+**Historical Note:** The name `Int` comes from the term [integer]. It appears

~This is due to https://github.com/avh4/elm-format/issues/339.~

Edit: I was thinking about another bug about markdown links. This one is not a bug and should therefore not be an issue for elm/core with elm-format.

4. andThen lambdas alignment

    |> andThen (\a -> taskB
    |> andThen (\b -> taskC
    |> andThen (\c -> succeed (func a b c))))

Becomes

        |> andThen
            (\a ->
                taskB
                    |> andThen
                        (\b ->
                            taskC
                                |> andThen (\c -> succeed (func a b c))
                        )
            )

~I know that this has been already discussed, but is there an elm-format issue for this?~ Edit: Discussed in https://github.com/avh4/elm-format/issues/568 Should this be part of 0.9.0-exp last experimental features before 1.0 milestone?

rl-king commented 4 years ago

Regarding andThen lambdas alignment #568

avh4 commented 4 years ago
  1. Arithmetic expressions examples

This looks like an issue, which I assume only affects code blocks in doc comments.

  1. Markdown link bug

Is this actually a bug? Does elm-markdown not support shortcut reference links https://spec.commonmark.org/0.29/#shortcut-reference-link (babelmark) ?

rlefevre commented 4 years ago

What I think is a bug is that [Module](Module) is parsed as a link, then rendered as an autolink <Module> which is not valid as it it's not an absolute URI. It is therefore ignored by elm-markdown.

I have submitted a fix proposal in https://github.com/avh4/elm-format/pull/649.

However I don't know that well "shortcut reference link`, so I may have overlooked something.

avh4 commented 4 years ago

Oh I see πŸ‘ I was looking at

-**Historical Note:** The name `Int` comes from the term [integer][]. It appears
+**Historical Note:** The name `Int` comes from the term [integer]. It appears

instead of [Module](Module)

rlefevre commented 4 years ago

I'm sorry you were right. The markdown bug exists but does not occur in elm/core. I don't know why I was thinking about it when noticing the [integer][] change. Sorry for the confusion.

rlefevre commented 4 years ago

This looks like an issue, which I assume only affects code blocks in doc comments.

Yes, it seems linked to the unary minus being interpreted as a minus operator in a multi-line expression. I have opened https://github.com/avh4/elm-format/issues/652.

lydell commented 3 years ago

I think the Unicode characters case was fixed in 0.8.4.