GithubHelp home page GithubHelp logo

UnionTypes demo about elm-koans HOT 5 CLOSED

robertjlooby avatar robertjlooby commented on August 31, 2024 1
UnionTypes demo

from elm-koans.

Comments (5)

robertjlooby avatar robertjlooby commented on August 31, 2024

Sorry that one's confusing. Someone else had commented on this before (#9) and I've been meaning to rework that whole suite but just haven't gotten around to it yet.

The "solution" is just to change one to match the other. All test is showing as it is written right now is that it compiles without error even though they are "different" values in the same type. It's not a very good test though.

from elm-koans.

nashamri avatar nashamri commented on August 31, 2024

@robertjlooby Yeah this one was confusing to me too because it doesn't have that phaceholder text. Maybe adding a comment there would make it clearer 😄

from elm-koans.

finnpedersenkazes avatar finnpedersenkazes commented on August 31, 2024

The third union type test is actually OK. IMHO. They are of the same type, but different. So ...

        , test "all types in the union type are the same type" <|
            \() ->
                Strand [ A, T, C, G ]
                    |> Expect.notEqual (Base A)

the trick is simply to change equal to notEqual :-)

@robertjlooby Thank you for this fun exercise. Intuition often arrives after hard work.

from elm-koans.

robertjlooby avatar robertjlooby commented on August 31, 2024

I think I like @nashamri's idea to throw a comment in there

from elm-koans.

robertjlooby avatar robertjlooby commented on August 31, 2024

Thank you everyone for your input on this and sorry to anyone who found it confusing. I put a comment in there (#25) which will hopefully make it less confusing going forward.

from elm-koans.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.