1 module Java.META.Spec where
3 import Data.Char (toLower)
8 loadFirstSection :: Section -> s
10 loadOtherSection :: s -> Section -> s
11 loadOtherSection s _ = s
13 storeMeta :: s -> META
15 loadSpec :: (MetaSpec s) => META -> s
16 loadSpec [] = error "Cannot load empty metadata"
18 let x = loadFirstSection s
19 in foldl loadOtherSection x ss
21 lookupList :: String -> Maybe String -> [(String, String)]
22 lookupList _ Nothing = []
23 lookupList name (Just val) = [(name, val)]
25 bool2string :: Bool -> String
26 bool2string True = "true"
27 bool2string False = "false"
29 string2bool :: String -> Bool
31 | map toLower s == "true" = True