Verified Commit bc3f8d28 authored by Camil Staps's avatar Camil Staps 🚀

Add usages for type definitions (#52)

parent 48235fe3
...@@ -105,6 +105,7 @@ where ...@@ -105,6 +105,7 @@ where
, tde_doc=Nothing , tde_doc=Nothing
, tde_instances=[] , tde_instances=[]
, tde_derivations=[] , tde_derivations=[]
, tde_usages=[]
} }
defc = defc =
{ cons_name="" { cons_name=""
......
Subproject commit 94fd5cfaa7c0115f469c8cb24207eece32553c4f Subproject commit 2286219bb6783b43992bdb595010e7853add6b4a
...@@ -46,6 +46,7 @@ CACHE_PREFETCH :== 5 ...@@ -46,6 +46,7 @@ CACHE_PREFETCH :== 5
, c_name :: Maybe String , c_name :: Maybe String
, c_className :: Maybe String , c_className :: Maybe String
, c_typeName :: Maybe String , c_typeName :: Maybe String
, c_using :: Bool
, c_modules :: Maybe [String] , c_modules :: Maybe [String]
, c_libraries :: Maybe [String] , c_libraries :: Maybe [String]
, c_include_builtins :: Bool , c_include_builtins :: Bool
...@@ -69,12 +70,13 @@ toRequestCacheKey db r ...@@ -69,12 +70,13 @@ toRequestCacheKey db r
, c_name = toLowerCase <$> r.name , c_name = toLowerCase <$> r.name
, c_className = r.className , c_className = r.className
, c_typeName = r.typeName , c_typeName = r.typeName
, c_using = fromMaybe False r.using
, c_modules = sort <$> r.modules , c_modules = sort <$> r.modules
, c_libraries = sort <$> r.libraries , c_libraries = sort <$> r.libraries
, c_include_builtins = fromJust (r.include_builtins <|> Just DEFAULT_INCLUDE_BUILTINS) , c_include_builtins = fromMaybe DEFAULT_INCLUDE_BUILTINS r.include_builtins
, c_include_core = fromJust (r.include_core <|> Just DEFAULT_INCLUDE_CORE) , c_include_core = fromMaybe DEFAULT_INCLUDE_CORE r.include_core
, c_include_apps = fromJust (r.include_apps <|> Just DEFAULT_INCLUDE_APPS) , c_include_apps = fromMaybe DEFAULT_INCLUDE_APPS r.include_apps
, c_page = fromJust (r.page <|> Just 0) , c_page = fromMaybe 0 r.page
}, db) }, db)
fromRequestCacheKey :: RequestCacheKey -> Request fromRequestCacheKey :: RequestCacheKey -> Request
fromRequestCacheKey k = fromRequestCacheKey k =
...@@ -82,6 +84,7 @@ fromRequestCacheKey k = ...@@ -82,6 +84,7 @@ fromRequestCacheKey k =
, name = k.c_name , name = k.c_name
, className = k.c_className , className = k.c_className
, typeName = k.c_typeName , typeName = k.c_typeName
, using = Just k.c_using
, modules = k.c_modules , modules = k.c_modules
, libraries = k.c_libraries , libraries = k.c_libraries
, include_builtins = Just k.c_include_builtins , include_builtins = Just k.c_include_builtins
......
...@@ -177,6 +177,11 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){ ...@@ -177,6 +177,11 @@ if ($_SERVER['REQUEST_METHOD'] !== 'GET'){
} }
} }
if (substr($name, 0, 6) == 'using ') {
$command['using'] = true;
$name = substr($name, 6);
}
if (substr($name, 0, 6) == 'class ') { if (substr($name, 0, 6) == 'class ') {
$command['className'] = substr($name, 6); $command['className'] = substr($name, 6);
} elseif (substr($name, 0, 5) == 'type ') { } elseif (substr($name, 0, 5) == 'type ') {
......
...@@ -112,6 +112,10 @@ ...@@ -112,6 +112,10 @@
<td class='code'>class Text</td> <td class='code'>class Text</td>
<td class='description'>The class definition of <code>Text</code></td> <td class='description'>The class definition of <code>Text</code></td>
</tr> </tr>
<tr>
<td class='code'>using type Maybe</td>
<td class='description'>All functions using the type <code>Maybe</code></td>
</tr>
</table> </table>
<p><b>Besides this web app, there are other frontends available:</b></p> <p><b>Besides this web app, there are other frontends available:</b></p>
<ul> <ul>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment