-save :: Program -> IO ()
-save program = do
- let path = ("./programs/" ++ (T.unpack (name program)) ++ ".json")
- B.writeFile path (encodePretty program)
+data File = File
+ { path :: String,
+ supportLevel :: SupportLevel,
+ help :: String
+ }
+ deriving (Generic, Show)
+
+instance ToJSON File where
+ toJSON (File path supportLevel help) = object [ "path" .= path, "movable" .= supportLevel, "help" .= help ]
+ toEncoding (File path supportLevel help) = pairs ("path" .= path <> "movable" .= supportLevel <> "help" .= help)