Skip to content

Instantly share code, notes, and snippets.

@deepak
Last active September 30, 2016 09:08
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 deepak/392dad0dd1f788471fae6eef16ac55a1 to your computer and use it in GitHub Desktop.
Save deepak/392dad0dd1f788471fae6eef16ac55a1 to your computer and use it in GitHub Desktop.
-- trying in elm-repl
import Random
type Msg = Foo Bool
r = (Random.generate Foo Random.bool)
-- { type = "leaf", home = "Random", value = Generate (Generator <function>) }
-- : Platform.Cmd.Cmd Repl.Msg
-- how to get the random value ?
r.value -- error
-- TYPE MISMATCH --------------------------------------------- repl-temp-000.elm
-- `r` is being used in an unexpected way.
-- 5| r.value
-- ^
-- Based on its definition, `r` has this type:
-- Cmd Msg
-- But you are trying to use it as:
-- { b | value : a }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment