-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unitb-config revamp #34
Conversation
Config file's name changed from z3_config.conf to z3_config.yml. TODO: there's a slight issue with the yaml library treating all of Z3Config's fields as String, in that it will require the numbers to be explicitly quoted to be considered as string literals; and otherwise it will ignore them. We'll try to fix this by generalizing the Document type class and the functions using it.
- literate-unitb-config compiles again - Add traverseOf (similar to lensOf and prismOf) - Swap `fieldWith`'s arguments to make them consistent with `field`
yaml < 0.8.22 causes literate-unitb-logic's test suite to throw an exception: Control.Concurrent.STM.atomically was nested Possibly related: snoyberg/yaml#86 Not sure about the exact cause, but we don't seem to have the issue with yaml >= 0.8.22, so I'm bumping the lower bound as a workaround.
-> BiParser Maybe b doc String | ||
field :: (Document doc,ToJSON a,FromJSON a) | ||
=> String -> (b -> a) | ||
-> BiParser Maybe b doc a | ||
field k f = BiParser (makeNode k . f) (lookupDoc k) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please align =>
and ->
with ::
?
-> Traversal' s a | ||
traverseOf def (BiParser f g) h x = | ||
(\i -> f i def) <$> h (runIdentity $ g x) | ||
-- f <$> h (runIdentity $ g x) <*> pure def |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this commented line please?
@@ -74,4 +74,4 @@ main = execParser opts >>= apply | |||
where | |||
opts = info ( helper <*> commandLineOpts ) | |||
$ fullDesc | |||
<> header "unitb-setting - customize the preferences for verifier" | |||
<> header "unitb-config - customize the preferences for verifier" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message was broken. Good thing you had to change it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah :)
@@ -21,6 +23,7 @@ instance (Applicative f) => Applicative (BiParser f a b) where | |||
|
|||
-- instance Profunctor (BiParser a) where |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this commented code. If we need a Profunctor
instance, we'll just add it from scratch
A series of changes to the
literate-unitb-config
executable,unitb-config
:ConfigFile
in favour ofyaml
for the configuration file. The configuration file was renamed fromz3_config.conf
toz3_config.yml
to reflect the change.Document
type class to reduce duplication (with respect tofield
,fieldWith
, and their primed variants) and to accommodate for introduction ofyaml
.unitb-option
tounitb-config
consistently.