Skip to content

from and to are used in incorrect order? #26

Closed
@safareli

Description

@safareli

toEither3 :: Either3 Number Number Number -> Color should be named fromEither3 as it takes Either3 (it's not returning Either3).

fromEither3 :: Color -> Either3 Number Number Number returns Either and it should be named toEither3.

Am I messing something?

data Color = Red Number | Green Number | Blue Number
-- 
toEither3 :: Either3 Number Number Number -> Color
toEither3 = either3 Red Green Blue

fromEither3 :: Color -> Either3 Number Number Number
fromEither3 (Red   v) = in1 v
fromEither3 (Green v) = in2 v
fromEither3 (Blue  v) = in3 v

see

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions