Skip to content

Instantly share code, notes, and snippets.

@pietro909
Created October 28, 2016 08:37
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 pietro909/27f7d05c2fd3a0818d011f343ce73475 to your computer and use it in GitHub Desktop.
Save pietro909/27f7d05c2fd3a0818d011f343ce73475 to your computer and use it in GitHub Desktop.
Trying to reproduce runtime error conditions
import Html exposing (text, div)
import String
import List
contains c s =
-- we should use String.contains
(List.length (String.indexes c s)) > 0
main =
div []
[ text (toString (contains "hi" "there"))
, text (toString (contains "hi" "hi all"))
, text (toString (contains "hi" 1)) -- doesn't compile
, text (toString (contains "hi" Nothing)) -- doesn't compile
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment