Skip to content

Commit

Permalink
cli options
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszcz committed Feb 22, 2024
1 parent 972d9a9 commit fb7a071
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/CommonOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ fieldSizeOpt = eitherReader aux
aux :: String -> Either String (Maybe Natural)
aux s = case s of
"cairo" -> Right $ Just cairoFieldSize
"small" -> Right $ Just defaultFieldSize
"small" -> Right $ Just smallFieldSize
_ ->
mapRight Just $
either Left checkAllowed $
Expand Down
2 changes: 1 addition & 1 deletion app/GlobalOptions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ parseGlobalFlags = do
fieldSizeOpt
( long "field-size"
<> value Nothing
<> help "Field type size [cairo,small,11]"
<> help "Field type size [cairo,small,11] (default: small)"
)
_globalUnrollLimit <-
option
Expand Down
9 changes: 6 additions & 3 deletions src/Juvix/Data/Field.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ newtype FField = FField

makeLenses ''FField

defaultFieldSize :: Natural
defaultFieldSize = smallFieldSize

cairoFieldSize :: Natural
cairoFieldSize = 3618502788666131213697322783095070105623107215331596699973092056135872020481

defaultFieldSize :: Natural
defaultFieldSize = 2147483647
smallFieldSize :: Natural
smallFieldSize = 2147483647

allowedFieldSizes :: [Natural]
allowedFieldSizes = [11, defaultFieldSize, cairoFieldSize]
allowedFieldSizes = [11, smallFieldSize, cairoFieldSize]

instance Serialize FField where
put f = S.put (fieldSize f, fieldToInteger f)
Expand Down

0 comments on commit fb7a071

Please sign in to comment.