@@ -1,35 +1,34 @@
11module Generate.Noscript (noscript) where
22
33import Data.List (isInfixOf)
4−import SourceSyntax.Declaration (Declaration(..))
4+import qualified SourceSyntax.Declaration as D
55import SourceSyntax.Expression
66import SourceSyntax.Literal
77import SourceSyntax.Location
88import SourceSyntax.Module
99import qualified Generate.Markdown as MD
1010
11−noscript :: Module t v -> String
11+noscript :: Extract def => Module def -> String
1212noscript modul = concat (extract modul)
1313
1414class Extract a where
1515 extract :: a -> [String]
1616
17−instance Extract (Module t v) where
17+instance Extract def => Extract (Module def) where
1818 extract (Module _ _ _ stmts) =
1919 map (\s -> "<p>" ++ s ++ "</p>") (concatMap extract stmts)
2020
21−instance Extract (Declaration t v) where
22− extract (Definition d) = extract d
21+instance Extract def => Extract (D.Declaration' port def) where
22+ extract (D.Definition d) = extract d
2323 extract _ = []
2424
25−instance Extract (Def t v) where
26− extract (Def _ e) = extract e
27− extract _ = []
25+instance Extract Def where
26+ extract (Definition _ e _) = extract e
2827
2928instance Extract e => Extract (Located e) where
3029 extract (L _ e) = extract e
3130
32−instance Extract (Expr t v) where
31+instance Extract def => Extract (Expr' def) where
3332 extract expr =
3433 let f = extract in
3534 case expr of