How can I improve readability of this code? indentChar
needs to be reused elsewhere.
toCoordinate = dropWhile ((||) <$> (not . indentChar) <*> (=='(')) >>> takeWhile(/= ' ')
indentChar = (||) <$> isAlpha <*> (=='(')
Desired result:
*Parse> toCoordinate " \\--(my.coordinate - from outerspace)"
"my.coordinate"
"\\--"
actually mean anything or are those completely arbitrary characters? Is the coordinate text, or will it really be comprised of digits? Also, you have mismatched parentheses in the definition oftoCoordinate
. \$\endgroup\$indentChar = liftA2 (||) isAlpha (=='(')
more readable. \$\endgroup\$