Skip to content

Commit

Permalink
Cleaned up random definition in interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
justingrubbs committed Jun 3, 2024
1 parent b92d501 commit 5111743
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Disco/Interpret/CESK.hs
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,9 @@ appConst k = \case
--------------------------------------------------
-- Randomness

ORandom -> arity2 (\t g -> arity2 (\v1 v2 ->
let (a,g') = R.randomR (vint v1,vint v2) (vgen g)
in out $ VPair (intv a) (genv g')) t)
ORandom -> arity2 . flip $ \g -> arity2 $ \v1 v2 ->
let (a,g') = R.randomR (vint v1,vint v2) (vgen g)
in out $ VPair (intv a) (genv g')
OSeed -> out . VGen . (R.mkStdGen . fromIntegral . vint)
--------------------------------------------------
-- Graph operations
Expand Down

0 comments on commit 5111743

Please sign in to comment.