Skip to content

Commit

Permalink
Extract randomGeneratorConstantConstruct
Browse files Browse the repository at this point in the history
  • Loading branch information
lue-bird committed Oct 3, 2023
1 parent abcdd68 commit 40ce5df
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/Simplify.elm
Original file line number Diff line number Diff line change
Expand Up @@ -7738,21 +7738,25 @@ emptyAsString qualifyResources emptiable =
randomGeneratorWrapper : TypeProperties (NonEmptiableProperties (WrapperProperties { mapFn : ( ModuleName, String ) }))
randomGeneratorWrapper =
{ represents = "random generator"
, wrap =
{ description = A "constant generator"
, fn = ( [ "Random" ], "constant" )
, getValue =
\lookupTable expr ->
Maybe.map .firstArg (AstHelpers.getSpecificFnCall ( [ "Random" ], "constant" ) lookupTable expr)
, is =
\lookupTable expr ->
isJust (AstHelpers.getSpecificFnCall ( [ "Random" ], "constant" ) lookupTable expr)
}
, wrap = randomGeneratorConstantConstruct
, empty = { invalid = () }
, mapFn = ( [ "Random" ], "map" )
}


randomGeneratorConstantConstruct : ConstructWithOneArgProperties
randomGeneratorConstantConstruct =
{ description = A "constant generator"
, fn = ( [ "Random" ], "constant" )
, getValue =
\lookupTable expr ->
Maybe.map .firstArg (AstHelpers.getSpecificFnCall ( [ "Random" ], "constant" ) lookupTable expr)
, is =
\lookupTable expr ->
isJust (AstHelpers.getSpecificFnCall ( [ "Random" ], "constant" ) lookupTable expr)
}


maybeWithJustAsWrap :
TypeProperties
(EmptiableProperties
Expand Down

0 comments on commit 40ce5df

Please sign in to comment.