Skip to content

Commit

Permalink
Deduplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
miniBill committed May 26, 2024
1 parent a391d21 commit e31ba4a
Showing 1 changed file with 33 additions and 120 deletions.
153 changes: 33 additions & 120 deletions src/Elm/Declare.elm
Original file line number Diff line number Diff line change
Expand Up @@ -179,21 +179,9 @@ fn :
-> (value -> Expression)
-> Function (Expression -> Expression)
fn name one toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnDone

call : Expression -> Expression -> Expression
call expr argOne =
Elm.apply
expr
[ argOne
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnDone


{-| -}
Expand All @@ -204,23 +192,10 @@ fn2 :
-> (one -> two -> Expression)
-> Function (Expression -> Expression -> Expression)
fn2 name one two toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnArg two
|> Elm.fnDone

call : Expression -> Expression -> Expression -> Expression
call expr argOne argTwo =
Elm.apply
expr
[ argOne
, argTwo
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnArg two
|> fnDone


{-| -}
Expand All @@ -232,25 +207,11 @@ fn3 :
-> (one -> two -> three -> Expression)
-> Function (Expression -> Expression -> Expression -> Expression)
fn3 name one two three toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnArg two
|> Elm.fnArg three
|> Elm.fnDone

call : Expression -> Expression -> Expression -> Expression -> Expression
call expr argOne argTwo argThree =
Elm.apply
expr
[ argOne
, argTwo
, argThree
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnArg two
|> fnArg three
|> fnDone


{-| -}
Expand All @@ -263,27 +224,12 @@ fn4 :
-> (one -> two -> three -> four -> Expression)
-> Function (Expression -> Expression -> Expression -> Expression -> Expression)
fn4 name one two three four toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnArg two
|> Elm.fnArg three
|> Elm.fnArg four
|> Elm.fnDone

call : Expression -> Expression -> Expression -> Expression -> Expression -> Expression
call expr argOne argTwo argThree argFour =
Elm.apply
expr
[ argOne
, argTwo
, argThree
, argFour
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnArg two
|> fnArg three
|> fnArg four
|> fnDone


{-| -}
Expand All @@ -297,29 +243,13 @@ fn5 :
-> (one -> two -> three -> four -> five -> Expression)
-> Function (Expression -> Expression -> Expression -> Expression -> Expression -> Expression)
fn5 name one two three four five toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnArg two
|> Elm.fnArg three
|> Elm.fnArg four
|> Elm.fnArg five
|> Elm.fnDone

call : Expression -> Expression -> Expression -> Expression -> Expression -> Expression -> Expression
call expr argOne argTwo argThree argFour argFive =
Elm.apply
expr
[ argOne
, argTwo
, argThree
, argFour
, argFive
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnArg two
|> fnArg three
|> fnArg four
|> fnArg five
|> fnDone


{-| -}
Expand All @@ -334,31 +264,14 @@ fn6 :
-> (one -> two -> three -> four -> five -> six -> Expression)
-> Function (Expression -> Expression -> Expression -> Expression -> Expression -> Expression -> Expression)
fn6 name one two three four five six toExp =
let
funcExp : Expression
funcExp =
Elm.fnBuilder toExp
|> Elm.fnArg one
|> Elm.fnArg two
|> Elm.fnArg three
|> Elm.fnArg four
|> Elm.fnArg five
|> Elm.fnArg six
|> Elm.fnDone

call : Expression -> Expression -> Expression -> Expression -> Expression -> Expression -> Expression -> Expression
call expr argOne argTwo argThree argFour argFive argSix =
Elm.apply
expr
[ argOne
, argTwo
, argThree
, argFour
, argFive
, argSix
]
in
innerFunction name funcExp call
fnX name toExp
|> fnArg one
|> fnArg two
|> fnArg three
|> fnArg four
|> fnArg five
|> fnArg six
|> fnDone


{-| -}
Expand Down

0 comments on commit e31ba4a

Please sign in to comment.