-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Description
Use of these three (or maybe two, I'm not sure about map3) results in "too much recursion."
Ellie with a SSCCE ➡️ https://ellie-app.com/4Kv76dc7Hkpa1
type Expr
= Int_ Int
| Plus2 Expr Expr
| Plus3 Expr Expr Expr
exprGenerator : Generator Expr
exprGenerator =
Random.uniform
(Random.map Int_ (Random.int Random.minInt Random.maxInt))
--[ Random.map2 Plus2 lazyExprGenerator lazyExprGenerator
[ Random.map3 Plus3 lazyExprGenerator lazyExprGenerator lazyExprGenerator
]
|> Random.andThen identity
lazyExprGenerator : Generator Expr
lazyExprGenerator =
Random.lazy (\() -> exprGenerator)Switching the recursive generators (Plus3 for Plus2) or changing the seed to 1 shows non-failing case.
Metadata
Metadata
Assignees
Labels
No labels
