1-----------------------------------------------------------------------------
3-- Module : PureScript.CodeGen.Externs
4-- Copyright : (c) Phil Freeman 2013
7-- Maintainer : Phil Freeman <paf31@cantab.net>
8-- Stability : experimental
13-----------------------------------------------------------------------------
15module PureScript.CodeGen.Externs (
19import Data.List (intercalate)
20import qualified Data.Map as M
21import PureScript.Declarations
22import PureScript.TypeChecker.Monad
23import PureScript.CodeGen.Pretty.Types
25externToPs :: Environment -> Declaration -> Maybe String
26externToPs env (ValueDeclaration name _) = do
27 (ty, _) <- M.lookup name $ names env
28 return $ "extern " ++ show name ++ " :: " ++ prettyPrintPolyType ty
29externToPs env (ExternDeclaration name ty) =
30 return $ "extern " ++ show name ++ " :: " ++ prettyPrintPolyType ty
31externToPs env (TypeSynonymDeclaration name args ty) =
32 return $ "type " ++ name ++ " " ++ intercalate " " args ++ " = " ++ prettyPrintType ty
33externToPs _ _ = Nothing
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list