Skip to content

Instantly share code, notes, and snippets.

@canonic-epicure
Created May 23, 2018 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save canonic-epicure/46cf994ac5a33b938a1552bfbad6a4a1 to your computer and use it in GitHub Desktop.
Save canonic-epicure/46cf994ac5a33b938a1552bfbad6a4a1 to your computer and use it in GitHub Desktop.
data Action = Flower | Upwards | Branch
data RndGen
RndNumGen : Type
RndNumGen = EffM Identity Action [RND] (const [RND])
getRnd : RndNumGen -> (Action, RndNumGen)
getRnd prev =
let
(Id action) = run prev
in
(action, next)
where
next : RndNumGen
next = do
prev
rndSelect' $ [ Flower, Branch, Upwards, Upwards, Upwards ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment