getInfo :: String -> Maybe Info
getInfo str = case words str of
    (('*':type_name):"=":f1:fields) -> Just $ Info type_name (getSums $ f1:fields) True
    (type_name:"=":f1:fields)     -> Just $ Info type_name (getSums $ f1:fields) False
    [type_name] -> Just $ Info type_name [] False
    otherwise   -> Nothing

-------------
-- Haskell --
-------------

-- name (type, is_prim)
getInfo :: String -> Maybe Info
getInfo str = case words str of
    (('*':type_name):"=":f1:fields) -> Just $ Info type_name (getSums $ f1:fields) True
    (type_name:"=":f1:fields)     -> Just $ Info type_name (getSums $ f1:fields) False
    [type_name] -> Just $ Info type_name [] False
    otherwise   -> Nothing

-------------
-- Haskell --
-------------

-- name (type, is_prim)
getInfo str = case words str of
    (('*':type_name):"=":f1:fields) -> Just $ Info type_name (getSums $ f1:fields) True
    (type_name:"=":f1:fields)     -> Just $ Info type_name (getSums $ f1:fields) False
    [type_name] -> Just $ Info type_name [] False
    otherwise   -> Nothing

-------------
-- Haskell --
-------------

-- name (type, is_prim)