getModel :: FilePath -> IO Model
getModel fileName = do
    binary <- isBinary fileName
    ascii <- isAscii fileName
    if isJust binary
        then return $ parseBinary (fromJust binary)
        else if isJust ascii
            then return $ parseASCII (fromJust ascii)
            else throw $ DeadlyImporterError $
                "Failed to determine STL storage representation for "
                ++ fileName ++ "."

-- | Checks if file starts with "solid" token. Note: this check is not
-- sufficient, binary format could also begin with "solid".
getModel :: FilePath -> IO Model
getModel fileName = do
    binary <- isBinary fileName
    ascii <- isAscii fileName
    if isJust binary
        then return $ parseBinary (fromJust binary)
        else if isJust ascii
            then return $ parseASCII (fromJust ascii)
            else throw $ DeadlyImporterError $
                "Failed to determine STL storage representation for "
                ++ fileName ++ "."

-- | Checks if file starts with "solid" token. Note: this check is not
-- sufficient, binary format could also begin with "solid".
getModel fileName = do
    binary <- isBinary fileName
    ascii <- isAscii fileName
    if isJust binary
        then return $ parseBinary (fromJust binary)
        else if isJust ascii
            then return $ parseASCII (fromJust ascii)
            else throw $ DeadlyImporterError $
                "Failed to determine STL storage representation for "
                ++ fileName ++ "."

-- | Checks if file starts with "solid" token. Note: this check is not
-- sufficient, binary format could also begin with "solid".