Skip to content

Commit

Permalink
Merge pull request #3 from Andros-Spica/main
Browse files Browse the repository at this point in the history
v 0.3.0 - added more programming languages
  • Loading branch information
Andros-Spica authored Nov 26, 2021
2 parents 733252a + 3fc838d commit 353578f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- V 0.3.0: Added more programming languages: Java, Julia, C#, Ruby, Processing
- V 0.2.0: Some small changes to NASSA.yml field checks, some general refactoring and added checks if files/dirs referenced in the .yml file actually exist
- V 0.1.0: First prototype for a representative selection of variables in NASSA.yml files
2 changes: 1 addition & 1 deletion nassa.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: nassa
version: 0.2.0
version: 0.3.0
synopsis: A package to validate NASSA modules
description: NASSA maintains a library of agent-based-modelling algorithms in individual code modules. Each module is defined by a NASSA.yml file. nassa-hs validates these .yml files.
license: MIT
Expand Down
23 changes: 19 additions & 4 deletions src/NASSA/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,34 @@ data ProgrammingLanguage =
LanguageR
| LanguagePython
| LanguageNetLogo
| LanguageJava
| LanguageJulia
| LanguageCsharp
| LanguageRuby
| LanguageProcessing
deriving (Eq)

instance Show ProgrammingLanguage where
show LanguageR = "R"
show LanguagePython = "Python"
show LanguageNetLogo = "NetLogo"
show LanguageJava = "Java"
show LanguageJulia = "Julia"
show LanguageCsharp = "C#"
show LanguageRuby = "Ruby"
show LanguageProcessing = "Processing"

instance FromJSON ProgrammingLanguage where
parseJSON = withText "programmingLanguage" $ \case
"R" -> pure LanguageR
"Python" -> pure LanguagePython
"NetLogo" -> pure LanguageNetLogo
other -> fail $ "unknown Language: " ++ show other
"R" -> pure LanguageR
"Python" -> pure LanguagePython
"NetLogo" -> pure LanguageNetLogo
"Java" -> pure LanguageJava
"Julia" -> pure LanguageJulia
"C#" -> pure LanguageCsharp
"Ruby" -> pure LanguageRuby
"Processing" -> pure LanguageProcessing
other -> fail $ "unknown Language: " ++ show other

data InOrOutput = InOrOutput
{ _inOrOutputName :: String
Expand Down

0 comments on commit 353578f

Please sign in to comment.