Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 1.1.0 Runtime error "Uncaught Error: Trying to use (==)" #14

Open
justgook opened this issue May 15, 2019 · 0 comments
Open

Version 1.1.0 Runtime error "Uncaught Error: Trying to use (==)" #14

justgook opened this issue May 15, 2019 · 0 comments

Comments

@justgook
Copy link

justgook commented May 15, 2019

Uncaught Error: Trying to use (==) on functions. There is no way to know if functions are "the same" in the Elm sense. Read more about this at https://package.elm-lang.org/packages/elm/core/latest/Basics#== which describes why it is this way and what the better version will look like.

Ellie

module Main exposing (main)

import Browser
import Html exposing (Html)
import Json.Decode exposing (Value)
import Task exposing (Task)
import WebGL.Texture as WebGL


init _ =
    ( ()
    --here is problem
    , Task.map2 (==) (WebGL.load image) (WebGL.load image)
        |> Task.attempt identity
    )


main : Program Value () (Result WebGL.Error Bool)
main =
    Browser.element
        { init = init
        , view = \_ -> Html.text "Success"
        , subscriptions = \_ -> Sub.none
        , update = \_ m -> ( m, Cmd.none )
        }


image =
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mPUDLS6DAAC6AGJTI9bHgAAAABJRU5ErkJggg=="

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant