Skip to content

Instantly share code, notes, and snippets.

@gotcha
Last active July 2, 2016 10:38
Show Gist options
  • Save gotcha/3c0904f722dc98c1cef4e33940fe087e to your computer and use it in GitHub Desktop.
Save gotcha/3c0904f722dc98c1cef4e33940fe087e to your computer and use it in GitHub Desktop.
type alias FieldId = String
type alias Url = String
type alias Flags =
(FieldId, Url)
init : FieldId -> Url -> String
init fieldid url =
if isvalidUrl fieldid then
"Not Empty"
else
"Empty"
isvalidUrl : Url -> Bool
isvalidUrl url =
if url == "" then
False
else
True
@gotcha
Copy link
Author

gotcha commented Jul 2, 2016

The code above is valid.

The init function above the first parameter is of type FieldId.

isValidUrl awaits a value of type Url.

However, the code does compile.

Is there a way to make it complain ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment