Last active
December 10, 2020 21:16
-
-
Save jfmengels/966c086eb79244ca55cf362fc2dd60cf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
removeRange : Node TypeAnnotation -> Node TypeAnnotation | |
removeRange (Node _ value) = | |
Node Range.emptyRange | |
(case value of | |
TypeAnnotation.FunctionTypeAnnotation input output -> | |
TypeAnnotation.FunctionTypeAnnotation (removeRange input) (removeRange output) | |
TypeAnnotation.Typed (Node _ nameNode) params -> | |
TypeAnnotation.Typed (Node Range.emptyRange nameNode) (List.map removeRange params) | |
TypeAnnotation.GenericType string -> | |
TypeAnnotation.GenericType string | |
TypeAnnotation.Unit -> | |
TypeAnnotation.Unit | |
TypeAnnotation.Tupled nodes -> | |
TypeAnnotation.Tupled (List.map removeRange nodes) | |
TypeAnnotation.Record recordDefinition -> | |
TypeAnnotation.Record (removeRangeOfRecordDefinition recordDefinition) | |
TypeAnnotation.GenericRecord (Node _ var) (Node _ recordDefinition) -> | |
TypeAnnotation.GenericRecord | |
(Node Range.emptyRange var) | |
(Node Range.emptyRange (removeRangeOfRecordDefinition recordDefinition)) | |
) | |
removeRangeOfRecordDefinition : List (Node ( Node a, Node b )) -> List (Node ( Node a, Node b )) | |
removeRangeOfRecordDefinition recordDefinition = | |
List.map | |
(Node.value | |
>> (\( Node _ field, Node _ type_ ) -> | |
Node Range.emptyRange ( Node Range.emptyRange field, Node Range.emptyRange type_ ) | |
) | |
) | |
recordDefinition |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment