Elm

Other Elm solutions.
module Triangle exposing (Triangle(..), triangleKind)


type Triangle
    = Equilateral
    | Isosceles
    | Scalene


triangleKind : number -> number -> number -> Result String Triangle
triangleKind x y z =
    let
        validLength n =
            n > 0

        validLengths =
            List.all validLength [ x, y, z ]

        triangleInequality =
            (x + y > z)
                && (y + z > x)
                && (z + x > y)

        classification =
            if x == y && x == z && y == z then
                Ok Equilateral

            else if x == y || x == z || y == z then
                Ok Isosceles

            else
                Ok Scalene
    in
    if not validLengths then
        Err "Invalid lengths"

    else if not triangleInequality then
        Err "Violates inequality"

    else
        classification

Roc

Other Roc solutions.
module [isEquilateral, isIsosceles, isScalene]

isEquilateral : (F64, F64, F64) -> Bool
isEquilateral = \(a, b, c) ->
    isTriangle (a, b, c)
    && Num.isApproxEq a b {}
    && Num.isApproxEq b c {}

isIsosceles : (F64, F64, F64) -> Bool
isIsosceles = \(a, b, c) ->
    isTriangle (a, b, c) && (eq a b || eq b c || eq a c)

isScalene : (F64, F64, F64) -> Bool
isScalene = \(a, b, c) ->
    isTriangle (a, b, c) && neq a b && neq b c && neq a c

isTriangle : (F64, F64, F64) -> Bool
isTriangle = \(a, b, c) ->
    (a + b >= c)
    && (b + c >= a)
    && (a + c >= b)
    && List.all [a, b, c] \x -> x > 0

eq : F64, F64 -> Bool
eq = \a, b -> Num.isApproxEq a b {}

neq : F64, F64 -> Bool
neq = \a, b -> !(Num.isApproxEq a b {})