Have arg parser take string -> string option (#368)

This commit is contained in:
Patrick Stevens
2025-04-21 10:07:58 +01:00
committed by GitHub
parent f944953384
commit 0fe97da788
8 changed files with 102 additions and 70 deletions

View File

@@ -46,7 +46,7 @@ module internal JsonParseGenerator =
|> SynExpr.createMatch indexed
|> SynExpr.paren
let assertNotNull (body : SynExpr) (boundIdent : Ident) : SynExpr =
let assertNotNull (boundIdent : Ident) (body : SynExpr) : SynExpr =
let raiseExpr =
SynExpr.CreateConst ()
|> SynExpr.applyFunction (SynExpr.createLongIdent [ "System" ; "ArgumentNullException" ])
@@ -108,7 +108,7 @@ module internal JsonParseGenerator =
|> SynExpr.pipeThroughFunction (
SynExpr.applyFunction
(SynExpr.createLongIdent [ "Seq" ; "map" ])
(SynExpr.createLambda "elt" (assertNotNull body (Ident.create "elt")))
(SynExpr.createLambda "elt" (assertNotNull (Ident.create "elt") body))
)
|> SynExpr.pipeThroughFunction (SynExpr.createLongIdent [ collectionType ; "ofSeq" ])