module Fun.Typer where data Type = UnknownType | NormalType String | InternalType String | ListType Type deriving (Show, Eq) -- TODO: Struct (like 'data' with mutiple), Union (like 'data' with '|') -- TODO: Handle primary types as normal non-primary types? sizeOfNormalType :: String -> Integer sizeOfNormalType "Signed64" = 64 sizeOfNormalType "Signed32" = 32 sizeOfNormalType "Signed16" = 16 sizeOfNormalType "Signed8" = 8 sizeOfNormalType "Unsigned64" = 64 sizeOfNormalType "Unsigned32" = 32 sizeOfNormalType "Unsigned16" = 16 sizeOfNormalType "Unsigned8" = 8 sizeOfNormalType _ = 0 resolveType :: String -> Type resolveType t@('_' : _) = InternalType t resolveType t = NormalType t