Skip to content

Instantly share code, notes, and snippets.

View emmabastas's full-sized avatar
🏳️‍🌈

Emma Bastås emmabastas

🏳️‍🌈
View GitHub Profile
@emmabastas
emmabastas / MyModule.elm
Last active August 16, 2020 17:53
Thoughts about safe recursion in Elm
module MyModule exposing (Expr(..), mirror, myExpression, sum)
import Safe.Recursion exposing (Recurse)
type Expr
= Num Int
| Add (Recurse Expr) (Recurse Expr)
| Mul (Recurse Expr) (Recurse Expr)
@emmabastas
emmabastas / README.md
Last active April 13, 2022 13:39
Google Summer of Code 2021 Work Product Submission - Emma Bastås

Google Summer of Code 2021 Work Product Submission

Student: [Emma Bastås][eb]
Mentor: [Aaron VonderHaar][av]
Organization: [elm-tooling][et]
Original proposal: elm-tooling/gsoc-projects#13


@emmabastas
emmabastas / README.md
Last active August 23, 2021 02:06
elm-format parsing overhaul doccumentation

elm-format parsing overhaul doccumentation

Background

Historically the Elm compiler implemented it's parsers using the libraries parsec and indents (in this document parsec is used to refer to both of these libraries), since elm-format is based on the Elm compiler it has inherited this as well. However, in Elm 0.19 the parsing codebase was overhauled, the Elm compiler got it's own parsing primitives and all of the parsers where rewritten to use these primitives instead of parsec. To integrate these changes into elm-format is non trivial and elm-format has continued using parsec.

This situation is not ideal, there is great value in having the parsing logic for the Elm compiler and elm-format be as similar as possible from a maintainability standpoint. Moreover, the primitives in the Elm compiler are more elegant and performant in the context of parsing Elm code. For the long term elm-format ne