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

UnionTypes demo #11

Closed
igoratron opened this issue Jul 2, 2016 · 5 comments
Closed

UnionTypes demo #11

igoratron opened this issue Jul 2, 2016 · 5 comments
Assignees

Comments

@igoratron
Copy link

Hey, not sure what the solution to the 3rd union type test is? Seems to require a different assertion function, something like assertSameType?

@robertjlooby robertjlooby self-assigned this Jul 6, 2016
@robertjlooby
Copy link
Owner

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.

@nashamri
Copy link

@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 😄

@finnpedersenkazes
Copy link

finnpedersenkazes commented Mar 8, 2018

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.

@robertjlooby
Copy link
Owner

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

@robertjlooby
Copy link
Owner

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.

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

4 participants