Last active
August 31, 2017 21:20
-
-
Save deque-blog/4ab18f24db8a201a8d65344b6a5a2462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logEvent : Event -> List PlaceholderValue -> Maybe String | |
logEvent e vals = loop (messageSpec e) vals (title e ++ ": ") | |
where | |
loop : Schema -> List PlaceholderValue -> String -> Maybe String | |
loop [] [] out = pure out | |
loop (IntVar :: xs) (IntVal i :: ys) out = loop xs ys (out ++ show i) | |
loop (StrVar :: xs) (StrVal s :: ys) out = loop xs ys (out ++ s) | |
loop (StrCst x :: xs) ys out = loop xs ys (out ++ x) | |
loop _ _ _ = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment