1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-20 05:12:05 +03:00
juvix/app/Commands/Dev/Geb/Infer/Options.hs
Jonathan Cubides 830b3be304
Add FileExt type (#2467)
This PR introduces FileExt type, and consequently, one can generalise
methods and matches based on the file extension; for example,
`parseInputJuvixAsmFile` is now an app. `parseInputFile FileExtJuvixAsm`
2023-10-25 12:02:12 +02:00

21 lines
616 B
Haskell

module Commands.Dev.Geb.Infer.Options where
import CommonOptions
import Data.List.NonEmpty qualified as NonEmpty
import Juvix.Compiler.Backend.Geb.Pretty qualified as Geb
newtype GebInferOptions = GebInferOptions
{ _gebInferOptionsInputFile :: AppPath File
}
deriving stock (Data)
makeLenses ''GebInferOptions
instance CanonicalProjection GebInferOptions Geb.Options where
project _ = Geb.defaultOptions
parseGebInferOptions :: Parser GebInferOptions
parseGebInferOptions = do
_gebInferOptionsInputFile <- parseInputFiles (NonEmpty.fromList [FileExtJuvixGeb, FileExtLisp])
pure GebInferOptions {..}