module Bio.VCF.Parser.Helpers
( tabOrSpace
, isTab
, isSpace
, notTabOrSpace
, isNumber
, isFloatNumber
, isBase
, isBaseOrDeletion
, endOfLine
) where
import Data.Word (Word8)
tabOrSpace :: Word8 -> Bool
tabOrSpace c = isTab c || isSpace c
isTab :: Word8 -> Bool
isTab c = c == 9
isSpace :: Word8 -> Bool
isSpace c = c == 32
notTabOrSpace :: Word8 -> Bool
notTabOrSpace = not . tabOrSpace
isNumber :: Word8 -> Bool
isNumber c = c >= 48 && c <= 57
isFloatNumber :: Word8 -> Bool
isFloatNumber c = isNumber c || c == 46
isBase :: Word8 -> Bool
isBase c = c == 65 || c == 97 ||
c == 67 || c == 99 ||
c == 71 || c == 103 ||
c == 84 || c == 116 ||
c == 78 || c == 110
isBaseOrDeletion :: Word8 -> Bool
isBaseOrDeletion c = isBase c || c == 42 || c == 44 ||
c == 60 || c == 62
endOfLine :: Word8 -> Bool
endOfLine c = c == 13 || c == 10