for more information visit the package's GitHub page
Package contains the following modules:
This module is basically a hack. It exploits a bug in Elm's equality alogirthm to allow generation of unqiue values. Use only with a hefty amount of caution.
elm install harrysarson/unique-type
The following will display "False" in the browser.
module Main exposing (main)
import Html
import Unique
type alias User =
{ name : String
, id : Unique.Unique
}
createUser : String -> User
createUser name =
{ name = name
, id = Unique.unique ()
}
main =
let
user1 = createUser "Jim"
user2 = createUser "Jim"
in
Html.text (Debug.toString <| user1 == user2)