the-sett / elm-syntax-dsl

A DSL for creating Elm syntax trees and pretty printing Elm source code.
BSD 3-Clause "New" or "Revised" License
20 stars 4 forks source link

funDecl and valDecl use signature which is partly redundant. #7

Closed rupertlssmith closed 5 years ago

rupertlssmith commented 5 years ago

The signatures of these function are:

funDecl : Maybe String -> Maybe Signature -> String -> List Pattern -> Expression -> Declaration
valDecl : Maybe String -> Maybe Signature -> String -> Expression -> Declaration

And the function for creating signatures is:

signature : String -> TypeAnnotation -> Signature

This function takes a name, but the function or value already has a name - so really the funDecl and valDecl functions should only require a Maybe TypeAnnotation, and not a full signature.

This rules out the name in the signature being different to the function or value being created.