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
24import PureScript.CodeGen.Pretty.Kinds
26externToPs :: Environment -> Declaration -> Maybe String
27externToPs env (ValueDeclaration name _) = do
28 (ty, _) <- M.lookup name $ names env
29 return $ "extern " ++ show name ++ " :: " ++ prettyPrintPolyType ty
30externToPs env (ExternDeclaration name ty) =
31 return $ "extern " ++ show name ++ " :: " ++ prettyPrintPolyType ty
32externToPs env (ExternDataDeclaration name kind) =
33 return $ "extern data " ++ name ++ " :: " ++ prettyPrintKind kind
34externToPs env (TypeSynonymDeclaration name args ty) =
35 return $ "type " ++ name ++ " " ++ unwords args ++ " = " ++ prettyPrintType ty
36externToPs _ _ = 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